diff options
author | Ard Biesheuvel <ard.biesheuvel@linaro.org> | 2015-09-23 10:29:34 -0400 |
---|---|---|
committer | Matt Fleming <matt.fleming@intel.com> | 2015-10-12 09:20:07 -0400 |
commit | a1041713349d0b823b492d7b4ea4325d0b5666db (patch) | |
tree | f55fd0b6c63da4d6b96e88262b013c04ea86f193 /drivers/firmware/efi | |
parent | bf924863c9445174c6e118f723dc477e2b6ccc7e (diff) |
efi: Introduce EFI_NX_PE_DATA bit and set it from properties table
UEFI v2.5 introduces a runtime memory protection feature that splits
PE/COFF runtime images into separate code and data regions. Since this
may require special handling by the OS, allocate a EFI_xxx bit to
keep track of whether this feature is currently active or not.
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Diffstat (limited to 'drivers/firmware/efi')
-rw-r--r-- | drivers/firmware/efi/efi.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/firmware/efi/efi.c b/drivers/firmware/efi/efi.c index c297d78f50fd..31fc864eb037 100644 --- a/drivers/firmware/efi/efi.c +++ b/drivers/firmware/efi/efi.c | |||
@@ -426,6 +426,24 @@ int __init efi_config_parse_tables(void *config_tables, int count, int sz, | |||
426 | } | 426 | } |
427 | pr_cont("\n"); | 427 | pr_cont("\n"); |
428 | set_bit(EFI_CONFIG_TABLES, &efi.flags); | 428 | set_bit(EFI_CONFIG_TABLES, &efi.flags); |
429 | |||
430 | /* Parse the EFI Properties table if it exists */ | ||
431 | if (efi.properties_table != EFI_INVALID_TABLE_ADDR) { | ||
432 | efi_properties_table_t *tbl; | ||
433 | |||
434 | tbl = early_memremap(efi.properties_table, sizeof(*tbl)); | ||
435 | if (tbl == NULL) { | ||
436 | pr_err("Could not map Properties table!\n"); | ||
437 | return -ENOMEM; | ||
438 | } | ||
439 | |||
440 | if (tbl->memory_protection_attribute & | ||
441 | EFI_PROPERTIES_RUNTIME_MEMORY_PROTECTION_NON_EXECUTABLE_PE_DATA) | ||
442 | set_bit(EFI_NX_PE_DATA, &efi.flags); | ||
443 | |||
444 | early_memunmap(tbl, sizeof(*tbl)); | ||
445 | } | ||
446 | |||
429 | return 0; | 447 | return 0; |
430 | } | 448 | } |
431 | 449 | ||