Re: [PATCH 19/22] x86/tboot: mark tboot_mm as a kernel mm

Dave Hansen <[email protected]> Tue, 14 Jul 2026 08:19:51 -0700
Newsgroups gmane.linux.ports.ppc64.devel,gmane.linux.kernel.mm,gmane.linux.ports.arm.kernel,gmane.linux.ports.parisc,gmane.linux.ports.riscv,gmane.linux.ports.sparc,gmane.linux.uml.devel,gmane.comp.boot-loaders.tboot.devel,gmane.linux.kernel.efi,gmane.linux.kernel,gmane.linux.kernel.cross-arch
Message-ID <[email protected]>
On 7/14/26 07:04, Kevin Brodsky wrote:
> tboot_mm is a kernel-owned address space used to build the
> identity map for tboot shutdown. Mark it with MMF_KERNEL so
> page table allocation and initialisation code treats its page tables
> as kernel page tables.
> 
> Having marked tboot_mm as a kernel mm, we also need to convert
> pte_alloc_map() (user PTE) to pte_alloc_kernel() (kernel PTE), and
> drop the matching pte_unmap().

This makes me wonder whether MMF_KERNEL is the right way to mark these mms.

I think this series tries to cram too much into that one bit.

Using MMF_KERNEL to drive the page table accounting seems like a good
idea. It also seems like a good thing to make sure that those mm's don't
ever exit to userspace, for instance.

But I think it goes a step too far to say that all the special 'init_mm'
TLB flushing should also be common among all MMF_KERNEL mms.

My suggestion for now would be to just go after the page table
accounting alone. Don't mechanically replace mm==&mm_init checks.