From patchwork Fri Sep 28 10:43:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sebastian Andrzej Siewior X-Patchwork-Id: 10619575 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E143D15A6 for ; Fri, 28 Sep 2018 10:44:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D427E2AB60 for ; Fri, 28 Sep 2018 10:44:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C81AC2AF1E; Fri, 28 Sep 2018 10:44:19 +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,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI 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 7F57B2AB60 for ; Fri, 28 Sep 2018 10:44:19 +0000 (UTC) Received: from localhost ([::1]:42592 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g5qFs-0001Dm-PB for patchwork-qemu-devel@patchwork.kernel.org; Fri, 28 Sep 2018 06:44:16 -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 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Intel SDM says for CPUID function 0DH, sub-function 0: | • ECX enumerates the size (in bytes) required by the XSAVE instruction for an | XSAVE area containing all the user state components supported by this | processor. | • EBX enumerates the size (in bytes) required by the XSAVE instruction for an | XSAVE area containing all the user state components corresponding to bits | 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 = xsave_area_size(x86_cpu_xsave_components(cpu)); *eax = env->features[FEAT_XSAVE_COMP_LO]; *edx = env->features[FEAT_XSAVE_COMP_HI]; - *ebx = *ecx; + *ebx = xsave_area_size(env->xcr0); } else if (count == 1) { *eax = env->features[FEAT_XSAVE]; } else if (count < ARRAY_SIZE(x86_ext_save_areas)) {