]> www.infradead.org Git - users/jedix/linux-maple.git/commit
x86, kasan: Fix build failure on KASAN=y && KMEMCHECK=y kernels
authorAndrey Ryabinin <aryabinin@virtuozzo.com>
Fri, 16 Oct 2015 11:28:53 +0000 (14:28 +0300)
committerAllen Pais <allen.pais@oracle.com>
Tue, 26 Dec 2017 03:59:30 +0000 (09:29 +0530)
commit0e5830d2b76a620bdcc6855edb726a7217c98eea
tree371c9bec01b0e91983ac4ba817f0d769b0a24c4a
parente75871e4a0d4d17421a68b9b0a1c81b546c08c07
x86, kasan: Fix build failure on KASAN=y && KMEMCHECK=y kernels

Declaration of memcpy() is hidden under #ifndef CONFIG_KMEMCHECK.
In asm/efi.h under #ifdef CONFIG_KASAN we #undef memcpy(), due to
which the following happens:

  In file included from arch/x86/kernel/setup.c:96:0:
  ./arch/x86/include/asm/desc.h: In function â\80\98native_write_idt_entryâ\80\99:
  ./arch/x86/include/asm/desc.h:122:2: error: implicit declaration of function â\80\98memcpyâ\80\99 [-Werror=implicit-function-declaration]   memcpy(&idt[entry], gate, sizeof(*gate));
    ^
    cc1: some warnings being treated as errors
    make[2]: *** [arch/x86/kernel/setup.o] Error 1

We will get rid of that #undef in asm/efi.h eventually.
But in the meanwhile move memcpy() declaration out of #ifdefs
to fix the build.

Reported-by: Borislav Petkov <bp@alien8.de>
Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/1444994933-28328-1-git-send-email-aryabinin@virtuozzo.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
(cherry picked from commit a75ca545e8d57473da47ece828ad98a10727ec6f)

Orabug: 27132235

Signed-off-by: Gayatri Vasudevan <gayatri.vasudevan@oracle.com>
Reviewed-by: John Haxby <john.haxby@oracle.com>
Acked-by: HÃ¥kon Bugge <haakon.bugge@oracle.com>
Acked-by: Girish Moodalbail <girish.moodalbail@oracle.com>
arch/x86/include/asm/string_64.h