From patchwork Tue Mar 27 21:31:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Babu Moger X-Patchwork-Id: 10311723 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 481276037D for ; Tue, 27 Mar 2018 21:31:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3972129AC3 for ; Tue, 27 Mar 2018 21:31:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2E21329B4B; Tue, 27 Mar 2018 21:31:51 +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 A7EA529AC3 for ; Tue, 27 Mar 2018 21:31:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752123AbeC0Vbt (ORCPT ); Tue, 27 Mar 2018 17:31:49 -0400 Received: from mail-sn1nam02on0057.outbound.protection.outlook.com ([104.47.36.57]:10954 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752027AbeC0Vbo (ORCPT ); Tue, 27 Mar 2018 17:31:44 -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=ZXMM6TI2hBIfyARPNE1BdsIgGbhQRYTNj2bsXSPPlZ0=; b=ptbyRkRVqUVrDH3UDwl6IsLRUnh4SKOWm+LueU8ATSXeSAZuA5XMxIYLP1s6ScwMgYPO7wp8do+Bpal7KroC3ZXn6nJWL8Vv/Ycaz+4EazaaherBcIlvmgRZE/zAdVM9mxTSAfjB0oJaEQgly4lgAmc7sk+EbggBTFRloxXv6UQ= 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:28 +0000 From: Babu Moger 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 9/9] i386: Remove generic SMT thread check Date: Tue, 27 Mar 2018 17:31:11 -0400 Message-Id: <1522186271-27743-10-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 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: 192de3ca-588d-4b89-4643-08d5942a19d7 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:J0KxVWwSSs53iEeqOZAZRN8QA/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1fo/F6+aU6pOStWmoMTxCVtBBV4/KQOIxUXDIPm+3Zj3CG3+nYpThcKXdjNqqPmVmea7R70bK9M7lMYu5fn184cGakkK9L+t9YHmeAabR65bjMyhoQ8Q1E4492Aa+IviEtfsoBzOxL2hc9PYLBwg5wOVA31rgtFdY8XUW8Lv2wGv448Rtg4l4d4mTgPq/RoTGBI2TcZQPJgKmbm2AvsuBJS9aEKl/HoR5cpnyOmh5deITx94uKc23yZSApiVznHI+LTt9qE9YwoKEYgO7QbZsNyZcmsxbs28b/rJDpNkqoguvuBz/7nZMPuxGQEf16814; 4:JpiYLfkmqjchOxnZYfwcPEjiZaBrvHq/ld4qMo1Hq9Ty/Gfm1nzBXZWW97IgHh9KpKo0jDnsGFwRWLWyUb6k82U5dyacz1S2WgZ1pauRCOzNXNndDzsJs1fhMoZ8eMkGzwzGVUmi5oe/y3EjRO2JH7J8rWod8CFBtMqQm6H38/2O64vedlyZ6OFIY01Lp2c/kbqdNwIv7dFRpzRHyBP/yKqXNA6lugdkH6RXMJqSD8rqzG7a0XIKFZUGoNykqtGLIJ7dlYo+oOBJ5x6ZtPKSAzNQAmEpTFPAGsboNxm/LcKslhgZjnrOZB+zfS76yyL8 X-Microsoft-Antispam-PRVS: 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)(59450400001)(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)(41533002); 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:GevVnb6QwKLwC7pxkUUsUkWcMkmdiJmiDxuBIjh2U?= =?us-ascii?Q?KDABPAPDBrN2py9Fp5TNyPfFRKLPaO0VdrJuFDLzC7S3wTFs2hunEjSD8soS?= =?us-ascii?Q?zs6sz4IgKLOXcY+/CjcayRPe0Tjfrgpav0Vm4CnvljOtc4ucyIVjAQ+0XvhR?= =?us-ascii?Q?bN5G6L1hDZT3tnl3Bk9zwplZsyoPP6MC8CvGOlGW+gZHt5hco6yM1sKet7le?= =?us-ascii?Q?+H6kbRlqCjq1CE/KLgPp309ArjiQZuLrpJQlXF+2Q9y1Q+80HyW2XOH7qMD6?= =?us-ascii?Q?Oo8vOCVdSVQPnlfxF/rV+LUS8H0AbYhOoAsyh4jDxuT1v+KJBAjHGR+6iBzI?= =?us-ascii?Q?k1INmPfEXkn63EW27DRCXATENLyQFznuIjDvLBaxaOyeLRLTYBWzKe8r/SnU?= =?us-ascii?Q?ekuvHH+Ixk/sYH2b76itEjeO6sT7fzuu01sse/4S4Z69LOKtUiRdIvUTDSEi?= =?us-ascii?Q?HKYwk0q54KqTmbGkDPc5pb51sP7ZObmCuNZo+cJUb7N/MqBh2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o/wU/RwUOnNyMxR7rUaj1HdB8NBmdrh979O9zBydpwUM2Iy3iowvZS0c7htQOVSU0JSXGKQ8z42LYUJ+0yM8fJJMrrOBBkgNgWGFUApOpnLp8p8IDFw+CsiiIW7qQi4tUlqMfdzJASG4WFoA6D06mulDft8khpWAB0SBC0T6300xp/7dhd/bUdmySBOyB6T; 20:eDSgiLSUteIOCY0NzRmnTKOxsfExbB8+q6Lhn3TmzNX0bESzbp00XizbeIAclPmD3a7caScz5TjKH19a7OM7HwU4I71R/tbXxHSVZCzSW4lrMgnjxg4UX+scE+gidfhHDkUGm9HRL+TnIFD3R4lzmcRa7voeFLoluVprL86YQkxEbf9SvPDDSxqnN3p0DcsBJBztmgtWLbtikEOHeIkGQadzMmyGm6Ryr+A6ICoxQXSBYr2SSfIQeED1JgvNKZPR X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Mar 2018 21:31:28.0087 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 192de3ca-588d-4b89-4643-08d5942a19d7 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: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Remove generic non-intel check while validating hyperthreading support. Certain AMD CPUs can support hyperthreading now. CPU family with TOPOEXT feature can support hyperthreading now. Signed-off-by: Babu Moger --- target/i386/cpu.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index f8e7325..e216d54 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -4824,17 +4824,20 @@ static void x86_cpu_realizefn(DeviceState *dev, Error **errp) qemu_init_vcpu(cs); - /* Only Intel CPUs support hyperthreading. Even though QEMU fixes this - * issue by adjusting CPUID_0000_0001_EBX and CPUID_8000_0008_ECX - * based on inputs (sockets,cores,threads), it is still better to gives + /* Most Intel and certain AMD CPUs support hyperthreading. Even though QEMU + * fixes this issue by adjusting CPUID_0000_0001_EBX and CPUID_8000_0008_ECX + * based on inputs (sockets,cores,threads), it is still better to give * users a warning. * * NOTE: the following code has to follow qemu_init_vcpu(). Otherwise * cs->nr_threads hasn't be populated yet and the checking is incorrect. */ - if (!IS_INTEL_CPU(env) && cs->nr_threads > 1 && !ht_warned) { - error_report("AMD CPU doesn't support hyperthreading. Please configure" - " -smp options properly."); + if (IS_AMD_CPU(env) && + !(env->features[FEAT_8000_0001_ECX] & CPUID_EXT3_TOPOEXT) && + cs->nr_threads > 1 && !ht_warned) { + error_report("This family of AMD CPU doesn't support " + "hyperthreading. Please configure -smp " + "options properly."); ht_warned = true; }