From: Avi Kivity Date: Wed, 22 Aug 2012 10:03:48 +0000 (+0300) Subject: x86/alternatives: Fix p6 nops on non-modular kernels X-Git-Tag: v3.2.31~43 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=943df77ba7b5f75e16bf47678146fb0c2af5ef70;p=karo-tx-linux.git x86/alternatives: Fix p6 nops on non-modular kernels commit cb09cad44f07044d9810f18f6f9a6a6f3771f979 upstream. Probably a leftover from the early days of self-patching, p6nops are marked __initconst_or_module, which causes them to be discarded in a non-modular kernel. If something later triggers patching, it will overwrite kernel code with garbage. Reported-by: Tomas Racek Signed-off-by: Avi Kivity Cc: Michael Tokarev Cc: Borislav Petkov Cc: Marcelo Tosatti Cc: qemu-devel@nongnu.org Cc: Anthony Liguori Cc: H. Peter Anvin Cc: Alan Cox Cc: Alan Cox Link: http://lkml.kernel.org/r/5034AE84.90708@redhat.com Signed-off-by: Ingo Molnar Signed-off-by: Ben Hutchings --- diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c index 73ef56c5a8b3..bda833c5f6ce 100644 --- a/arch/x86/kernel/alternative.c +++ b/arch/x86/kernel/alternative.c @@ -160,7 +160,7 @@ static const unsigned char * const k7_nops[ASM_NOP_MAX+2] = #endif #ifdef P6_NOP1 -static const unsigned char __initconst_or_module p6nops[] = +static const unsigned char p6nops[] = { P6_NOP1, P6_NOP2,