[GIT PULL] x86/boot changes for v6.9

From: Ingo Molnar
Date: Tue Mar 12 2024 - 05:47:03 EST


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-03-12

# HEAD: 2e2bc42c8381d2c0e9604b59e49264821da29368 Merge branch 'linus' into x86/boot, to resolve conflict

x86/boot changes for v6.9:

- Continuing work by Ard Biesheuvel to improve the x86 early startup code,
with the long-term goal to make it position independent:

- Get rid of early accesses to global objects, either by moving them
to the stack, deferring the access until later, or dropping the
globals entirely.

- Move all code that runs early via the 1:1 mapping into .head.text,
and move code that does not out of it, so that build time checks can
be added later to ensure that no inadvertent absolute references were
emitted into code that does not tolerate them.

- Remove fixup_pointer() and occurrences of __pa_symbol(), which rely
on the compiler emitting absolute references, which is not guaranteed.

- Improve the early console code.

- Add early console message about ignored NMIs, so that users are at least
warned about their existence - even if we cannot do anything about them.

- Improve the kexec code's kernel load address handling.

- Enable more X86S (simplified x86) bits.

- Simplify early boot GDT handling

- Micro-optimize the boot code a bit

- Misc cleanups.

MERGE NOTES:

As discussed in the x86/sev pull request thread on lkml, your smart-merge
of arch/x86/include/asm/coco.h via x86/sev in:

38b334fc767e Merge tag 'x86_sev_for_v6.9_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

.. conflicts with pending changes in x86/boot, which internally merged
x86/sev as well but used a different (and worse) resolution.

See the details in merge commit 38b334fc767e, which picks your better
resolution and explains the background. Please merge x86-boot-2024-03-12~1
if you'd like to do the conflict merge resolution yourself.

Thanks,

Ingo

------------------>
Ard Biesheuvel (16):
x86/startup_64: Drop long return to initial_code pointer
x86/boot/64: Simplify global variable accesses in GDT/IDT programming
x86/boot/64: Use RIP_REL_REF() to assign 'phys_base'
x86/boot/64: Use RIP_REL_REF() to access early_dynamic_pgts[]
x86/boot/64: Use RIP_REL_REF() to access '__supported_pte_mask'
x86/boot/64: Use RIP_REL_REF() to access early page tables
x86/boot/64: Use RIP_REL_REF() to access early_top_pgt[]
efi/x86: Set the PE/COFF header's NX compat flag unconditionally
x86/startup_64: Simplify CR4 handling in startup code
x86/startup_64: Defer assignment of 5-level paging global variables
x86/startup_64: Simplify calculation of initial page table address
x86/startup_64: Simplify virtual switch on primary boot
efi/libstub: Add generic support for parsing mem_encrypt=
x86/boot: Move mem_encrypt= parsing to the decompressor
x86/sme: Move early SME kernel encryption handling into .head.text
x86/sev: Move early startup code into .head.text section

Brian Gerst (1):
x86/boot/64: Load the final kernel GDT during early boot directly, remove startup_gdt[]

Chris Koch (1):
kexec: Allocate kernel above bzImage's pref_address

H. Peter Anvin (1):
x86/boot: Add error_putdec() helper

Kirill A. Shutemov (1):
x86/trampoline: Bypass compat mode in trampoline_start64() if not needed

NOMURA JUNICHI(野村 淳一) (1):
x86/boot: Add a message about ignored early NMIs

Uros Bizjak (1):
x86/boot: Use 32-bit XOR to clear registers


Documentation/arch/x86/boot.rst | 3 +-
arch/x86/Kconfig | 10 +-
arch/x86/boot/compressed/ident_map_64.c | 2 +-
arch/x86/boot/compressed/misc.c | 59 ++++++--
arch/x86/boot/compressed/misc.h | 3 +
arch/x86/boot/compressed/sev.c | 3 +
arch/x86/boot/header.S | 4 -
arch/x86/include/asm/desc.h | 1 +
arch/x86/include/asm/mem_encrypt.h | 8 +-
arch/x86/include/asm/pgtable_64_types.h | 2 +-
arch/x86/include/asm/setup.h | 2 +-
arch/x86/include/asm/sev.h | 10 +-
arch/x86/include/uapi/asm/bootparam.h | 1 +
arch/x86/kernel/head64.c | 179 +++++++++----------------
arch/x86/kernel/head_64.S | 148 ++++++++------------
arch/x86/kernel/kexec-bzimage64.c | 5 +-
arch/x86/kernel/sev-shared.c | 23 ++--
arch/x86/kernel/sev.c | 14 +-
arch/x86/kernel/sev_verify_cbit.S | 2 +-
arch/x86/lib/Makefile | 13 --
arch/x86/mm/mem_encrypt_identity.c | 74 +++-------
arch/x86/realmode/rm/trampoline_64.S | 33 ++++-
drivers/firmware/efi/libstub/efi-stub-helper.c | 8 ++
drivers/firmware/efi/libstub/efistub.h | 2 +-
drivers/firmware/efi/libstub/x86-stub.c | 3 +
25 files changed, 277 insertions(+), 335 deletions(-)