2024-05-13 06:51:48

by Ingo Molnar

[permalink] [raw]
Subject: [GIT PULL] x86/boot changes for v6.10

Linus,

Please pull the latest x86/boot Git tree from:

git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86-boot-2024-05-13

# HEAD: a0025f587c685e5ff842fb0194036f2ca0b6eaf4 x86/boot/64: Clear most of CR4 in startup_64(), except PAE, MCE and LA57

x86/boot changes for v6.10:

- Move the kernel cmdline setup earlier in the boot process (again),
to address a split_lock_detect= boot parameter bug.

- Ignore relocations in .notes sections

- Simplify boot stack setup

- Re-introduce a bootloader quirk wrt. CR4 handling

- Miscellaneous cleanups & fixes

Thanks,

Ingo

------------------>
Ard Biesheuvel (1):
x86/boot/64: Clear most of CR4 in startup_64(), except PAE, MCE and LA57

Brian Gerst (1):
x86/boot: Simplify boot stack setup

Guixiong Wei (1):
x86/boot: Ignore relocations in .notes sections in walk_relocs() too

Ingo Molnar (1):
x86/build: Clean up arch/x86/tools/relocs.c a bit

Julian Stecklina (1):
x86/boot: Move kernel cmdline setup earlier in the boot process (again)

Xin Li (Intel) (1):
x86: Rename __{start,end}_init_task to __{start,end}_init_stack


arch/x86/boot/compressed/head_64.S | 5 +
arch/x86/include/asm/processor.h | 6 +-
arch/x86/kernel/head_32.S | 11 +-
arch/x86/kernel/head_64.S | 2 +-
arch/x86/kernel/setup.c | 32 ++--
arch/x86/kernel/vmlinux.lds.S | 3 +
arch/x86/tools/relocs.c | 371 +++++++++++++++++++------------------
arch/x86/xen/xen-head.S | 2 +-
include/asm-generic/vmlinux.lds.h | 6 +-
9 files changed, 219 insertions(+), 219 deletions(-)


2024-05-14 01:03:27

by Linus Torvalds

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

On Sun, 12 May 2024 at 23:51, Ingo Molnar <[email protected]> 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

2024-05-14 02:52:02

by pr-tracker-bot

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

The pull request you sent on Mon, 13 May 2024 08:51:28 +0200:

> git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86-boot-2024-05-13

has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/9d8e0d52a2a4c4ab87da01cb17f15f1ec6cee826

Thank you!

--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/prtracker.html

2024-05-14 07:28:49

by Ard Biesheuvel

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

On Tue, 14 May 2024 at 03:03, Linus Torvalds
<[email protected]> wrote:
>
> On Sun, 12 May 2024 at 23:51, Ingo Molnar <[email protected]> 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?
>

I agree. But not setting CR4 to a known value is what caused the
regression, and that could cause other problems down the road, so
fixing it was arguably more important.

More than happy to send another patch to clear the G bit from the page
table entries created by the decompressor, but at this point, it
shouldn't make a difference.

2024-05-15 08:10:35

by Ingo Molnar

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


* Ard Biesheuvel <[email protected]> wrote:

> On Tue, 14 May 2024 at 03:03, Linus Torvalds
> <[email protected]> wrote:
> >
> > On Sun, 12 May 2024 at 23:51, Ingo Molnar <[email protected]> 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?
> >
>
> I agree. But not setting CR4 to a known value is what caused the
> regression, and that could cause other problems down the road, so
> fixing it was arguably more important.
>
> More than happy to send another patch to clear the G bit from the page
> table entries created by the decompressor, but at this point, it
> shouldn't make a difference.

Please - we shouldn't be creating page table entries with random G bits set
in them. The boot code should at least pretend to maintain the illusion
that it knows what it's doing. ;-)

Thanks,

Ingo