All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jan Beulich" <JBeulich@suse.com>
To: Harmandeep Kaur <write.harmandeep@gmail.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Dario Faggioli <dario.faggioli@citrix.com>,
	xen-devel@lists.xen.org, Shuai Ruan <shuai.ruan@linux.intel.com>
Subject: Re: Error booting Xen
Date: Tue, 26 Jan 2016 06:22:16 -0700	[thread overview]
Message-ID: <56A7811802000078000CB144@prv-mh.provo.novell.com> (raw)
In-Reply-To: <CAPtdW171tLo-eemzCOCvg8N8rq9yEz_+RoE7tPvD24zYwTuUiw@mail.gmail.com>

>>> On 26.01.16 at 13:51, <write.harmandeep@gmail.com> wrote:
> I tried the patch and I am very happy to inform you
> all that the patch has solved my problem. Now I am
> able to boot Xen without disabling XSAVE. I have
> full log of boot at http://paste2.org/gVW0Z9nm (if
> any one is interested. also "XXX Hello, this is my
> first mod :)" is printed by my mod, so ignore that
> one).

Thanks for trying it out, but while I'm glad it helped I'm afraid
we're not done here. With (for every vCPU)

(XEN) traps.c:3290: GPF (0000): ffff82d0801c1d08 -> ffff82d080252e5c
(XEN) d0v1 fault#1: mxcsr=00001f80
(XEN) d0v1 xs=0000000000000000 xc=0000000000000000
(XEN) d0v1 r0=0000000000000000 r1=0000000000000000
(XEN) d0v1 r2=0000000000000000 r3=0000000000000000
(XEN) d0v1 r4=0000000000000000 r5=0000000000000000
(XEN) traps.c:3290: GPF (0000): ffff82d0801c1d08 -> ffff82d080252e5c
(XEN) d0v1 fault#2: mxcsr=00001f80
(XEN) d0v1 xs=0000000000000000 xc=0000000000000000
(XEN) d0v1 r0=0000000000000000 r1=0000000000000000
(XEN) d0v1 r2=0000000000000000 r3=0000000000000000
(XEN) d0v1 r4=0000000000000000 r5=0000000000000000

it continues to be unclear why bit 63 in the value printed as
xc= isn't set from the beginning. Or wait, I think I see where
the problem is. Here's a 3rd patch, to try together with the
other two. The expectation would be for the above log
messages to then disappear altogether. (And then the patch
should also work on its own, i.e. with the other two removed
again.) Please let us know.

Thanks, Jan

x86/xstate: don't unintentionally clear compaction bit

When the VGCF_I387_VALID flag is clear in arch_set_info_guest()'s input
we must not clear the compaction bit when using XSAVES/XRSTORS. Split
initialization of xcomp_bv from the other FPU/SSE/AVX related state
setup in this function.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- unstable.orig/xen/arch/x86/domain.c
+++ unstable/xen/arch/x86/domain.c
@@ -922,15 +922,10 @@ int arch_set_info_guest(
     {
         memcpy(v->arch.fpu_ctxt, &c.nat->fpu_ctxt, sizeof(c.nat->fpu_ctxt));
         if ( v->arch.xsave_area )
-        {
             v->arch.xsave_area->xsave_hdr.xstate_bv = XSTATE_FP_SSE;
-            v->arch.xsave_area->xsave_hdr.xcomp_bv =
-                cpu_has_xsaves ? XSTATE_COMPACTION_ENABLED : 0;
-        }
     }
     else if ( v->arch.xsave_area )
-        memset(&v->arch.xsave_area->xsave_hdr, 0,
-               sizeof(v->arch.xsave_area->xsave_hdr));
+        v->arch.xsave_area->xsave_hdr.xstate_bv = 0;
     else
     {
         typeof(v->arch.xsave_area->fpu_sse) *fpu_sse = v->arch.fpu_ctxt;
@@ -939,6 +934,11 @@ int arch_set_info_guest(
         fpu_sse->fcw = FCW_DEFAULT;
         fpu_sse->mxcsr = MXCSR_DEFAULT;
     }
+    if ( cpu_has_xsaves )
+    {
+        ASSERT(v->arch.xsave_area);
+        v->arch.xsave_area->xsave_hdr.xcomp_bv = XSTATE_COMPACTION_ENABLED;
+    }
 
     if ( !compat )
     {

  parent reply	other threads:[~2016-01-26 13:22 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-18 18:03 Error booting Xen Harmandeep Kaur
2016-01-18 18:09 ` Andrew Cooper
2016-01-18 18:29   ` Dario Faggioli
2016-01-19 13:36     ` Jan Beulich
2016-01-19 14:51       ` Dario Faggioli
2016-01-19 15:07         ` Andrew Cooper
2016-01-19 16:27           ` Harmandeep Kaur
2016-01-19 16:47             ` Jan Beulich
2016-01-19 17:02               ` Andrew Cooper
2016-01-19 17:08                 ` Dario Faggioli
2016-01-19 17:09                   ` Andrew Cooper
2016-01-19 19:55                   ` Harmandeep Kaur
2016-01-20 10:06                     ` Jan Beulich
2016-01-21 15:14                       ` Dario Faggioli
2016-01-21 15:24                         ` Harmandeep Kaur
2016-01-25 13:42                         ` Jan Beulich
2016-01-26 11:58                           ` Dario Faggioli
2016-01-26 12:51                           ` Harmandeep Kaur
2016-01-26 13:13                             ` Harmandeep Kaur
2016-01-26 13:23                               ` Jan Beulich
2016-01-26 17:01                                 ` Harmandeep Kaur
2016-01-26 17:23                                   ` Jan Beulich
2016-01-26 18:02                                     ` Harmandeep Kaur
2016-01-26 18:28                                       ` Dario Faggioli
2016-01-26 18:36                                         ` Harmandeep Kaur
2016-01-27  8:24                                       ` Jan Beulich
2016-01-27 13:12                                       ` Jan Beulich
2016-01-27 13:28                                         ` Harmandeep Kaur
2016-01-27 14:28                                           ` Jan Beulich
2016-01-28 19:17                                             ` Harmandeep Kaur
2016-01-29 10:13                                               ` Jan Beulich
2016-02-03  8:23                                                 ` Dario Faggioli
2016-02-03 11:35                                                   ` Harmandeep Kaur
2016-02-03 12:49                                                     ` Jan Beulich
2016-02-03 12:55                                                     ` Dario Faggioli
2016-02-03 13:10                                                       ` Andrew Cooper
2016-02-03 13:17                                                         ` Dario Faggioli
2016-02-03 16:57                                                           ` Konrad Rzeszutek Wilk
2016-02-03 13:40                                                       ` Harmandeep Kaur
2016-02-03 14:18                                                         ` Jan Beulich
2016-01-26 13:22                             ` Jan Beulich [this message]
2016-02-02  4:43                       ` Shuai Ruan
     [not found]                       ` <20160202044349.GA3036@shuai.ruan@linux.intel.com>
2016-02-02 10:39                         ` Andrew Cooper
2016-02-03  0:56                           ` Shuai Ruan
2016-02-03  7:56                           ` Shuai Ruan
2016-01-19 14:07 ` Harmandeep Kaur

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=56A7811802000078000CB144@prv-mh.provo.novell.com \
    --to=jbeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=dario.faggioli@citrix.com \
    --cc=shuai.ruan@linux.intel.com \
    --cc=write.harmandeep@gmail.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.