From patchwork Thu Apr 26 16:26:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Babu Moger X-Patchwork-Id: 10366337 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 85A946032C for ; Thu, 26 Apr 2018 16:27:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 777D2286CF for ; Thu, 26 Apr 2018 16:27:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6B76828A63; Thu, 26 Apr 2018 16:27:50 +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 D3920286CF for ; Thu, 26 Apr 2018 16:27:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932308AbeDZQ1r (ORCPT ); Thu, 26 Apr 2018 12:27:47 -0400 Received: from mail-sn1nam01on0075.outbound.protection.outlook.com ([104.47.32.75]:11117 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932288AbeDZQ1b (ORCPT ); Thu, 26 Apr 2018 12:27: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; bh=oTM2m5FB/q5ESDvF286atu7IlNL6QExoNcInsT0w/m0=; b=t699kbZXAesXczd2YiINIHUj81MevdVc3qD0JjTUbl9NxON3DSFTCI6wSUZorBRchnOFdKDQR6sjGPemY0c9lYIvY87YEJnodZAZDGAl3FivsBp8VKRcLpiZAtXWzFxWRT5WMuPNq3us8dRILY8GuAcIIYBxM6lhSj0pKpcBClg= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Babu.Moger@amd.com; Received: from bmoger-ubuntu.amd.com (165.204.78.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.696.13; Thu, 26 Apr 2018 16:27:09 +0000 From: Babu Moger To: mst@redhat.com, marcel@redhat.com, pbonzini@redhat.com, rth@twiddle.net, ehabkost@redhat.com, mtosatti@redhat.com Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org, kash@tripleback.net, geoff@hostfission.com, babu.moger@amd.com Subject: [PATCH v7 9/9] i386: Remove generic SMT thread check Date: Thu, 26 Apr 2018 11:26:49 -0500 Message-Id: <1524760009-24710-10-git-send-email-babu.moger@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1524760009-24710-1-git-send-email-babu.moger@amd.com> References: <1524760009-24710-1-git-send-email-babu.moger@amd.com> MIME-Version: 1.0 X-Originating-IP: [165.204.78.1] X-ClientProxiedBy: CY4PR1801CA0020.namprd18.prod.outlook.com (2603:10b6:910:74::33) 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)(4534165)(4627221)(201703031133081)(201702281549075)(48565401081)(2017052603328)(7153060)(7193020); SRVR:SN1PR12MB2479; X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB2479; 3:dwfPsXAU/QV/BgKckGgxO/xYhfY9JBHZZlu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QCOIp1XnbVXUN2jMC4Cf6aLerF0g3gXOeqpAegHyJGsPtWKE20Vsidv7WhkgQ4QkZE1sNeiBPpIcc/kzDVGhLiYCfnbJ3rqgx48mATsnuz68ONHIE8ra1ZaDZ0TC7ZNVieeP20QUAuEhsJKMB/FI0btEHyxvr7p3yTIkvcBos1YeWO2q3eM7YVKvO8MB9u3alNbvE6MCzKlfzP3M+yONP/OQ6kZERuFEkpKyzhFUORw82lNxktzkaWp5u3RXexoFJ2HTEW1LY3yoWWYMmCaKySaeIxUz3/3Lm6Iuselgph4221; 4:PExkVj+ib0jcLgPx9RGAkto9DKbNk1aVip6URkBDT7f6lCkVXv4HowkYamAcCCwfN9KEeUZeuiXxVuW1qsQPQKN8O7/LT6Tdo+rBlyQZtASQmtJaN0EwnOAv2DkcFQPUtMpNqeJajTIo/wK54kQm10Ez382HcmIyZUg1UacRt18Wdvf8aOQk0wAkltr9S+hwFZkzfALvxvHgQDobmqKu2ENvxr+5koVdErdJ8+3muWytKr6tG8A+E8NdZdnTt6PqxsUQ4yZkZM/Yw/9gQGb4mawCny+jRqqtZz1rRV1ibhJD1YF0HaZs6z0TZ7eWgbGj X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(3002001)(3231232)(944501410)(52105095)(6055026)(6041310)(20161123560045)(20161123558120)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(6072148)(201708071742011); SRVR:SN1PR12MB2479; BCL:0; PCL:0; RULEID:; SRVR:SN1PR12MB2479; X-Forefront-PRVS: 0654257CF5 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39380400002)(366004)(376002)(396003)(39860400002)(346002)(189003)(199004)(68736007)(8676002)(2906002)(6116002)(76176011)(8936002)(5660300001)(316002)(3846002)(4326008)(81156014)(50226002)(81166006)(386003)(956004)(16526019)(7416002)(52116002)(476003)(97736004)(59450400001)(186003)(25786009)(86362001)(446003)(7696005)(11346002)(51416003)(26005)(48376002)(36756003)(16586007)(47776003)(53416004)(486006)(44832011)(106356001)(7736002)(6666003)(72206003)(2616005)(6486002)(105586002)(66066001)(478600001)(305945005)(53936002)(50466002)(41533002); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR12MB2479; 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; SN1PR12MB2479; 23:ZcpOcjeghUsOPYsmVM76owHJzEeqDI0fwtl6SdSfs?= =?us-ascii?Q?g5dvZeHR8HF8GMetVlWyqHDqGI9v5qiLSMD6ZKeAPw5gIpa2VcA9QKIZLePb?= =?us-ascii?Q?aDiwc6ee4F98UPr8+KMuOk+igKzQe9eNgFqfd5eTqnPfUSL9dQpjByvFQtPn?= =?us-ascii?Q?R+kjXdpmzcqzMoAdRyUQP0N+r1G5qS9oiJu08f26feOGQ4WZexmuYsBzoB/f?= =?us-ascii?Q?H186aolovbBEcqECDyiuKAEJmuaD0QGc6a2po61Oj/B0c0aC6kRIM0aKxKc0?= =?us-ascii?Q?zeBxf0bQoyHkYhuHBzfyFXSimWTlwI111SO1O4HcFF/eZRujJZPtYrGudd+a?= =?us-ascii?Q?r5vL1rjwFSBNuxf5z5FQDByOu6JGjeua29mJsCyrOParB/fjgcJa+sr++SVf?= =?us-ascii?Q?Or20XpmwdcUFXPhnJvy0DJqi0EAUgyJZrOc5qpWbLIehBlAGQ8Fy63XSextT?= =?us-ascii?Q?iozXK04+xuHq25tRl964PZZcfupjehMbTCLeBI8qesP4rvUruWLrQInxO5nl?= =?us-ascii?Q?RZskLv79jPawMmW/UOsnv4DVSxxNi410hxc8WDDHjvvLXwAU2kBtyWdyqXj7?= =?us-ascii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QCnBQM5xs4mu28XNeKtVX+P6e8m5rjIIt0x8nJay2JJPw2dW/SeIShdn6K; 20:0VwnpHFll64+wzKx0RQgaI+7aTQMgWfmuls+gMmNWYKZSniZfmw/aEU4Fv23wWJTiXrj0ttwbF/Q2Sy3XOHOk5ln+TZg7jBAWswH6VnbtlbsiXGjXT4DiBaH+mSE/5Ps+qN9/CdkjYL+tqLQNnjDu3LJk+iy33bdqtfrRQVyAjRQveSKq+fkQ/Ooh5aaLl/krT3AaIxHBNiuL95sx5YnNVDpgGwIbAt6cUoUFxr+oYdkmzycUYKq15aqBQruL3Fs X-MS-Office365-Filtering-Correlation-Id: 4573a995-3dc7-4dbd-d003-08d5ab928f31 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Apr 2018 16:27:09.0180 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4573a995-3dc7-4dbd-d003-08d5ab928f31 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 6ebbef2..54d908f 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -4830,17 +4830,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; }