From nobody Wed Nov 5 22:22:10 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 1538131484554541.375724684919; Fri, 28 Sep 2018 03:44:44 -0700 (PDT) Received: from localhost ([::1]:42592 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g5qG9-0001Dm-Vm for importer@patchew.org; Fri, 28 Sep 2018 06:44:34 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34136) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g5qFL-00013j-Jl for qemu-devel@nongnu.org; Fri, 28 Sep 2018 06:43:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g5qFJ-0002Z9-9v for qemu-devel@nongnu.org; Fri, 28 Sep 2018 06:43:43 -0400 Received: from galois.linutronix.de ([2a01:7a0:2:106d:700::1]:58573) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1g5qFI-0002TG-H1 for qemu-devel@nongnu.org; Fri, 28 Sep 2018 06:43:40 -0400 Received: from localhost ([127.0.0.1] helo=bazinga.breakpoint.cc) by Galois.linutronix.de with esmtp (Exim 4.80) (envelope-from ) id 1g5qF8-0005r5-A2; Fri, 28 Sep 2018 12:43:30 +0200 From: Sebastian Andrzej Siewior To: qemu-devel@nongnu.org Date: Fri, 28 Sep 2018 12:43:19 +0200 Message-Id: <20180928104319.3296-1-bigeasy@linutronix.de> X-Mailer: git-send-email 2.19.0 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Received-From: 2a01:7a0:2:106d:700::1 Subject: [Qemu-devel] [PATCH] i386: correct cpu_x86_cpuid(0xd) 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: Paolo Bonzini , tglx@linutronix.de, Eduardo Habkost , Sebastian Andrzej Siewior , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Intel SDM says for CPUID function 0DH, sub-function 0: | =E2=80=A2 ECX enumerates the size (in bytes) required by the XSAVE instru= ction for an | XSAVE area containing all the user state components supported by this | processor. | =E2=80=A2 EBX enumerates the size (in bytes) required by the XSAVE instru= ction for an | XSAVE area containing all the user state components corresponding to bi= ts | currently set in XCR0. Signed-off-by: Sebastian Andrzej Siewior Reviewed-by: Eduardo Habkost --- target/i386/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index f24295e6e4bb7..00c18444c0bac 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -4178,7 +4178,7 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index, = uint32_t count, *ecx =3D xsave_area_size(x86_cpu_xsave_components(cpu)); *eax =3D env->features[FEAT_XSAVE_COMP_LO]; *edx =3D env->features[FEAT_XSAVE_COMP_HI]; - *ebx =3D *ecx; + *ebx =3D xsave_area_size(env->xcr0); } else if (count =3D=3D 1) { *eax =3D env->features[FEAT_XSAVE]; } else if (count < ARRAY_SIZE(x86_ext_save_areas)) { --=20 2.19.0