2021.04 RC4, upstream rpi3 smp fix

This commit is contained in:
Peter Robinson 2021-03-17 09:10:48 +00:00
parent 2abadc5169
commit 610279571c
4 changed files with 46 additions and 86 deletions

View File

@ -1,82 +0,0 @@
From 62f3f85e50692b2685d1056a041d1dbb9e16f2a4 Mon Sep 17 00:00:00 2001
From: Peter Robinson <pbrobinson@gmail.com>
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 <pbrobinson@gmail.com>
---
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

View File

@ -0,0 +1,38 @@
From ca1e8231dcf89b78c6860239281bbe36e7a63341 Mon Sep 17 00:00:00 2001
From: Mark Kettenis <kettenis@openbsd.org>
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 <kettenis@openbsd.org>
---
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

View File

@ -1 +1 @@
SHA512 (u-boot-2021.04-rc3.tar.bz2) = 0d6b46b791475ce21320fbc2b361235d09588a5b912d40b32a11d937adc7c0e7b75b893ba4e8dc55156cfd99f684fc56839c17d0b9c021f5cfaaf5e5997f93ba
SHA512 (u-boot-2021.04-rc4.tar.bz2) = 522f9e7886a357ad573088fbbb4be17b91efedf5651808d7cbe53f4b3c4da236a96d5e781b8464d17bc6f961bd65cf3fb58d707bc7f10ce1df002800045cfd23

View File

@ -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 <pbrobinson@fedoraproject.org> - 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 <pbrobinson@fedoraproject.org> - 2021.04-0.5.rc3
- Fix for SMP on RPi3B and RPi3B+
- Initial support for Pinephone 3Gb edition