All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 00/11] x86: Refactor and consolidate startup code
@ 2025-04-10 13:41 Ard Biesheuvel
  2025-04-10 13:41 ` [PATCH v4 01/11] x86/asm: Make rip_rel_ptr() usable from fPIC code Ard Biesheuvel
                   ` (11 more replies)
  0 siblings, 12 replies; 26+ messages in thread
From: Ard Biesheuvel @ 2025-04-10 13:41 UTC (permalink / raw)
  To: linux-efi
  Cc: x86, mingo, linux-kernel, Ard Biesheuvel, Tom Lendacky,
	Dionna Amalie Glaze, Kevin Loughlin

From: Ard Biesheuvel <ardb@kernel.org>

!! NOTE: patches #7 - #10 depend on [0] !!

Reorganize C code that is used during early boot, either in the
decompressor/EFI stub or the kernel proper, but before the kernel
virtual mapping is up.

v4:
- drop patches that were queued up
- fix address space error in patch #1
- add patches for SEV-SNP boot code - these cannot be applied yet, but
  are included for completeness

v3:
- keep rip_rel_ptr() around in PIC code - sadly, it is still needed in
  some cases
- remove RIP_REL_REF() uses in separate patches
- keep __head annotations for now, they will all be removed later
- disable objtool validation for library objects (i.e., pieces that are
  not linked into vmlinux)

I will follow up with a series that gets rid of .head.text altogether,
as it will no longer be needed at all once the startup code is checked
for absolute relocations.

Cc: Tom Lendacky <thomas.lendacky@amd.com>
Cc: Dionna Amalie Glaze <dionnaglaze@google.com>
Cc: Kevin Loughlin <kevinloughlin@google.com>

[0] https://lore.kernel.org/all/20250410132850.3708703-2-ardb+git@google.com/T/#u

Ard Biesheuvel (11):
  x86/asm: Make rip_rel_ptr() usable from fPIC code
  x86/boot: Move the early GDT/IDT setup code into startup/
  x86/boot: Move early kernel mapping code into startup/
  x86/boot: Drop RIP_REL_REF() uses from early mapping code
  x86/boot: Move early SME init code into startup/
  x86/boot: Drop RIP_REL_REF() uses from SME startup code
  x86/sev: Prepare for splitting off early SEV code
  x86/sev: Split off startup code from core code
  x86/boot: Move SEV startup code into startup/
  x86/boot: Drop RIP_REL_REF() uses from early SEV code
  x86/asm: Retire RIP_REL_REF()

 arch/x86/boot/compressed/Makefile                          |    2 +-
 arch/x86/boot/compressed/sev.c                             |   17 +-
 arch/x86/boot/startup/Makefile                             |   16 +
 arch/x86/boot/startup/gdt_idt.c                            |   84 +
 arch/x86/boot/startup/map_kernel.c                         |  225 +++
 arch/x86/{coco/sev/shared.c => boot/startup/sev-shared.c}  |  375 +----
 arch/x86/boot/startup/sev-startup.c                        | 1395 ++++++++++++++++
 arch/x86/{mm/mem_encrypt_identity.c => boot/startup/sme.c} |   19 +-
 arch/x86/coco/sev/Makefile                                 |   19 -
 arch/x86/coco/sev/core.c                                   | 1726 ++++----------------
 arch/x86/include/asm/asm.h                                 |    5 -
 arch/x86/include/asm/coco.h                                |    2 +-
 arch/x86/include/asm/mem_encrypt.h                         |    2 +-
 arch/x86/include/asm/sev-internal.h                        |  112 ++
 arch/x86/include/asm/sev.h                                 |   37 +
 arch/x86/kernel/head64.c                                   |  285 +---
 arch/x86/mm/Makefile                                       |    6 -
 17 files changed, 2208 insertions(+), 2119 deletions(-)
 create mode 100644 arch/x86/boot/startup/gdt_idt.c
 create mode 100644 arch/x86/boot/startup/map_kernel.c
 rename arch/x86/{coco/sev/shared.c => boot/startup/sev-shared.c} (78%)
 create mode 100644 arch/x86/boot/startup/sev-startup.c
 rename arch/x86/{mm/mem_encrypt_identity.c => boot/startup/sme.c} (97%)
 create mode 100644 arch/x86/include/asm/sev-internal.h

-- 
2.49.0.504.g3bcea36a83-goog


^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2025-04-12 20:50 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-10 13:41 [PATCH v4 00/11] x86: Refactor and consolidate startup code Ard Biesheuvel
2025-04-10 13:41 ` [PATCH v4 01/11] x86/asm: Make rip_rel_ptr() usable from fPIC code Ard Biesheuvel
2025-04-12 14:33   ` [tip: x86/boot] " tip-bot2 for Ard Biesheuvel
2025-04-10 13:41 ` [PATCH v4 02/11] x86/boot: Move the early GDT/IDT setup code into startup/ Ard Biesheuvel
2025-04-12 14:33   ` [tip: x86/boot] " tip-bot2 for Ard Biesheuvel
2025-04-10 13:41 ` [PATCH v4 03/11] x86/boot: Move early kernel mapping " Ard Biesheuvel
2025-04-12 14:33   ` [tip: x86/boot] " tip-bot2 for Ard Biesheuvel
2025-04-10 13:41 ` [PATCH v4 04/11] x86/boot: Drop RIP_REL_REF() uses from early mapping code Ard Biesheuvel
2025-04-12 14:33   ` [tip: x86/boot] " tip-bot2 for Ard Biesheuvel
2025-04-10 13:41 ` [PATCH v4 05/11] x86/boot: Move early SME init code into startup/ Ard Biesheuvel
2025-04-12 14:33   ` [tip: x86/boot] " tip-bot2 for Ard Biesheuvel
2025-04-10 13:41 ` [PATCH v4 06/11] x86/boot: Drop RIP_REL_REF() uses from SME startup code Ard Biesheuvel
2025-04-12 14:33   ` [tip: x86/boot] " tip-bot2 for Ard Biesheuvel
2025-04-10 13:41 ` [PATCH v4 07/11] x86/sev: Prepare for splitting off early SEV code Ard Biesheuvel
2025-04-12 14:33   ` [tip: x86/boot] " tip-bot2 for Ard Biesheuvel
2025-04-10 13:41 ` [PATCH v4 08/11] x86/sev: Split off startup code from core code Ard Biesheuvel
2025-04-11 21:46   ` kernel test robot
2025-04-12 12:23   ` Ingo Molnar
2025-04-12 18:47     ` Ingo Molnar
2025-04-12 20:08       ` Ingo Molnar
2025-04-12 20:24         ` Ard Biesheuvel
2025-04-12 20:50           ` Ingo Molnar
2025-04-10 13:41 ` [PATCH v4 09/11] x86/boot: Move SEV startup code into startup/ Ard Biesheuvel
2025-04-10 13:41 ` [PATCH v4 10/11] x86/boot: Drop RIP_REL_REF() uses from early SEV code Ard Biesheuvel
2025-04-10 13:41 ` [PATCH v4 11/11] x86/asm: Retire RIP_REL_REF() Ard Biesheuvel
2025-04-11 19:15 ` [PATCH v4 00/11] x86: Refactor and consolidate startup code Borislav Petkov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.