WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH] fix asm syntax

To: Keir Fraser <Keir.Fraser@xxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] fix asm syntax
From: John Levon <levon@xxxxxxxxxxxxxxxxx>
Date: Tue, 17 Oct 2006 17:42:11 +0100
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx, Jan Beulich <jbeulich@xxxxxxxxxx>
Delivery-date: Tue, 17 Oct 2006 09:42:28 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <C15AC2FB.2AAF%Keir.Fraser@xxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <20061017160425.GA13575@xxxxxxxxxxxxxxxxxxxx> <C15AC2FB.2AAF%Keir.Fraser@xxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.9i
On Tue, Oct 17, 2006 at 05:27:23PM +0100, Keir Fraser wrote:

> > Possibly --divide should alter the semantics in this case too. It's
> > something I need to bring up on the binutils list, but in the meantime,
> > it seems like a bug we have to work around.
> 
> Would 'rex64\' work on Solaris, then?
> 
> We could provide an OS-specific macro for forcing rex64.

How about the below.

regards
john

# HG changeset patch
# User john.levon@xxxxxxx
# Date 1161103248 25200
# Node ID 4e217ea549122efcf2b6bba2c6aaf4b9581cac2f
# Parent  e5a8b0d52d68be688de73101dfe44145158d0cff
Define REX64_PREFIX to account for assembler syntax differences on SVR4
targets.

Signed-off-by: John Levon <john.levon@xxxxxxx>

diff --git a/xen/arch/x86/i387.c b/xen/arch/x86/i387.c
--- a/xen/arch/x86/i387.c
+++ b/xen/arch/x86/i387.c
@@ -14,6 +14,7 @@
 #include <asm/processor.h>
 #include <asm/hvm/support.h>
 #include <asm/i387.h>
+#include <asm/asm_defns.h>
 
 void init_fpu(void)
 {
@@ -45,7 +46,7 @@ void save_init_fpu(struct vcpu *v)
          * mode that doesn't require extended registers.
          */
         __asm__ __volatile__ (
-            "rex64/fxsave (%1)"
+            REX64_PREFIX "fxsave (%1)"
             : "=m" (*fpu_ctxt) : "cdaSDb" (fpu_ctxt) );
 #endif
 
@@ -95,7 +96,7 @@ void restore_fpu(struct vcpu *v)
             "1: fxrstor %0            \n"
 #else /* __x86_64__ */
             /* See above for why the operands/constraints are this way. */
-            "1: rex64/fxrstor (%2)    \n"
+            "1: " REX64_PREFIX "fxrstor (%2)    \n"
 #endif
             ".section .fixup,\"ax\"   \n"
             "2: push %%"__OP"ax       \n"
diff --git a/xen/include/asm-x86/x86_64/asm_defns.h 
b/xen/include/asm-x86/x86_64/asm_defns.h
--- a/xen/include/asm-x86/x86_64/asm_defns.h
+++ b/xen/include/asm-x86/x86_64/asm_defns.h
@@ -60,6 +60,12 @@
 #define safe_swapgs                             \
         "mfence; swapgs;"
 
+#ifdef __sun__
+#define REX64_PREFIX "rex64\\"
+#else
+#define REX64_PREFIX "rex64/"
+#endif
+
 #define BUILD_SMP_INTERRUPT(x,v) XBUILD_SMP_INTERRUPT(x,v)
 #define XBUILD_SMP_INTERRUPT(x,v)               \
 asmlinkage void x(void);                        \

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel