Re: [PATCH 2/4] arm64: vdso32: Detect binutils support for dmb ishld

From: Catalin Marinas
Date: Thu Sep 26 2019 - 04:30:49 EST


On Thu, Sep 26, 2019 at 07:03:51AM +0100, Vincenzo Frascino wrote:
> diff --git a/arch/arm64/include/asm/vdso/compat_barrier.h b/arch/arm64/include/asm/vdso/compat_barrier.h
> index fb60a88b5ed4..3fd8fd6d8fc2 100644
> --- a/arch/arm64/include/asm/vdso/compat_barrier.h
> +++ b/arch/arm64/include/asm/vdso/compat_barrier.h
> @@ -20,7 +20,7 @@
>
> #define dmb(option) __asm__ __volatile__ ("dmb " #option : : : "memory")
>
> -#if __LINUX_ARM_ARCH__ >= 8
> +#if __LINUX_ARM_ARCH__ >= 8 && defined(CONFIG_AS_DMB_ISHLD)
> #define aarch32_smp_mb() dmb(ish)
> #define aarch32_smp_rmb() dmb(ishld)
> #define aarch32_smp_wmb() dmb(ishst)
> diff --git a/arch/arm64/kernel/vdso32/Makefile b/arch/arm64/kernel/vdso32/Makefile
> index 1fba0776ed40..1a3299d901b1 100644
> --- a/arch/arm64/kernel/vdso32/Makefile
> +++ b/arch/arm64/kernel/vdso32/Makefile
> @@ -55,6 +55,9 @@ endif
> VDSO_CAFLAGS += -fPIC -fno-builtin -fno-stack-protector
> VDSO_CAFLAGS += -DDISABLE_BRANCH_PROFILING
>
> +# Check for binutils support for dmb ishld
> +dmbinstr := $(call as-instr,dmb ishld,-DCONFIG_AS_DMB_ISHLD=1)

Is this check for the compat gas or the native one? Looking at
scripts/Kbuild.include, as-instr uses CC but you'd need a COMPATCC here
instead.

I may have missed something but I don't think this fixes the issue
Will's issue since he reported the problem with an old compat binutils.

--
Catalin