From patchwork Thu May 10 20:41:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Babu Moger X-Patchwork-Id: 10392441 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 D3A2C6053D for ; Thu, 10 May 2018 20:42:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C3F0328CF8 for ; Thu, 10 May 2018 20:42:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B846928D00; Thu, 10 May 2018 20:42:25 +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 4564B28CF8 for ; Thu, 10 May 2018 20:42:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752303AbeEJUmV (ORCPT ); Thu, 10 May 2018 16:42:21 -0400 Received: from mail-sn1nam01on0080.outbound.protection.outlook.com ([104.47.32.80]:43264 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752247AbeEJUmO (ORCPT ); Thu, 10 May 2018 16:42:14 -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=asu+/GXHhQMe2epTy0WRwg2G1oG2YYxE8mQu2TQ8KwY=; b=UrlkaQWLI5/gYBXwR89VFpU4OYY8w+pzPtp03uhUZ0FHL7yjK2E0Ax4Xl3oalm0jHFrdK9hooInljZ3DaoWXzPsbDiNTZWSIzI91YZpUxP1O/ZIE5VGXI9jbSWkJzTAd6czBuFz2RlHeb33PHzfAt5LZ+Jxm/+JBJEHwy260iEk= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Babu.Moger@amd.com; Received: from bmoger-ubuntu.amd.com (165.204.78.1) by SN1PR12MB2478.namprd12.prod.outlook.com (2603:10b6:802:29::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.755.16; Thu, 10 May 2018 20:42:08 +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, geoff@hostfission.com, kash@tripleback.net, babu.moger@amd.com Subject: [PATCH v8 8/8] i386: Remove generic SMT thread check Date: Thu, 10 May 2018 15:41:48 -0500 Message-Id: <20180510204148.11687-9-babu.moger@amd.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180510204148.11687-1-babu.moger@amd.com> References: <20180510204148.11687-1-babu.moger@amd.com> MIME-Version: 1.0 X-Originating-IP: [165.204.78.1] X-ClientProxiedBy: SN4PR0801CA0024.namprd08.prod.outlook.com (2603:10b6:803:29::34) To SN1PR12MB2478.namprd12.prod.outlook.com (2603:10b6:802:29::17) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(48565401081)(2017052603328)(7153060)(7193020); SRVR:SN1PR12MB2478; X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB2478; 3:bdxbFyXH0S2mdhsclZ2SklZCM3hZoSrWRu7ews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ibYdvwESze2I9qyPwIt/pH0lLUsxFPSAs6x6eqFDubvOymdoBj174dC/IKBz+d512cMzcvqP0OF8/gYxggt16IB/ikNlF2OpMEHOL4ZvmTeXwHNwEpJFbSP+bu4Gr295ZvJxHgGoDDuG05CQgCNJDwXhtUebGU9qFWTpQccfXBAYwdKugPR7Ia8ujGk0BzLxuQZL0nUYD39dbnf3rmA78m/266KsEZ8MjqOGuISgDMV6H5Yr03o92C3L4NAm9FfHFzwC0Lm/HYwOcFapkOnxEL+RDr9jBo5uD35qNo0Ie906Yimbzd2; 4:YcSZu4NwXUZsFi2Sn1+30QVrmKtyk7+NNUtKpxmXWjlkyYAob9YCCsW1eWC5Ap8EDMAb6O4PIwjEqSVK1qfjaSCJGPp1GgIrzc8L24MLtIq8sE5qBm7Njy7MTZMtgyDb4ZSgxMsy2rFwLChcgsULQKyk5manLpQf4VuzI32dHppQypDmlvs2ojxbjWOUv5oZxpFbq4i6243ZHzsvHWeGBm4hYLVpNXUS2Ysd1o7zH7ODrlfVQrB1hxzTEI2Bg9T1+FG+4GkWktdTxR8TMFKVG464H081DdFtzLa+A4P6T53RhbbOC1lR9pYUb5GO6723 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)(5005006)(8121501046)(10201501046)(3002001)(93006095)(93001095)(3231254)(944501410)(52105095)(6055026)(149027)(150027)(6041310)(20161123558120)(20161123562045)(20161123560045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:SN1PR12MB2478; BCL:0; PCL:0; RULEID:; SRVR:SN1PR12MB2478; X-Forefront-PRVS: 066898046A X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(346002)(366004)(376002)(396003)(39860400002)(39380400002)(189003)(199004)(476003)(446003)(48376002)(50466002)(50226002)(2616005)(53936002)(76176011)(97736004)(4326008)(11346002)(16526019)(8676002)(86362001)(186003)(7736002)(956004)(44832011)(305945005)(6486002)(81156014)(2906002)(8936002)(52116002)(7696005)(59450400001)(486006)(81166006)(386003)(3846002)(26005)(25786009)(68736007)(51416003)(106356001)(5660300001)(316002)(36756003)(16586007)(105586002)(53416004)(7416002)(6666003)(6116002)(39060400002)(72206003)(66066001)(478600001)(47776003)(1076002)(41533002); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR12MB2478; H:bmoger-ubuntu.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; SN1PR12MB2478; 23:rBJslHnlCMkpDjRbbpEe10Laqr3yeMXg+zOJyazfD?= =?us-ascii?Q?UHQd6PCfvtSR30RGcURha8p6g1naKVhBA5BpCAAPE+lR9DoN+Ldlxljo1iX7?= =?us-ascii?Q?ux4/YZfzvo3WVd2xk2A5XpeeWEB1K19auy0HNdFNPTcDm3vpKNJgq4TjIs0q?= =?us-ascii?Q?QLUgvAWpKrQtl2GyrbO2LNjpp+XyeUDi+ZsmwzMeOw2Za/u5pgzIehx2sqGf?= =?us-ascii?Q?KZsk31rpp1BHdI8bD96ay/CLN5RA6XtgFpHsm7S2fa8tobZLLbwN8vgcr2gg?= =?us-ascii?Q?IgVVkwBTqTw23isKW0QNH+Zur/hZKKPcXx3DXmwa+bqrHml7veF8MQQNdO4t?= =?us-ascii?Q?PKsfCDEjy6rekLtT2L4koKYHMyBVaPPUjF18wkvjzy3zif/kfWMmRf9JCvm7?= =?us-ascii?Q?a0u4u6L3gEkre6B91eyLiVtmXA+VanJ6slbHwcfRRb0+sAEtwqFbNQvvXQVG?= =?us-ascii?Q?yl3LDYgXX1ogqdlHDoOqapjqfGPJGuhmaHJV+RseWB341WfkOkJR8O2yNVd9?= =?us-ascii?Q?+/XBxNGciEqStErwGbGQnPEhiQoucPm5WH7Fw/FDfc1U4fGNGQ+bRxfnDzGR?= =?us-ascii?Q?cJfA2blRj2e763qFMCSd4OQb6Q9GgEYE+tHsOpCKAS9cg8blHM/RIPbD0een?= =?us-ascii?Q?WR8WDJC4SzEldVXbOitEqYu1pTBYyoXqpQh9AzM9wNjQsj12/n1J209kWUkL?= =?us-ascii?Q?4l3DC4/SNA5moLQbof6anSd5WlAfnlJG9T4bsp9i2COj2S+FILIicTB4VCMz?= =?us-ascii?Q?BYT/kYU0YjwC1nfOD64n8jXpgOfoGNaFN0hilR2IT6vSopITSmMAucxMzK5U?= =?us-ascii?Q?5AwvLaywiZw80vvbxsis/OqA3gBusNaRVietdWl5zj27wQRf+y/gk7i9CdAb?= =?us-ascii?Q?w8xKoDjS4vjMYfRp8HSIOTO2zkDquWjrL230Z+PoUyeKmfQK6V56ye3UE3Wu?= =?us-ascii?Q?RavZUmCe3vHl2rBrMp2LgXFTHh5+b4wehjJICO/QOQKK0fPMKW2xlezU17i6?= =?us-ascii?Q?9G/w96/sYxDAcrdLeQ7zctuGX/SwCkq+HstP0xMaD2nxbC3pLJRpAMb+XRj+?= =?us-ascii?Q?ftx++EIsz0CddgBaeqnnt+FYvCGFOuksnKfyz8DAegw0CD/8StaHq/mjYMcJ?= =?us-ascii?Q?PuE92ABHmBCchuDIZl9qo1/sw8LG474aVP/Wld9j83+qGzudXGY0m7CaWqhl?= =?us-ascii?Q?vc5vpQIW9HbLXrAdkirTJ3nriDu6v5qJwF4CyAfBa3m4TqGAcIFlwSQ6asg1?= =?us-ascii?Q?V5itC+xfWyN3YOCdJLwwjn9VDvLLLqbzQJ7dAdVAaKerTCCxOEs0cCJ9fZ/S?= =?us-ascii?Q?kGxXsy+SB9jnNT+gab+FpU=3D?= X-Microsoft-Antispam-Message-Info: oF4r+XmSGqE3BHqno7K+uBnXXCKdl/c20h9zyG16QIUmW4eR+A1OBn2heZfESZE7Xk2+uamzpwx/r8v7CZqSsP/vMvFy7A/WWZRFOVUQddcjk/jDZJAX3VmUVUUL2QbW9twDnx1g9WV+4lcwD2fBTiuGWHfrzzm3O355ZEbBkg+9m0DP9fxa4uXWTsimEz7f X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB2478; 6:27isKwjCFK+ZFzTgMhGOw9iwod4bkHWCDeRewqEPE+923twO712ndHP6btegJIoNkBa3EgPQv6eFN66QdjhvAlvDnlMWJXFyHQ86MaEbchSbNDwRA7Xh/XZW865I1nhQgsuyAwDFRSz9ImRJL4piJ2G86z3zWB6gmcUbfXiWvcHu8HV27x3TGJBUan7UmaTNrftmX5YugMQj3F85irGVIdQo2YdMGNoAkt6Ij0fjB5LnqkjShUvuVVNwPCxgMd/fdhyK/Q2zseU3VcAxIXrZI12U3H5HXp3V0u2iMeTqXeWuDMjKZ7RBTxV3WKknWTXEQekG8RkRWJuRLivZc8a3AtwCpu2IcUlmejerjGRh5LWSyhvdvT7t6VnpKI/eDU3+iQArMQSU5zC9o5jDQM6YF+OhKfkicE+fm21C+gjsgeAm+JdJU03xNvica8JP2an0ZuccCSFXuKybt/z0yJZISw==; 5:9jmMz4PZi+fuYxjKKpvpL9cZY0dADjBO65bL0fhHk7vt15LKcMVxBfd4eeCNpuiVaVacR8uONCNBXOtTvovPCscMWBv/LdyU837584cnwAyWVfph+pgf8br9hy1c0K8iI0EbMwEDEHgfCgCr6WcIrH7hMGRJdN8T+KxMEVZLknM=; 24:GF7yPy8ZkhbG0prlqEMKIh8VznhRUcjAJgwiiN5P/CJNcRFALP/2NrhBTSVQwWa+OW7/Af1mSv8ldJ25c/NPlcdju+cwSRLjgU9mXgtdIzY= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB2478; 7:iu6u1mdx1EH7japepQK2g8j8cwtrNwhGTT1aCQUyC7L2xl6rS32aA5yHLaAE+VZjsnmHTYnj+rRQRZqdT/rPkltK+2ZsHTLg3tnpbLAwchl/9D1eaPTGlEygPPubfJGvO5z6a8C66j1vUCgxgd+VdICtI407duTx/P1xaX2akwouaaPrfbPcGI2MuYyABGO90/zkmRzf/Yn0EDYuk32N7MHeMApMFJCufEJWcVB86QPHAifD5WFOrE8lHIo7NpxW; 20:AZt/8w93onFCO/LNVfCb5DQXwynuMLN5Og8RJpLGH3IBcsLB9yiR8+iXiwNA7J9CGJJjNQAPLPc8uGEGmkmnBkBnIo0of2t67r0aWEnQeM8Xig+XBWLWQy1vBAullkgGMM+ZQuG8SdvEbyw+1OusOPmYqbFGlFcC/AZWdDLds5YNobd5C2eUs2bM/ylbHxfOiYP5vQ8gzet0CY/SY6HAMURIL6PTG7h9xO8jeSYMpLvEKMtAKElHPO+WbCc7LeFB X-MS-Office365-Filtering-Correlation-Id: af0e0a13-4b6f-4e28-d335-08d5b6b67fcd X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 May 2018 20:42:08.1354 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: af0e0a13-4b6f-4e28-d335-08d5b6b67fcd X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR12MB2478 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 575f2416a1..17803135ed 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -4790,17 +4790,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; }