Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1518196

Re: [PATCH v3 4/4] KVM: x86: emulate FXSAVE and FXRSTOR

From Radim Krčmář <rkrcmar@redhat.com>
Newsgroups linux.kernel
Subject Re: [PATCH v3 4/4] KVM: x86: emulate FXSAVE and FXRSTOR
Date 2016-11-09 15:20 +0100
Message-ID <sBBTj-8ph-17@gated-at.bofh.it> (permalink)
References <sBkIO-5kY-3@gated-at.bofh.it> <sBkIO-5kY-11@gated-at.bofh.it> <sBo01-7H0-5@gated-at.bofh.it> <sBA1c-7dw-15@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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.)

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v3 4/4] KVM: x86: emulate FXSAVE and FXRSTOR Radim Krčmář <rkrcmar@redhat.com> - 2016-11-08 21:00 +0100
  Re: [PATCH v3 4/4] KVM: x86: emulate FXSAVE and FXRSTOR Paolo Bonzini <pbonzini@redhat.com> - 2016-11-09 00:30 +0100
    Re: [PATCH v3 4/4] KVM: x86: emulate FXSAVE and FXRSTOR Radim Krčmář <rkrcmar@redhat.com> - 2016-11-09 13:20 +0100
      Re: [PATCH v3 4/4] KVM: x86: emulate FXSAVE and FXRSTOR Radim Krčmář <rkrcmar@redhat.com> - 2016-11-09 15:20 +0100
  [PATCH v4] KVM: x86: emulate FXSAVE and FXRSTOR Radim Krčmář <rkrcmar@redhat.com> - 2016-11-09 19:10 +0100
    Re: [PATCH v4] KVM: x86: emulate FXSAVE and FXRSTOR Radim Krčmář <rkrcmar@redhat.com> - 2016-11-09 19:50 +0100
      Re: [PATCH v4] KVM: x86: emulate FXSAVE and FXRSTOR Fengguang Wu <lkp@intel.com> - 2016-11-10 03:50 +0100

csiph-web