Re: [PATCHv3 13/13] x86/mm: Offset boot-time paging mode switching cost

From: Andi Kleen
Date: Mon Aug 07 2017 - 11:54:51 EST


> diff --git a/arch/x86/entry/entry_64.S b/arch/x86/entry/entry_64.S
> index 077e8b45784c..6f92e61d35ac 100644
> --- a/arch/x86/entry/entry_64.S
> +++ b/arch/x86/entry/entry_64.S
> @@ -274,7 +274,7 @@ return_from_SYSCALL_64:
> * depending on paging mode) in the address.
> */
> #ifdef CONFIG_X86_5LEVEL
> - testl $1, p4d_folded(%rip)
> + testl $1, __p4d_folded(%rip)
> jnz 1f


You can use

ALTERNATIVE "", "jmp 1f", X86_FEATURE_LA57

to do the patching.

-Andi