Re: [GIT PULL] x86/boot changes for v6.10

From: Linus Torvalds
Date: Mon May 13 2024 - 21:03:26 EST


On Sun, 12 May 2024 at 23:51, Ingo Molnar <mingo@xxxxxxxxxx> wrote:
>
> - Re-introduce a bootloader quirk wrt. CR4 handling

I've pulled this, but shouldn't the compressed boot also just stop
setting the G flag that it didn't understand?

For example, arch/x86/kernel/head64.c seems to do this:

pmd_entry = __PAGE_KERNEL_LARGE_EXEC & ~_PAGE_GLOBAL;

but arch/x86/boot/compressed/ident_map_64.c does the somewhat suspect

mapping_info.page_flag = __PAGE_KERNEL_LARGE_EXEC | sme_me_mask;

without masking off _PAGE_GLOBAL.

The hibernation code does

pgprot_t pmd_text_prot = __pgprot(__PAGE_KERNEL_LARGE_EXEC);
pgprot_val(pmd_text_prot) &= __default_kernel_pte_mask;

and again there are several situations where __default_kernel_pte_mask
does not have _PAGE_GLOBAL.

So again, the boot/compressed code seems a bit at an odds with other
code paths. The cr4 games seem to work around the fact that this code
is just buggy.

Hmm?

Linus