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: <db0e6b8f034f832c7e52fe3dd47073ad@agner.ch>
Date:   Sat, 09 Feb 2019 18:28:25 +0100
From:   Stefan Agner <stefan@...er.ch>
To:     linux@...linux.org.uk
Cc:     ndesaulniers@...gle.com, natechancellor@...il.com, arnd@...db.de,
        ard.biesheuvel@...aro.org, nicolas.pitre@...aro.org,
        thierry.reding@...il.com, will.deacon@....com,
        julien.thierry@....com, mark.rutland@....com,
        linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH 4/5] ARM: use unified assembler in c files

Thanks for the reviews so far.

During some more testing I stumbled upon another issue:

On 07.02.2019 10:48, Stefan Agner wrote:
> Use unified assembler syntax (UAL) in inline assembler. Divided
> syntax is considered depricated. This will also allow to build
> the kernel using LLVM's integrated assembler.
> 
> Signed-off-by: Stefan Agner <stefan@...er.ch>
> ---
>  arch/arm/mm/copypage-v4mc.c | 2 +-
>  arch/arm/mm/copypage-v4wb.c | 2 +-
>  arch/arm/mm/copypage-v4wt.c | 2 +-
>  3 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/arm/mm/copypage-v4mc.c b/arch/arm/mm/copypage-v4mc.c
> index b03202cddddb..b19c7ad1a6de 100644
> --- a/arch/arm/mm/copypage-v4mc.c
> +++ b/arch/arm/mm/copypage-v4mc.c
> @@ -56,7 +56,7 @@ static void mc_copy_user_page(void *from, void *to)
>  	ldmia	%0!, {r2, r3, ip, lr}		@ 4\n\
>  	subs	%2, %2, #1			@ 1\n\
>  	stmia	%1!, {r2, r3, ip, lr}		@ 4\n\
> -	ldmneia	%0!, {r2, r3, ip, lr}		@ 4\n\
> +	ldmiane	%0!, {r2, r3, ip, lr}		@ 4\n\
>  	bne	1b				@ "
>  	: "+&r" (from), "+&r" (to), "=&r" (tmp)
>  	: "2" (PAGE_SIZE / 64)
> diff --git a/arch/arm/mm/copypage-v4wb.c b/arch/arm/mm/copypage-v4wb.c
> index cd3e165afeed..6e3c9b69dd25 100644
> --- a/arch/arm/mm/copypage-v4wb.c
> +++ b/arch/arm/mm/copypage-v4wb.c
> @@ -38,7 +38,7 @@ static void v4wb_copy_user_page(void *kto, const void *kfrom)
>  	ldmia	%1!, {r3, r4, ip, lr}		@ 4\n\
>  	subs	%2, %2, #1			@ 1\n\
>  	stmia	%0!, {r3, r4, ip, lr}		@ 4\n\
> -	ldmneia	%1!, {r3, r4, ip, lr}		@ 4\n\
> +	ldmiane	%1!, {r3, r4, ip, lr}		@ 4\n\
>  	bne	1b				@ 1\n\
>  	mcr	p15, 0, %1, c7, c10, 4		@ 1   drain WB"
>  	: "+&r" (kto), "+&r" (kfrom), "=&r" (tmp)
> diff --git a/arch/arm/mm/copypage-v4wt.c b/arch/arm/mm/copypage-v4wt.c
> index 8614572e1296..4a40fa1cbc2a 100644
> --- a/arch/arm/mm/copypage-v4wt.c
> +++ b/arch/arm/mm/copypage-v4wt.c
> @@ -34,7 +34,7 @@ static void v4wt_copy_user_page(void *kto, const void *kfrom)
>  	ldmia	%1!, {r3, r4, ip, lr}		@ 4\n\
>  	subs	%2, %2, #1			@ 1\n\
>  	stmia	%0!, {r3, r4, ip, lr}		@ 4\n\
> -	ldmneia	%1!, {r3, r4, ip, lr}		@ 4\n\
> +	ldmiane	%1!, {r3, r4, ip, lr}		@ 4\n\
>  	bne	1b				@ 1\n\
>  	mcr	p15, 0, %2, c7, c7, 0		@ flush ID cache"
>  	: "+&r" (kto), "+&r" (kfrom), "=&r" (tmp)

When compiling with gcc, this leads to:

/tmp/ccrvA1wy.s: Assembler messages:
/tmp/ccrvA1wy.s:180: Error: bad instruction `ldmiane r0!,{r3,r4,ip,lr}'
make[1]: *** [scripts/Makefile.build:277: arch/arm/mm/copypage-v4wb.o]
Error 1
make: *** [Makefile:1042: arch/arm/mm] Error 2

Unfortunately, the gcc option -masm-syntax-unified which allows unified
syntax in inline assembly is broken (see also
https://lkml.org/lkml/2019/1/7/1320).

So this requires to sprinkle those inline assembly with ".syntax
unified" strings, similar to how I've done it in uaccess.h.

--
Stefan

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ