From patchwork Wed Apr 19 19:54:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pranith Kumar X-Patchwork-Id: 9688787 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 78091602DC for ; Wed, 19 Apr 2017 19:55:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 68CEE2787C for ; Wed, 19 Apr 2017 19:55:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5C73728429; Wed, 19 Apr 2017 19:55:08 +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.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham 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 E55D42787C for ; Wed, 19 Apr 2017 19:55:07 +0000 (UTC) Received: from localhost ([::1]:50163 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d0vgw-0002oq-AU for patchwork-qemu-devel@patchwork.kernel.org; Wed, 19 Apr 2017 15:55:06 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55128) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d0vgB-0002oh-4P for qemu-devel@nongnu.org; Wed, 19 Apr 2017 15:54:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d0vg8-0005od-II for qemu-devel@nongnu.org; Wed, 19 Apr 2017 15:54:19 -0400 Received: from mail-yb0-x244.google.com ([2607:f8b0:4002:c09::244]:36184) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d0vg8-0005o5-E4 for qemu-devel@nongnu.org; Wed, 19 Apr 2017 15:54:16 -0400 Received: by mail-yb0-x244.google.com with SMTP id b2so2121098yba.3 for ; Wed, 19 Apr 2017 12:54:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references; bh=TqvnwGgBEoyxaKcelUFZgItnJuu+0ZVzY9g6y5dSkRU=; b=YbMsJ6bXANdhorJrqyw2Kwb0QBMIwqzO9NN8vua6URe7O43c1mgXeJ50nqCmXgVqub bzQ7izMcxOi+tPvTJ3m+uRap/JkWdnk5cdg5b3ry2nAOdqmA2vVaIfANSNMCGSJIWZZZ sPo28dYcEXLwpH19tWu9ABqf6yi4+Ao5w6AiFGkyXyOqBbWBS7m0xEjFM37UmKuZSPH0 iBd/xzj5aRjp6zJqAE37Cx11TqPZ+klOLzl/jxeZynKuOosX6zGNzxnQQ7ZTXh51VYbd +ny0XwD+rzO18oQJsCouZ/rpLDDW6+O5V94Kv428IpvqKyH2HuIz13g7mANDtzCzfL+Z MzZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=TqvnwGgBEoyxaKcelUFZgItnJuu+0ZVzY9g6y5dSkRU=; b=UsiAsl342JwpsUGoQLBzluuI7ApZVKDZvFLWcErGC6tELH7mS4uB2wokrHEmqlsplB ENOTbLGBiQWm1pqcOwztW2Y8H0gvYKkT1RJ2+Z7zJ5r7zbty5Ito+yCe2KYgtFAZ6ETf ww0aiszbNqDYnioo0dxPVOUC6b6b38BneDjg+dkEeBWxOqXUhwWRSKinyU4V21Mg3kZl fygDyV4OMPFraH3/mLj+ail3K7vmA/APw4+TZphzgfBxQj6JaYq/+twQXpUIQsqqzi7q oJS+/nThkB0ymLVuf0r8fQSVR6iakyeMieEajzuhJGxLC+9ppQh/yhVH6YgvhPwMMaXR msGQ== X-Gm-Message-State: AN3rC/77Tr0b3DA49MZvm7o5qcF8Pn/XllHjZfz5qRY1XINOGHl/sFj3 hrDf9pcZsidKXQ== X-Received: by 10.37.38.14 with SMTP id m14mr3538957ybm.60.1492631655707; Wed, 19 Apr 2017 12:54:15 -0700 (PDT) Received: from localhost.localdomain (c-73-207-178-95.hsd1.ga.comcast.net. [73.207.178.95]) by smtp.gmail.com with ESMTPSA id e190sm1471494ywd.33.2017.04.19.12.54.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 19 Apr 2017 12:54:15 -0700 (PDT) From: Pranith Kumar To: Paolo Bonzini , Richard Henderson , Eduardo Habkost , qemu-devel@nongnu.org (open list:All patches CC here) Date: Wed, 19 Apr 2017 15:54:13 -0400 Message-Id: <20170419195413.30141-2-bobby.prani@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170419195413.30141-1-bobby.prani@gmail.com> References: <20170419195413.30141-1-bobby.prani@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4002:c09::244 Subject: [Qemu-devel] [PATCH] tcg/i386: Do not display HT warning for TCG 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: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP When we enable hyperthreading (using threads smp argument), we warn the user if the cpu is an AMD cpu. This does not make sense on TCG and is also obsolete now that AMD Ryzen support hyperthreading. Fix this by adding CPUID_HT bit to the TCG features and explicitly checking this bit in the cpuid. Signed-off-by: Pranith Kumar --- target/i386/cpu.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 13c0985f11..f34bb5ead7 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -202,12 +202,12 @@ static void x86_cpu_vendor_words2str(char *dst, uint32_t vendor1, #define TCG_FEATURES (CPUID_FP87 | CPUID_PSE | CPUID_TSC | CPUID_MSR | \ CPUID_PAE | CPUID_MCE | CPUID_CX8 | CPUID_APIC | CPUID_SEP | \ CPUID_MTRR | CPUID_PGE | CPUID_MCA | CPUID_CMOV | CPUID_PAT | \ - CPUID_PSE36 | CPUID_CLFLUSH | CPUID_ACPI | CPUID_MMX | \ + CPUID_PSE36 | CPUID_CLFLUSH | CPUID_ACPI | CPUID_MMX | CPUID_HT | \ CPUID_FXSR | CPUID_SSE | CPUID_SSE2 | CPUID_SS | CPUID_DE) /* partly implemented: CPUID_MTRR, CPUID_MCA, CPUID_CLFLUSH (needed for Win64) */ /* missing: - CPUID_VME, CPUID_DTS, CPUID_SS, CPUID_HT, CPUID_TM, CPUID_PBE */ + CPUID_VME, CPUID_DTS, CPUID_SS, CPUID_TM, CPUID_PBE */ #define TCG_EXT_FEATURES (CPUID_EXT_SSE3 | CPUID_EXT_PCLMULQDQ | \ CPUID_EXT_MONITOR | CPUID_EXT_SSSE3 | CPUID_EXT_CX16 | \ CPUID_EXT_SSE41 | CPUID_EXT_SSE42 | CPUID_EXT_POPCNT | \ @@ -3643,7 +3643,7 @@ static void x86_cpu_realizefn(DeviceState *dev, Error **errp) qemu_init_vcpu(cs); - /* Only Intel CPUs support hyperthreading. Even though QEMU fixes this + /* Only some 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. @@ -3651,8 +3651,8 @@ static void x86_cpu_realizefn(DeviceState *dev, Error **errp) * 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" + if ((env->features[FEAT_1_EDX] & CPUID_HT) && (cs->nr_threads > 1) && !ht_warned) { + error_report("This CPU doesn't support hyperthreading. Please configure" " -smp options properly."); ht_warned = true; }