Skip to content

x86/boot: Early boot cleanups

Brian Gerst lkml 2 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest5 patches 0 repliesNew
  2. v15 patches 11 repliesSuperseded

Changes in v2 from the cover letter

- Use sizeof(*boot_params) (Tom Lendacky)
- Always clear decrypted BSS section even if encryption is not active (Tom Lendacky)

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5x86/sme: Clear decrypted BSS separatelyarch/x86/kernel/vmlinux.lds.S arch/x86/mm/mem_encrypt_amd.c+5 -10 replies
2/5x86/boot/64: Clear BSS as early as possiblearch/x86/include/asm/setup.h arch/x86/kernel/head64.c arch/x86/kernel/head_64.S +2 more+24 -170 replies
3/5x86/boot: Remove hardcoded boot_param constantsarch/x86/include/asm/setup.h arch/x86/kernel/asm-offsets.c arch/x86/kernel/head_32.S +1 more+7 -80 replies
4/5x86/boot/64: Remove copy_bootdata() callarch/x86/include/asm/setup.h arch/x86/kernel/head64.c arch/x86/xen/enlighten_pv.c+4 -80 replies
5/5x86/boot/64: Copy boot parameters and command line earlierarch/x86/boot/startup/map_kernel.c arch/x86/boot/startup/sme.c arch/x86/include/asm/mem_encrypt.h +7 more+37 -1300 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/5] x86/boot: Early boot cleanups

This series moves clearing BSS and copying boot parameters and the command line to the early boot code. Clearing BSS early prevents using unitialized data making the code more robust. Copying the boot parameters early simplifies the code by not needing to pass around the orignal source pointer and does not need special handling when encryption is enabled.

v2 changes:
- Use sizeof(*boot_params) (Tom Lendacky)
- Always clear decrypted BSS section even if encryption is not active (Tom Lendacky)

Brian Gerst (5):
x86/sme: Clear decrypted BSS separately x86/boot/64: Clear BSS as early as possible x86/boot: Remove hardcoded boot_param constants x86/boot/64: Remove copy_bootdata() call x86/boot/64: Copy boot parameters and command line earlier

 arch/x86/boot/startup/map_kernel.c      | 10 ++--
 arch/x86/boot/startup/sme.c             |  6 ++-
 arch/x86/include/asm/mem_encrypt.h      | 14 ++----
 arch/x86/include/asm/setup.h            | 11 ++---
 arch/x86/kernel/asm-offsets.c           |  3 ++
 arch/x86/kernel/head64.c                | 61 ++---------------------
 arch/x86/kernel/head_32.S               |  4 +-
 arch/x86/kernel/head_64.S               | 47 ++++++++++++++----
 arch/x86/kernel/setup.c                 |  1 +
 arch/x86/kernel/smpboot.c               |  2 +-
 arch/x86/kernel/vmlinux.lds.S           |  2 +-
 arch/x86/mm/mem_encrypt_amd.c           | 65 ++-----------------------
 arch/x86/xen/enlighten_pv.c             |  4 +-
 arch/x86/xen/xen-head.S                 |  5 +-
 drivers/firmware/efi/libstub/x86-stub.c |  6 +--
 15 files changed, 77 insertions(+), 164 deletions(-)

base-commit: e811152a1de6a33cf5a933770821477757f69f99

Signature · 1 line
2.55.0