]> asedeno.scripts.mit.edu Git - linux.git/commit
x86/boot/64/clang: Use fixup_pointer() to access '__supported_pte_mask'
authorAlexander Potapenko <glider@google.com>
Wed, 9 May 2018 09:18:22 +0000 (11:18 +0200)
committerIngo Molnar <mingo@kernel.org>
Mon, 14 May 2018 09:14:30 +0000 (11:14 +0200)
commit4a09f0210c8b1221aae8afda8bd3a603fece0986
treecaf78773f04aa44afa5a4eba51056a7e247a1b23
parent4fe875e4bd3cae85ae6f6eaf77f63fabe613b66e
x86/boot/64/clang: Use fixup_pointer() to access '__supported_pte_mask'

Clang builds with defconfig started crashing after the following
commit:

  fb43d6cb91ef ("x86/mm: Do not auto-massage page protections")

This was caused by introducing a new global access in __startup_64().

Code in __startup_64() can be relocated during execution, but the compiler
doesn't have to generate PC-relative relocations when accessing globals
from that function. Clang actually does not generate them, which leads
to boot-time crashes. To work around this problem, every global pointer
must be adjusted using fixup_pointer().

Signed-off-by: Alexander Potapenko <glider@google.com>
Reviewed-by: Dave Hansen <dave.hansen@intel.com>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: dvyukov@google.com
Cc: kirill.shutemov@linux.intel.com
Cc: linux-mm@kvack.org
Cc: md@google.com
Cc: mka@chromium.org
Fixes: fb43d6cb91ef ("x86/mm: Do not auto-massage page protections")
Link: http://lkml.kernel.org/r/20180509091822.191810-1-glider@google.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/x86/kernel/head64.c