From patchwork Fri Jun 15 17:15:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Babu Moger X-Patchwork-Id: 10467149 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 CD9046020F for ; Fri, 15 Jun 2018 17:22:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BC97028E14 for ; Fri, 15 Jun 2018 17:22:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B10A128E16; Fri, 15 Jun 2018 17:22:20 +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.8 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 362FD28E14 for ; Fri, 15 Jun 2018 17:22:20 +0000 (UTC) Received: from localhost ([::1]:48496 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fTsQV-0001mZ-AH for patchwork-qemu-devel@patchwork.kernel.org; Fri, 15 Jun 2018 13:22:19 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53291) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fTsKU-0006HI-IS for qemu-devel@nongnu.org; Fri, 15 Jun 2018 13:16:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fTsKQ-0007Ta-Fz for qemu-devel@nongnu.org; Fri, 15 Jun 2018 13:16:06 -0400 Received: from mail-eopbgr730061.outbound.protection.outlook.com ([40.107.73.61]:38533 helo=NAM05-DM3-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fTsKQ-0007T0-8S for qemu-devel@nongnu.org; Fri, 15 Jun 2018 13:16:02 -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=O9WOH8MIdu+CCjBsrkqtkatANQbJD5mpxxc3b4MmgbE=; b=WNoFvCVh61pLa4KUiEWXWeiG/ZRhRSdX/nhA04HLt6dUL/sVZroh6aPy8EkdOZkWIawGIyiHjxfgHRHPGS56kcXgVqGRjOboPIMDjkohUZGcan2WEdniRA2vgxFXY1uDDyDreKS8QOprZjOlShlTwufC4oyGqkgRLTt+5h6+TbQ= 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_GCM_SHA384) id 15.20.863.14; Fri, 15 Jun 2018 17:15:59 +0000 From: Babu Moger To: mst@redhat.com, marcel.apfelbaum@gmail.com, pbonzini@redhat.com, rth@twiddle.net, ehabkost@redhat.com Date: Fri, 15 Jun 2018 13:15:47 -0400 Message-Id: <1529082947-60001-4-git-send-email-babu.moger@amd.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1529082947-60001-1-git-send-email-babu.moger@amd.com> References: <1529082947-60001-1-git-send-email-babu.moger@amd.com> MIME-Version: 1.0 X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: SN4PR0201CA0010.namprd02.prod.outlook.com (2603:10b6:803:2b::20) To DM5PR12MB2471.namprd12.prod.outlook.com (2603:10b6:4:b5::10) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: cba823b1-337e-44ae-d7c9-08d5d2e3aa7c X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(711020)(48565401081)(2017052603328)(7153060)(7193020); SRVR:DM5PR12MB2471; X-Microsoft-Exchange-Diagnostics: 1; DM5PR12MB2471; 3:VyLKic5o7APsUQh2961cufMUeT588QybOauQ5alAmyrBoIuevW9lOpStggNFXAJXE+GaDcKDXaqhiSvbn5UYiC72dLtZjR/4vjcGabGxjwWBKNj6Eb93aZxRmwBefambB/Fn2+GN547ydtD7c3LS4dWNIvrFBU1VV7LYP/eCNyzyYU8uh4bw+cSWV/uuAsCDeB2JDwNMI+JMulPZEGqXq+4raeHROSzBu1Ck3K96BTd3vvLciRgC3hI4miwSvAnL; 25:0QYEfgdbXn6Zp/G60cc0bqfVE5RsllTD0wV0DdqdzhIm333NQoSb0HASYXxyQn2sJ4CeqojmKXwTa8UaqMWEyPUEhhSqfkm5cJR6lYfjC2uznaoo5K+rKRy1w7vcFUZlA6UfeubMZoydG5MDLlbqnfi7RjGIB/Cjr+XseeWdM89YLoOFtt2zM6y06yGclWWmprjaLA/itUoffmSMXyNiT+p3Cth/3zdWuRBeLs14EYm3hSrbITOZXOZI9AZO/51fus8uHqFFHa+YYHx6gJiv30jzG1/4ol69IN9fvGPIN9Qw6NA2wg/dYxunms3pmVG3L0vvHUsWOfmRIyf7zs677w==; 31:QwPu51lZBamBk6fg7SpwC5un50r6Tulyc1CqzTKz++hfE8t9CYpI8l3WJbkcyUcKNqxRGcLoXhdiP2CbmzDgu4nkq5osoALYAlM0aGTFYyEtdnmjkh6rKK1ciUhClL5gd02uOrX2w9HdCXM/ZaZQsycEIeZqgblq18FVLY0JB/koqxMSVDUYWJVSlXlBzsmqQWTM4/V9DJzjKxJY+NReALoIGEO8p6XJqIFGmhYX+sM= X-MS-TrafficTypeDiagnostic: DM5PR12MB2471: X-Microsoft-Exchange-Diagnostics: 1; DM5PR12MB2471; 20:lsSwiE/iGfFu+3zxDYghOd0ojalXNn+TvqmjCHt1sa/RW4TLMTJiARO8rKGGayEazM+ipNKsSBwvUFed9Ez0JNfhoLXwYaC9q1dXjNQcrZYGSvmAvZy569Ye1KUUvwaW4dgZqjTGd1JXOF3MOXXcytrNXhwxg1ZrEEwibuSmSA6bD11snOFfX2Wzm7bSI5HqxsxvsU8mcN3eiBDtvcdTvZ6FNwne44xtg9q3ykbDhPpq6MW2Dgl3A9okLWHq2gZKOpdAaYYJGxAsfIA/OnAJeX6l85LtzpAcZxTMyrZ2qmJMGs97eKQhRZFxU50QinWzNXXy+eP97K9iGmB6rpsfaqh/MejXF7GBEmmN/j8bZggr3zT4k6zL3jBCergYOd98GfhRF0S4w4siUTvbjIRrYukqE5gNfdjsd7zaOMVnBknBB3iJCNhgg4PfY1xGOKocMX5YfaNoYmmWCvHfMgw4O+MtWkITNj+TPLFmg8nl7sf/My7j/uH7ePhN82xSOng7; 4:RHszvu2Pyu29TMnILQKlkdmijEjDsxPu5F9v52lO++84nIKDYPkpo3XMlrPWOqCMaFcvhwoWEH8bXSkOWhYJg//rHUP57Vjg0P//NNnY/c812gt8+3uWTjWEUBTyV7qKuWAlLXmlaq8isWEcz8+IGrvR0sHiTTYok9yxqBPT7ZNcKWJMKXwWrHhxLvLEKOgDLf/5Gjhisz/w4DK4w+FYXwfYJO3JA2BMxxU500lGq4qVF0Y+FWudXyMgrOxDmPxs8zVh9GOE4tmbrMLRNgboTHwyyNpEfQ/hujLhjjfEbccp8BMUiYaA13+5SG0zzPUf 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)(10201501046)(93006095)(93001095)(3231254)(944501410)(52105095)(3002001)(6055026)(149027)(150027)(6041310)(20161123562045)(20161123564045)(20161123560045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016); SRVR:DM5PR12MB2471; BCL:0; PCL:0; RULEID:; SRVR:DM5PR12MB2471; X-Forefront-PRVS: 0704670F76 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(376002)(39860400002)(346002)(366004)(39380400002)(396003)(189003)(199004)(186003)(66066001)(6666003)(86362001)(5660300001)(8676002)(68736007)(47776003)(36756003)(478600001)(7416002)(81166006)(26005)(50226002)(48376002)(59450400001)(386003)(6486002)(16526019)(50466002)(81156014)(4720700003)(72206003)(25786009)(76176011)(51416003)(316002)(446003)(52116002)(8936002)(7696005)(4326008)(53936002)(3846002)(11346002)(305945005)(6116002)(7736002)(956004)(476003)(2616005)(97736004)(2906002)(486006)(53416004)(106356001)(44832011)(39060400002)(105586002)(16586007)(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:ILyEww+NBhlXoHja7n4nWMSpWU9fFzbgBq6U8R5I4?= =?us-ascii?Q?kiWq+TLklFb35ivj4iY+krmF6dNFcmExVh3u+K/dJYJJxKtmrcyJ8jhRAHff?= =?us-ascii?Q?/oFD0UZm+alg74xP5KIkag1FdIYtWjv5G0mEUzvIAECWJsalI+wubC/Lxb5o?= =?us-ascii?Q?ClBn/eb87g+tkeRAbFatavtY3DjeNP29PA/TORC3bY3Kh5VqmJ+qxab2/3PL?= =?us-ascii?Q?lrJ6n5s1GVO/tNpOScHa3GvVt7gQrxfZIE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EShsiqw5Hf7zaxTomryvLe94dPvvRle3UtzS/fconLAuOH4XsZICslleRXdX9zzre4PtlYe9oeN6/Z6z1D+PGjw6Bk=; 24:VLCpPqOaCcZvdDGpI2BPbG7hllWBXEYs3ujXMMQHZiW9nKVmWHiAqBmuluhT3pOZvcFmcj1udibJSWUV9Fd45Mhvkm+Bk4YTdp0ITVK36QY= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM5PR12MB2471; 7:kt96+4uN+0hStxiF5Qtl/zaHk47EgwuzPHW37Z30ugMwWHSAHkeBXaPJrEPiyAXIGsnImCY3rUUHQ23iOe79NrbDmwM95Hro0sAn/inubHqDunm5CSL3Uh4A5f3Y5Izy/F1BAmgyvSFfJ+fMzquq2rl9HmoccNpFnwIIFd64tG6GSAoHyalKwsZtFpTMuPjZ1PeR4s3uwcjkq+TMPI/7v7rG11fZeXqviUu258YervSzsEC3WZ7lMSeKEXd/AJPc; 20:vmWg9KEEEq9peHeLw9ZvCmmEDSqIJd5N6H38+gM4s9F8+zGYgmj7JfkofoZUna7DcW/67WGdKQBKd1XOREULf9v8Oe2jDc+2WKWj9hQjK5T0aKgmDQgIdij3mPIF9+OhJYSHpT4Irukgh0pDp+ImQg6liij1yFYcVs1zQpLQFGytDn9EqSaQwUe+21OXKe4wVCf6nwSVdkP/WvZrM4emdkh46GFFGxUY9n2RBAcfVY1Hwp6K34OoPt3AiE5mx8EG X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jun 2018 17:15:59.5986 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cba823b1-337e-44ae-d7c9-08d5d2e3aa7c X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB2471 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 40.107.73.61 Subject: [Qemu-devel] [PATCH v15 3/3] i386: Remove generic SMT thread check X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: geoff@hostfission.com, kvm@vger.kernel.org, kash@tripleback.net, mtosatti@redhat.com, qemu-devel@nongnu.org, babu.moger@amd.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" 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 2f839ec..cecf421 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -4982,17 +4982,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; }