Makefile: kasan: print warning if compiler doesn't support kasan

Print warning if compiler doesn't support kasan, and continue
build without -fsanitize=kernel-address.

Signed-off-by: Andrey Ryabinin <a.ryabinin@samsung.com>
efi: libstub: disable KASAN for efistub

KASan as many other options should be disabled for this stub
to prevent build failures.

Signed-off-by: Andrey Ryabinin <a.ryabinin@samsung.com>
mm/slab.h: move slub specific stuff to include/linxu/slub_def.h

Signed-off-by: Andrey Ryabinin <a.ryabinin@samsung.com>
x86_64: load_percpu_segment: read irq_stack_union.gs_base before load_segment

Reading irq_stack_union.gs_base after load_segment creates troubles for kasan.
Compiler inserts __asan_load in between load_segment and wrmsrl. If kernel
built with stackprotector this will result in boot failure because __asan_load
has stackprotector.

To avoid this irq_stack_union.gs_base stored to temporary variable before
load_segment, so __asan_load will be called before load_segment().

There are two alternative ways to fix this:
 a) Add __attribute__((no_sanitize_address)) to load_percpu_segment(),
    which tells compiler to not instrument this function. However this
    will result in build failure with CONFIG_KASAN=y and CONFIG_OPTIMIZE_INLINING=y.

 b) Add -fno-stack-protector for mm/kasan/kasan.c

Signed-off-by: Andrey Ryabinin <a.ryabinin@samsung.com>
kasan: Kconfig: fix kconfig dependency.

Kasan requires CONFIG_SLUB_DEBUG to built. Fix it
and update Kconfig help message.

Signed-off-by: Andrey Ryabinin <a.ryabinin@samsung.com>
x86_64: kasan: move shadow to vmalloc area.

Move shadow to vmalloc area. Also map shadow corresponding to shadow
itself with poison page.

Signed-off-by: Andrey Ryabinin <a.ryabinin@samsung.com>
x86_64: kasan: fix kernel boot with CONFIG_DEBUG_VIRTUAL=y

Use __pa_nodebug instead of __pa before shadow initialized.
__pa with CONFIG_DEBUG_VIRTUAL=y may result in __asan_load
call before shadow area initialized.

Signed-off-by: Andrey Ryabinin <a.ryabinin@samsung.com>
kasan: add kasan_ prefix to poison_shadow()/unpoison_shadow()

Since unpoison_shadow() used outside mm/kasan/ it's nice
to add kasan_ prefix to indicate subsystem related to this function.

Signed-off-by: Andrey Ryabinin <a.ryabinin@samsung.com>
kasan: optimize __asan_load*/__asan_store* routines.

Before:
 $ netperf
 MIGRATED TCP STREAM TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to localhost (127.0.0.1) port 0 AF_INET
 Recv   Send    Send
 Socket Socket  Message  Elapsed
 Size   Size    Size     Time     Throughput
 bytes  bytes   bytes    secs.    10^6bits/sec

  87380  16384  16384    10.00    7162.98

After:
 $ netperf
 MIGRATED TCP STREAM TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to localhost (127.0.0.1) port 0 AF_INET
 Recv   Send    Send
 Socket Socket  Message  Elapsed
 Size   Size    Size     Time     Throughput
 bytes  bytes   bytes    secs.    10^6bits/sec

  87380  16384  16384    10.00    13346.68

Signed-off-by: Andrey Ryabinin <a.ryabinin@samsung.com>
Merge pull request #5 from aryabinin/kasan

Misc updates for kasan