Take the newly introduced EFI_RT_PROPERTIES_TABLE configuration table into account, which carries a mask of which EFI runtime services are still functional after ExitBootServices() has been called by the OS.
Unified · Split
| @@ -47,6 +47,7 @@ EXPORT_SYMBOL(efi); · 46 unmodified lines | ||
| 47 | 47 | |
| 48 | 48 | static unsigned long __ro_after_init rng_seed = EFI_INVALID_TABLE_ADDR; |
| 49 | 49 | static unsigned long __initdata mem_reserve = EFI_INVALID_TABLE_ADDR; |
| 50 | +static unsigned long __initdata rt_prop = EFI_INVALID_TABLE_ADDR; | |
| 50 | 51 | |
| 51 | 52 | struct mm_struct efi_mm = { |
| 52 | 53 | .mm_rb = RB_ROOT, |
| @@ -449,6 +450,7 @@ static const efi_config_table_type_t common_tables[] __initconst = { · 396 unmodified lines | ||
| 449 | 450 | {LINUX_EFI_TPM_EVENT_LOG_GUID, "TPMEventLog", &efi.tpm_log}, |
| 450 | 451 | {LINUX_EFI_TPM_FINAL_LOG_GUID, "TPMFinalLog", &efi.tpm_final_log}, |
| 451 | 452 | {LINUX_EFI_MEMRESERVE_TABLE_GUID, "MEMRESERVE", &mem_reserve}, |
| 453 | + {EFI_RT_PROPERTIES_TABLE_GUID, "RTPROP", &rt_prop}, | |
| 452 | 454 | #ifdef CONFIG_EFI_RCI2_TABLE |
| 453 | 455 | {DELLEMC_EFI_RCI2_TABLE_GUID, NULL, &rci2_table_phys}, |
| 454 | 456 | #endif |
| @@ -575,6 +577,16 @@ int __init efi_config_parse_tables(const efi_config_table_t *config_tables, · 120 unmodified lines | ||
| 575 | 577 | } |
| 576 | 578 | } |
| 577 | 579 | |
| 580 | + if (rt_prop != EFI_INVALID_TABLE_ADDR) { | |
| 581 | + efi_rt_properties_table_t *tbl; | |
| 582 | + | |
| 583 | + tbl = early_memremap(rt_prop, sizeof(*tbl)); | |
| 584 | + if (tbl) { | |
| 585 | + efi.runtime_supported_mask &= tbl->runtime_services_supported; | |
| 586 | + early_memunmap(tbl, sizeof(*tbl)); | |
| 587 | + } | |
| 588 | + } | |
| 589 | + | |
| 578 | 590 | return 0; |
| 579 | 591 | } |
| 580 | 592 | |
| @@ -334,6 +334,7 @@ void efi_native_runtime_setup(void); · 333 unmodified lines | ||
| 334 | 334 | #define EFI_TCG2_PROTOCOL_GUID EFI_GUID(0x607f766c, 0x7455, 0x42be, 0x93, 0x0b, 0xe4, 0xd7, 0x6d, 0xb2, 0x72, 0x0f) |
| 335 | 335 | #define EFI_LOAD_FILE_PROTOCOL_GUID EFI_GUID(0x56ec3091, 0x954c, 0x11d2, 0x8e, 0x3f, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b) |
| 336 | 336 | #define EFI_LOAD_FILE2_PROTOCOL_GUID EFI_GUID(0x4006c0c1, 0xfcb3, 0x403e, 0x99, 0x6d, 0x4a, 0x6c, 0x87, 0x24, 0xe0, 0x6d) |
| 337 | +#define EFI_RT_PROPERTIES_TABLE_GUID EFI_GUID(0xeb66918a, 0x7eef, 0x402a, 0x84, 0x2e, 0x93, 0x1d, 0x21, 0xc3, 0x8a, 0xe9) | |
| 337 | 338 | |
| 338 | 339 | #define EFI_IMAGE_SECURITY_DATABASE_GUID EFI_GUID(0xd719b2cb, 0x3d3a, 0x4596, 0xa3, 0xbc, 0xda, 0xd0, 0x0e, 0x67, 0x65, 0x6f) |
| 339 | 340 | #define EFI_SHIM_LOCK_GUID EFI_GUID(0x605dab50, 0xe046, 0x4300, 0xab, 0xb6, 0x3d, 0xd8, 0x10, 0xdd, 0x8b, 0x23) |
| @@ -486,6 +487,14 @@ typedef struct { · 146 unmodified lines | ||
| 486 | 487 | #define EFI_PROPERTIES_TABLE_VERSION 0x00010000 |
| 487 | 488 | #define EFI_PROPERTIES_RUNTIME_MEMORY_PROTECTION_NON_EXECUTABLE_PE_DATA 0x1 |
| 488 | 489 | |
| 490 | +typedef struct { | |
| 491 | + u16 version; | |
| 492 | + u16 length; | |
| 493 | + u32 runtime_services_supported; | |
| 494 | +} efi_rt_properties_table_t; | |
| 495 | + | |
| 496 | +#define EFI_RT_PROPERTIES_TABLE_VERSION 0x1 | |
| 497 | + | |
| 489 | 498 | #define EFI_INVALID_TABLE_ADDR (~0UL) |
| 490 | 499 | |
| 491 | 500 | typedef struct { |