From: Stanislav Kinsburskii <skinsburskii@linux.microsoft.com>
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>
---
arch/x86/kernel/cpu/mshyperv.c | 6 ++++--
include/asm-generic/mshyperv.h | 1 +
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/arch/x86/kernel/cpu/mshyperv.c b/arch/x86/kernel/cpu/mshyperv.c
index 4f01f424ea5b..2c29dfd6de19 100644
--- a/arch/x86/kernel/cpu/mshyperv.c
+++ b/arch/x86/kernel/cpu/mshyperv.c
@@ -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 0x%x, high 0x%x, ext 0x%x, hints 0x%x, misc 0x%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);
diff --git a/include/asm-generic/mshyperv.h b/include/asm-generic/mshyperv.h
index dc4729dba9ef..c020d5d0ec2a 100644
--- a/include/asm-generic/mshyperv.h
+++ b/include/asm-generic/mshyperv.h
@@ -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;
--
2.34.1
On Thu, Feb 27, 2025 at 7:09 AM Nuno Das Neves <nunodasneves@linux.microsoft.com> wrote: > > From: Stanislav Kinsburskii <skinsburskii@linux.microsoft.com> > > 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: Tianyu Lan <tiala@microsoft.com> -- Thanks Tianyu Lan
On 2/26/2025 3:07 PM, Nuno Das Neves wrote: > From: Stanislav Kinsburskii <skinsburskii@linux.microsoft.com> > > 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> > --- > arch/x86/kernel/cpu/mshyperv.c | 6 ++++-- > include/asm-generic/mshyperv.h | 1 + > 2 files changed, 5 insertions(+), 2 deletions(-) Looks good to me. Reviewed-by: Easwar Hariharan <eahariha@linux.microsoft.com>
On 2/26/2025 3:07 PM, Nuno Das Neves wrote:
> From: Stanislav Kinsburskii <skinsburskii@linux.microsoft.com>
[...]
>
> - 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 0x%x, high 0x%x, ext 0x%x, hints 0x%x, misc 0x%x\n",
> + ms_hyperv.features, ms_hyperv.priv_high,
> + ms_hyperv.ext_features, ms_hyperv.hints,
> ms_hyperv.misc_features);
Would using %#x instead of 0x%x be better in your opinion?
[..]
--
Thank you,
Roman
On 2/27/2025 9:59 AM, Roman Kisel wrote:
>
>
> On 2/26/2025 3:07 PM, Nuno Das Neves wrote:
>> From: Stanislav Kinsburskii <skinsburskii@linux.microsoft.com>
> [...]
>> - 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 0x%x, high 0x%x, ext 0x%x, hints 0x%x, misc 0x%x\n",
>> + ms_hyperv.features, ms_hyperv.priv_high,
>> + ms_hyperv.ext_features, ms_hyperv.hints,
>> ms_hyperv.misc_features);
>
> Would using %#x instead of 0x%x be better in your opinion?
>
It's a reasonable suggestion. I'm not sure if it's worth another
version, if this patch seems good enough to merge as-is.
However if I'm doing another version of this series that still
includes this patch, then I can certainly make the change.
Thanks!
> [..]
On 2/27/2025 4:17 PM, Nuno Das Neves wrote:
> On 2/27/2025 9:59 AM, Roman Kisel wrote:
>>
>>
>> On 2/26/2025 3:07 PM, Nuno Das Neves wrote:
>>> From: Stanislav Kinsburskii <skinsburskii@linux.microsoft.com>
>> [...]
>>> - 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 0x%x, high 0x%x, ext 0x%x, hints 0x%x, misc 0x%x\n",
>>> + ms_hyperv.features, ms_hyperv.priv_high,
>>> + ms_hyperv.ext_features, ms_hyperv.hints,
>>> ms_hyperv.misc_features);
>>
>> Would using %#x instead of 0x%x be better in your opinion?
>>
> It's a reasonable suggestion. I'm not sure if it's worth another
> version, if this patch seems good enough to merge as-is.
> However if I'm doing another version of this series that still
> includes this patch, then I can certainly make the change.
>
You're right, a suggestion like that shouldn't warrant another version,
agreed! Whether you implement that tweak or not, looks good to me.
Reviewed-by: Roman Kisel <romank@linux.microsoft.com>
> Thanks!
>
>> [..]
>
--
Thank you,
Roman
On Wed, Feb 26, 2025 at 03:07:56PM -0800, Nuno Das Neves wrote: > From: Stanislav Kinsburskii <skinsburskii@linux.microsoft.com> > > 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. > Reviewed-by: Stanislav Kinsburskii <skinsburskii@linux.microsoft.com>
© 2016 - 2026 Red Hat, Inc.