[RFC PATCH] x86/mm: Disable PTI for kernel_ident_mapping_init()

Dave Hansen dave.hansen at intel.com
Mon Nov 25 10:31:13 PST 2024


On 11/25/24 09:05, David Woodhouse wrote:
> Not sure I like this very much, but it works, and mirrors what
> arch/x86/boot/compressed/ident_map_64.c already does.

I don't like it much, either.

arch/x86/boot/compressed/ is already on the road to sharing no code with
the core kernel and it's full of horrors. It should be an example of
what *not* to do. ;)

I think we have a lot of software-available space in the page table
pointer entries. What would folks think if we set a special bit in those
p4d entries that said:

	"I don't need to be propagated to
	the user portion of the page tables."

It would obviously get set in this code that you're trying to fix. It
might _also_ be able to be set in in "_USR", like here:

#define _KERNPG_TABLE_NOENC  (__PP|__RW|   0|___A|   0|___D|   0|   0)
#define _PAGE_TABLE_NOENC    (__PP|__RW|_USR|___A|   0|___D|   0|   0)

like:

#define _USR _PAGE_USER|_PAGE_SW_WHATEVER





More information about the kexec mailing list