|
| 1 | +From d98e17c06af9126952db516fb2ff6c614efa1dcb Mon Sep 17 00:00:00 2001 |
| 2 | +From: Rajat Goyal <Rajat.Goyal@arm.com> |
| 3 | +Date: Tue, 8 Apr 2025 09:38:34 +0000 |
| 4 | +Subject: [PATCH] SystemReady Linux 6.13 |
| 5 | + |
| 6 | +Signed-off-by: Rajat Goyal <Rajat.Goyal@arm.com> |
| 7 | +Change-Id: I9f5488a91fc531bb9a626893c4edd5d71e7ed159 |
| 8 | +--- |
| 9 | + .../admin-guide/kernel-parameters.txt | 1 + |
| 10 | + .../firmware/efi/libstub/efi-stub-helper.c | 2 ++ |
| 11 | + drivers/firmware/efi/libstub/efistub.h | 1 + |
| 12 | + drivers/firmware/efi/libstub/fdt.c | 21 +++++++++++++++++-- |
| 13 | + 4 files changed, 23 insertions(+), 2 deletions(-) |
| 14 | + |
| 15 | +diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt |
| 16 | +index 3872bc6ec49d..fe35184d28cf 100644 |
| 17 | +--- a/Documentation/admin-guide/kernel-parameters.txt |
| 18 | ++++ b/Documentation/admin-guide/kernel-parameters.txt |
| 19 | +@@ -1469,6 +1469,7 @@ |
| 20 | + reservation and treat the memory by its base type |
| 21 | + (i.e. EFI_CONVENTIONAL_MEMORY / "System RAM"). |
| 22 | + novamap: do not call SetVirtualAddressMap(). |
| 23 | ++ acsforcevamap: Arm ACS, force the call of SetVirtualAddressMap(). |
| 24 | + no_disable_early_pci_dma: Leave the busmaster bit set |
| 25 | + on all PCI bridges while in the EFI boot stub |
| 26 | + |
| 27 | +diff --git a/drivers/firmware/efi/libstub/efi-stub-helper.c b/drivers/firmware/efi/libstub/efi-stub-helper.c |
| 28 | +index c0c81ca4237e..e08bda316892 100644 |
| 29 | +--- a/drivers/firmware/efi/libstub/efi-stub-helper.c |
| 30 | ++++ b/drivers/firmware/efi/libstub/efi-stub-helper.c |
| 31 | +@@ -20,6 +20,7 @@ |
| 32 | + bool efi_nochunk; |
| 33 | + bool efi_nokaslr = !IS_ENABLED(CONFIG_RANDOMIZE_BASE); |
| 34 | + bool efi_novamap; |
| 35 | ++bool efi_acsforcevamap = false; |
| 36 | + |
| 37 | + static bool efi_noinitrd; |
| 38 | + static bool efi_nosoftreserve; |
| 39 | +@@ -87,6 +88,7 @@ efi_status_t efi_parse_options(char const *cmdline) |
| 40 | + } else if (!strcmp(param, "efi") && val) { |
| 41 | + efi_nochunk = parse_option_str(val, "nochunk"); |
| 42 | + efi_novamap |= parse_option_str(val, "novamap"); |
| 43 | ++ efi_acsforcevamap |= parse_option_str(val, "acsforcevamap"); |
| 44 | + |
| 45 | + efi_nosoftreserve = IS_ENABLED(CONFIG_EFI_SOFT_RESERVE) && |
| 46 | + parse_option_str(val, "nosoftreserve"); |
| 47 | +diff --git a/drivers/firmware/efi/libstub/efistub.h b/drivers/firmware/efi/libstub/efistub.h |
| 48 | +index 76e44c185f29..97232efbc21c 100644 |
| 49 | +--- a/drivers/firmware/efi/libstub/efistub.h |
| 50 | ++++ b/drivers/firmware/efi/libstub/efistub.h |
| 51 | +@@ -39,6 +39,7 @@ extern bool efi_nokaslr; |
| 52 | + extern int efi_loglevel; |
| 53 | + extern int efi_mem_encrypt; |
| 54 | + extern bool efi_novamap; |
| 55 | ++extern bool efi_acsforcevamap; |
| 56 | + extern const efi_system_table_t *efi_system_table; |
| 57 | + |
| 58 | + typedef union efi_dxe_services_table efi_dxe_services_table_t; |
| 59 | +diff --git a/drivers/firmware/efi/libstub/fdt.c b/drivers/firmware/efi/libstub/fdt.c |
| 60 | +index 6a337f1f8787..4471ea1811be 100644 |
| 61 | +--- a/drivers/firmware/efi/libstub/fdt.c |
| 62 | ++++ b/drivers/firmware/efi/libstub/fdt.c |
| 63 | +@@ -232,13 +232,30 @@ efi_status_t allocate_new_fdt_and_exit_boot(void *handle, |
| 64 | + unsigned long fdt_addr = 0; |
| 65 | + unsigned long fdt_size = 0; |
| 66 | + |
| 67 | +- if (!efi_novamap) { |
| 68 | ++ if(efi_acsforcevamap) { |
| 69 | ++ efi_info("ACS:acsforcevamap is 1\n"); |
| 70 | ++ } |
| 71 | ++ else { |
| 72 | ++ efi_info("ACS:acsforcevamap is 0\n"); |
| 73 | ++ } |
| 74 | ++ |
| 75 | ++ if(efi_novamap) { |
| 76 | ++ efi_info("ACS:efi_novamap is 1\n"); |
| 77 | ++ } |
| 78 | ++ else { |
| 79 | ++ efi_info("ACS:efi_novamap is 0\n"); |
| 80 | ++ } |
| 81 | ++ |
| 82 | ++ |
| 83 | ++ if (!efi_novamap || efi_acsforcevamap) { |
| 84 | ++ efi_info("ACS:Alloc memory for virtual address map ..."); |
| 85 | + status = efi_alloc_virtmap(&priv.runtime_map, &desc_size, |
| 86 | + &desc_ver); |
| 87 | + if (status != EFI_SUCCESS) { |
| 88 | + efi_err("Unable to retrieve UEFI memory map.\n"); |
| 89 | + return status; |
| 90 | + } |
| 91 | ++ efi_info(" Success\n"); |
| 92 | + } |
| 93 | + |
| 94 | + /* |
| 95 | +@@ -294,7 +311,7 @@ efi_status_t allocate_new_fdt_and_exit_boot(void *handle, |
| 96 | + if (status == EFI_SUCCESS) { |
| 97 | + efi_set_virtual_address_map_t *svam; |
| 98 | + |
| 99 | +- if (efi_novamap) |
| 100 | ++ if (efi_novamap && !efi_acsforcevamap) |
| 101 | + return EFI_SUCCESS; |
| 102 | + |
| 103 | + /* Install the new virtual address map */ |
| 104 | +-- |
| 105 | +2.34.1 |
| 106 | + |
0 commit comments