# HG changeset patch # User john.levon@sun.com # Date 1161091309 25200 # Node ID 3348121778e4020dac6ee010320e704de0d64f67 # Parent 4620ccff3fd3ec41bbdabfdddb3f75fb83673172 Our version of ''as'' doesn''t accept the ''rex64/'' syntax. Signed-off-by: John Levon <john.levon@sun.com> 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 @@ -45,7 +45,7 @@ void save_init_fpu(struct vcpu *v) * mode that doesn''t require extended registers. */ __asm__ __volatile__ ( - "rex64/fxsave (%1)" + "rex64 ; fxsave (%1)" : "=m" (*fpu_ctxt) : "cdaSDb" (fpu_ctxt) ); #endif @@ -95,7 +95,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 ; fxrstor (%2) \n" #endif ".section .fixup,\"ax\" \n" "2: push %%"__OP"ax \n" _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On 17/10/06 14:22, "John Levon" <levon@movementarian.org> wrote:> Our version of ''as'' doesn''t accept the ''rex64/'' syntax. > > Signed-off-by: John Levon <john.levon@sun.com>But won''t gcc be using gas? -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On Tue, Oct 17, 2006 at 02:37:24PM +0100, Keir Fraser wrote:> > Our version of ''as'' doesn''t accept the ''rex64/'' syntax. > > > > Signed-off-by: John Levon <john.levon@sun.com> > > But won''t gcc be using gas?Apparently our version of gas is too old to understand it. regards john _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On 17/10/06 14:40, "John Levon" <levon@movementarian.org> wrote:>>> Our version of ''as'' doesn''t accept the ''rex64/'' syntax. >>> >>> Signed-off-by: John Levon <john.levon@sun.com> >> >> But won''t gcc be using gas? > > Apparently our version of gas is too old to understand it.That''s not a Solaris-specific problem then. The ''rex64/'' syntax was fixed at least a year ago in binutils -- is Solaris that far behind? -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On Tue, Oct 17, 2006 at 04:07:23PM +0100, Keir Fraser wrote:> >>> Our version of ''as'' doesn''t accept the ''rex64/'' syntax. > >>> > >>> Signed-off-by: John Levon <john.levon@sun.com> > >> > >> But won''t gcc be using gas? > > > > Apparently our version of gas is too old to understand it. > > That''s not a Solaris-specific problem then. The ''rex64/'' syntax was fixed at > least a year ago in binutils -- is Solaris that far behind?At the time, there hadn''t been a binutils release for quite a while, and we generally only track actual releases for things like this. I see there are more recent ones now. We should probably update (especially as it has the --divide flag). However, I don''t think there''s a disadvantage to the more compatible syntax, is there? regards, john _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
>However, I don''t think there''s a disadvantage to the more compatible >syntax, is there?While not producing bad side effects here (as Keir convinced me), it is generally wrong (i.e. it would work right only because of the more than odd constraint on the operand, which are needed to work around a quirk in the assembler that was fixed about ten months ago). However, the / prefix separation in general has been supported for far more than a year, so I wonder what specific problem you were seeing (and with how old an assembler)... Jan _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On Tue, Oct 17, 2006 at 04:33:32PM +0100, Jan Beulich wrote:> >However, I don''t think there''s a disadvantage to the more compatible > >syntax, is there? > > While not producing bad side effects here (as Keir convinced me), it is > generally wrong (i.e. it would work right only because of the more than > odd constraint on the operand, which are needed to work around a > quirk in the assembler that was fixed about ten months ago). However, > the / prefix separation in general has been supported for far more than > a year, so I wonder what specific problem you were seeing (and with > how old an assembler)...The standard GNU ld is currently still 2.15 on Solaris. If there''s serious objections to not using the newer syntax, we can always keep it as a local hack until we''ve updated. We''re releasing our sources after all. regards, john _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On 17/10/06 16:42, "John Levon" <levon@movementarian.org> wrote:> The standard GNU ld is currently still 2.15 on Solaris. If there''s > serious objections to not using the newer syntax, we can always keep it > as a local hack until we''ve updated. We''re releasing our sources after > all.2.15 supports the rex64/ syntax, I''m certain. It''s the default binutils on my Debian build box. If you get a build failure with that version, that''s rather suspect. -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On Tue, Oct 17, 2006 at 04:49:09PM +0100, Keir Fraser wrote:> On 17/10/06 16:42, "John Levon" <levon@movementarian.org> wrote: > > > The standard GNU ld is currently still 2.15 on Solaris. If there''s > > serious objections to not using the newer syntax, we can always keep it > > as a local hack until we''ve updated. We''re releasing our sources after > > all. > > 2.15 supports the rex64/ syntax, I''m certain. It''s the default binutils on > my Debian build box. If you get a build failure with that version, that''s > rather suspect.You''re right. I looked closer at the problem. It''s this code: 1689 if (!is_space_char (*l) 1690 && *l != END_OF_INSN 1691 && (intel_syntax 1692 || (*l != PREFIX_SEPARATOR 1693 && *l != '',''))) 1694 { 1695 as_bad (_("invalid character %s in mnemonic"), 1696 output_invalid (*l)); On sysv targets: 211 #define PREFIX_SEPARATOR ''\\'' 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. regards john _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On 17/10/06 17:04, "John Levon" <levon@movementarian.org> wrote:> On sysv targets: > > 211 #define PREFIX_SEPARATOR ''\\'' > > 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. -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
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@sun.com # 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@sun.com> 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@lists.xensource.com http://lists.xensource.com/xen-devel