Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

x86/hyper-v: stash the max number of virtual/logical processor

Max virtual processor will be needed for 'extended' hypercalls supporting
more than 64 vCPUs. While on it, unify on 'Hyper-V' in mshyperv.c as we
currently have a mix, report acquired misc features as well.

Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Vitaly Kuznetsov and committed by
Greg Kroah-Hartman
dd018597 2e252fbf

+11 -3
+2
arch/x86/include/asm/mshyperv.h
··· 28 28 u32 features; 29 29 u32 misc_features; 30 30 u32 hints; 31 + u32 max_vp_index; 32 + u32 max_lp_index; 31 33 }; 32 34 33 35 extern struct ms_hyperv_info ms_hyperv;
+9 -3
arch/x86/kernel/cpu/mshyperv.c
··· 184 184 ms_hyperv.misc_features = cpuid_edx(HYPERV_CPUID_FEATURES); 185 185 ms_hyperv.hints = cpuid_eax(HYPERV_CPUID_ENLIGHTMENT_INFO); 186 186 187 - pr_info("HyperV: features 0x%x, hints 0x%x\n", 187 + pr_info("Hyper-V: features 0x%x, hints 0x%x\n", 188 188 ms_hyperv.features, ms_hyperv.hints); 189 + 190 + ms_hyperv.max_vp_index = cpuid_eax(HVCPUID_IMPLEMENTATION_LIMITS); 191 + ms_hyperv.max_lp_index = cpuid_ebx(HVCPUID_IMPLEMENTATION_LIMITS); 192 + 193 + pr_debug("Hyper-V: max %u virtual processors, %u logical processors\n", 194 + ms_hyperv.max_vp_index, ms_hyperv.max_lp_index); 189 195 190 196 /* 191 197 * Extract host information. ··· 225 219 rdmsrl(HV_X64_MSR_APIC_FREQUENCY, hv_lapic_frequency); 226 220 hv_lapic_frequency = div_u64(hv_lapic_frequency, HZ); 227 221 lapic_timer_frequency = hv_lapic_frequency; 228 - pr_info("HyperV: LAPIC Timer Frequency: %#x\n", 222 + pr_info("Hyper-V: LAPIC Timer Frequency: %#x\n", 229 223 lapic_timer_frequency); 230 224 } 231 225 ··· 259 253 } 260 254 261 255 const __refconst struct hypervisor_x86 x86_hyper_ms_hyperv = { 262 - .name = "Microsoft HyperV", 256 + .name = "Microsoft Hyper-V", 263 257 .detect = ms_hyperv_platform, 264 258 .init_platform = ms_hyperv_init_platform, 265 259 };