From nobody Sat Nov 1 22:28:58 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1509315114629923.9035391327444; Sun, 29 Oct 2017 15:11:54 -0700 (PDT) Received: from localhost ([::1]:37877 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e8vnq-0002xz-HO for importer@patchew.org; Sun, 29 Oct 2017 18:11:34 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43124) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e8vdo-0001TA-4P for qemu-devel@nongnu.org; Sun, 29 Oct 2017 18:01:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e8vdl-0001le-3P for qemu-devel@nongnu.org; Sun, 29 Oct 2017 18:01:12 -0400 Received: from [77.247.229.177] (port=51420 helo=neth.polepetko.eu) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e8vdk-0001j8-TQ for qemu-devel@nongnu.org; Sun, 29 Oct 2017 18:01:09 -0400 Received: from neth.polepetko.eu (localhost [127.0.0.1]) by neth.polepetko.eu (Postfix) with ESMTP id 5CD72513F1; Sun, 29 Oct 2017 22:22:43 +0100 (CET) Received: from localhost.localdomain (unknown [77.247.229.177]) (Authenticated sender: pixo@polepetko.eu) by neth.polepetko.eu (Postfix) with ESMTPSA; Sun, 29 Oct 2017 22:22:43 +0100 (CET) From: Stanislav Lanci To: qemu-devel@nongnu.org Date: Sun, 29 Oct 2017 22:22:24 +0100 Message-Id: <20171029212224.2777-1-pixo@polepetko.eu> X-Mailer: git-send-email 2.14.2 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 77.247.229.177 X-Mailman-Approved-At: Sun, 29 Oct 2017 18:10:21 -0400 Subject: [Qemu-devel] [PATCH] AMD Processor Topology Information 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: Stanislav Lanci Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Add CPUID 0x8000001E for describing AMD Processor Topology Information Disables warning about smt for 17h family of AMD CPUs Signed-off-by: Stanislav Lanci --- target/i386/cpu.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index ddc45abd70..5885b2dd9e 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -3072,6 +3072,22 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index,= uint32_t count, *edx =3D 0; } break; + case 0x8000001E: + /* AMD CPU Topology */ + if (env->cpuid_vendor1 !=3D CPUID_VENDOR_INTEL_1 || + env->cpuid_vendor2 !=3D CPUID_VENDOR_INTEL_2 || + env->cpuid_vendor3 !=3D CPUID_VENDOR_INTEL_3) { + *eax =3D cpu->apic_id; + *ebx =3D (cs->nr_threads - 1 ) << 8 | cpu->core_id; + *ecx =3D cpu->socket_id; + *edx =3D 0; + } else { + *eax =3D 0; + *ebx =3D 0; + *ecx =3D 0; + *edx =3D 0; + } + break; case 0xC0000000: *eax =3D env->cpuid_xlevel2; *ebx =3D 0; @@ -3742,7 +3758,7 @@ 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 incorrec= t. */ - if (!IS_INTEL_CPU(env) && cs->nr_threads > 1 && !ht_warned) { + if (!IS_INTEL_CPU(env) && cs->nr_threads > 1 && !ht_warned && (env->cp= uid_version & 0xFF00F00) !=3D 0x800F00) { error_report("AMD CPU doesn't support hyperthreading. Please confi= gure" " -smp options properly."); ht_warned =3D true; --=20 2.14.2