From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
To: Bingsong Si <owen.si@ucloud.cn>, ehabkost@redhat.com
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] Revert "i386: correct cpu_x86_cpuid(0xd)"
Date: Mon, 19 Aug 2019 15:34:00 +0100 [thread overview]
Message-ID: <20190819143400.GB2807@work-vm> (raw)
In-Reply-To: <20190819100924.14968-1-owen.si@ucloud.cn>
Copying in Eduardo.
* Bingsong Si (owen.si@ucloud.cn) wrote:
> This reverts commit de2e68c902f7b6e438b0fa3cfedd74a06a20704f.
>
> Initial value of env->xcr0 == 0, then CPUID(EAX=0xd,ECX=0).EBX == 0, after kvm
> upstream commit 412a3c41, It is ok.
> On host before commit 412a3c41, some legacy guest, i.e. CentOS 6, get
> xstate_size == 0, will crash the guest.
>
> Signed-off-by: Bingsong Si <owen.si@ucloud.cn>
> ---
> 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 ff65e11008..69562e21ed 100644
> --- a/target/i386/cpu.c
> +++ b/target/i386/cpu.c
> @@ -4416,7 +4416,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 = xsave_area_size(env->xcr0);
> + *ebx = *ecx;
> } else if (count == 1) {
> *eax = env->features[FEAT_XSAVE];
> } else if (count < ARRAY_SIZE(x86_ext_save_areas)) {
> --
> 2.22.0
>
>
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
next prev parent reply other threads:[~2019-08-19 14:34 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-19 10:09 [Qemu-devel] [PATCH] Revert "i386: correct cpu_x86_cpuid(0xd)" Bingsong Si
2019-08-19 14:34 ` Dr. David Alan Gilbert [this message]
2019-08-20 21:23 ` Eduardo Habkost
2019-08-21 3:04 ` owen.si
2019-08-21 11:19 ` Eduardo Habkost
2019-08-21 11:54 ` owen.si
2019-08-21 20:45 ` Eduardo Habkost
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190819143400.GB2807@work-vm \
--to=dgilbert@redhat.com \
--cc=ehabkost@redhat.com \
--cc=owen.si@ucloud.cn \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.