]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
x86/mshyperv: Add support for extended Hyper-V features
authorStanislav Kinsburskii <skinsburskii@linux.microsoft.com>
Fri, 14 Mar 2025 19:28:48 +0000 (12:28 -0700)
committerWei Liu <wei.liu@kernel.org>
Thu, 20 Mar 2025 21:23:03 +0000 (21:23 +0000)
Extend the "ms_hyperv_info" structure to include a new field,
"ext_features", for capturing extended Hyper-V features.
Update the "ms_hyperv_init_platform" function to retrieve these features
using the cpuid instruction and include them in the informational output.

Signed-off-by: Stanislav Kinsburskii <skinsburskii@linux.microsoft.com>
Signed-off-by: Nuno Das Neves <nunodasneves@linux.microsoft.com>
Reviewed-by: Easwar Hariharan <eahariha@linux.microsoft.com>
Reviewed-by: Roman Kisel <romank@linux.microsoft.com>
Reviewed-by: Tianyu Lan <tiala@microsoft.com>
Reviewed-by: Michael Kelley <mhklinux@outlook.com>
Link: https://lore.kernel.org/r/1741980536-3865-3-git-send-email-nunodasneves@linux.microsoft.com
Signed-off-by: Wei Liu <wei.liu@kernel.org>
Message-ID: <1741980536-3865-3-git-send-email-nunodasneves@linux.microsoft.com>

arch/x86/kernel/cpu/mshyperv.c
include/asm-generic/mshyperv.h

index 4f01f424ea5bd42b981de9f9bfc51c67d07fed3c..fd285b18d6b4e4b28284f2beb520d40bff87a720 100644 (file)
@@ -434,13 +434,15 @@ static void __init ms_hyperv_init_platform(void)
         */
        ms_hyperv.features = cpuid_eax(HYPERV_CPUID_FEATURES);
        ms_hyperv.priv_high = cpuid_ebx(HYPERV_CPUID_FEATURES);
+       ms_hyperv.ext_features = cpuid_ecx(HYPERV_CPUID_FEATURES);
        ms_hyperv.misc_features = cpuid_edx(HYPERV_CPUID_FEATURES);
        ms_hyperv.hints    = cpuid_eax(HYPERV_CPUID_ENLIGHTMENT_INFO);
 
        hv_max_functions_eax = cpuid_eax(HYPERV_CPUID_VENDOR_AND_MAX_FUNCTIONS);
 
-       pr_info("Hyper-V: privilege flags low 0x%x, high 0x%x, hints 0x%x, misc 0x%x\n",
-               ms_hyperv.features, ms_hyperv.priv_high, ms_hyperv.hints,
+       pr_info("Hyper-V: privilege flags low %#x, high %#x, ext %#x, hints %#x, misc %#x\n",
+               ms_hyperv.features, ms_hyperv.priv_high,
+               ms_hyperv.ext_features, ms_hyperv.hints,
                ms_hyperv.misc_features);
 
        ms_hyperv.max_vp_index = cpuid_eax(HYPERV_CPUID_IMPLEMENT_LIMITS);
index 250c65236919df4ed6f156064e5e6b2078750af0..c8043efabf5ab3c6332dbaef1a2405b8d995c1c5 100644 (file)
@@ -36,6 +36,7 @@ enum hv_partition_type {
 struct ms_hyperv_info {
        u32 features;
        u32 priv_high;
+       u32 ext_features;
        u32 misc_features;
        u32 hints;
        u32 nested_features;