All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ben Guthro <ben.guthro@gmail.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: Mark Roddy <mark.roddy@citrix.com>, xen-devel <xen-devel@lists.xen.org>
Subject: Re: XSAVE/XRSTOR crash resurgence in 4.3
Date: Mon, 22 Jul 2013 08:25:08 -0400	[thread overview]
Message-ID: <CAOvdn6XRXMZ7_8__9jYZnCbdMnG+wxYV-CNb00J-th+BvRF5vQ@mail.gmail.com> (raw)
In-Reply-To: <CAOvdn6Wm_q+DYPeHJ5fe6P2Y4RGKFH4EJcuiKhwG8SixKaha_w@mail.gmail.com>

On Wed, Jul 17, 2013 at 9:07 AM, Ben Guthro <ben.guthro@gmail.com> wrote:
> On Wed, Jul 17, 2013 at 2:38 AM, Jan Beulich <JBeulich@suse.com> wrote:
>>>>> On 16.07.13 at 18:57, Ben Guthro <ben.guthro@gmail.com> wrote:
>>> On Tue, Jul 16, 2013 at 12:23 PM, Jan Beulich <JBeulich@suse.com> wrote:
>>>>>>> On 15.07.13 at 15:49, Ben Guthro <ben.guthro@gmail.com> wrote:
>>>>> The following output was from a WinXP SP3 guest (32bit) on a Lenovo T430:
>>>>>
>>>>> (XEN) d1v0: fip=1b773d6e9a fdp=23773d1c48 w=8
>>>>> (XEN) d1v0: FIP=1b773d6e9a FDP=23773d1c48 w=8
>>>>> (XEN) d1v1: fip=1b79e78dee fdp=230012e3b4 w=8
>>>>> (XEN) d1v1: FIP=1b79e78dee FDP=230012e3b4 w=8
>>>>> (XEN) d1v1: fip=0000:79e78dee fdp=0000:0012e3b4
>>>>> (XEN) d1v1: fip=0000:79e78dee fdp=0000:0012e3b4
>>>>> (XEN) d1v1: fip=0000:79e78dee fdp=0000:0012e3b4
>>>>> (XEN) d1v1: fip=0000:79e78dee fdp=0000:0012e3b4
>>>>> (XEN) d1v1: fip=1b79e78dee fdp=230012d528 w=8
>>>>> (XEN) d1v1: FIP=1b79e78dee FDP=230012d528 w=8
>>>>> (XEN) d1v0: fip=4500000000 fdp=4b1000000000 w=8
>>>>> (XEN) d1v0: FIP=4500000000 FDP=4b1000000000 w=8
>>>>> (XEN) d1v1: fip=1b773d6e9a fdp=23773d1c48 w=8
>>>>> (XEN) d1v1: FIP=1b773d6e9a FDP=23773d1c48 w=8
>>>>
>>>> Well, it should have been quite obvious (to me) that this is
>>>> related to xsaveopt behavior (according to my own observations
>>>> of cases where the selector/offset fields don't get written). Could
>>>> you double check whether the system(s) you see the problem on
>>>> support xsaveopt, and if so, simply comment out the conditionals
>>>> that cause it to be used?
>>>
>>> They do support xsaveopt.
>>> I'll ifdef these out for tonight's test run.
>
> There was a problem with my commit for this test run, so I did not get
> the data I wanted.
>
> I will test with this patch tonight.

Testing runs over the past few nights were successful, with this patch.
While not totally conclusive - I would say that this solved the problem.

Thank you again.

Ben

>> And attached/below also a tentative fix.
>>
>> Jan
>>
>> --- a/xen/arch/x86/xstate.c
>> +++ b/xen/arch/x86/xstate.c
>> @@ -72,9 +72,24 @@ void xsave(struct vcpu *v, uint64_t mask
>>      if ( word_size <= 0 || !is_pv_32bit_vcpu(v) )
>>      {
>>          if ( cpu_has_xsaveopt )
>> +        {
>> +            /*
>> +             * xsaveopt may not write the FPU portion even when the respective
>> +             * mask bit is set. For the check further down to work we hence
>> +             * need to put the save image back into the state that it was in
>> +             * right after the previous xsaveopt.
>> +             */
>> +            if ( word_size > 0 &&
>> +                 (ptr->fpu_sse.x[FPU_WORD_SIZE_OFFSET] == 4 ||
>> +                  ptr->fpu_sse.x[FPU_WORD_SIZE_OFFSET] == 2) )
>> +            {
>> +                ptr->fpu_sse.fip.sel = 0;
>> +                ptr->fpu_sse.fdp.sel = 0;
>> +            }
>>              asm volatile ( ".byte 0x48,0x0f,0xae,0x37"
>>                             : "=m" (*ptr)
>>                             : "a" (lmask), "d" (hmask), "D" (ptr) );
>> +        }
>>          else
>>              asm volatile ( ".byte 0x48,0x0f,0xae,0x27"
>>                             : "=m" (*ptr)
>>
>>

  reply	other threads:[~2013-07-22 12:25 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-03 14:02 XSAVE/XRSTOR crash resurgence in 4.3 Ben Guthro
2013-07-04 13:21 ` Jan Beulich
2013-07-04 13:24   ` Ben Guthro
2013-07-04 18:19     ` Mark Roddy
2013-07-05  6:42       ` Jan Beulich
2013-07-05 10:30       ` Jan Beulich
2013-07-05 12:10         ` Ben Guthro
2013-07-05 12:15           ` Jan Beulich
2013-07-05 12:58             ` Ben Guthro
2013-07-08 14:13               ` Ben Guthro
2013-07-08 14:24                 ` Jan Beulich
2013-07-08 14:31                   ` Ben Guthro
2013-07-08 14:40                     ` Jan Beulich
2013-07-08 14:42                       ` Ben Guthro
2013-07-08 14:47                         ` Jan Beulich
2013-07-08 15:10                           ` Ben Guthro
2013-07-12 13:11                             ` Ben Guthro
2013-07-12 13:38                               ` Jan Beulich
2013-07-12 13:49                                 ` Ben Guthro
2013-07-12 14:34                                   ` Jan Beulich
2013-07-12 14:49                                     ` Ben Guthro
2013-07-12 14:55                                       ` Jan Beulich
2013-07-12 15:14                                         ` Ben Guthro
2013-07-15  6:41                                           ` Jan Beulich
2013-07-15 12:33                                           ` Jan Beulich
2013-07-15 12:43                                             ` Ben Guthro
2013-07-15 13:49                                               ` Ben Guthro
2013-07-15 14:06                                                 ` Jan Beulich
2013-07-16 16:23                                                 ` Jan Beulich
2013-07-16 16:57                                                   ` Ben Guthro
2013-07-17  6:38                                                     ` Jan Beulich
2013-07-17 13:07                                                       ` Ben Guthro
2013-07-22 12:25                                                         ` Ben Guthro [this message]
2013-08-05 13:05                                                           ` [PATCH] x86: refine FPU selector handling code for XSAVEOPT Jan Beulich
2013-08-05 16:03                                                             ` Keir Fraser
2013-07-08 14:44                       ` XSAVE/XRSTOR crash resurgence in 4.3 Andrew Cooper
2013-07-08 14:52                         ` Jan Beulich
2013-07-08 14:55                           ` Andrew Cooper

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=CAOvdn6XRXMZ7_8__9jYZnCbdMnG+wxYV-CNb00J-th+BvRF5vQ@mail.gmail.com \
    --to=ben.guthro@gmail.com \
    --cc=JBeulich@suse.com \
    --cc=mark.roddy@citrix.com \
    --cc=xen-devel@lists.xen.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.