x86/efi: Re-enable memory attributes table for kexec
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest5 patches 8 repliesIn review
- v15 patches 5 repliesSuperseded
Changes in v2 from the cover letter
- Sanity check the descriptor size and entry count individually: this prevents integer overflow, and avoid noisy diagnostics when using kexec_load(), which reconstructs the EFI memory map using a different descriptor size.
- Apply Gregory's Rb to patch #1 (but not patch #1)
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/5 | efi/memattr: Fix thinko in table size sanity checkdrivers/ | +28 | 3 replies | |
| 2/5 | x86/efi: Gather initial memory reservation and table handling logicarch/ arch/ arch/ | +17 | 2 replies | |
| 3/5 | x86/efi: Defer the call to efi_memattr_init()arch/ drivers/ | +3 | 1 reply | |
| 4/5 | efi: Use efi_mem_reserve() to reserve the memory attribute tabledrivers/ | +1 | 2 replies | |
| 5/5 | x86/efi: Drop kexec quirk for the EFI memory attributes tablearch/ | +0 | 0 replies |
Reviews trailers per patch
4 of 5 patches have a Reviewed-by or Acked-by.
| Patch | Gregory Price | Breno Leitao |
|---|---|---|
| 1/5 | R-b | |
| 2/5 | R-b | R-b |
| 3/5 | R-b | |
| 4/5 | R-b | |
| 5/5 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v2 0/5] x86/efi: Re-enable memory attributes table for kexec
From: Ard Biesheuvel <[email protected]>
The EFI memory attributes table augments the EFI memory map, and provides permission attributes for all runtime code and data regions that are otherwise mapped read-write-execute in their entirety.
Currently, this table is disregarded when doing kexec boot on x86, for two reasons:
- the boot services data region that holds the table is not reserved correctly, and may contain garbage at kexec time
- a misguided sanity check on the size of the table is likely to trigger on kexec, as the EFI memory map has been trimmed down by that time.
Fix both issues, so that the EFI memory attributes table can be taken into account again at kexec time. Note that this requires that the call to efi_memattr_init() is moved to a later point for x86.
Changes since v1:
- Sanity check the descriptor size and entry count individually: this prevents integer overflow, and avoid noisy diagnostics when using kexec_load(), which reconstructs the EFI memory map using a different descriptor size.
- Apply Gregory's Rb to patch #1 (but not patch #1)
I'd like to take this through the EFI tree as a whole, or take the first patch now (which is a fix) and leave the rest for -tip during the next cycle. (Patches #3 and #4 should be queued together in any case)
Ard Biesheuvel (5):
efi/memattr: Fix thinko in table size sanity check x86/efi: Gather initial memory reservation and table handling logic x86/efi: Defer the call to efi_memattr_init()
efi: Use efi_mem_reserve() to reserve the memory attribute table x86/efi: Drop kexec quirk for the EFI memory attributes table
arch/x86/include/asm/efi.h | 5 +-- arch/x86/kernel/setup.c | 11 +----- arch/x86/platform/efi/efi.c | 15 ++++++++ arch/x86/platform/efi/quirks.c | 4 -- drivers/firmware/efi/efi.c | 2 +- drivers/firmware/efi/memattr.c | 39 +++++++++++++++----- 6 files changed, 49 insertions(+), 27 deletions(-)
base-commit: d0c3bcd5b8976159d835a897254048e078f447e6
Signature · 1 line
2.53.0.1118.gaef5881109-goog