Skip to content

x86/boot: Clean up handling of boot_params pointer

Brian Gerst lkml 2 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest6 patches 0 repliesNew
  2. v11 patch 2 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6x86/boot: Move sanitize_boot_params()arch/x86/kernel/head64.c+2 -10 replies
2/6x86/boot: Remove extra call to copy_bootdata()arch/x86/include/asm/setup.h arch/x86/kernel/head64.c arch/x86/xen/enlighten_pv.c+4 -80 replies
3/6x86/boot: Clean up get_cmd_line_ptr()arch/x86/kernel/head64.c+8 -110 replies
4/6x86/boot: Move copy_bootdata() to very early boot.arch/x86/include/asm/setup.h arch/x86/kernel/head64.c arch/x86/kernel/head_64.S +2 more+19 -980 replies
5/6x86/boot: Use copied boot data in __startup_64()arch/x86/include/asm/setup.h arch/x86/kernel/head64.c arch/x86/kernel/head_64.S+3 -50 replies
6/6x86/boot: Use copied boot data in sme_enable()arch/x86/include/asm/mem_encrypt.h arch/x86/kernel/head_64.S arch/x86/mm/mem_encrypt_identity.c+26 -280 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/6] x86/boot: Clean up handling of boot_params pointer

On entry from the bootloader, RSI contains the pointer to the boot_params data structure. The pointer is passed to x86_64_start_kernel(), which requires preserving RSI all the way though the early boot asm code. Change it to copy the boot_params data as soon as possible, which also has the benefit of not needing to remap the real mode data pages if memory encryption is enabled.

Note: The memory encryption changes are untested due to lack of hardware.

Brian Gerst (6):
x86/boot: Move sanitize_boot_params() x86/boot: Remove extra call to copy_bootdata() x86/boot: Clean up get_cmd_line_ptr() x86/boot: Move copy_bootdata() to very early boot. x86/boot: Use copied boot data in __startup_64() x86/boot: Use copied boot data in sme_enable()

 arch/x86/include/asm/mem_encrypt.h |  4 +-
 arch/x86/include/asm/setup.h       |  9 +++--
 arch/x86/kernel/head64.c           | 59 ++++++++++-------------------
 arch/x86/kernel/head_64.S          | 26 +++----------
 arch/x86/kernel/setup.c            |  2 +-
 arch/x86/mm/mem_encrypt_amd.c      | 61 ------------------------------
 arch/x86/mm/mem_encrypt_identity.c | 42 ++++++++++----------
 arch/x86/xen/enlighten_pv.c        |  2 +-
 8 files changed, 58 insertions(+), 147 deletions(-)
Signature · 1 line
2.39.2