[PATCH v2 4/6] efi/libstub: install the poisoned-memory table from the stub

From: Breno Leitao

Date: Fri Aug 21 2026 - 06:16:14 EST


Call install_poisoned_memory_table() while boot services are still up,
so the table exists before the kernel that will flip bits in it runs.

x86 does not go through efi_stub_common(), so the generic stub and the
x86 stub each need the call; on x86 it has to come before exit_boot(),
which is the last point a configuration table can be installed.

Signed-off-by: Breno Leitao <leitao@xxxxxxxxxx>
---
drivers/firmware/efi/libstub/efi-stub.c | 1 +
drivers/firmware/efi/libstub/x86-stub.c | 2 ++
2 files changed, 3 insertions(+)

diff --git a/drivers/firmware/efi/libstub/efi-stub.c b/drivers/firmware/efi/libstub/efi-stub.c
index 42d6073bcd062..008635eb5027a 100644
--- a/drivers/firmware/efi/libstub/efi-stub.c
+++ b/drivers/firmware/efi/libstub/efi-stub.c
@@ -179,6 +179,7 @@ efi_status_t efi_stub_common(efi_handle_t handle,
EFI_RT_SUPPORTED_SET_VIRTUAL_ADDRESS_MAP);

install_memreserve_table();
+ install_poisoned_memory_table();

status = efi_boot_kernel(handle, image, image_addr, cmdline_ptr);

diff --git a/drivers/firmware/efi/libstub/x86-stub.c b/drivers/firmware/efi/libstub/x86-stub.c
index cef32e2c82d8f..f90de11bc8855 100644
--- a/drivers/firmware/efi/libstub/x86-stub.c
+++ b/drivers/firmware/efi/libstub/x86-stub.c
@@ -1023,6 +1023,8 @@ void __noreturn efi_stub_entry(efi_handle_t handle,

setup_unaccepted_memory();

+ install_poisoned_memory_table();
+
status = exit_boot(boot_params, handle);
if (status != EFI_SUCCESS) {
efi_err("exit_boot() failed!\n");

--
2.53.0-Meta