From patchwork Fri Jan 26 21:39:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Babu Moger X-Patchwork-Id: 10187095 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 457F660211 for ; Fri, 26 Jan 2018 21:40:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 33E2F293D3 for ; Fri, 26 Jan 2018 21:40:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 28BE02A84A; Fri, 26 Jan 2018 21:40:13 +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 B76AD293D3 for ; Fri, 26 Jan 2018 21:40:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752231AbeAZVkL (ORCPT ); Fri, 26 Jan 2018 16:40:11 -0500 Received: from mail-by2nam01on0070.outbound.protection.outlook.com ([104.47.34.70]:19812 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752183AbeAZVkF (ORCPT ); Fri, 26 Jan 2018 16:40:05 -0500 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=NHMv97KYfRauRHv8QbKeUEwZt6iGHC2JeXVOuGfJQd0=; b=2VXYFTVaWkYUBfWEPQIEbzmXHihL1dCDsc9UHo8WdDuQ6ya9JF2voIAe/eNUY4JDSmbcup3DAVDYrCRB8JZpg/vD+YfvJXQMIOf8CtfQ1gMVbbmbUui7cpf9fP/aI/txVNLe4WLgjRiRTaOL//S1gquLaNVW8h1itDvqYnzK4f0= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Babu.Moger@amd.com; Received: from linux-pyp0.amd.com (165.204.77.1) by DM5PR12MB1769.namprd12.prod.outlook.com (10.175.89.150) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.428.17; Fri, 26 Jan 2018 21:40:02 +0000 From: Babu Moger To: pbonzini@redhat.com, rth@twiddle.net, ehabkost@redhat.com, pixo@polepetko.eu Cc: mtosatti@redhat.com, babu.moger@amd.com, qemu-devel@nongnu.org, kvm@vger.kernel.org Subject: [PATCH 5/5] target/i386: Remove generic SMT thread check Date: Fri, 26 Jan 2018 16:39:44 -0500 Message-Id: <20180126213944.7594-6-babu.moger@amd.com> X-Mailer: git-send-email 2.16.0 In-Reply-To: <20180126213944.7594-1-babu.moger@amd.com> References: <20180126213944.7594-1-babu.moger@amd.com> MIME-Version: 1.0 X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: CY4PR04CA0064.namprd04.prod.outlook.com (10.171.243.157) To DM5PR12MB1769.namprd12.prod.outlook.com (10.175.89.150) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 2e6b381e-3439-4154-1d8a-08d565055b83 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(48565401081)(5600026)(4604075)(2017052603307)(7153060)(7193020); SRVR:DM5PR12MB1769; X-Microsoft-Exchange-Diagnostics: 1; DM5PR12MB1769; 3:t8D2eAUkXvl/KjigcHg+TgaL+M8c/cHt5rZYq93k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W+vOWmOY+fX/IGY5GIQM8aaAqqg+S1jrTpMOqti1ctXAQvtMsCRt9wDmyR64UG1BQFnrFq9B3VNDuxUh/w5xmA6v3tVHGQX4e9YpD59PySi9pwjRuRq4UzpDQ/ToGoVFauqvQz/AbPg9Qn+hQpwLl4lZWvgQ+hLsp8sYSYwJ4r0WVHl+jjhzwP5j75k0xNLTDFBtAzZJbAKiWK+UAeASSKUXlbNhBDaz6F6HtWtdHOzoodUSsxFX4n5BE3QlW5D3EG9zWyIEI3p2t2GUfTykBw88gCJVQyC/ilWgHJjUtr; 4:xY2kzWnd8dHwoHgaViSCVGbWgt0zIoZhzbJFCO34MxtlecYzq2LWY+OOiaDt8eOpj+TdMWd5QiD6A5jEIO1ffYnP+Bz/plvsNmkwGv9ZgaLWKORR7TTzpRCXJv+7HJCCOp5qq9+GLDLU/Q8wIDhCNxYr87RwuUiPBCbCq2WKZl15CjsKKgl+o7aEBRLEOXertAZR5VaIq5ifjDn72FPM5C2B3kcZqABSJxXb0RXtLZTldBnLh9PM9hFbXKBf3GxwhXj3TqLxfFftDxf8EQieKdpIfnoH4lQZ0THp+9yVQLde/jOqOulHKB8uioiJ6UVr X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040501)(2401047)(5005006)(8121501046)(3231077)(2400081)(944501161)(10201501046)(93006095)(93001095)(3002001)(6055026)(6041288)(20161123564045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(6072148)(201708071742011); SRVR:DM5PR12MB1769; BCL:0; PCL:0; RULEID:; SRVR:DM5PR12MB1769; X-Forefront-PRVS: 05641FD966 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39860400002)(39380400002)(346002)(396003)(376002)(366004)(189003)(199004)(5660300001)(106356001)(51416003)(7696005)(52116002)(59450400001)(53416004)(8936002)(68736007)(386003)(105586002)(8676002)(81156014)(81166006)(50226002)(76176011)(53936002)(6666003)(2950100002)(6486002)(4326008)(16526019)(72206003)(36756003)(86362001)(1076002)(186003)(3846002)(305945005)(2906002)(66066001)(6116002)(47776003)(50466002)(48376002)(16586007)(97736004)(7736002)(478600001)(26005)(25786009)(316002)(41533002); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR12MB1769; H:linux-pyp0.amd.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR12MB1769; 23:SXPPCGdBeiuL1Yk/3zhFwYw7Z5O3+OEAe3qhvKmE4?= =?us-ascii?Q?Fcjo8cwuiVRE0jSa+IJcIyZmmE7Mr3t5KOOWhd/bie8BKB/HQl5uRUOfU0Ye?= =?us-ascii?Q?hg5q5xkLepjljBiHSPGMccEg34+BffOH0sekTKBbHH83no/fl5LVEUptXILS?= =?us-ascii?Q?MibKdmA6+P5JMTZL/2ZqmWuD/PsEDCpUamjvIQkLgFIfLuQAZj/KG4G+sK8b?= =?us-ascii?Q?gERmUxZlqpllEtFx23xKna7Af8Z/kKTw12KhpQOXEqxxuwIzt9m4JkpLCzjX?= =?us-ascii?Q?Xq92UJZ9+/lWIWXkPllFS9GjONiLJXf4SZXCFjLo7XileAJykxCFzx8t7So3?= =?us-ascii?Q?aczcRsNoPUQxb5ZeIhzvciVFYvsf8OX2E8GUIhi6vbWZkM0bjrw6VMdOXu2H?= =?us-ascii?Q?0Y5DYTDYgHSluK8lf1sU3gfNKy1vBC7jzNSz+MpPQxCQ1HKUS6JxAWR+9AKF?= =?us-ascii?Q?y9r0X41BBU6gWiLKFsdQgyjRW/ubV+3tziCo/NnR7gUR3CO3HND3qdcQfN5b?= =?us-ascii?Q?AblOj18dCWpURDwT9ssjLuMHC/SwXEic6D4EEi+jVfjKydetSF9RS4EWZsKO?= =?us-ascii?Q?wLl2+l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gyVQimYKKZft5o6I4VKpYmG+iKYZut1fl53Nc5JERKBPPs9hg=; 5:srB8KXir08HU+GlNqpSmG+cez/TN1kdHW9lEpOP7vtlhUZXGpZigle9rOsEkhADMvWH8BTpNtFryeBn4p6zyd/jxEWgAR3zYEVShEGNvgYVgIK+P/MWavp+rL76UUrIUzx2HmNUd0QFEUa0B+DrIFfjalxxLJEMcklobBx+3oNc=; 24:wb4tSy8hVdMn1XKgGY1eQddUooit55SFoegcTqhTPcAYIHWxhETJ6GOg0LjKaim62zkJdFEt7DKiQVhfqg+qKTKS7l//ATPbtZhJvWn7jp0=; 7:HE7RJ2hOTZEjHwwtkHIJbNxQLUx8x0BLG2QuQIh0m8qYG/HhuEIYOxZeOwY9X7RN9J+nrkg3kP3O2tzEz1yDaH57gRJtpTJ4PR8FDLdf2/uXL81MzM/uCRQ4GavLbNAC7VcBapNhZoXhdr+bppSY+eWrAEs9RayGWfu6nSkSuFFBoEilWLFF1FNXyOcdoiu0DEiz8dQRWQzR1f7jKTMuHgR2IYqyHfssRgkFMChcOGwGT39QPPz6xKIqCLEQel0X SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM5PR12MB1769; 20:xQ7x8LL5u4hVOWDXikHZPbauGoFB1a9vj5zWOsbCux8JKdgLo+XLBE2weqi8dNFYONbN4dozXLDWOXtl36qMf9CV64OSgqqnEgausR9jy/3acTkswHLrjjQkpBHjGXCPFr6Y3+8CybUqOaZYZXw9hgdKtC7AUHq9/Oc18H+H4bAk6PuyCQaB6Z4G4hSgSp01NwjjaZ2dCgePUG5eaKscAdQJSrCMYb+AF/hkNFMiAi33YtAwSk14HOdvt2M0/zis X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jan 2018 21:40:02.0948 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2e6b381e-3439-4154-1d8a-08d565055b83 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB1769 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 | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 956ed112db..6c34720839 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -3888,17 +3888,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 + /* 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 gives * 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; }