|
Message-ID: <20200314001245.GO11469@brightrain.aerifal.cx> Date: Fri, 13 Mar 2020 20:12:45 -0400 From: Rich Felker <dalias@...c.org> To: musl@...ts.openwall.com Subject: Re: [PATCH] fix mips syscall asm regressions and kernel bug On Wed, Mar 11, 2020 at 07:09:25PM -0400, Rich Felker wrote: > >From dd656a205b5f1d0513f7c71c70c786af1e248304 Mon Sep 17 00:00:00 2001 > From: Rich Felker <dalias@...ifal.cx> > Date: Wed, 11 Mar 2020 18:58:38 -0400 > Subject: [PATCH 3/4] restore mips syscall asm improvements from reverted > change > > in addition to the wrong change to loading of r2, commit > 604f8d3d8b08ee4f548de193050ef93a7753c2e0 removed some useless, > redundant, and possibly undefined constraints. bring back the good > parts. > --- > arch/mips/syscall_arch.h | 31 ++++++++++++++++--------------- > 1 file changed, 16 insertions(+), 15 deletions(-) > > diff --git a/arch/mips/syscall_arch.h b/arch/mips/syscall_arch.h > index a3812188..0a5d6d8f 100644 > --- a/arch/mips/syscall_arch.h > +++ b/arch/mips/syscall_arch.h > @@ -21,7 +21,8 @@ static inline long __syscall0(long n) > register long r2 __asm__("$2"); > __asm__ __volatile__ ( > "addu $2,$0,%2 ; syscall" > - : "=&r"(r2), "=r"(r7) : "ir"(n), "0"(r2), "1"(r7) > + : "=&r"(r2), "=r"(r7) > + : "ir"(n) > : SYSCALL_CLOBBERLIST, "$8", "$9", "$10"); > return r7 ? -r2 : r2; > } This part of the change (also present in the 64-bit versions) was horribly wrong because of an ancient GCC bug: specific-register bindings for outputs are not honored at all with earlyclobber. This is https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87733 I think for now I can work around it by adding back the dummy input constraint the old asm was using. This looks wrong but at least it worked. Rich
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.