Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1271293

Re: [PATCH v7 0/4] KASAN for arm64

From "Suzuki K. Poulose" <Suzuki.Poulose@arm.com>
Newsgroups linux.kernel
Subject Re: [PATCH v7 0/4] KASAN for arm64
Date 2015-11-17 16:00 +0100
Message-ID <qvPTH-6ll-5@gated-at.bofh.it> (permalink)
References <qiNG2-3wf-9@gated-at.bofh.it> <qj3hM-19c-23@gated-at.bofh.it> <qvq8W-6FI-3@gated-at.bofh.it> <qvu2S-EC-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 16/11/15 15:34, Andrey Ryabinin wrote:
> On 11/16/2015 02:16 PM, Suzuki K. Poulose wrote:
>> On 13/10/15 09:34, Catalin Marinas wrote:
>>> On Mon, Oct 12, 2015 at 06:52:56PM +0300, Andrey Ryabinin wrote:

>> Hi,
>>
>> I get the following failure with KASAN + 16K_PAGES + 48BIT_VA, with 4.4-rc1:
>>
>>
>> arch/arm64/mm/kasan_init.c: In function ‘kasan_early_init’:
>> include/linux/compiler.h:484:38: error: call to ‘__compiletime_assert_95’ declared with attribute error: BUILD_BUG_ON failed: !IS_ALIGNED(KASAN_SHADOW_END, PGDIR_SIZE)
>>    _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
>>                                        ^

...

>
> Yes, it's really needed, because some code relies on this (e.g.  clear_pgs() and kasan_init()).
> But it should be possible to get rid of this requirement.

And the other important point I missed mentioning was that, my tool chain doesn't
support KASAN. But still the KASAN support files are still compiled and generates
the above error. Shouldn't we disable it at build time if we detect that compiler
doesn't support it ? Something like we do for LSE_ATOMICS.


commit c09d6a04d17d730b0463207a26ece082772b59ee
Author: Will Deacon <will.deacon@arm.com>
Date:   Tue Feb 3 16:14:13 2015 +0000

     arm64: atomics: patch in lse instructions when supported by the CPU
     
     On CPUs which support the LSE atomic instructions introduced in ARMv8.1,
     it makes sense to use them in preference to ll/sc sequences.
     
...

diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile
index 0953a97..15ff5b4 100644
--- a/arch/arm64/Makefile
+++ b/arch/arm64/Makefile
@@ -17,7 +17,18 @@ GZFLAGS              :=-9
  
  KBUILD_DEFCONFIG := defconfig
  
-KBUILD_CFLAGS  += -mgeneral-regs-only
+# Check for binutils support for specific extensions
+lseinstr := $(call as-instr,.arch_extension lse,-DCONFIG_AS_LSE=1)
+
+ifeq ($(CONFIG_ARM64_LSE_ATOMICS), y)
+  ifeq ($(lseinstr),)
+$(warning LSE atomics not supported by binutils)
+  endif
+endif
+
+KBUILD_CFLAGS  += -mgeneral-regs-only $(lseinstr)
+KBUILD_AFLAGS  += $(lseinstr)
+



Thanks
Suzuki

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH v7 0/4] KASAN for arm64 "Suzuki K. Poulose" <Suzuki.Poulose@arm.com> - 2015-11-16 12:30 +0100
  Re: [PATCH v7 0/4] KASAN for arm64 Andrey Ryabinin <ryabinin.a.a@gmail.com> - 2015-11-16 16:40 +0100
    Re: [PATCH v7 0/4] KASAN for arm64 Catalin Marinas <catalin.marinas@arm.com> - 2015-11-16 18:00 +0100
      Re: [PATCH v7 0/4] KASAN for arm64 Andrey Ryabinin <ryabinin.a.a@gmail.com> - 2015-11-18 15:40 +0100
        Re: [PATCH v7 0/4] KASAN for arm64 "Suzuki K. Poulose" <Suzuki.Poulose@arm.com> - 2015-11-18 16:50 +0100
          Re: [PATCH v7 0/4] KASAN for arm64 Ard Biesheuvel <ard.biesheuvel@linaro.org> - 2015-11-18 17:00 +0100
        Re: [PATCH v7 0/4] KASAN for arm64 Catalin Marinas <catalin.marinas@arm.com> - 2015-11-18 18:30 +0100
    Re: [PATCH v7 0/4] KASAN for arm64 "Suzuki K. Poulose" <Suzuki.Poulose@arm.com> - 2015-11-17 16:00 +0100
      Re: [PATCH v7 0/4] KASAN for arm64 Andrey Ryabinin <aryabinin@virtuozzo.com> - 2015-11-17 16:50 +0100
        Re: [PATCH v7 0/4] KASAN for arm64 Mark Rutland <mark.rutland@arm.com> - 2015-11-26 13:20 +0100
          Re: [PATCH v7 0/4] KASAN for arm64 Andrey Ryabinin <aryabinin@virtuozzo.com> - 2015-11-26 13:30 +0100
            Re: [PATCH v7 0/4] KASAN for arm64 Catalin Marinas <catalin.marinas@arm.com> - 2015-11-26 16:10 +0100

csiph-web