Re: [PATCH v2] x86/boot/64/clang: Use fixup_pointer() to access '__supported_pte_mask'

From: Dave Hansen
Date: Tue May 08 2018 - 12:49:46 EST


On 05/08/2018 09:28 AM, Alexander Potapenko wrote:
> Clang builds with defconfig started crashing after 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().

Looks good to me. Thanks for adding the comment, especially!

Reviewed-by: Dave Hansen <dave.hansen@xxxxxxxxx>