public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] KVM:x86: AMD Processor Topology Information
@ 2017-10-29 21:56 Stanislav Lanci
  2017-10-29 22:44 ` Nick Sarnie
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Stanislav Lanci @ 2017-10-29 21:56 UTC (permalink / raw)
  To: kvm; +Cc: Stanislav Lanci

This patch allow to enable x86 feature TOPOEXT and increase maximum extended function to 0x8000001E.
Both are needed to provide information about SMT on AMD Zen CPUs to the guest.

Signed-off-by: Stanislav Lanci <pixo@polepetko.eu>
---
 arch/x86/kvm/cpuid.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c
index 0099e10eb045..374afdeaa6f5 100644
--- a/arch/x86/kvm/cpuid.c
+++ b/arch/x86/kvm/cpuid.c
@@ -365,7 +365,8 @@ 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(TOPOEXT);
 
 	/* cpuid 0xC0000001.edx */
 	const u32 kvm_cpuid_C000_0001_edx_x86_features =
@@ -604,7 +605,7 @@ static inline int __do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function,
 		entry->edx = 0;
 		break;
 	case 0x80000000:
-		entry->eax = min(entry->eax, 0x8000001a);
+		entry->eax = min(entry->eax, 0x8000001e);
 		break;
 	case 0x80000001:
 		entry->edx &= kvm_cpuid_8000_0001_edx_x86_features;
-- 
2.14.2

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-01-30 13:54 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-29 21:56 [PATCH] KVM:x86: AMD Processor Topology Information Stanislav Lanci
2017-10-29 22:44 ` Nick Sarnie
2018-01-26 21:04 ` Babu Moger
2018-01-26 22:53 ` Paolo Bonzini
2018-01-29 16:39 ` Babu Moger
2018-01-30 13:54   ` Radim Krčmář

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox