Re: [PATCH v4 3/3] x86/kvm: Expose AMD Core Perf Extension flag to guests

From: Radim Krcmar
Date: Mon Feb 05 2018 - 08:43:58 EST


2018-01-30 11:32-0600, Janakarajan Natarajan:
> Expose the AMD Core Perf Extension flag to the guests.
>
> Signed-off-by: Janakarajan Natarajan <Janakarajan.Natarajan@xxxxxxx>
> ---
> diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c
> @@ -365,7 +371,7 @@ static inline int __do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function,
> F(LAHF_LM) | F(CMP_LEGACY) | 0 /*SVM*/ | 0 /* ExtApicSpace */ |
> F(CR8_LEGACY) | F(ABM) | F(SSE4A) | F(MISALIGNSSE) |
> F(3DNOWPREFETCH) | F(OSVW) | 0 /* IBS */ | F(XOP) |
> - 0 /* SKINIT, WDT, LWP */ | F(FMA4) | F(TBM);
> + 0 /* SKINIT, WDT, LWP */ | F(FMA4) | F(TBM) | f_perfext;

You can just say F(PERFCTR_CORE) here. The conditional features are
needed when there is a runtime config option for them. We are
automatically masking features that the host doesn't support,

thanks.

>
> /* cpuid 0xC0000001.edx */
> const u32 kvm_cpuid_C000_0001_edx_x86_features =
> --
> 2.7.4
>