lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YYumVx7qO3gY2tgD@hirez.programming.kicks-ass.net>
Date:   Wed, 10 Nov 2021 12:00:39 +0100
From:   Peter Zijlstra <peterz@...radead.org>
To:     Juergen Gross <jgross@...e.com>
Cc:     x86@...nel.org, linux-kernel@...r.kernel.org, jpoimboe@...hat.com,
        mark.rutland@....com, dvyukov@...gle.com, seanjc@...gle.com,
        pbonzini@...hat.com, mbenes@...e.cz
Subject: Re: [PATCH v2 11/23] x86,xen: Remove .fixup usage

On Wed, Nov 10, 2021 at 11:35:37AM +0100, Juergen Gross wrote:
> On 10.11.21 11:01, Peter Zijlstra wrote:
> > Employ the fancy new EX_TYPE_IMM_REG to store -EFAULT in the return
> > register and use this to remove some Xen .fixup usage.
> > 
> > All callers of these functions only test for 0 return, so the actual
> > return value change from -1 to -EFAULT is immaterial.
> > 
> > Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
> > ---
> >   arch/x86/include/asm/xen/page.h |   14 +++-----------
> >   1 file changed, 3 insertions(+), 11 deletions(-)
> > 
> > --- a/arch/x86/include/asm/xen/page.h
> > +++ b/arch/x86/include/asm/xen/page.h
> > @@ -96,11 +96,7 @@ static inline int xen_safe_write_ulong(u
> >   	asm volatile("1: mov %[val], %[ptr]\n"
> >   		     "2:\n"
> > -		     ".section .fixup, \"ax\"\n"
> > -		     "3: sub $1, %[ret]\n"
> > -		     "   jmp 2b\n"
> > -		     ".previous\n"
> > -		     _ASM_EXTABLE(1b, 3b)
> > +		     _ASM_EXTABLE_TYPE_REG(1b, 2b, EX_TYPE_EFAULT_REG, %[ret])
> >   		     : [ret] "+r" (ret), [ptr] "=m" (*addr)
> >   		     : [val] "r" (val));
> > @@ -110,16 +106,12 @@ static inline int xen_safe_write_ulong(u
> >   static inline int xen_safe_read_ulong(const unsigned long *addr,
> >   				      unsigned long *val)
> >   {
> > -	int ret = 0;
> >   	unsigned long rval = ~0ul;
> > +	int ret = 0;
> 
> Spurious change.

Yeah, can't help myself, must be reverse xmas tree :-)

> >   	asm volatile("1: mov %[ptr], %[rval]\n"
> >   		     "2:\n"
> > -		     ".section .fixup, \"ax\"\n"
> > -		     "3: sub $1, %[ret]\n"
> > -		     "   jmp 2b\n"
> > -		     ".previous\n"
> > -		     _ASM_EXTABLE(1b, 3b)
> > +		     _ASM_EXTABLE_TYPE_REG(1b, 2b, EX_TYPE_EFAUL_REG, %[ret])
> 
> I guess you didn't compile that? There is a typo: s/EFAUL/EFAULT/

Damn.. I figure that must've gotten lost in the robot spam telling me
clang can't do __cold on labels :/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ