Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1713696

Re: [PATCHv4 09/14] x86/mm: Handle boot-time paging mode switching at early boot

From Ingo Molnar <mingo@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCHv4 09/14] x86/mm: Handle boot-time paging mode switching at early boot
Date 2017-08-17 11:10 +0200
Message-ID <ufoYr-2Kf-61@gated-at.bofh.it> (permalink)
References <ucch3-8wk-3@gated-at.bofh.it> <ucch5-8wk-27@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


* Kirill A. Shutemov <kirill.shutemov@linux.intel.com> wrote:

>  	/* Prepare to add new identity pagetables on demand. */
> diff --git a/arch/x86/entry/entry_64.S b/arch/x86/entry/entry_64.S
> index daf8936d0628..077e8b45784c 100644
> --- a/arch/x86/entry/entry_64.S
> +++ b/arch/x86/entry/entry_64.S
> @@ -273,8 +273,20 @@ return_from_SYSCALL_64:
>  	 * Change top bits to match most significant bit (47th or 56th bit
>  	 * depending on paging mode) in the address.
>  	 */
> +#ifdef CONFIG_X86_5LEVEL
> +	testl	$1, p4d_folded(%rip)
> +	jnz	1f
> +	shl	$(64 - 57), %rcx
> +	sar	$(64 - 57), %rcx
> +	jmp	2f
> +1:
> +	shl	$(64 - 48), %rcx
> +	sar	$(64 - 48), %rcx
> +2:
> +#else
>  	shl	$(64 - (__VIRTUAL_MASK_SHIFT+1)), %rcx
>  	sar	$(64 - (__VIRTUAL_MASK_SHIFT+1)), %rcx
> +#endif

So I really, really hate this change, as it slows down everything, not just LA57 
hardware, and slows down a critical system call hot path. (I expect enterprise 
distros to enable CONFIG_X86_5LEVEL.)

Could this use alternatives patching instead?

Thanks,

	Ingo

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

Re: [PATCHv4 09/14] x86/mm: Handle boot-time paging mode switching  at early boot Ingo Molnar <mingo@kernel.org> - 2017-08-17 11:10 +0200

csiph-web