From patchwork Tue Jun 19 21:31:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Babu Moger X-Patchwork-Id: 10475499 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 9BE2F60532 for ; Tue, 19 Jun 2018 21:32:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 893D728BD9 for ; Tue, 19 Jun 2018 21:32:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7B1B028C87; Tue, 19 Jun 2018 21:32: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 0288628BD9 for ; Tue, 19 Jun 2018 21:32:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030378AbeFSVcp (ORCPT ); Tue, 19 Jun 2018 17:32:45 -0400 Received: from mail-sn1nam02on0042.outbound.protection.outlook.com ([104.47.36.42]:7378 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1030443AbeFSVcb (ORCPT ); Tue, 19 Jun 2018 17:32:31 -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=GUT05WAzpHsTS8cwez0Iq5tzt5zRuD373pWSf9hcuyQ=; b=Nq/3xg8n7JSszIXoXVzj5Ph+gg+YNzOYd1LdxGmW5s0EmOhv4yEezbmrYgS4KQRPzxhxxG/B/b8H1ShNCafUR6V0ibi4u625VO9HgXy3gufdzMeJqDgff3nc+65aChGGWCMFNSsPp0H0vMJuLVVA01gu3cIwNz5a11zMcWiIXxo= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Babu.Moger@amd.com; Received: from linux-h3ml.amd.com (165.204.77.1) by DM5PR12MB2469.namprd12.prod.outlook.com (2603:10b6:4:b4::38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.863.16; Tue, 19 Jun 2018 21:32:15 +0000 From: Babu Moger To: mst@redhat.com, marcel.apfelbaum@gmail.com, pbonzini@redhat.com, rth@twiddle.net, ehabkost@redhat.com Cc: qemu-devel@nongnu.org, mtosatti@redhat.com, kvm@vger.kernel.org, kash@tripleback.net, geoff@hostfission.com, babu.moger@amd.com Subject: [PATCH v16 3/3] i386: Remove generic SMT thread check Date: Tue, 19 Jun 2018 17:31:59 -0400 Message-Id: <1529443919-67509-4-git-send-email-babu.moger@amd.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1529443919-67509-1-git-send-email-babu.moger@amd.com> References: <1529443919-67509-1-git-send-email-babu.moger@amd.com> MIME-Version: 1.0 X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: SN4PR0701CA0016.namprd07.prod.outlook.com (2603:10b6:803:28::26) To DM5PR12MB2469.namprd12.prod.outlook.com (2603:10b6:4:b4::38) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: ac8733f5-dc6c-449e-2448-08d5d62c20b6 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(48565401081)(5600026)(711020)(2017052603328)(7153060)(7193020); SRVR:DM5PR12MB2469; X-Microsoft-Exchange-Diagnostics: 1; DM5PR12MB2469; 3:rOoDlHN8AjROZGlPVZ3zVRi9zi8rdS8sUygh5F8FxsXwwC8iSODbliPMF87mbB58/rtKaRV7kFRXINEOdu72TBV3m1Y9BDGCzoxrQaymuXCqIHUyTg+wr469zlxDM2ZiLc/fQKasnOwiIsXssOQrUjgEWq0P7LgQbEowLTypmQth6vZXPkWBIFBWygQ/0fnyv3XUuWty+wACygvHk6ClelF9h2yx3R22iXFyiLdRewn0oLBnbeAizL3OTAG26oCp; 25:9R02FJiK+2dypbzUe3igenyww1DqK5gQub7KqgNauUNpQLdmOq2KBi0K3mpXqwusLz2NYf/TmAuZUrPm8FLoJP6fyhfdPNBqdT+6S5KOJT2b1H3Nzn8tmTaBCKxh0sThCBy/Gu/0xB6fx5VD2e9qqkFBSVeqPCbr2bzLx7PW6yNbcZIMBc6lCW6BBfkxz0slJeeQWf23Fr8Jw/kvWAosbynhfPaZ81kZXIEvNBcFSHuRTsUIVioHpROa4gnPfd2v3rHgX38aa7mOjIlcGLAbu+K2tDC25wI1WIgilfU+eR7AKM1l3aoki00oOSrlijczHmOXBy5eerKMYMKHkVav3A==; 31:qVqC4XKMrh5B81HMXfcYmZ5BxlANn0sPgWtQozVgt9tHd3qRuZ/0GxxDgQoZ5/cnAKoMSe6f6E9VueOqK54cNAgcvZKbOF4CxAgfBN99FR8S/hpyfSZ3NXzFAnkfO6WdZbCPb0R5oqMoBdZLfCOmwXWh48NerIM/x1wNLLhQN1jYoVCiAeb336h7G/taGokJPEZQVjdyTVcqcI4iClRkKkcyRfd3GVY0d4J+z3vrHmI= X-MS-TrafficTypeDiagnostic: DM5PR12MB2469: X-Microsoft-Exchange-Diagnostics: 1; DM5PR12MB2469; 20:RtjAj6cDJbPrHivYe5JBznhWnzpKhZlpg110b664mhmJPXBTM//l9BwptzOkl62Ol4jMIjsC0DbiGX6VSAWyPDIo0awmMRQBqWUe5KSZ1tmM8AO2JDqK1GMDyGtDs7SuMJ7Unv2xnXlagGMRoKdFM9Kyy4fr9Rp8Bxo0LAicFbkrmgc8NsWJUn+R/VgGWyIaxj0nDjLVoop2cZNMTIndJDuNWbhJl3vt1UFh0fu2XVrdUH6LLFFYnwZoA1V4klzc1NQdPZWzCuAm6akDTSUeBQz8enoI1l2y1w8NcGTcgkUDrPN0ztDxvn0QuefnTtmzFpsuSwBMPfOQJixjKo49tODjB/k6tCXRrfEj4KA756ndIPPWLALeczTUljIZ7Bfe6/3DnE+XfynqhqtSTqRKobXGJYVndU82cZ/tYqqs82oEyFNIcSzyqffALayILcqKLV49BMbjbUaLp96OqBIeVVm6DAa61ss9AIAh7R4r+hws+L8RPDkgtmkNXrthWyH1; 4:4I1gR4cW3oI6X65ZwIHiI8HqimSw3SfStcUW7upmdmAOQiQYdRidp73phOHRYKMuKjyondJmspr4BSYugAvQ4nnlbdoponDpDn49W5j8BGqvQJc/TP96g/s6vhviTy8scSiKhbmb+6R6JdgRCR5Cb4NyyE3dXOPGkl4wUmb7pUdQm7T3VsrOiPo8tKlE//IX5P01JHqd74BxycezYzwu3DL+h6NCM+2eQhfN+iHXPE9/JJLHSaLmSCTOUal74zyMDDG9qD735wJoTgGjFOhxpUNdhrDzZOnsv3gIf7ah06hH0dIf/XwqJl5xRPSXbeVk 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)(93006095)(93001095)(3231254)(944501410)(52105095)(3002001)(6055026)(149027)(150027)(6041310)(20161123560045)(20161123562045)(20161123564045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016); SRVR:DM5PR12MB2469; BCL:0; PCL:0; RULEID:; SRVR:DM5PR12MB2469; X-Forefront-PRVS: 07083FF734 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39380400002)(39860400002)(366004)(396003)(376002)(346002)(189003)(199004)(106356001)(97736004)(26005)(386003)(76176011)(316002)(25786009)(4720700003)(16586007)(39060400002)(478600001)(59450400001)(6666003)(72206003)(186003)(16526019)(53936002)(66066001)(86362001)(105586002)(4326008)(48376002)(47776003)(50466002)(476003)(2616005)(5660300001)(53416004)(50226002)(7736002)(956004)(305945005)(36756003)(52116002)(2906002)(8936002)(7696005)(51416003)(81156014)(11346002)(446003)(81166006)(6486002)(486006)(7416002)(44832011)(6116002)(3846002)(68736007)(8676002)(41533002); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR12MB2469; 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; DM5PR12MB2469; 23:hDV3cZWAeG841ZzZ0GXKVbuuw7r20QjXQPVao6IDx?= =?us-ascii?Q?MchVqzpY7MUzK6QArM4xbKMtcJTllIFM4+6dBoonZ1Z/q5f9V77fDThZuetp?= =?us-ascii?Q?1OOzBG1Di2GAsBqOKOunAuHx3hbmzdi3QUA9Bop4ey7QZOjR7kHVl7lUEz0g?= =?us-ascii?Q?KQXZ2v9Z/iABc+qixoeO9qSNhf/nErCdaeifDHrMZmmLercQydEYwcpWQPri?= =?us-ascii?Q?uFuRChnJ4TqCOZVMe2Zsn8MCkZVFm2tATKcWxg768GSsdrzSmOJOySmUOHhR?= =?us-ascii?Q?bXHJgeGvIZHY7zI+LnIx/2Bg8gmr0jwdRpi1y7r8jZS+LY9FCvjzQ2TAIKkk?= =?us-ascii?Q?QwefdsSBGtsItGRtW1ZAN8KFgkgkx1IKVbY9PqOg0wk8xjcNVJ+teTdZkgbx?= =?us-ascii?Q?9pXG0nfdtjfRokQ/qDZNi/xznJ4b8BVX41/5ozgFI608yLlHKkSlhhWWhjzS?= =?us-ascii?Q?J67Xit7cT9wWXyhZmnrPpxNABmQuumeNlhOqkuNxVYzCZ1i0uho3lnKWboWi?= =?us-ascii?Q?P5VGJ0tKaKaBmBJzujEaljp45RyImtarmK2EB4TvyiiMayL/z6aL9DGzjbMP?= =?us-ascii?Q?9a50B8CIhDu+OC/s6HKrenm+0LX28Auit3n/LZVVBybkvSzRQBhhupUCShUb?= =?us-ascii?Q?tB3znCCZDOO8k4FD5gjjjXQh2fWG1gOcmBrdzZcd7gW5NI+IbEbfgz0tI+6/?= =?us-ascii?Q?3ABHB2CZ556mfkcvWpny43ftDiSOi17n2KdOfb2HQ+uyHijvU4SSqlDDQcXm?= =?us-ascii?Q?EFY84ACDxT+3V2dTBfXeO1YTs3kE49xhEl1vkaLTK2sm7uYXqxHAGvyrEqa9?= =?us-ascii?Q?d9aei+0r0Vx6/9qvpZ7frJ9dOzT+i4eZsgzdYPAHT1ZUCygnR1mlCc5a0GZL?= =?us-ascii?Q?htmY6eqbrLkHau8QANlLXl5rZdtHlJJdbihli+l5ctIt77gciglRTKIKKu6P?= =?us-ascii?Q?VD3299jWRL5SNSe6ceS/oytOeelaFHmYT4OTfpH7ngHCHczVvGQTSlr3+83a?= =?us-ascii?Q?ReI+o+KuUxVHHerR9OXv4EESPUekGZatYGPYDZ/jxYqp7arQdYm6TSBMjFdJ?= =?us-ascii?Q?0f7hmzzI+LAo/LgcwKF8dvV8P4fH4702LVBttr6hlvcN5Cn5tcyY0OnbuTyl?= =?us-ascii?Q?eDDSNRI+3MR5kJJslWTqnJIWTKiVMi5OGrn7W14LLfdhxFr87m57yLEGct3p?= =?us-ascii?Q?FurKRi7YEwD/Kub0udHIeJWL5UMVQe9kVprp0OoyRDBvuC4gdrJLdq2uDgfT?= =?us-ascii?Q?8YFrIR1PeMFwOykx7WF27UwA9qFnrhBBzwrth6bbhGSpKrvKQFz/33zSdgRk?= =?us-ascii?Q?UpADrJ6w1EslB64fKJ9TH0heuzy755I/oywUe9JixkF?= X-Microsoft-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xt47dIYBkvKGHAja+PrpN45c3MI31kWb762rqfDUbrtyxyVOCigQNHsJs6wXJvdCImP4XgEa23dGIgsBTnzVB1Q0= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM5PR12MB2469; 7:azejcw8YN8VQlkBB5RhY8mdxD6gzAp2/eDHPR7dMQlg0O1dn8cMEkLwdjUfw3JpC+Nhc0cX5pO7MT7iEJWgvDgurNfWPiJA18aZ8lyInsYyYb7e/PqeqtlrfJUVDk/S93erM9ZrFCUN6JZVk/AFpRzpvA2RAP7WuXi+jxXq2rFiAEKMcNMqzZz3aCjmaiTBdhHxPiizIyUu4T6lQDxPSs1/zRX7daDzzcAFAqPjzLVtKz0GUspVubfGban1mlcp7; 20:iowZZlUMMD7cclVaqmPpCzHA8ASj22wVaykcioMVYhA4BZJDYfV6Z89Fq2snmlJY3jK01/kr8/O9QDCbbFaU6ObAUX5lrEyhBgonQRdlH0az3y1QuSyoLxJQMEqUpitNj7ueasll3nKP+5oMFQyed8ofSFTiGtZhdyq/InY6nL+QrH0vrKthPVCB2w/Q+AU2Cw/sElGQfi7QzhHEPI+1WALadrkupWkWys+wwpOeRQBNAqRsiTitN5GX847yVFVg X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jun 2018 21:32:15.2031 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ac8733f5-dc6c-449e-2448-08d5d62c20b6 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB2469 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 | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index d6ed29b..e6c2f8a 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -4985,17 +4985,22 @@ 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 or try enabling topoext feature.", + cs->nr_threads); ht_warned = true; }