Re: [PATCH] x86: mm: Do not use set_{pud,pmd}_safe when splitting the large page

From: Borislav Petkov
Date: Tue Apr 09 2019 - 06:20:30 EST


On Tue, Apr 09, 2019 at 11:39:35AM +0200, Peter Zijlstra wrote:
> unsigned long kernel_physical_mapping_change(unsigned long paddr_start, unsigned
> long paddr_end, unsigned long page_size_mask)

... and add a comment above it what the "_change" thing is supposed to
mean...

> unsigned long last;
>
> last = __kernel_physical_mapping_init(paddr_start, paddr_end, page_size_mask, false);
>
> __flush_tlb_all();

... and maybe not do the flushing here because if you look at
early_set_memory_enc_dec(), it iterates over a bunch of addresses and
when it is done, does the TLB flush once.

If you did it here, then you'd flush after each change. Which is costly.

So maybe the comment above should also say that _change callers are
responsible to flush the TLB after they're done.

--
Regards/Gruss,
Boris.

Good mailing practices for 400: avoid top-posting and trim the reply.