From 610279571ca60f430935dcd52c59e88fa8b3aa7d Mon Sep 17 00:00:00 2001 From: Peter Robinson Date: Wed, 17 Mar 2021 09:10:48 +0000 Subject: [PATCH] 2021.04 RC4, upstream rpi3 smp fix --- ...r-consider-no-map-property-of-reserv.patch | 82 ------------------- ...emory-type-for-memory-reservation-bl.patch | 38 +++++++++ sources | 2 +- uboot-tools.spec | 10 ++- 4 files changed, 46 insertions(+), 86 deletions(-) delete mode 100644 0001-Revert-efi_loader-consider-no-map-property-of-reserv.patch create mode 100644 0001-efi_loader-fix-memory-type-for-memory-reservation-bl.patch diff --git a/0001-Revert-efi_loader-consider-no-map-property-of-reserv.patch b/0001-Revert-efi_loader-consider-no-map-property-of-reserv.patch deleted file mode 100644 index 485f966..0000000 --- a/0001-Revert-efi_loader-consider-no-map-property-of-reserv.patch +++ /dev/null @@ -1,82 +0,0 @@ -From 62f3f85e50692b2685d1056a041d1dbb9e16f2a4 Mon Sep 17 00:00:00 2001 -From: Peter Robinson -Date: Sat, 13 Mar 2021 14:42:29 +0000 -Subject: [PATCH] Revert: efi_loader: consider no-map property of reserved - memory - -This basically reverts 4cbb2930bd8c, but not directly as it's moved -about since. The patch breaks SMP on the Raspberry Pi 3 (original 3B -and 3B+) so on Linux only one CPU core comes online. I'm not exactly -sure why but a bisect idendified the patch and sure enough a revert -fixes the issue. - -Signed-off-by: Peter Robinson ---- - lib/efi_loader/efi_dt_fixup.c | 33 ++++++--------------------------- - 1 file changed, 6 insertions(+), 27 deletions(-) - -diff --git a/lib/efi_loader/efi_dt_fixup.c b/lib/efi_loader/efi_dt_fixup.c -index a4529ee3ef..87630f7857 100644 ---- a/lib/efi_loader/efi_dt_fixup.c -+++ b/lib/efi_loader/efi_dt_fixup.c -@@ -13,29 +13,13 @@ - - const efi_guid_t efi_guid_dt_fixup_protocol = EFI_DT_FIXUP_PROTOCOL_GUID; - --/** -- * efi_reserve_memory() - add reserved memory to memory map -- * -- * @addr: start address of the reserved memory range -- * @size: size of the reserved memory range -- * @nomap: indicates that the memory range shall not be accessed by the -- * UEFI payload -- */ --static void efi_reserve_memory(u64 addr, u64 size, bool nomap) -+static void efi_reserve_memory(u64 addr, u64 size) - { -- int type; -- efi_uintn_t ret; -- - /* Convert from sandbox address space. */ - addr = (uintptr_t)map_sysmem(addr, 0); -+ if (efi_add_memory_map(addr, size, -+ EFI_RESERVED_MEMORY_TYPE) != EFI_SUCCESS) - -- if (nomap) -- type = EFI_RESERVED_MEMORY_TYPE; -- else -- type = EFI_BOOT_SERVICES_DATA; -- -- ret = efi_add_memory_map(addr, size, type); -- if (ret != EFI_SUCCESS) - log_err("Reserved memory mapping failed addr %llx size %llx\n", - addr, size); - } -@@ -61,7 +45,7 @@ void efi_carve_out_dt_rsv(void *fdt) - for (i = 0; i < nr_rsv; i++) { - if (fdt_get_mem_rsv(fdt, i, &addr, &size) != 0) - continue; -- efi_reserve_memory(addr, size, false); -+ efi_reserve_memory(addr, size); - } - - /* process reserved-memory */ -@@ -81,13 +65,8 @@ void efi_carve_out_dt_rsv(void *fdt) - * a size instead of a reg property. - */ - if (fdt_addr != FDT_ADDR_T_NONE && -- fdtdec_get_is_enabled(fdt, subnode)) { -- bool nomap; -- -- nomap = !!fdt_getprop(fdt, subnode, "no-map", -- NULL); -- efi_reserve_memory(fdt_addr, fdt_size, nomap); -- } -+ fdtdec_get_is_enabled(fdt, subnode)) -+ efi_reserve_memory(fdt_addr, fdt_size); - subnode = fdt_next_subnode(fdt, subnode); - } - } --- -2.30.2 - diff --git a/0001-efi_loader-fix-memory-type-for-memory-reservation-bl.patch b/0001-efi_loader-fix-memory-type-for-memory-reservation-bl.patch new file mode 100644 index 0000000..4ca9f5d --- /dev/null +++ b/0001-efi_loader-fix-memory-type-for-memory-reservation-bl.patch @@ -0,0 +1,38 @@ +From ca1e8231dcf89b78c6860239281bbe36e7a63341 Mon Sep 17 00:00:00 2001 +From: Mark Kettenis +Date: Sun, 14 Mar 2021 20:04:24 +0100 +Subject: [PATCH] efi_loader: fix memory type for memory reservation block + +The devicetree specification clearly states that: + + As with the /reserved-memory node, when booting via UEFI + entries in the Memory Reservation Block must also be listed + in the system memory map obtained via the GetMemoryMap() toi + protect against allocations by UEFI applications. The memory + reservation block entries should be listed with type + EfiReservedMemoryType. + +This restores the behaviour that was changed by commit 4cbb2930bd8c +("efi_loader: consider no-map property of reserved memory"). + +Signed-off-by: Mark Kettenis +--- + lib/efi_loader/efi_dt_fixup.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lib/efi_loader/efi_dt_fixup.c b/lib/efi_loader/efi_dt_fixup.c +index a4529ee3ef..b6fe5d2e5a 100644 +--- a/lib/efi_loader/efi_dt_fixup.c ++++ b/lib/efi_loader/efi_dt_fixup.c +@@ -61,7 +61,7 @@ void efi_carve_out_dt_rsv(void *fdt) + for (i = 0; i < nr_rsv; i++) { + if (fdt_get_mem_rsv(fdt, i, &addr, &size) != 0) + continue; +- efi_reserve_memory(addr, size, false); ++ efi_reserve_memory(addr, size, true); + } + + /* process reserved-memory */ +-- +2.30.2 + diff --git a/sources b/sources index 6a0feed..7d286d7 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (u-boot-2021.04-rc3.tar.bz2) = 0d6b46b791475ce21320fbc2b361235d09588a5b912d40b32a11d937adc7c0e7b75b893ba4e8dc55156cfd99f684fc56839c17d0b9c021f5cfaaf5e5997f93ba +SHA512 (u-boot-2021.04-rc4.tar.bz2) = 522f9e7886a357ad573088fbbb4be17b91efedf5651808d7cbe53f4b3c4da236a96d5e781b8464d17bc6f961bd65cf3fb58d707bc7f10ce1df002800045cfd23 diff --git a/uboot-tools.spec b/uboot-tools.spec index 5660be2..28d5afb 100644 --- a/uboot-tools.spec +++ b/uboot-tools.spec @@ -1,8 +1,8 @@ -%global candidate rc3 +%global candidate rc4 Name: uboot-tools Version: 2021.04 -Release: 0.5%{?candidate:.%{candidate}}%{?dist} +Release: 0.6%{?candidate:.%{candidate}}%{?dist} Summary: U-Boot utilities License: GPLv2+ BSD LGPL-2.1+ LGPL-2.0+ URL: http://www.denx.de/wiki/U-Boot @@ -22,7 +22,7 @@ Patch2: uefi-use-Fedora-specific-path-name.patch Patch3: rpi-Enable-using-the-DT-provided-by-the-Raspberry-Pi.patch # Board fixes and enablement -Patch9: 0001-Revert-efi_loader-consider-no-map-property-of-reserv.patch +Patch9: 0001-efi_loader-fix-memory-type-for-memory-reservation-bl.patch # AllWinner improvements Patch10: AllWinner-PineTab.patch # TI fixes @@ -243,6 +243,10 @@ cp -p board/warp7/README builds/docs/README.warp7 %endif %changelog +* Wed Mar 17 2021 Peter Robinson - 2021.04-0.6.rc4 +- Update to 2021.04 RC4 +- Move to upstream fix for SMP on RPi3B and RPi3B+ + * Sat Mar 13 2021 Peter Robinson - 2021.04-0.5.rc3 - Fix for SMP on RPi3B and RPi3B+ - Initial support for Pinephone 3Gb edition