From patchwork Tue Jan 26 13:22:16 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 8121871 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 03998BEEE5 for ; Tue, 26 Jan 2016 13:25:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1A832201F2 for ; Tue, 26 Jan 2016 13:25:17 +0000 (UTC) Received: from lists.xen.org (lists.xenproject.org [50.57.142.19]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 293C92010B for ; Tue, 26 Jan 2016 13:25:16 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aO3Zi-000878-I9; Tue, 26 Jan 2016 13:22:26 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aO3Zh-00086x-P2 for xen-devel@lists.xen.org; Tue, 26 Jan 2016 13:22:25 +0000 Received: from [85.158.139.211] by server-6.bemta-5.messagelabs.com id 2A/D8-22089-11377A65; Tue, 26 Jan 2016 13:22:25 +0000 X-Env-Sender: JBeulich@suse.com X-Msg-Ref: server-7.tower-206.messagelabs.com!1453814542!17950119!1 X-Originating-IP: [137.65.248.74] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 7.35.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 40063 invoked from network); 26 Jan 2016 13:22:24 -0000 Received: from prv-mh.provo.novell.com (HELO prv-mh.provo.novell.com) (137.65.248.74) by server-7.tower-206.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 26 Jan 2016 13:22:24 -0000 Received: from INET-PRV-MTA by prv-mh.provo.novell.com with Novell_GroupWise; Tue, 26 Jan 2016 06:22:18 -0700 Message-Id: <56A7811802000078000CB144@prv-mh.provo.novell.com> X-Mailer: Novell GroupWise Internet Agent 14.2.0 Date: Tue, 26 Jan 2016 06:22:16 -0700 From: "Jan Beulich" To: "Harmandeep Kaur" References: <569D2A49.1090409@citrix.com> <1453141749.11427.92.camel@citrix.com> <569E4A0102000078000C8917@prv-mh.provo.novell.com> <1453215095.11427.144.camel@citrix.com> <569E5118.4030704@citrix.com> <569E76B102000078000C8C14@prv-mh.provo.novell.com> <569E6C36.3070402@citrix.com> <1453223282.11427.149.camel@citrix.com> <569F6A2102000078000C8F20@prv-mh.provo.novell.com> <1453389242.3116.106.camel@citrix.com> <56A6344C02000078000CAA56@prv-mh.provo.novell.com> In-Reply-To: Mime-Version: 1.0 Content-Disposition: inline Cc: Andrew Cooper , Dario Faggioli , xen-devel@lists.xen.org, Shuai Ruan Subject: Re: [Xen-devel] Error booting Xen X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP >>> On 26.01.16 at 13:51, 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 --- 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 ) {