From: "Jan Beulich" Subject: [PATCH] x86: use "R" constraint for fxsaveq/fxrstorq enforcement Date: Tue, 13 Aug 2013 16:43:58 +0100 Message-ID: <520A705E02000078000EB96B@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__Part4A791F2E.0__=" Return-path: Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1V9GlP-0005QW-O2 for xen-devel@lists.xenproject.org; Tue, 13 Aug 2013 15:44:03 +0000 List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel Cc: Keir Fraser List-Id: xen-devel@lists.xenproject.org This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=__Part4A791F2E.0__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline I became aware of this constraint's (referring to all legacy registers in one go) existence by (accidentally) noticing Linux commit 82024135 ("x86-64, fpu: Simplify constraints for fxsave/fxtstor"). Signed-off-by: Jan Beulich --- a/xen/arch/x86/i387.c +++ b/xen/arch/x86/i387.c @@ -96,8 +96,7 @@ static inline void fpu_fxrstor(struct vc ".previous \n" _ASM_EXTABLE(1b, 2b) : - : "m" (*fpu_ctxt), "i" (sizeof(*fpu_ctxt) / 4), - "cdaSDb" (fpu_ctxt) ); + : "m" (*fpu_ctxt), "i" (sizeof(*fpu_ctxt) / 4), "R" (fpu_ctxt)= ); break; case 4: case 2: asm volatile ( @@ -162,7 +161,7 @@ static inline void fpu_fxsave(struct vcp * addressing mode that doesn't require extended registers. */ asm volatile ( REX64_PREFIX "fxsave (%1)" - : "=3Dm" (*fpu_ctxt) : "cdaSDb" (fpu_ctxt) ); + : "=3Dm" (*fpu_ctxt) : "R" (fpu_ctxt) ); =20 /* * AMD CPUs don't save/restore FDP/FIP/FOP unless an exception --=__Part4A791F2E.0__= Content-Type: text/plain; name="x86-FXSR-use-R-constraint.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="x86-FXSR-use-R-constraint.patch" x86: use "R" constraint for fxsaveq/fxrstorq enforcement=0A=0AI became = aware of this constraint's (referring to all legacy registers=0Ain one go) = existence by (accidentally) noticing Linux commit 82024135=0A("x86-64, = fpu: Simplify constraints for fxsave/fxtstor").=0A=0ASigned-off-by: Jan = Beulich =0A=0A--- a/xen/arch/x86/i387.c=0A+++ b/xen/arch= /x86/i387.c=0A@@ -96,8 +96,7 @@ static inline void fpu_fxrstor(struct = vc=0A ".previous \n"=0A _ASM_EXTABLE= (1b, 2b)=0A :=0A- : "m" (*fpu_ctxt), "i" (sizeof(*fp= u_ctxt) / 4),=0A- "cdaSDb" (fpu_ctxt) );=0A+ : "m" = (*fpu_ctxt), "i" (sizeof(*fpu_ctxt) / 4), "R" (fpu_ctxt) );=0A = break;=0A case 4: case 2:=0A asm volatile (=0A@@ -162,7 +161,7 = @@ static inline void fpu_fxsave(struct vcp=0A * addressing mode = that doesn't require extended registers.=0A */=0A asm = volatile ( REX64_PREFIX "fxsave (%1)"=0A- : "=3Dm" = (*fpu_ctxt) : "cdaSDb" (fpu_ctxt) );=0A+ : "=3Dm" = (*fpu_ctxt) : "R" (fpu_ctxt) );=0A =0A /*=0A * AMD CPUs = don't save/restore FDP/FIP/FOP unless an exception=0A --=__Part4A791F2E.0__= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --=__Part4A791F2E.0__=--