From patchwork Sun Oct 29 21:56:33 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanislav Lanci X-Patchwork-Id: 10031775 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8FA0B602D6 for ; Sun, 29 Oct 2017 22:07:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 76BF0201B0 for ; Sun, 29 Oct 2017 22:07:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 689DB28712; Sun, 29 Oct 2017 22:07:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7DD4B201B0 for ; Sun, 29 Oct 2017 22:07:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751221AbdJ2WGC (ORCPT ); Sun, 29 Oct 2017 18:06:02 -0400 Received: from 177-229-rev.isper.sk ([77.247.229.177]:47010 "EHLO neth.polepetko.eu" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1751152AbdJ2WGB (ORCPT ); Sun, 29 Oct 2017 18:06:01 -0400 X-Greylist: delayed 559 seconds by postgrey-1.27 at vger.kernel.org; Sun, 29 Oct 2017 18:06:01 EDT Received: from neth.polepetko.eu (localhost [127.0.0.1]) by neth.polepetko.eu (Postfix) with ESMTP id 7D5BF5145E; Sun, 29 Oct 2017 22:56:40 +0100 (CET) Received: from localhost.localdomain (unknown [77.247.229.177]) (Authenticated sender: pixo@polepetko.eu) by neth.polepetko.eu (Postfix) with ESMTPSA; Sun, 29 Oct 2017 22:56:40 +0100 (CET) From: Stanislav Lanci To: kvm@vger.kernel.org Cc: Stanislav Lanci Subject: [PATCH] KVM:x86: AMD Processor Topology Information Date: Sun, 29 Oct 2017 22:56:33 +0100 Message-Id: <20171029215633.3102-1-pixo@polepetko.eu> X-Mailer: git-send-email 2.14.2 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Tested-by: Nick Sarnie Reviewed-by: Paolo Bonzini --- 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;