Message ID | 1522186271-27743-8-git-send-email-babu.moger@amd.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <kvm-owner@kernel.org> 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 654E0600F6 for <patchwork-kvm@patchwork.kernel.org>; Tue, 27 Mar 2018 21:31:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5749329AC3 for <patchwork-kvm@patchwork.kernel.org>; Tue, 27 Mar 2018 21:31:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4BE5129B4B; Tue, 27 Mar 2018 21:31:50 +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,DKIM_SIGNED, DKIM_VALID,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 B810B29AC3 for <patchwork-kvm@patchwork.kernel.org>; Tue, 27 Mar 2018 21:31:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752031AbeC0Vbo (ORCPT <rfc822;patchwork-kvm@patchwork.kernel.org>); Tue, 27 Mar 2018 17:31:44 -0400 Received: from mail-sn1nam02on0076.outbound.protection.outlook.com ([104.47.36.76]:53483 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751182AbeC0Vbg (ORCPT <rfc822;kvm@vger.kernel.org>); Tue, 27 Mar 2018 17:31:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=R2NwXhX2cqAeSxsui1F6Mayia9cl52OeJM7hV7WJCVk=; b=bsOkOchaFyluyM2zaCmLiy91bmKIy2BbIqLkQdIIe/WUdvTalwZPhY5oi6lRD68KUWOCoEWC6gBXDHxJW0we/Ur9jO+m2agDhCM3F3DTaahOYmM58/rNK2HulIpIiU+6tJLFgbSjYlCH89ogrX54Gga74YiGiG0ZBdQZ1UqLmng= Received: from linux-pyp0.amd.com (165.204.77.1) by DM5PR12MB1771.namprd12.prod.outlook.com (2603:10b6:3:113::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.609.10; Tue, 27 Mar 2018 21:31:26 +0000 From: Babu Moger <babu.moger@amd.com> To: mst@redhat.com, marcel@redhat.com, pbonzini@redhat.com, rth@twiddle.net, ehabkost@redhat.com, mtosatti@redhat.com Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org, kash@tripleback.net, babu.moger@amd.com Subject: [PATCH v5 7/9] i386: Add support for CPUID_8000_001E for AMD Date: Tue, 27 Mar 2018 17:31:09 -0400 Message-Id: <1522186271-27743-8-git-send-email-babu.moger@amd.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1522186271-27743-1-git-send-email-babu.moger@amd.com> References: <1522186271-27743-1-git-send-email-babu.moger@amd.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: CY4PR04CA0039.namprd04.prod.outlook.com (2603:10b6:903:c6::25) To DM5PR12MB1771.namprd12.prod.outlook.com (2603:10b6:3:113::8) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: e8b6a97a-643d-4c8c-dc73-08d5942a18c9 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:DM5PR12MB1771; X-Microsoft-Exchange-Diagnostics: 1; DM5PR12MB1771; 3:BBgD26SlK4281sgpaz7Hcm3qPuUDrNrO9aqP9ASxXfkzOPD3+w9ShPWf5Rp5j7ILkxbutwrjyg8CLcy5UCsvJQJBffLidVu1zQSbfyEbQRE8T8eYEc/xjQT4rGBlk6Mn/E9RDk6d08OkpM4czd1kguoDdFecR2I5iv7AzBElYYUl4svr7WN55Tw/hEYw4icoQr6Au25JeDviZuueBqyIUFxp/1f4RDGgvmTb4ip23x/BiJLCvLP1Bqh5q2gffEyS; 25:KtK3BRDhdpz1ZNBOyhvEr7RiwnM4yLS0KbtEmJtlx55RHqorx595W4y9+ZdpJyURC+Nc9+0v/lu8OIFUriRJ13qEMJt7UG9VRUv46g9nUQXqXEMiZrcs0zfxsxGRTe3ETWOXIToWYQjiUS/urBcfuA22t5Hsihuanq4t6wgDUTU35sl21jKuIMQocb/NhsqGyJBydAm+izIdgu9H2dbepD7ro78KCHaegwP/Xv7Q4Qd8wFadVq2xgCR9Ej+3zUMoTphUDADDmEWOcOtn4CvWLIv8TA0G4A7jGbql/qtBzdbRPzAUT8xfE/a82aO5oLqCLQXrGN0VFgATe9d7Dgph8g==; 31:7u56FMI4dw/uW4kY9GyJDVlTb4ryXuenrdswQWdOC1mHJAcrM+XWTrGVrUt9Eutf+atojD4VVnZUHDidvhQIbYi7q6OHCVyS/3oX6qIIGQC6f4vmX0B+4ZG2bw6Yoz7uO/ehs2sgfWEfeHo57LStYW2i6ryKREzzpsAc2/Br1pMXR0oPzzvENlhm1GAPL+p5My+NALy6e1k6AF3IdWuSGT3+YsN7yy3baZQ+PkR5VDc= X-MS-TrafficTypeDiagnostic: DM5PR12MB1771: X-Microsoft-Exchange-Diagnostics: 1; DM5PR12MB1771; 20:6/YDroksdjY93ZI6zF1g8/oqr7U1ZrhAINk1eWHip/GKNsDDyRjf6ux9FrVvqWIAvDn2RqVVohVEmbQPR1GgT0qc6xnggq2q7uS5dqZVj/u8mwjTzcUcZPjE2/Ay0U3tkvumCN6OhkJ3cPs34w2LC+bhhmafIXe4epBcIJQrrrrL2yuI/QWMZ73fZDdeceWdbAMX4bbF5EY+QoWU3QIZXjh6lG/1RDbDtcDGtnbA0+DFaIllQqxOUD/xxkI0Q+hmaX4X3Mj4E0NKOeWAFEGM1kF93d0SMFNE5iAo5V9jNEmXXAeYB33WWqNkXwcnlwCs0g93YU+dE99XXQR14+8hZAI9k3RUgjyrd/qHOA5wayt1kNZMQt550AF+5tx9Ss/WI9Kq9fm0/WtWMCFg5dnibKQu56vU3oKVfAtErX+ZywjTvoAg4Cgial5Y8kUEjZqfaJqueZOjclwnmNxMB5WCq1NXjWcNJm18DKLAkcb99C5Cy1Rf3x2e9TLIfwN3SLPG; 4:qlOWg0SiMqA2xok7xA3KIVrGJ9WNfOH/VYHLUyCOKxElvt2OgbinZJF9C2QdeZgQugDRtsIGiN8dt+/DY1/uj0f+glyqH/7b/BNcTER0zKtBK3LVD7lz1Y8C0vql3JmgONpKpISkeVKboEm3G/HSpO+lVZj4YQ1rOTVtPM57Sm0/KlTMV42XaMkOGkJF+RyL2AYfU6c62H/92eDkpxlB68KrAq11FdZ0hk972V+scmb/ZRGm2pk6kADUIsd5PsHyM/86wwXtgfS6Ui1Zp+XdBlalc3UZDZ38S5GjKq0X0tf/UYejJ125xhmBTPCWTkgY X-Microsoft-Antispam-PRVS: <DM5PR12MB1771F45B49B78D86FAB9378195AC0@DM5PR12MB1771.namprd12.prod.outlook.com> X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3231221)(944501327)(52105095)(3002001)(10201501046)(93006095)(93001095)(6055026)(6041310)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123558120)(20161123560045)(6072148)(201708071742011); SRVR:DM5PR12MB1771; BCL:0; PCL:0; RULEID:; SRVR:DM5PR12MB1771; X-Forefront-PRVS: 0624A2429E X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(396003)(366004)(346002)(39380400002)(376002)(39860400002)(199004)(189003)(36756003)(6666003)(105586002)(47776003)(76176011)(25786009)(66066001)(53416004)(97736004)(7696005)(51416003)(386003)(486005)(486005)(2906002)(72206003)(4720700003)(6486002)(52116002)(4326008)(11346002)(5660300001)(7736002)(305945005)(53936002)(81156014)(50466002)(8676002)(6346003)(81166006)(16526019)(106356001)(68736007)(50226002)(8936002)(3846002)(476003)(478600001)(26005)(2616005)(186003)(446003)(316002)(6116002)(956004)(86362001)(16586007)(48376002); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR12MB1771; H:linux-pyp0.amd.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Babu.Moger@amd.com; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR12MB1771; 23:/fD2Y6XqHX/IQhLJpHW1BjaK/w0ibjvFFOC9Xptu7?= =?us-ascii?Q?PVt38Q767L91QIMJ819rlZofYXWSsoxFGUIRR+3F+b4r8fr1pmwQu80nEjsV?= =?us-ascii?Q?HSSNZM4rGTK62NmbLQNmmOueuzjaUbf5F9/75jv+kb4bWWGuxzNUx8fCwAVl?= =?us-ascii?Q?isKReobyx3YW8M7ez56glurDXjP46hAaNoJEIds7p9SGA+Rbroq2q9v+6Ke5?= =?us-ascii?Q?o4OwsCbP7WAQVgImY9LvfWR+ctXmOy5bkY7AcC/XxSuL4bAg7/IN0rCZkj8T?= =?us-ascii?Q?t9lz3B11Y+Cic7EdaoL5nv9qfBDBzWUm3WDglqI25sU2H9s64QQ7IuB1UWri?= =?us-ascii?Q?EPq+2iY+RC0JG83RyKLDimUHRATLx/rorqLnEHs3OaBMdiSa3Wmlc3dQgx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oft-Antispam-Message-Info: q3fvN5Z1Xgx26YFLpaNbSI6E/glAOIfA2kQchutUkOaQcR8ZmElfUEbK1GYar1njrG+jm9LLZun9cd2TljxyJv+CpXSRBKU3BJlGGT90Y9UXEsjLaCES/nXLvZscs2NJBCVSIvUTpkBdzwky57QhCOI/ZHxZGxpTp027YKR+egO+FgvpcuYDxwKSiICO/uBC X-Microsoft-Exchange-Diagnostics: 1; DM5PR12MB1771; 6:JUJFavcZ9mRSaKSkQ+KYxnrNjhmVqOYP2WsKD1Fmxo8I7CIUwriVeM8JyTRP7OsryFr/FNDuKCy6vMZqvjQSpqnV2c+Ojvl0sVN/IgSeG8630VHWatRqgdmaDwziSLtFd47nuaULoP3jSnMrMI9NwvFC02bFUPIVWrxk7gS40j4Squ6yAtth6mFyXZJrezcKPtOTttkhAw85zM2i0VLaaDVJY2XSeWLuLoTZh73bg9ix+7IY79E+aqlm2EWYJSbrZevBXSRRa2oTfHreeApDMR7zhwXgo2/FNFnLVvyahw5VdXhSefyVlmvxgKw8RixlhF9kHvgPPbsLBpgq4xMbDwwwv3poZE8HIFe8wY560UD8Rr3X2gISUeasEgNoRwdUSX3rWqiXlwHjCpAY/Q414a+OLzkunapaVf3xhsNBv/hduJ2H2kW0QRUAaIZJbCgiz9ztei2NHi96IhqyQnil+Q==; 5:6uSTU427gBF5LQVsKb2O1FmE6XlRzowUqUOnXjD/AaVHZ7yr9Rjw50vb15qrNftAZ1SyjQgTZOlCQmfao2ps+Y0npfgN11XoFgyFXrgkvIjkseC6s9zBqixvSt9gac3ZKr+oQkXDO9si8Wu+/wT1qoN8uHqJ86+xfh4V3+bLv/0=; 24:oxOygYgBvqyx+sDlRT1IsS+NX4tfT7OPsbRbvZilFQNnT/e97j6f8PnpOgWzl9kqLII6u/qYnl6lQAAfDxRZBza0F9Gd1l+aNQNMBJHRiqU= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM5PR12MB1771; 7:/S109loGsP5+9kU1uW3n9DmbZzBDdA3Pizp969zQlrGAhbk8Rn7OcVP50XEFki0XQQDC5vnQBjKpve8sEggX9bZL3xqALUuI01tipBVYA8w+u5EosdWaz4NhYNpcX69apMzhP1D7tiNphNKhGpreoWCNYXsjVzwL+HzFLkhsC1qYGGVsuxGBgl4UTU/2tpJNOD+n7fgBm4iW0KGSIdwMOe2xwcNFofO5I15iSPet5Up+j33kzYKkYP0Z2VJwh3b7; 20:T7g7bFl5aGNct0Oy6H5S2dchrlARmdEyfuMmRfCG9RxQezbRte5RyseaSPri5xItUWd0CNtU+0/S4JBOvMchxgZKgVdfs9HQ4XJrzShUYbVYrtJJd3Pa+1skYyrTpuklWwNa0m6ElJblpJ6C1pNmhenRCjhjILWsShN+56QunYO13D3JScYURY+cvOCrl3QKTiV3dQSjFQ1O3OQQBr7nAqnh2DErYjgKlrUvHfeUwXmTlUwMVmLNUvEtx/b3ooxb X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Mar 2018 21:31:26.2431 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e8b6a97a-643d-4c8c-dc73-08d5942a18c9 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB1771 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: <kvm.vger.kernel.org> X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP |
diff --git a/target/i386/cpu.c b/target/i386/cpu.c index f69f551..6f3ad44 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -315,6 +315,12 @@ static uint32_t encode_cache_cpuid80000005(CPUCacheInfo *cache) (((CORES_IN_CMPLX - 1) * 2) + 1) : \ (CORES_IN_CMPLX - 1)) +/* Definitions used on CPUID Leaf 0x8000001E */ +#define EXTENDED_APIC_ID(threads, socket_id, core_id, thread_id) \ + ((threads) ? \ + ((socket_id << 6) | (core_id << 1) | thread_id) : \ + ((socket_id << 6) | core_id)) + /* * Encode cache info for CPUID[0x80000006].ECX and CPUID[0x80000006].EDX * @l3 can be NULL. @@ -4101,6 +4107,14 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index, uint32_t count, break; } break; + case 0x8000001E: + assert(cpu->core_id <= 255); + *eax = EXTENDED_APIC_ID((cs->nr_threads - 1), + cpu->socket_id, cpu->core_id, cpu->thread_id); + *ebx = (cs->nr_threads - 1) << 8 | cpu->core_id; + *ecx = cpu->socket_id; + *edx = 0; + break; case 0xC0000000: *eax = env->cpuid_xlevel2; *ebx = 0;
Populate threads/core_id/apic_ids/socket_id when CPUID_EXT3_TOPOEXT feature is supported. This is required to support hyperthreading feature on AMD CPUs. This is supported via CPUID_8000_001E extended functions. Signed-off-by: Babu Moger <babu.moger@amd.com> --- target/i386/cpu.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)