Skip to content

ESRT fixes for relocatable kexec'd kernel

Tyler Baicar linux-efi lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 19 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2efi/esrt: fix unsupported version initialization failuredrivers/firmware/efi/esrt.c+1 -15 replies
2/2efi/esrt: mark ESRT memory region as nomapdrivers/firmware/efi/esrt.c+8 -04 replies

Reviews trailers per patch

1 of 2 patches has a Reviewed-by or Acked-by.

PatchJeffrey HugoDave YoungTyler Baicar
SeriesT-b
1/2R-b
2/2T-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v1 thread

Cover letter [PATCH 0/2] ESRT fixes for relocatable kexec'd kernel

Currently on arm64 ESRT memory does not appear to be properly blocked off. Upon successful initialization, ESRT prints out the memory region that it exists in like:

esrt: Reserving ESRT space from 0x000000000a4c1c18 to 0x000000000a4c1cf0.

But then by dumping /proc/iomem this region appears as part of System RAM rather than being reserved:

08f10000-0deeffff : System RAM

This causes issues when trying to kexec if the kernel is relocatable. When kexec tries to execute, this memory can be selected to relocate the kernel to which then overwrites all the ESRT information. Then when the kexec'd kernel tries to initialize ESRT, it doesn't recognize the ESRT version number and just returns from efi_esrt_init(). This causes an early ioremap leak because the memory allocated for 'va' is never unmapped. So first fix that error case to properly unmap 'va' before returning.

This still leaves ESRT unable to initialize in the kexec'd kernel, so now mark the ESRT memory block as nomap so that this memory is not treated as System RAM. With this change I'm able to see that the ESRT data is not overwritten when running a kexec'd kernel.

Tyler Baicar (2):
efi/esrt: fix unsupported version initialization failure efi/esrt: mark ESRT memory region as nomap

 drivers/firmware/efi/esrt.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
Signature · 3 lines
Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm Technologies, Inc.
Qualcomm Technologies, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project.