From patchwork Tue Apr 10 23:16:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Babu Moger X-Patchwork-Id: 10334509 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 C376F601A0 for ; Tue, 10 Apr 2018 23:16:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BED2B2856A for ; Tue, 10 Apr 2018 23:16:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B36582856E; Tue, 10 Apr 2018 23:16:43 +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 2CC632856A for ; Tue, 10 Apr 2018 23:16:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755410AbeDJXQk (ORCPT ); Tue, 10 Apr 2018 19:16:40 -0400 Received: from mail-by2nam01on0081.outbound.protection.outlook.com ([104.47.34.81]:40576 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755318AbeDJXQg (ORCPT ); Tue, 10 Apr 2018 19:16:36 -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=vY4vPheSXj1Ng+3yJsTXKsCzUOZ4duddNHjMlbM+BYw=; b=dOS4V0q0mc2RzQOls+LLrIpcBxYDE8tuMjAMDl0ucWbQVnaVd19hvQAoovXSSCeyzBI4VmThlmMIrxaQBbpMQR+tV+hWDJbIzegxcpKBSLSshQjnO7MnOjovbCkdqpXMTFigqT9lORBOhjXuwE2PifBeFdVAI+ngEhE36Mc/HiU= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Babu.Moger@amd.com; Received: from linux-pyp0.amd.com (165.204.77.1) by CY4PR12MB1767.namprd12.prod.outlook.com (2603:10b6:903:122::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.653.12; Tue, 10 Apr 2018 23:16:30 +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 v6 9/9] i386: Remove generic SMT thread check Date: Tue, 10 Apr 2018 19:16:09 -0400 Message-Id: <1523402169-113351-10-git-send-email-babu.moger@amd.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1523402169-113351-1-git-send-email-babu.moger@amd.com> References: <1523402169-113351-1-git-send-email-babu.moger@amd.com> MIME-Version: 1.0 X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: MWHPR2201CA0048.namprd22.prod.outlook.com (2603:10b6:301:16::22) To CY4PR12MB1767.namprd12.prod.outlook.com (2603:10b6:903:122::9) 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:CY4PR12MB1767; X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1767; 3:mmU+7qtUW5c5ON97DA9SfW/rN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omyKb5bzfEs7WhTh/d2g2qP7eXfFiwC/+vP1B8KAWwe9wJlYjrZh8sNoWPbdpkqWT0kSmehULPKAzLUA9KCJDx6KmYqCdSP+55rCKasHSatarqNfMaR/yr/waT2k3YCzTtCL/5OvHGcxbVGUVUYTBm8BEPd+B6+vF835p3JxUH+5xFFp0QFh3HB8n0OnYx8OT2kUPBDWmxHNMDvAtejNmIiltoW5Ji8HDWLEw6K3ExzDnDZrmSk3+PzAJT3PN29q/E8aXYGQpGd2izOGuF2arfF+C6cklm95BemQ/3Bm2bldZlNNdaIB82luEz5NJM2Va89zNi; 4:CCN/QHTMJB5irmC34hc5C/7RpMNL3NSL0qU4DQFP5sVveLeBmnt2kyDpIk+5ZE8Bq9+gf+RjMeGKE7aJVYwLtWt8G8TZgikSEFGpzvQYEeWVdq+fHs1E1JlpV04zJj5vK1CNklaMI/YMhPS8NowZnJ/ziI7vSk5pww72WhODZiwt26wqmht4oOfBJvxl052Ed8PThZLgwbOSlJvwJQCF5a6rhiqhuESmmHzzb3U/Tcfb8jz1R2dE+gPXUZz0prJN9o8cDZQSDuQzzoY6sQY4qnieDM78le6zXgTfGttbMkbeofLXbI4oZPyETYWANNb6 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)(3231221)(944501327)(52105095)(3002001)(10201501046)(6055026)(6041310)(20161123560045)(20161123564045)(20161123558120)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:CY4PR12MB1767; BCL:0; PCL:0; RULEID:; SRVR:CY4PR12MB1767; X-Forefront-PRVS: 0638FD5066 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(346002)(376002)(366004)(39860400002)(39380400002)(396003)(199004)(189003)(476003)(2906002)(52116002)(26005)(86362001)(50466002)(50226002)(305945005)(5660300001)(186003)(48376002)(7736002)(16526019)(6666003)(25786009)(6116002)(446003)(11346002)(105586002)(4720700003)(2616005)(6486002)(4326008)(956004)(3846002)(66066001)(53416004)(8936002)(386003)(72206003)(478600001)(316002)(16586007)(8676002)(81156014)(81166006)(59450400001)(97736004)(36756003)(47776003)(76176011)(106356001)(7416002)(7696005)(51416003)(68736007)(53936002)(486006)(41533002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR12MB1767; H:linux-pyp0.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; CY4PR12MB1767; 23:meo0v4Y2KQ/1VL6Gvni5oqqQCsfUbf46DmPRDLSYA?= =?us-ascii?Q?z3A6tpGA7BSMOjsaJVz5e8GP8p9l+VMeEc4AT1SyDTNU7Qw0fZVaEJ9XJjtM?= =?us-ascii?Q?Z3eOracy5ESWXUN00CgStpsMUH6DsWYEAIMPVwce1eyTzfJwjcs6PgdVQSP/?= =?us-ascii?Q?QCShWz+IVhnPDhSEqZ4hTV5auxRFcrr0Zgr7q0M1ohekpnofaPfjNtXxi8Km?= =?us-ascii?Q?uZOo1rTdPn2Crh7ecIzcVbhaJiXd6T3w2nldJxCr1mPZTym6Q6UGNu0m2W6Z?= =?us-ascii?Q?NpqaNUhF7XKWSlBpFrNsqDYB0WbP7U2HeOP5zdHuOpL1KqmeJ7VOR7CSg5PM?= =?us-ascii?Q?tYtVt0z+0lRIhmbxtT+CQ6bDkgzXhNDAdQm87kaxaLjiDksT14o/RxZzmW98?= =?us-ascii?Q?s8OnMXoMZAqIa6Kqkc3WkSfFzB0EdMDkiq+sAxuIxnQFzxCQTgYWpONipkbr?= =?us-ascii?Q?Kfmarbw9mL06ZEH0wbrveT84BtOXfCIdsybe3U8KEtNA9wQTMzLSnKPzLi6+?= =?us-ascii?Q?igHqfIrwMd9CHgfUkr4/L4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6crXIcda5kuCrQ6H1FoZm1mST5Nco1FRb9Cl42mvNU5C2lDpL405DBBCQU8qOEOxFuSZeNemA8Ay5zfktOlkaGQag3R3NEtniXaRY; 20:fImGeiDqHCUoR7yw22CccesITUxD3BgUcd7uY9+x2H4e79XOdTlgq46yX4r1qQ8Q7uBpTa5Fsj9V9lXOTzJGVp5TlW+8HO8AUa3DCt85LaXFxnZRQoSlh4HX7rOyi+NITU99AComEDIvixemAZ3QBpK2HvJ+bcU5jq34PK96lzSTDSq8HIA73kea95vdP9wvUXsGidF4yQy7G0Fx+4zfTMXRAvzWFQtqqfJOwBmPbLw/sjgXQMvf6rSUqGIrrIVk X-MS-Office365-Filtering-Correlation-Id: a17bc69d-5b29-4860-ac84-08d59f391841 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Apr 2018 23:16:30.1390 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a17bc69d-5b29-4860-ac84-08d59f391841 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR12MB1767 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 --- 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 bfe24b9..077364a 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -4822,17 +4822,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; }