[PATCH v4 1/7] x86/kasan: generate KASAN_SHADOW_OFFSET in Makefile

Catalin Marinas catalin.marinas at arm.com
Mon Jul 27 09:40:35 PDT 2015


On Fri, Jul 24, 2015 at 07:41:53PM +0300, Andrey Ryabinin wrote:
> diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
> index b3a1a5d..6d6dd6f 100644
> --- a/arch/x86/Kconfig
> +++ b/arch/x86/Kconfig
> @@ -255,11 +255,6 @@ config ARCH_SUPPORTS_OPTIMIZED_INLINING
>  config ARCH_SUPPORTS_DEBUG_PAGEALLOC
>  	def_bool y
>  
> -config KASAN_SHADOW_OFFSET
> -	hex
> -	depends on KASAN
> -	default 0xdffffc0000000000
> -
>  config HAVE_INTEL_TXT
>  	def_bool y
>  	depends on INTEL_IOMMU && ACPI
> diff --git a/arch/x86/Makefile b/arch/x86/Makefile
> index 118e6de..c666989 100644
> --- a/arch/x86/Makefile
> +++ b/arch/x86/Makefile
> @@ -39,6 +39,8 @@ ifdef CONFIG_X86_NEED_RELOCS
>          LDFLAGS_vmlinux := --emit-relocs
>  endif
>  
> +KASAN_SHADOW_OFFSET := 0xdffffc0000000000

To keep things simple for x86, can you not just define:

KASAN_SHADOW_OFFSET := $(CONFIG_KASAN_SHADOW_OFFSET)

or, even better, in scripts/Makefile.kasan:

KASAN_SHADOW_OFFSET ?= $(CONFIG_KASAN_SHADOW_OFFSET)

and set it under arch/arm64/Makefile only.

-- 
Catalin



More information about the linux-arm-kernel mailing list