* [PATCH] KVM: x86: Sort CPUID_8000_0021_EAX leaf bits properly
@ 2025-03-24 16:06 Borislav Petkov
2025-04-10 21:46 ` Sean Christopherson
2025-04-25 22:09 ` Sean Christopherson
0 siblings, 2 replies; 4+ messages in thread
From: Borislav Petkov @ 2025-03-24 16:06 UTC (permalink / raw)
To: Paolo Bonzini, Sean Christopherson
Cc: X86 ML, KVM, LKML, Borislav Petkov (AMD)
From: "Borislav Petkov (AMD)" <bp@alien8.de>
WRMSR_XX_BASE_NS is bit 1 so put it there, add some new bits as
comments only.
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
---
arch/x86/kvm/cpuid.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c
index 121edf1f2a79..e98ab18f784b 100644
--- a/arch/x86/kvm/cpuid.c
+++ b/arch/x86/kvm/cpuid.c
@@ -1160,6 +1160,7 @@ void kvm_set_cpu_caps(void)
kvm_cpu_cap_init(CPUID_8000_0021_EAX,
F(NO_NESTED_DATA_BP),
+ F(WRMSR_XX_BASE_NS),
/*
* Synthesize "LFENCE is serializing" into the AMD-defined entry
* in KVM's supported CPUID, i.e. if the feature is reported as
@@ -1173,10 +1174,14 @@ void kvm_set_cpu_caps(void)
SYNTHESIZED_F(LFENCE_RDTSC),
/* SmmPgCfgLock */
F(NULL_SEL_CLR_BASE),
+ /* UpperAddressIgnore */
F(AUTOIBRS),
EMULATED_F(NO_SMM_CTL_MSR),
+ /* FSRS */
+ /* FSRC */
/* PrefetchCtlMsr */
- F(WRMSR_XX_BASE_NS),
+ /* GpOnUserCpuid */
+ /* EPSF */
SYNTHESIZED_F(SBPB),
SYNTHESIZED_F(IBPB_BRTYPE),
SYNTHESIZED_F(SRSO_NO),
--
2.43.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] KVM: x86: Sort CPUID_8000_0021_EAX leaf bits properly
2025-03-24 16:06 [PATCH] KVM: x86: Sort CPUID_8000_0021_EAX leaf bits properly Borislav Petkov
@ 2025-04-10 21:46 ` Sean Christopherson
2025-04-11 9:45 ` Borislav Petkov
2025-04-25 22:09 ` Sean Christopherson
1 sibling, 1 reply; 4+ messages in thread
From: Sean Christopherson @ 2025-04-10 21:46 UTC (permalink / raw)
To: Borislav Petkov; +Cc: Paolo Bonzini, X86 ML, KVM, LKML, Borislav Petkov (AMD)
On Mon, Mar 24, 2025, Borislav Petkov wrote:
> From: "Borislav Petkov (AMD)" <bp@alien8.de>
>
> WRMSR_XX_BASE_NS is bit 1 so put it there, add some new bits as
> comments only.
>
> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
> ---
> arch/x86/kvm/cpuid.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c
> index 121edf1f2a79..e98ab18f784b 100644
> --- a/arch/x86/kvm/cpuid.c
> +++ b/arch/x86/kvm/cpuid.c
> @@ -1160,6 +1160,7 @@ void kvm_set_cpu_caps(void)
>
> kvm_cpu_cap_init(CPUID_8000_0021_EAX,
> F(NO_NESTED_DATA_BP),
> + F(WRMSR_XX_BASE_NS),
> /*
> * Synthesize "LFENCE is serializing" into the AMD-defined entry
> * in KVM's supported CPUID, i.e. if the feature is reported as
> @@ -1173,10 +1174,14 @@ void kvm_set_cpu_caps(void)
> SYNTHESIZED_F(LFENCE_RDTSC),
> /* SmmPgCfgLock */
> F(NULL_SEL_CLR_BASE),
> + /* UpperAddressIgnore */
> F(AUTOIBRS),
> EMULATED_F(NO_SMM_CTL_MSR),
> + /* FSRS */
> + /* FSRC */
I'm going to skip these, as they aren't yet publicly documented, and there are
patches proposed to add actual support. I wouldn't care all that much if these
didn't collide with Intel's version (the proposed patches name them AMD_FSxx).
https://lore.kernel.org/all/20241204134345.189041-2-davydov-max@yandex-team.ru
> /* PrefetchCtlMsr */
> - F(WRMSR_XX_BASE_NS),
> + /* GpOnUserCpuid */
> + /* EPSF */
FWIW, this one's also not in the APM (though the only APM I can find is a year old),
though it's in tools/x86/kcpuid.
> SYNTHESIZED_F(SBPB),
> SYNTHESIZED_F(IBPB_BRTYPE),
> SYNTHESIZED_F(SRSO_NO),
> --
> 2.43.0
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] KVM: x86: Sort CPUID_8000_0021_EAX leaf bits properly
2025-04-10 21:46 ` Sean Christopherson
@ 2025-04-11 9:45 ` Borislav Petkov
0 siblings, 0 replies; 4+ messages in thread
From: Borislav Petkov @ 2025-04-11 9:45 UTC (permalink / raw)
To: Sean Christopherson; +Cc: Borislav Petkov, Paolo Bonzini, X86 ML, KVM, LKML
On Thu, Apr 10, 2025 at 02:46:39PM -0700, Sean Christopherson wrote:
> I'm going to skip these, as they aren't yet publicly documented,
https://www.amd.com/content/dam/amd/en/documents/epyc-technical-docs/programmer-references/57238.zip
> and there are patches proposed to add actual support. I wouldn't care all
> that much if these didn't collide with Intel's version (the proposed patches
> name them AMD_FSxx).
>
> https://lore.kernel.org/all/20241204134345.189041-2-davydov-max@yandex-team.ru
Pff, I think the right thing to do is to detect those and when set, set the
Intel flags because they're basically the same.
Lemme go reply there.
... goes and replies...
>
> > /* PrefetchCtlMsr */
> > - F(WRMSR_XX_BASE_NS),
> > + /* GpOnUserCpuid */
> > + /* EPSF */
>
> FWIW, this one's also not in the APM (though the only APM I can find is a year old),
> though it's in tools/x86/kcpuid.
See above. Yeah, the PPRs have them earlier than the APM.
Thx.
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] KVM: x86: Sort CPUID_8000_0021_EAX leaf bits properly
2025-03-24 16:06 [PATCH] KVM: x86: Sort CPUID_8000_0021_EAX leaf bits properly Borislav Petkov
2025-04-10 21:46 ` Sean Christopherson
@ 2025-04-25 22:09 ` Sean Christopherson
1 sibling, 0 replies; 4+ messages in thread
From: Sean Christopherson @ 2025-04-25 22:09 UTC (permalink / raw)
To: Sean Christopherson, Paolo Bonzini, Borislav Petkov
Cc: X86 ML, KVM, LKML, Borislav Petkov (AMD)
On Mon, 24 Mar 2025 17:06:17 +0100, Borislav Petkov wrote:
> WRMSR_XX_BASE_NS is bit 1 so put it there, add some new bits as
> comments only.
Applied to kvm-x86 misc, thanks!
[1/1] KVM: x86: Sort CPUID_8000_0021_EAX leaf bits properly
commit: 49c140d5af127ef4faf19f06a89a0714edf0316f
--
https://github.com/kvm-x86/linux/tree/next
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-04-25 22:10 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-24 16:06 [PATCH] KVM: x86: Sort CPUID_8000_0021_EAX leaf bits properly Borislav Petkov
2025-04-10 21:46 ` Sean Christopherson
2025-04-11 9:45 ` Borislav Petkov
2025-04-25 22:09 ` Sean Christopherson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox