From patchwork Thu May 24 15:43:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Babu Moger X-Patchwork-Id: 10425035 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 5F85D6032A for ; Thu, 24 May 2018 15:44:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 36F40296AD for ; Thu, 24 May 2018 15:44:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2BA6E296D5; Thu, 24 May 2018 15:44:17 +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=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, MAILING_LIST_MULTI, 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 836E2296AD for ; Thu, 24 May 2018 15:44:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S970928AbeEXPoO (ORCPT ); Thu, 24 May 2018 11:44:14 -0400 Received: from mail-bl2nam02on0059.outbound.protection.outlook.com ([104.47.38.59]:26944 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S967988AbeEXPoG (ORCPT ); Thu, 24 May 2018 11:44:06 -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:X-MS-Exchange-SenderADCheck; bh=DXWHowz4f+MZAy7FzX1t7oUmhcqC5eHjVzDUyhEZDbI=; b=XZ+uyxO8RjvGuYn8D12vDVE1HZnHhaNiisqE00HfwiYB9LLvTnX8smTumcq5P3sVGbTKWIMfsTZqnpszgWdwXB+JMz7aPyYFIp8TM4RH0kCAOnXgxiF/vfE29ctd7/lb06XnrP5y8CSpYdXvdd8CFfqho8vhrZdcwpO4oa65dfU= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Babu.Moger@amd.com; Received: from linux-h3ml.amd.com (165.204.77.1) by DM5PR12MB2471.namprd12.prod.outlook.com (2603:10b6:4:b5::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.797.11; Thu, 24 May 2018 15:43:51 +0000 From: Babu Moger To: mst@redhat.com, marcel.apfelbaum@gmail.com, pbonzini@redhat.com, rth@twiddle.net, ehabkost@redhat.com, mtosatti@redhat.com Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org, babu.moger@amd.com, kash@tripleback.net, geoff@hostfission.com Subject: [PATCH v11 5/5] i386: Remove generic SMT thread check Date: Thu, 24 May 2018 11:43:34 -0400 Message-Id: <1527176614-26271-6-git-send-email-babu.moger@amd.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1527176614-26271-1-git-send-email-babu.moger@amd.com> References: <1527176614-26271-1-git-send-email-babu.moger@amd.com> MIME-Version: 1.0 X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: SN4PR0501CA0024.namprd05.prod.outlook.com (2603:10b6:803:40::37) To DM5PR12MB2471.namprd12.prod.outlook.com (2603:10b6:4:b5::10) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4534165)(4627221)(201703031133081)(201702281549075)(48565401081)(2017052603328)(7153060)(7193020); SRVR:DM5PR12MB2471; X-Microsoft-Exchange-Diagnostics: 1; DM5PR12MB2471; 3:hpEEVOYMnz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ffgkplWkxiqs04tmdx1XKQUaktL214wL+PzukRmD7HqxX0a9WxjiZIkCEZ8X2dhun/ZpGLK4uy9NBPNpvPPAOasI1oFx4mFmu56m3jeUTH/bNK1eTnXlzlJMegwEBmc07s2KysNtCfoXw644yANYl0gbfYgFVLTW3XsXuGTM2915lnIjI011FKKCMzmj4WajZOFXbbNP84bGSOY1BFqjWAF0ZHjJUFiPXZQ60rtJd5Ya6EiwV6Yw1/G/3SgAVq+HsV9XPnyBcd8MijBfvuZ8OR9DJT0cnsCjIE+JCEzh+RB4RuyMdCuuavsSnO5zq5F6CUJG; 4:ryBFFTR0JXvLhA711DgR3Ugz45FOiYvCZCgysjglDsCWyogTBZIMFdbrxG9+5e0H+9ZXEDCjIwYPE+FbxtIVgcTdufpDLnsCEwo2R4xjIpa98v+s/wKEm5k4o4fxcgng0sI7vRVFXkj6ZsN/agxWAzN2zPhremrujNipRteIhIfpTcGjTmjrGxiYnWIl7jDA/h8hWS9cXkXK8z0igQ1b9e6ZtOYH+8qzp+vGkpRsBPoL60D2MhRtLhj9DuqXqH/0/8llhlnIcU3OU+NIuf3jgSxeZWlIX7Cggo76is4biGPiAOWEJZu2nddV6RWXXzZQ X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3002001)(10201501046)(93006095)(93001095)(3231254)(944501410)(52105095)(6055026)(149027)(150027)(6041310)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123558120)(20161123564045)(6072148)(201708071742011)(7699016); SRVR:DM5PR12MB2471; BCL:0; PCL:0; RULEID:; SRVR:DM5PR12MB2471; X-Forefront-PRVS: 0682FC00E8 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(346002)(39380400002)(366004)(39860400002)(396003)(376002)(189003)(199004)(5660300001)(53416004)(6666003)(2616005)(446003)(11346002)(956004)(476003)(59450400001)(486006)(44832011)(16586007)(7416002)(4326008)(25786009)(478600001)(53936002)(39060400002)(26005)(47776003)(316002)(186003)(16526019)(386003)(86362001)(7696005)(51416003)(52116002)(66066001)(68736007)(76176011)(97736004)(2906002)(50466002)(3846002)(6116002)(72206003)(4720700003)(7736002)(6486002)(305945005)(36756003)(48376002)(50226002)(8676002)(8936002)(81166006)(81156014)(105586002)(106356001)(41533002); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR12MB2471; H:linux-h3ml.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR12MB2471; 23:owfdgPQQxMewP8ZaDQyl3sOwgPISciVeBi2oe++fd?= =?us-ascii?Q?dVWBGGIWF4UGDUsvo483uFGYfi45H2wn3f9lpo1utilU+3L2orkX+Mbd8Bj9?= =?us-ascii?Q?mt1v5P5mOrH/lx4kH7MfOEPOeH/wQqshPzGyRtp3RFsVEZgXu+fjAvyn89Tw?= =?us-ascii?Q?uFZfhn7uUTgeARJ1eKjkKkktRNf2ogPXm0x8A+RzZuYEuV9Rxx4QlfRs9RnY?= =?us-ascii?Q?g/Nba5mlbTpjoHspEjNRs1ALtA/sph5/nDEw98xwD2XqRjueroToq6pOFS6z?= =?us-ascii?Q?AvWW8iNlhU6UO8MaA5nKDZlRq4xsfWnVKmfwiyV0UaaceiAKwlVocGovug8k?= =?us-ascii?Q?SvLAzYOb0LYXJZVu6eGsccVn+ZeavTvd7XmRiADRm0ilBFWT3MmT8a8Fmsec?= =?us-ascii?Q?GkW/7ndSIX1eUuHbuPORIIErBj1Jbp5x2Zftu6IMoWV6O5jUzY0ZpeWSsLq8?= =?us-ascii?Q?5ET8xe0ulFhdU5XncS4r3Ah7dfC8GMVZ9ToxHey9CaEOi4DGNyz06sTbdeL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7E2fg7/g9aW1RnVQuz+mDPBHg9LldtVkfG0P9aBYOCKBLRs4FnACIskqVRD5IXaNrxucmvio9xCZGCGh7e3MC9yzD5ftMITagoiWLIAF0Ukzdrivw9VxNCvRiPg+Rok5+Ej2790Em0xyQywe6hEJhc4LFwkbBMwQv77Srafli5qswYdTGbYBzB0NC44trpmZPmgslblUbm1cICh35mKREX4dxx; 20:MtQqqlBBmEX+ZB7ayoMNST58opUpKVCMCUKIct13HA9NEA54O8lE71E645mT9uNnyE6R1e5gJ9CFNc6POk/01ZswGzic4Kywf3fRU/DoCT7GBoeu4tGOHcVfl+eauHhBWSRzTb9pBaFmxUbjPZvTcdBgJoNXOyngBFAfk2/eE12PMQhUfSnA5beEu0i5wKfpF9nkwsfjdf4bYSV0PqJM12HKUQHaEVQhb4Qk4DzYyrtWfD7/SYU4a9WIyVnErXyP X-MS-Office365-Filtering-Correlation-Id: d7375cac-ff01-45f9-18af-08d5c18d2665 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 May 2018 15:43:51.4939 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d7375cac-ff01-45f9-18af-08d5c18d2665 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB2471 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 Tested-by: Geoffrey McRae Reviewed-by: Eduardo Habkost --- 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 0b62356..e09eedb 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -4951,17 +4951,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(%d). Please configure -smp " + "options properly.", cs->nr_threads); ht_warned = true; }