From: "Radim Krčmář" <rkrcmar@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org,
Bandan Das <bsd@redhat.com>, Nadav Amit <nadav.amit@gmail.com>
Subject: Re: [PATCH v3 4/4] KVM: x86: emulate FXSAVE and FXRSTOR
Date: Wed, 9 Nov 2016 15:19:37 +0100 [thread overview]
Message-ID: <20161109141937.GA32080@potion> (raw)
In-Reply-To: <20161109121200.GA2128@potion>
2016-11-09 13:12+0100, Radim Krčmář:
> 2016-11-09 00:25+0100, Paolo Bonzini:
>> On 08/11/2016 20:54, Radim Krčmář wrote:
>>> +static int em_fxsave(struct x86_emulate_ctxt *ctxt)
>>> +{
>>> + struct fxregs_state fx_state;
>>> + size_t size = 288; /* up to XMM7 */
>>
>> Sorry for noticing this only now; if CR4.OSFXSR is 0, XMM and MXCSR
>> should not be saved.
>
> Intel processors don't save it, but the spec allows saving even when
> CR4.OSFXSR is 0:
>
> If the OSFXSR bit in control register CR4 is not set, the FXSAVE
> instruction may not save this register (these registers).
> This behavior is implementation dependent.
>
> I let "implementation dependent" behavior be the one with less code, but
> haven't checked AMD spec, which doesn't seem to make it implementation
> dependent ... I'll add it. (On intel, OSFXSR gets written with 0 and
Nope, Intel always saves and restores MXCSR. I should have access to an
AMD machine later today and will implement FXSR to match AMD.
> XMM 0-7 isn't modified without OSFXSR, so I'll just assume that AMD
> won't break with that.)
next prev parent reply other threads:[~2016-11-09 14:19 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-08 19:54 [PATCH v3 0/4] KVM: x86: emulate FXSAVE and FXRSTOR Radim Krčmář
2016-11-08 19:54 ` [PATCH v3 1/4] KVM: x86: add Align16 instruction flag Radim Krčmář
2016-11-08 19:54 ` [PATCH v3 2/4] KVM: x86: save one bit in ctxt->d Radim Krčmář
2016-11-08 19:54 ` [PATCH v3 3/4] KVM: x86: add asm_safe wrapper Radim Krčmář
2016-11-08 19:54 ` [PATCH v3 4/4] KVM: x86: emulate FXSAVE and FXRSTOR Radim Krčmář
2016-11-08 23:25 ` Paolo Bonzini
2016-11-09 12:12 ` Radim Krčmář
2016-11-09 14:19 ` Radim Krčmář [this message]
2016-11-09 18:07 ` [PATCH v4] " Radim Krčmář
2016-11-09 18:42 ` kbuild test robot
2016-11-09 18:46 ` Radim Krčmář
2016-11-10 2:47 ` Fengguang Wu
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=20161109141937.GA32080@potion \
--to=rkrcmar@redhat.com \
--cc=bsd@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nadav.amit@gmail.com \
--cc=pbonzini@redhat.com \
/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.