From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Jan Beulich" Subject: Re: [PATCH v6 1/2] xen/hvm: introduce a flags field in the CPU save record Date: Tue, 12 Jan 2016 09:31:52 -0700 Message-ID: <5695388802000078000C6062@prv-mh.provo.novell.com> References: <1452615153-67387-1-git-send-email-roger.pau@citrix.com> <1452615153-67387-2-git-send-email-roger.pau@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aJ1rQ-0005g2-Rn for xen-devel@lists.xenproject.org; Tue, 12 Jan 2016 16:31:56 +0000 In-Reply-To: <1452615153-67387-2-git-send-email-roger.pau@citrix.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Roger Pau Monne Cc: Andrew Cooper , xen-devel@lists.xenproject.org List-Id: xen-devel@lists.xenproject.org >>> On 12.01.16 at 17:12, wrote: > @@ -2087,19 +2100,21 @@ static int hvm_load_cpu_ctxt(struct domain *d, hvm_domain_context_t *h) > seg.attr.bytes = ctxt.ldtr_arbytes; > hvm_set_segment_register(v, x86_seg_ldtr, &seg); > > - /* In case xsave-absent save file is restored on a xsave-capable host */ > - if ( cpu_has_xsave && !xsave_enabled(v) ) > + v->fpu_initialised = !!(ctxt.flags & XEN_X86_FPU_INITIALISED); > + if ( v->fpu_initialised ) > { > - struct xsave_struct *xsave_area = v->arch.xsave_area; > + memcpy(v->arch.fpu_ctxt, ctxt.fpu_regs, sizeof(ctxt.fpu_regs)); > + /* In case xsave-absent save file is restored on a xsave-capable host */ > + if ( cpu_has_xsave && !xsave_enabled(v) ) > + { > + struct xsave_struct *xsave_area = v->arch.xsave_area; > > - memcpy(v->arch.xsave_area, ctxt.fpu_regs, sizeof(ctxt.fpu_regs)); > - xsave_area->xsave_hdr.xstate_bv = XSTATE_FP_SSE; > - if ( cpu_has_xsaves || cpu_has_xsavec ) > - xsave_area->xsave_hdr.xcomp_bv = XSTATE_FP_SSE | > - XSTATE_COMPACTION_ENABLED; > + xsave_area->xsave_hdr.xstate_bv = XSTATE_FP_SSE; > + if ( cpu_has_xsaves || cpu_has_xsavec ) > + xsave_area->xsave_hdr.xcomp_bv = XSTATE_FP_SSE | > + XSTATE_COMPACTION_ENABLED; > + } > } > - else > - memcpy(v->arch.fpu_ctxt, ctxt.fpu_regs, sizeof(ctxt.fpu_regs)); > I would have expected this to simply be re-indentation, yet you changed from if/else to just if with the else code done ahead of it. If this really is intended, the commit message should explain it. Jan