]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
arm64: dts: broadcom: bcmbca: bcm4908: Reserve CFE stub area
authorSam Edwards <cfsworks@gmail.com>
Sat, 5 Oct 2024 05:01:54 +0000 (22:01 -0700)
committerFlorian Fainelli <florian.fainelli@broadcom.com>
Tue, 17 Dec 2024 19:39:20 +0000 (11:39 -0800)
The CFE bootloader places a stub program in the first page of physical
memory to hold the secondary CPUs until the boot CPU writes the release
address, but does not splice a /reserved-memory node into the FDT to
protect it. If Linux overwrites this program before execution reaches
smp_prepare_cpus(), the secondary CPUs may become inaccessible.

This is only a problem with CFE, and then only until the secondary CPUs
are brought online. Ideally, there would be some hypothetical mechanism
we could use to indicate that this area of memory is sensitive only
during boot. But as there is none, and since it is such a small amount
of memory, it is easiest to reserve it unconditionally.

Therefore, add a /reserved-memory node to bcm4908.dtsi to protect the
first 4KiB of physical memory.

Signed-off-by: Sam Edwards <CFSworks@gmail.com>
Link: https://lore.kernel.org/r/20241005050155.61103-2-CFSworks@gmail.com
Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi

index 8b924812322cde7af413263ea0aede5612c075df..c51b92387fad82cee15803d7b5d7f1759ea7a179 100644 (file)
                };
        };
 
+       reserved-memory {
+               #address-cells = <2>;
+               #size-cells = <2>;
+               ranges;
+
+               cfe-stub@0 {
+                       reg = <0x0 0x0 0x0 0x1000>;
+               };
+       };
+
        axi@81000000 {
                compatible = "simple-bus";
                #address-cells = <1>;