From: "Jan Beulich" Subject: Re: [V12 1/4] x86/xsaves: using named operand instead numbered operand in xrstor Date: Wed, 25 Nov 2015 02:30:50 -0700 Message-ID: <56558DDA02000078000B8D82@prv-mh.provo.novell.com> References: <1448437869-9669-1-git-send-email-shuai.ruan@linux.intel.com> <1448437869-9669-2-git-send-email-shuai.ruan@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1448437869-9669-2-git-send-email-shuai.ruan@linux.intel.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: Shuai Ruan Cc: kevin.tian@intel.com, wei.liu2@citrix.com, Ian.Campbell@citrix.com, stefano.stabellini@eu.citrix.com, andrew.cooper3@citrix.com, ian.jackson@eu.citrix.com, xen-devel@lists.xen.org, jun.nakajima@intel.com, keir@xen.org List-Id: xen-devel@lists.xenproject.org >>> On 25.11.15 at 08:51, wrote: > --- a/xen/arch/x86/xstate.c > +++ b/xen/arch/x86/xstate.c > @@ -158,6 +158,16 @@ void xsave(struct vcpu *v, uint64_t mask) > ptr->fpu_sse.x[FPU_WORD_SIZE_OFFSET] = word_size; > } > > +#define XRSTOR_FIXUP ".section .fixup,\"ax\" \n" \ > + "2: mov %[size],%%ecx \n" \ > + " xor %[lmask_out],%[lmask_out] \n" \ > + " rep stosb \n" \ > + " lea %[mem],%[ptr] \n" \ > + " mov %[lmask_in],%[lmask_out] \n" \ > + " jmp 1b \n" \ > + ".previous \n" \ > + _ASM_EXTABLE(1b, 2b) So this is exactly the disconnect I told you to avoid: The definition here and the use site can't independently change any of the operand names, since you don't pass them as macro arguments. But I guess I'll give up on this an will try to remember to adjust this later myself. Jan