From patchwork Mon Mar 12 21:00: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: 10277481 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 407DC603B5 for ; Mon, 12 Mar 2018 21:01:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 313C1286EE for ; Mon, 12 Mar 2018 21:01:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 25CB728B59; Mon, 12 Mar 2018 21:01:22 +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 79B46286EE for ; Mon, 12 Mar 2018 21:01:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932574AbeCLVBT (ORCPT ); Mon, 12 Mar 2018 17:01:19 -0400 Received: from mail-bn3nam01on0087.outbound.protection.outlook.com ([104.47.33.87]:20895 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932576AbeCLVBO (ORCPT ); Mon, 12 Mar 2018 17:01:14 -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=nvleo03ywej05xBBAwO0LHWvnbWedetm8CKsg/q4VIA=; b=DvYs2pmGfALfwR78IZkuZHzqp937YyLMma7ygGZ2x+jzwyVZyQXH6Z0HhhfU+Xkfe/32WHQxJfydUuRHkqileLG9clOn/2nVY6cbEsHpdlwGGYvUVfhaDYk9ezN5OnTUi3rgcsSsOQGAdkDcy+4H9pUVja4BqcEiEBQaxS4ecO8= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Babu.Moger@amd.com; Received: from linux-pyp0.amd.com (165.204.77.1) by MWHPR12MB1774.namprd12.prod.outlook.com (2603:10b6:300:112::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.567.14; Mon, 12 Mar 2018 21:01:10 +0000 From: Babu Moger To: pbonzini@redhat.com, rth@twiddle.net, ehabkost@redhat.com, rkrcmar@redhat.com Cc: mtosatti@redhat.com, qemu-devel@nongnu.org, kvm@vger.kernel.org, Gary.Hook@amd.com, Thomas.Lendacky@amd.com, brijesh.singh@amd.com, babu.moger@amd.com, kash@tripleback.net Subject: [PATCH v4 5/5] target/i386: Remove generic SMT thread check Date: Mon, 12 Mar 2018 17:00:49 -0400 Message-Id: <1520888449-4352-6-git-send-email-babu.moger@amd.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1520888449-4352-1-git-send-email-babu.moger@amd.com> References: <1520888449-4352-1-git-send-email-babu.moger@amd.com> MIME-Version: 1.0 X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: BN6PR1201CA0019.namprd12.prod.outlook.com (2603:10b6:405:4c::29) To MWHPR12MB1774.namprd12.prod.outlook.com (2603:10b6:300:112::21) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 71e1e592-e441-452b-53f2-08d5885c6312 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:MWHPR12M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dJzVKzGd89EFJ7sAru7SioiMSpY6A2+LCxMLwhNO8VTkx7nCCB1QmmOCMy2yVMCTL5WE763uKE55xI+566KjoW/X4kHrDA4MY86zG1TiFHOEocYWu36LSXAhUfYClD8m1PtQJTfh78V2/bi/Ox0fDW/mLIZNqzyRftybtcLBAIQxAKkaMnEKvzTbywh1gxj4Gh/kKyPXNFTbUgQ2MkdF86iuAgg2hbCW9yZ3nQENsUWmTAqkE7BGjyshXv4zafUGRjSwKoar88vEKky+bXWUp040q4ndv7ExTEBJo0mKrVQvJJ8KDJ/N6TuWHIXUOyrYAtNyzVlSCfkr1sc2Nof52xB2qL3ekVS5W/5+sNFvASnlfW0DLa5cncUAoH9/DJB9QdPcL77zRKaloK+dPH; 4:ZlEIilUTLAIRQPxlhOxIYrbU4JaduoS2fPfDE4rrqGeQxKWMi07Smud/GtKbXI+lknD0A30HoL76F/VVUBADzVghobVuHtPh102oEU8KAsiLvJJjCoktcgJpJDBbCfF8cxaaMzM41Etw6/WOxRsjQWbNgJPzF1VpV3D+hUuSX2H7lSYtIEP+32qHsW/3SWze5JhLePpgQOPcEtLgDRi0WRnrgUyVDxD8gyYP5uTeSS18DfrrqACf2vBmeMvxSE4YF6uWQptUR+7TkCYANvX8fDENv3bQv944vchi8kOalwn916wmFCxwqqqia5Y3ffer 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)(5005006)(8121501046)(3231221)(944501244)(52105095)(3002001)(10201501046)(93006095)(93001095)(6055026)(6041310)(20161123558120)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(6072148)(201708071742011); SRVR:MWHPR12MB1774; BCL:0; PCL:0; RULEID:; SRVR:MWHPR12MB1774; X-Forefront-PRVS: 06098A2863 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(396003)(376002)(366004)(39860400002)(39380400002)(346002)(199004)(189003)(6486002)(66066001)(8676002)(81156014)(59450400001)(76176011)(50466002)(316002)(47776003)(4720700003)(6666003)(50226002)(6116002)(8936002)(106356001)(2906002)(2950100002)(3846002)(48376002)(16586007)(25786009)(53936002)(81166006)(7696005)(4326008)(386003)(51416003)(52116002)(478600001)(72206003)(186003)(97736004)(5660300001)(68736007)(26005)(7736002)(305945005)(105586002)(16526019)(36756003)(86362001)(53416004)(41533002); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR12MB1774; H:linux-pyp0.amd.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX: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; MWHPR12MB1774; 23:sVEg59Ebi1Z06WQgZ4TreiJQd6ndgRS2VI4lr15FE?= =?us-ascii?Q?nuetn1S/SzO1Ju+nN2YbfbJ19ukXnrJ/Ww9NdFd8Y38nnu7X/SO1eQmliKm1?= =?us-ascii?Q?PttOHv0YYH2RzJXjdoumje65koFNUGMvbqe08jPKI1mv/oyld8Fn2RmDI4Le?= =?us-ascii?Q?OOrUu8RYmns4uPjJaOEUlqmcqayIIeXysgR8mzjhnt+igDoRYoxGqHvs94Co?= =?us-ascii?Q?xvoiKuPjT/e5IejZ25ckNYU+9F7T4y88aabSvUDyQOHyrq8UgVf7D9Duk7vy?= =?us-ascii?Q?lN+X2KyGS1WOLKGSkP0E1aUhD57Su8A8ZNWqfdOY9v0A7OoloEBL1apHKgIB?= =?us-ascii?Q?DsV+ub301Fgej3pxtYAxx8IzrpWQ82CCsXD8/zPa+3nFELBsyPOPQzvax+rG?= =?us-ascii?Q?o5ywrfYmMGKYyIVAereDlSqWYKrMqSL+9mqysHJR2763B3+yVqG505kNAdZF?= =?us-ascii?Q?vAxri3MoS78jpt245XJGqdmHZD6m67DtkGRpUfp0wpHN2mmihZGqwpMe1M9S?= =?us-ascii?Q?PLqJ3iNRAoIikRofCrpacIDGJza63VMACZjeTg0mveZ00icfTrMIfjOV2L5C?= =?us-ascii?Q?9FZJcAS6PCb7IA9v2AUbMCV7LK6CZtnUk1mnvDeA3ikuH6QMfIlNai6Pxc76?= =?us-ascii?Q?0EsOpn581/szOuFHaxSrz+yOHxVrdnszmeAkuNJ+U1ADfbfD075YiF3olL+5?= =?us-ascii?Q?1BGkHxOQc/NXgXayzJQOf26DgfGVUIRFvtZcC0/Eif/Z5zl7aL+mjP4WdRNg?= =?us-ascii?Q?j5DYtFJnHsnPDQaO1C9qwiAY9iZ58pdzg7Hmm0KRzedkd9tDwg4RFMJlS6YY?= =?us-ascii?Q?DdPOUQsu5MXZS7fl62DjaYx63peyy9DzGWwcpJBuIpxzj3TKx34e7ZOt3FfC?= =?us-ascii?Q?RPeowGH01JEHFUbn0oA5GF6IuJBH5hX25APKBxUgg/ePD7C8fvjZUYMLGMBd?= =?us-ascii?Q?90zt2uakZc7LwYM4fxbBhdlUc+Gt+uxaw4yApMR/vw5t3yzOa9Qvf270Guw3?= =?us-ascii?Q?k6fG4Ki33cofqgguoJn93J3FkbZq1ARdCG7do81rItiQMWCzd7WIq5gz993u?= =?us-ascii?Q?ZJxIlo/QhiNJI3oJO/P+KjCCfejObiO3CJiI3FtXeuelYHYTmmaGdqOI7jCI?= =?us-ascii?Q?yWdUhqEAoSwDR1oiWNmA6LAZ1E6B/nCRI+a/cAypXy2c42aArpzTPi/VMeLL?= =?us-ascii?Q?afxxUifZ3wOSAg=3D?= X-Microsoft-Antispam-Message-Info: Z0QcHSOmW8cXGyxu7jvZ0FxQFEiWiamFVgRg50LS08NeT3RxsCHT5C8vr1xI3M6SYC3J3Cpv06v0PCUVPNdCV4l7KLlFaGk2LDdAdx0Nn7t1whzh8PWuGg4TkuUuJIQItQ+oIC36UM0IT8hNOf+FnRzCsg/RkBjKsyChFSlFLTV1DIq4wWjBKxpJnpBBrVTX X-Microsoft-Exchange-Diagnostics: 1; MWHPR12MB1774; 6:BX+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9w179IG9CHGdNf6nVXSVTiAY+rwp4YOsuu0/yLM+1UEWkEx/K/9ZbfBQs8oboVEpm9B5YWGAe0iXUXBjLZAsz3pWSJdrMLp3wAtOEqNyfcERvmXfkfN7iBDwX6fDE6QTDpkYLZjmvvpnY/bxANsC7xu6l X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Mar 2018 21:01:10.6276 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 71e1e592-e441-452b-53f2-08d5885c6312 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR12MB1774 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 | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index ade272e..10970b7 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -4330,17 +4330,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; }