Re: [tip:efi/core] x86/mm/pat: Use _PAGE_GLOBAL bit for EFI page table mappings

From: Andy Lutomirski
Date: Wed Feb 24 2016 - 11:36:57 EST


On Wed, Feb 24, 2016 at 8:20 AM, Borislav Petkov <bp@xxxxxxxxx> wrote:
> On Wed, Feb 24, 2016 at 02:10:46PM +0000, Matt Fleming wrote:
>> > Normally, the only pages with are _PAGE_GLOBAL are those that are in
>> > the normal kernel mappings (swapper_pg_dir and normal mm_struct pgds).
>> > By allowing _PAGE_GLOBAL to be set in EFI mappings, you're breaking
>> > that convention, which forces you to use extra-expensive
>> > __flush_tlb_all calls in efi_call_virt.
>
> Hold on, do you mean the __flush_tlb_all() in the CONFIG_EFI_MIXED code?
>
> That's mixed mode. I think you mean the FLUSH_TLB_ALL in efi_call.
> That's EFI on 64-bit but that is mandated by the spec, AFAIR.

I mean the one in efi_call_virt. Why would the spec mandate a TLB
flush at all? EFI runtime services have no business touching the
paging structures directly. Heck, the 32-bit ones don't even know the
*format* of the paging structures.

>
> So the EFI runtime crap should not change once it is mapped. And those
> should be global. It is only natural.

Why is it natural?

Long-term, I'd rather see EFI runtime services use an actual mm_struct
and use_mm.

--Andy