From patchwork Tue May 22 00:41:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Babu Moger X-Patchwork-Id: 10417163 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 3A6926032B for ; Tue, 22 May 2018 00:41:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2A9D028AF9 for ; Tue, 22 May 2018 00:41:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1F2CE28AFF; Tue, 22 May 2018 00:41:47 +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 961A628AF9 for ; Tue, 22 May 2018 00:41:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752318AbeEVAlo (ORCPT ); Mon, 21 May 2018 20:41:44 -0400 Received: from mail-co1nam03on0042.outbound.protection.outlook.com ([104.47.40.42]:64128 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751727AbeEVAlj (ORCPT ); Mon, 21 May 2018 20:41:39 -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=mZoedMjZp2bhamGsgLzHW7yfB5uXTu8avv5PJN8fxzo=; b=FCr/9kYKtnxQQiA7BDeXkCWY87Gf1dPS6BLlMBRFtnrUNGCe0jqu4NjOHQS8+kwjVw7kKIF5p2zJm0vf8uBmrzQbaEppNw/G4/ZpevhH1rzHiXkg3ouyQuOJMR/aaWb02nFF2+E39QOppM/Lz1v05QFCKhNLwBrxpa4PZETHSMY= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Babu.Moger@amd.com; Received: from linux-h3ml.amd.com (165.204.77.1) by SN1PR12MB2479.namprd12.prod.outlook.com (2603:10b6:802:29::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.776.11; Tue, 22 May 2018 00:41:27 +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 v10 5/5] i386: Remove generic SMT thread check Date: Mon, 21 May 2018 20:41:15 -0400 Message-Id: <1526949675-106737-6-git-send-email-babu.moger@amd.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1526949675-106737-1-git-send-email-babu.moger@amd.com> References: <1526949675-106737-1-git-send-email-babu.moger@amd.com> MIME-Version: 1.0 X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: SN1PR12CA0071.namprd12.prod.outlook.com (2603:10b6:802:20::42) To SN1PR12MB2479.namprd12.prod.outlook.com (2603:10b6:802:29::18) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(48565401081)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:SN1PR12MB2479; X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB2479; 3:CdHqRab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sl+walCYc2fNs0HePVxVZ+K4UGDbQid8/UfocGHPJo7H9+M3i/FCsdJCnfQBi1jZtTTwi0ycE8HbY49hiXjtohW0zOObRTzweCvC1lXHVX1PIol33DdsKnJqt/eAgraCxshHFWGWKiNM9emO257i+KeGxMRcqWRJutzX2LNCElyv99OkwZHN8nTtd5dwC32LEqioXK/DWwn6q9b/lBwyE0iLpPu0r5VNRxnethBU1j2AqpAaYnesNMXknjss+A7DL5zwiZ+L+FJcQzcWMcqE8SR1P5/kqwbdBT4jgYrI5YHUmEil2c1zczDtYRZ8zeKZQIPv2XUueXNzdpoyEmVXizX62lY; 4:ib/8J05NkYyTvO/Ceg8gn3kZpkK9YAZeK+u6ezWpbqKiGijp7N1PowBytsm8rWlJPXRzvcTmlbmAoqE6HEU9pQSIJtwjcDw55G6Cnl8F7zdwJ5xk5UHtnbuVR9artaNHtp9GYMvuFnH/nvGj59aGELOR3O9B+rqTfwMZebwK3145LMPZiJnb2Tl7GBMIWxKe7ECdPE8w7tr1T2zDpVwlLWIb5UwG/Du/faNrBNQ4hIAmeh5HrHqgHMOGhRhLHSsUWJQwrXkZh3v2/qcc/7VC71GRjYagVdGeLd1je3jonk2UZ1/f2e4PpQcLuwzlNZOb 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)(3231254)(944501410)(52105095)(93006095)(93001095)(10201501046)(3002001)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123558120)(20161123562045)(20161123564045)(6072148)(201708071742011)(7699016); SRVR:SN1PR12MB2479; BCL:0; PCL:0; RULEID:; SRVR:SN1PR12MB2479; X-Forefront-PRVS: 0680FADD48 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(396003)(366004)(346002)(39860400002)(376002)(39380400002)(199004)(189003)(16586007)(66066001)(25786009)(6666003)(36756003)(316002)(305945005)(48376002)(2616005)(486006)(3846002)(4720700003)(68736007)(956004)(47776003)(7736002)(53936002)(44832011)(50466002)(2906002)(6116002)(446003)(476003)(11346002)(8676002)(26005)(81166006)(8936002)(106356001)(7416002)(81156014)(386003)(105586002)(86362001)(97736004)(72206003)(5660300001)(478600001)(7696005)(186003)(39060400002)(50226002)(51416003)(59450400001)(53416004)(6486002)(16526019)(52116002)(76176011)(4326008)(41533002); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR12MB2479; H:linux-h3ml.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN1PR12MB2479; 23:w8cnJVM3ItKJEO+ohCDgyDK7a6b+aQSsH2zV1fZDv?= =?us-ascii?Q?qJwWhaA3PQCSzYVc/684mUz4TMvSJcDsm9JdCiG0RLG9S/416+HktbMt4xcO?= =?us-ascii?Q?0fP3tmIGjEmK+WlXMx0LdfH/vsdzRtdsPcUfRS5bA9tbQ1CNZ38w6d2LtUE7?= =?us-ascii?Q?4xuHGDACOr+snXXH9zCR1O3TqolE8yQnXcy1tI5EOoTw7T0i1bJQt0P5aRWZ?= =?us-ascii?Q?MduVERzXo7GGvVbztHx8LOlXUOay2qOFltbSWqJsIC1w8zo+Ewv+Kwtt57jF?= =?us-ascii?Q?1g+y2q5nBThNYw2CksPaEzhqnVgDNiwGpTAyazj0owBOjZzSsqhY9JlHbXsR?= =?us-ascii?Q?aJnV1pxk+MJWAVs2FuphQ1wWXp2E8krhGnQkbXUHMfpjTFCDaCdb7zmx3ej6?= =?us-ascii?Q?ChFDQsxKcBgOiSqLdiTvt1q+vU8LAqgy+xsn7/PcKGP4l3IIfUf0iJNaNNAp?= =?us-ascii?Q?yN0U/QrZhxHF5NniGco8p1FHadDS3B3t5QvMVv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nbdlJdPcQ/oKrNza9xTy0JbVMGKJXVSxKgjxQir4q1HpqDj4UgeQPY6EIIRmbglC12XB4ZFQUluEqCiOrBcKj2IRuZ+MPtcmz+n6gaKWQaBEHvlwhB10/9WtYmTPh3N6Fcf/6Q+NyWmUVKHVGQN2U34VAjXIYXxqfcdVecxX4damDcytb+t4+rU+hJajlDiie6mXWWneJbCbqt/PQ3DL9sQNRkxaGOSC1FHShwL5y2itZA4MqdSYJaRvb4MvF; 20:Y+x54YRzH20YjwMV0uVW6fpDLL++bQGZ4tX6jZlcuG2fIp4Vdz8M7J5r9A2gWwtMCXA+ReaaN9TKavft2BX6qsg1N0rPfEI1UarpQhmzxqJSbUmxx2WBUroi36u7FW2lceA736D89EYKNHdYwZz4gRE6YXv4NPdLvwZJntGAZp6EnnzQl3ZGivB5TnM5kXhqdjGYnFTmVa1JdWiz+NMwDyatL1y4o413KiTUfv3hrJ5V6+KdmWx+Rt+r6VNLxF/t X-MS-Office365-Filtering-Correlation-Id: 172ff495-d5d2-41c8-58e8-08d5bf7cc0e5 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 May 2018 00:41:27.2617 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 172ff495-d5d2-41c8-58e8-08d5bf7cc0e5 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR12MB2479 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 d20b305..7eba8cc 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -4961,17 +4961,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; }