Message ID | 56E132B402000078000DB110@prv-mh.provo.novell.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On 10/03/16 07:39, Jan Beulich wrote: > This reverts an unintended change in commit 879b44b041 ("x86/fpu: add > a per-domain field to set the width of FIP/FDP"), which I had done > intermediately while fixing the build issue: After having reverted that > adjustment I must have forgotten to "git add" the adjustment. > > Signed-off-by: Jan Beulich <jbeulich@suse.com> Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
On 10/03/16 07:39, Jan Beulich wrote: > This reverts an unintended change in commit 879b44b041 ("x86/fpu: add > a per-domain field to set the width of FIP/FDP"), which I had done > intermediately while fixing the build issue: After having reverted that > adjustment I must have forgotten to "git add" the adjustment. > > Signed-off-by: Jan Beulich <jbeulich@suse.com> It think you also need to only clobber fip/fdp in memory if mask & XSTATE_FP. But, quite frankly, this logic too complicated and clearly too fragile and you should just take the simplification I posted. David > > --- a/xen/arch/x86/xstate.c > +++ b/xen/arch/x86/xstate.c > @@ -292,7 +292,7 @@ void xsave(struct vcpu *v, uint64_t mask) > > XSAVE("0x48,"); > > - if ( !(ptr->xsave_hdr.xstate_bv & XSTATE_FP) || > + if ( !(mask & ptr->xsave_hdr.xstate_bv & XSTATE_FP) || > /* > * AMD CPUs don't save/restore FDP/FIP/FOP unless an exception > * is pending. > > > > > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xen.org > http://lists.xen.org/xen-devel >
>>> On 10.03.16 at 13:27, <david.vrabel@citrix.com> wrote: > On 10/03/16 07:39, Jan Beulich wrote: >> This reverts an unintended change in commit 879b44b041 ("x86/fpu: add >> a per-domain field to set the width of FIP/FDP"), which I had done >> intermediately while fixing the build issue: After having reverted that >> adjustment I must have forgotten to "git add" the adjustment. >> >> Signed-off-by: Jan Beulich <jbeulich@suse.com> > > It think you also need to only clobber fip/fdp in memory if mask & > XSTATE_FP. > > But, quite frankly, this logic too complicated and clearly too fragile > and you should just take the simplification I posted. By all means I intend to once we've got confirmation from Intel. I even did the re-basing already in preparation for that to happen. Jan
--- a/xen/arch/x86/xstate.c +++ b/xen/arch/x86/xstate.c @@ -292,7 +292,7 @@ void xsave(struct vcpu *v, uint64_t mask) XSAVE("0x48,"); - if ( !(ptr->xsave_hdr.xstate_bv & XSTATE_FP) || + if ( !(mask & ptr->xsave_hdr.xstate_bv & XSTATE_FP) || /* * AMD CPUs don't save/restore FDP/FIP/FOP unless an exception * is pending.