-
Notifications
You must be signed in to change notification settings - Fork 5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
maxcpus=1 stops Pi2 and Pi3 from booting #1989
Comments
Note that a soft reboot is not enough to show the problem. |
I've used
|
I seem to get a mixture of successful and unsuccessful boots with
|
The mystery deepens. Pi2 and Pi3 both use the ARM architectural timers as their clock source, accessed from via the p15 co-processor interface by the
And from later on:
Notice how the timestamps are now shuffling back and forth rather than monotonically increasing. It is as if this register has been switched into another mode, but I don't know what that mode would be and I can't see any evidence of such a switch; the frequency (CNTFRQ) remains the same (19.2MHz), as does the control register (CNTKCTL). Are there any ARM gurus out there who can shed some light? @lategoodbye? @ED6E0F17? |
In the maxcpus!=4 case, some CPUs will permanently be executing the loop in the armstub waiting to be released. Hence, the content of this memory is permanently important. Is the kernel accidentally re-using that page for something else, thus causing the unused secondary CPUs to go off an execute random code? I don't know why that would always cause arch timer issues though. When all 4 CPUs are in use, all the CPUs jump out of that code very early on, thus making it quite unlikely any such bug would be hit. The value 400000020 looks special, as if it's a 400000000 flag plus value 20. Perhaps you can add code into writel and friends that checks for that value (or something in that range) and prints a backtrace in case it's caused by a stray register write? |
Ooh, interesting thought:
The stub is loaded to 0xc0000000 (0x00000000 uncached, as seen from the VPU), and it has clearly been trashed by something. Thanks for the suggestion - I'll follow up with an explanation when I find one. |
I have a fix which is somewhere between a solution and a workaround:
This bit of Device Tree magic will declare the first page as off-limits. |
@pelwell You were faster than me. I think this could be an acceptable way. |
Is the size of the armstub variable? |
I wonder if the kernel code should reserve this itself; the memory can be released if it's known that all possible CPUs have been released from the spin loop. Let met check... |
Looks like this is basically the correct approach, although the kernel docs recommend using /memreserve/ instead: https://www.kernel.org/doc/Documentation/arm64/booting.txt
|
The armstub only uses 0x0-0xff. |
According to the binding document and this example, we should add a "no-map" property to the stubs node ? |
Thanks, @swarren @lategoodbye, having had time to read around I think the |
I have a patch adding /memreserve/ for all Pis waiting to go - I think it's safe to merge. While we're in this area, I think it's time to add a @popcornmix - I propose merging both kernel side patches now, and I'll send you the armstubs patches - one for armstub7.S, and one for the generated header - for perusal and possible delaying. |
@pelwell agree that adding the wfe/sev is desirable, but the wfe alone will break older kernels. |
1 similar comment
@pelwell agree that adding the wfe/sev is desirable, but the wfe alone will break older kernels. |
The Raspberry Pi startup stub files for multi-core BCM27XX processors make the secondary CPUs spin until the corresponding mailbox is written. These stubs are loaded at physical address 0x00000xxx (as seen by the ARMs), but this page will be reused by the kernel unless it is explicitly reserved, causing the waiting cores to execute random code. Use the /memreserve/ Device Tree directive to mark the first page as off-limits to the kernel. See: #1989 Signed-off-by: Phil Elwell <phil@raspberrypi.org>
In order to reduce power consumption and bus traffic, it is sensible for secondary cores to enter a low-power idle state when waiting to be started. The wfe instruction causes a core to wait until an event or interrupt arrives before continuing to the next instruction. The sev instruction sends a wakeup event to the other cores, so call it from bcm2836_smp_boot_secondary, the function that wakes up the waiting cores during booting. It is harmless to use this patch without the corresponding change adding wfe to the ARMv7/ARMv8-32 stubs, but if the stubs are updated and this patch is not applied then the other cores will sleep forever. See: #1989 Signed-off-by: Phil Elwell <phil@raspberrypi.org>
I've pushed the kernel-side commits. |
So these changes must go upstream or we are in trouble after release of the new armstubs? |
People using the upstream kernel can always put copies of the old stub
files on their SD card/network boot directory, but that isn't ideal. I'll
upstream these patches as well.
|
This patch causes secondary CPUs to enter a low power state while waiting to be woken during booting. Without the corresponding kernel patch to send an event, the secondary CPUs won't come online. See: raspberrypi/linux#1989 Signed-off-by: Phil Elwell <phil@raspberrypi.org>
In order to reduce power consumption and bus traffic, it is sensible for secondary cores to enter a low-power idle state when waiting to be started. The wfe instruction causes a core to wait until an event or interrupt arrives before continuing to the next instruction. The sev instruction sends a wakeup event to the other cores, so call it from bcm2836_smp_boot_secondary, the function that wakes up the waiting cores during booting. It is harmless to use this patch without the corresponding change adding wfe to the ARMv7/ARMv8-32 stubs, but if the stubs are updated and this patch is not applied then the other cores will sleep forever. See: raspberrypi/linux#1989 Signed-off-by: Phil Elwell <phil@raspberrypi.org>
Having to copy old firmware files sounds like a nasty regression that can cause user-visible problems. I'd like to see this rolled out in a smoother fashion if at all possible. (1) Get the required sev present in all OSs (this includes RPi Foundation Linux, upstream Linux, Linux distro kernels, all non-Linux OSs that exist and use SMP), then wait a decent amount of time, and only then update the stubs in a way that requires an OS update. Alternatively, conditionalize the feature on some setup.txt flag that the RPi disk images can set, but nobody else does yet. The default value of the flag could be flipped in e.g. 6 months after people have time to convert. |
We're considering adding flags or a "breaking step" counter to our DTB that the firmware can check, which would then allow it to nop-out the |
kernel: irq_bcm2836: Send event when onlining sleeping cores kernel: ARM: dts: bcm283x: Reserve first page for firmware See: raspberrypi/linux#1989 kernel: smsc95xx: Avoid HW TX CSUM for IPV6 See: raspberrypi/linux#1832
In order to reduce power consumption and bus traffic, it is sensible for secondary cores to enter a low-power idle state when waiting to be started. The wfe instruction causes a core to wait until an event or interrupt arrives before continuing to the next instruction. The sev instruction sends a wakeup event to the other cores, so call it from bcm2836_smp_boot_secondary, the function that wakes up the waiting cores during booting. It is harmless to use this patch without the corresponding change adding wfe to the ARMv7/ARMv8-32 stubs, but if the stubs are updated and this patch is not applied then the other cores will sleep forever. See: raspberrypi#1989 Signed-off-by: Phil Elwell <phil@raspberrypi.org>
commit ab68300 Author: Phil Elwell <phil@raspberrypi.org> Date: Mon May 8 16:30:18 2017 +0100 ARM: dts: bcm283x: Reserve first page for firmware The Raspberry Pi startup stub files for multi-core BCM27XX processors make the secondary CPUs spin until the corresponding mailbox is written. These stubs are loaded at physical address 0x00000xxx (as seen by the ARMs), but this page will be reused by the kernel unless it is explicitly reserved, causing the waiting cores to execute random code. Use the /memreserve/ Device Tree directive to mark the first page as off-limits to the kernel. See: raspberrypi/linux#1989 Signed-off-by: Phil Elwell <phil@raspberrypi.org> Gbp-Pq: Topic rpi Gbp-Pq: Name rpi_1246_ab683001cb3ae4a7775e2b44f56c9207d3d672ff.patch
commit a3d4f16 Author: Phil Elwell <phil@raspberrypi.org> Date: Mon May 8 16:43:40 2017 +0100 irq_bcm2836: Send event when onlining sleeping cores In order to reduce power consumption and bus traffic, it is sensible for secondary cores to enter a low-power idle state when waiting to be started. The wfe instruction causes a core to wait until an event or interrupt arrives before continuing to the next instruction. The sev instruction sends a wakeup event to the other cores, so call it from bcm2836_smp_boot_secondary, the function that wakes up the waiting cores during booting. It is harmless to use this patch without the corresponding change adding wfe to the ARMv7/ARMv8-32 stubs, but if the stubs are updated and this patch is not applied then the other cores will sleep forever. See: raspberrypi/linux#1989 Signed-off-by: Phil Elwell <phil@raspberrypi.org> Gbp-Pq: Topic rpi Gbp-Pq: Name rpi_1247_a3d4f16fed1bcef2e69fdadda03ddfaab2a5461a.patch
[ Upstream commit b0804ed ] The Raspberry Pi startup stub files for multi-core BCM283X processors make the secondary CPUs spin until the corresponding mailbox is written. These stubs are loaded at physical address 0x00000xxx (as seen by the ARMs), but this page will be reused by the kernel unless it is explicitly reserved, causing the waiting cores to execute random code. Use the /memreserve/ Device Tree directive to mark the first page as off-limits to the kernel. See: raspberrypi/linux#1989 Signed-off-by: Phil Elwell <phil@raspberrypi.org> Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
[ Upstream commit b0804ed0cadd7e38d94d2f15cdcc0d9695818856 ] The Raspberry Pi startup stub files for multi-core BCM283X processors make the secondary CPUs spin until the corresponding mailbox is written. These stubs are loaded at physical address 0x00000xxx (as seen by the ARMs), but this page will be reused by the kernel unless it is explicitly reserved, causing the waiting cores to execute random code. Use the /memreserve/ Device Tree directive to mark the first page as off-limits to the kernel. See: raspberrypi/linux#1989 Signed-off-by: Phil Elwell <phil@raspberrypi.org> Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
commit ab68300 Author: Phil Elwell <phil@raspberrypi.org> Date: Mon May 8 16:30:18 2017 +0100 ARM: dts: bcm283x: Reserve first page for firmware The Raspberry Pi startup stub files for multi-core BCM27XX processors make the secondary CPUs spin until the corresponding mailbox is written. These stubs are loaded at physical address 0x00000xxx (as seen by the ARMs), but this page will be reused by the kernel unless it is explicitly reserved, causing the waiting cores to execute random code. Use the /memreserve/ Device Tree directive to mark the first page as off-limits to the kernel. See: raspberrypi/linux#1989 Signed-off-by: Phil Elwell <phil@raspberrypi.org> Gbp-Pq: Topic rpi Gbp-Pq: Name rpi_1246_ab683001cb3ae4a7775e2b44f56c9207d3d672ff.patch
commit a3d4f16 Author: Phil Elwell <phil@raspberrypi.org> Date: Mon May 8 16:43:40 2017 +0100 irq_bcm2836: Send event when onlining sleeping cores In order to reduce power consumption and bus traffic, it is sensible for secondary cores to enter a low-power idle state when waiting to be started. The wfe instruction causes a core to wait until an event or interrupt arrives before continuing to the next instruction. The sev instruction sends a wakeup event to the other cores, so call it from bcm2836_smp_boot_secondary, the function that wakes up the waiting cores during booting. It is harmless to use this patch without the corresponding change adding wfe to the ARMv7/ARMv8-32 stubs, but if the stubs are updated and this patch is not applied then the other cores will sleep forever. See: raspberrypi/linux#1989 Signed-off-by: Phil Elwell <phil@raspberrypi.org> Gbp-Pq: Topic rpi Gbp-Pq: Name rpi_1247_a3d4f16fed1bcef2e69fdadda03ddfaab2a5461a.patch
[ Upstream commit b0804ed0cadd7e38d94d2f15cdcc0d9695818856 ] The Raspberry Pi startup stub files for multi-core BCM283X processors make the secondary CPUs spin until the corresponding mailbox is written. These stubs are loaded at physical address 0x00000xxx (as seen by the ARMs), but this page will be reused by the kernel unless it is explicitly reserved, causing the waiting cores to execute random code. Use the /memreserve/ Device Tree directive to mark the first page as off-limits to the kernel. See: raspberrypi/linux#1989 Signed-off-by: Phil Elwell <phil@raspberrypi.org> Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
[ Upstream commit b0804ed0cadd7e38d94d2f15cdcc0d9695818856 ] The Raspberry Pi startup stub files for multi-core BCM283X processors make the secondary CPUs spin until the corresponding mailbox is written. These stubs are loaded at physical address 0x00000xxx (as seen by the ARMs), but this page will be reused by the kernel unless it is explicitly reserved, causing the waiting cores to execute random code. Use the /memreserve/ Device Tree directive to mark the first page as off-limits to the kernel. See: raspberrypi/linux#1989 Signed-off-by: Phil Elwell <phil@raspberrypi.org> Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
[ Upstream commit b0804ed0cadd7e38d94d2f15cdcc0d9695818856 ] The Raspberry Pi startup stub files for multi-core BCM283X processors make the secondary CPUs spin until the corresponding mailbox is written. These stubs are loaded at physical address 0x00000xxx (as seen by the ARMs), but this page will be reused by the kernel unless it is explicitly reserved, causing the waiting cores to execute random code. Use the /memreserve/ Device Tree directive to mark the first page as off-limits to the kernel. See: raspberrypi/linux#1989 Signed-off-by: Phil Elwell <phil@raspberrypi.org> Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
[ Upstream commit b0804ed0cadd7e38d94d2f15cdcc0d9695818856 ] The Raspberry Pi startup stub files for multi-core BCM283X processors make the secondary CPUs spin until the corresponding mailbox is written. These stubs are loaded at physical address 0x00000xxx (as seen by the ARMs), but this page will be reused by the kernel unless it is explicitly reserved, causing the waiting cores to execute random code. Use the /memreserve/ Device Tree directive to mark the first page as off-limits to the kernel. See: raspberrypi/linux#1989 Signed-off-by: Phil Elwell <phil@raspberrypi.org> Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
[ Upstream commit b0804ed0cadd7e38d94d2f15cdcc0d9695818856 ] The Raspberry Pi startup stub files for multi-core BCM283X processors make the secondary CPUs spin until the corresponding mailbox is written. These stubs are loaded at physical address 0x00000xxx (as seen by the ARMs), but this page will be reused by the kernel unless it is explicitly reserved, causing the waiting cores to execute random code. Use the /memreserve/ Device Tree directive to mark the first page as off-limits to the kernel. See: raspberrypi/linux#1989 Signed-off-by: Phil Elwell <phil@raspberrypi.org> Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
[ Upstream commit b0804ed0cadd7e38d94d2f15cdcc0d9695818856 ] The Raspberry Pi startup stub files for multi-core BCM283X processors make the secondary CPUs spin until the corresponding mailbox is written. These stubs are loaded at physical address 0x00000xxx (as seen by the ARMs), but this page will be reused by the kernel unless it is explicitly reserved, causing the waiting cores to execute random code. Use the /memreserve/ Device Tree directive to mark the first page as off-limits to the kernel. See: raspberrypi/linux#1989 Signed-off-by: Phil Elwell <phil@raspberrypi.org> Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
[ Upstream commit b0804ed ] The Raspberry Pi startup stub files for multi-core BCM283X processors make the secondary CPUs spin until the corresponding mailbox is written. These stubs are loaded at physical address 0x00000xxx (as seen by the ARMs), but this page will be reused by the kernel unless it is explicitly reserved, causing the waiting cores to execute random code. Use the /memreserve/ Device Tree directive to mark the first page as off-limits to the kernel. See: raspberrypi/linux#1989 Signed-off-by: Phil Elwell <phil@raspberrypi.org> Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
[ Upstream commit b0804ed ] The Raspberry Pi startup stub files for multi-core BCM283X processors make the secondary CPUs spin until the corresponding mailbox is written. These stubs are loaded at physical address 0x00000xxx (as seen by the ARMs), but this page will be reused by the kernel unless it is explicitly reserved, causing the waiting cores to execute random code. Use the /memreserve/ Device Tree directive to mark the first page as off-limits to the kernel. See: raspberrypi/linux#1989 Signed-off-by: Phil Elwell <phil@raspberrypi.org> Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
[ Upstream commit b0804ed0cadd7e38d94d2f15cdcc0d9695818856 ] The Raspberry Pi startup stub files for multi-core BCM283X processors make the secondary CPUs spin until the corresponding mailbox is written. These stubs are loaded at physical address 0x00000xxx (as seen by the ARMs), but this page will be reused by the kernel unless it is explicitly reserved, causing the waiting cores to execute random code. Use the /memreserve/ Device Tree directive to mark the first page as off-limits to the kernel. See: raspberrypi/linux#1989 Signed-off-by: Phil Elwell <phil@raspberrypi.org> Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
[ Upstream commit b0804ed0cadd7e38d94d2f15cdcc0d9695818856 ] The Raspberry Pi startup stub files for multi-core BCM283X processors make the secondary CPUs spin until the corresponding mailbox is written. These stubs are loaded at physical address 0x00000xxx (as seen by the ARMs), but this page will be reused by the kernel unless it is explicitly reserved, causing the waiting cores to execute random code. Use the /memreserve/ Device Tree directive to mark the first page as off-limits to the kernel. See: raspberrypi/linux#1989 Signed-off-by: Phil Elwell <phil@raspberrypi.org> Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
[ Upstream commit b0804ed ] The Raspberry Pi startup stub files for multi-core BCM283X processors make the secondary CPUs spin until the corresponding mailbox is written. These stubs are loaded at physical address 0x00000xxx (as seen by the ARMs), but this page will be reused by the kernel unless it is explicitly reserved, causing the waiting cores to execute random code. Use the /memreserve/ Device Tree directive to mark the first page as off-limits to the kernel. See: raspberrypi/linux#1989 Signed-off-by: Phil Elwell <phil@raspberrypi.org> Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
[ Upstream commit b0804ed ] The Raspberry Pi startup stub files for multi-core BCM283X processors make the secondary CPUs spin until the corresponding mailbox is written. These stubs are loaded at physical address 0x00000xxx (as seen by the ARMs), but this page will be reused by the kernel unless it is explicitly reserved, causing the waiting cores to execute random code. Use the /memreserve/ Device Tree directive to mark the first page as off-limits to the kernel. See: raspberrypi/linux#1989 Signed-off-by: Phil Elwell <phil@raspberrypi.org> Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
[ Upstream commit b0804ed0cadd7e38d94d2f15cdcc0d9695818856 ] The Raspberry Pi startup stub files for multi-core BCM283X processors make the secondary CPUs spin until the corresponding mailbox is written. These stubs are loaded at physical address 0x00000xxx (as seen by the ARMs), but this page will be reused by the kernel unless it is explicitly reserved, causing the waiting cores to execute random code. Use the /memreserve/ Device Tree directive to mark the first page as off-limits to the kernel. See: raspberrypi/linux#1989 Signed-off-by: Phil Elwell <phil@raspberrypi.org> Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
[ Upstream commit b0804ed0cadd7e38d94d2f15cdcc0d9695818856 ] The Raspberry Pi startup stub files for multi-core BCM283X processors make the secondary CPUs spin until the corresponding mailbox is written. These stubs are loaded at physical address 0x00000xxx (as seen by the ARMs), but this page will be reused by the kernel unless it is explicitly reserved, causing the waiting cores to execute random code. Use the /memreserve/ Device Tree directive to mark the first page as off-limits to the kernel. See: raspberrypi/linux#1989 Signed-off-by: Phil Elwell <phil@raspberrypi.org> Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
[ Upstream commit b0804ed0cadd7e38d94d2f15cdcc0d9695818856 ] The Raspberry Pi startup stub files for multi-core BCM283X processors make the secondary CPUs spin until the corresponding mailbox is written. These stubs are loaded at physical address 0x00000xxx (as seen by the ARMs), but this page will be reused by the kernel unless it is explicitly reserved, causing the waiting cores to execute random code. Use the /memreserve/ Device Tree directive to mark the first page as off-limits to the kernel. See: raspberrypi/linux#1989 Signed-off-by: Phil Elwell <phil@raspberrypi.org> Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
[ Upstream commit b0804ed ] The Raspberry Pi startup stub files for multi-core BCM283X processors make the secondary CPUs spin until the corresponding mailbox is written. These stubs are loaded at physical address 0x00000xxx (as seen by the ARMs), but this page will be reused by the kernel unless it is explicitly reserved, causing the waiting cores to execute random code. Use the /memreserve/ Device Tree directive to mark the first page as off-limits to the kernel. See: raspberrypi/linux#1989 Signed-off-by: Phil Elwell <phil@raspberrypi.org> Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
[ Upstream commit b0804ed0cadd7e38d94d2f15cdcc0d9695818856 ] The Raspberry Pi startup stub files for multi-core BCM283X processors make the secondary CPUs spin until the corresponding mailbox is written. These stubs are loaded at physical address 0x00000xxx (as seen by the ARMs), but this page will be reused by the kernel unless it is explicitly reserved, causing the waiting cores to execute random code. Use the /memreserve/ Device Tree directive to mark the first page as off-limits to the kernel. See: raspberrypi/linux#1989 Signed-off-by: Phil Elwell <phil@raspberrypi.org> Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
[ Upstream commit b0804ed0cadd7e38d94d2f15cdcc0d9695818856 ] The Raspberry Pi startup stub files for multi-core BCM283X processors make the secondary CPUs spin until the corresponding mailbox is written. These stubs are loaded at physical address 0x00000xxx (as seen by the ARMs), but this page will be reused by the kernel unless it is explicitly reserved, causing the waiting cores to execute random code. Use the /memreserve/ Device Tree directive to mark the first page as off-limits to the kernel. See: raspberrypi/linux#1989 Signed-off-by: Phil Elwell <phil@raspberrypi.org> Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
[ Upstream commit b0804ed0cadd7e38d94d2f15cdcc0d9695818856 ] The Raspberry Pi startup stub files for multi-core BCM283X processors make the secondary CPUs spin until the corresponding mailbox is written. These stubs are loaded at physical address 0x00000xxx (as seen by the ARMs), but this page will be reused by the kernel unless it is explicitly reserved, causing the waiting cores to execute random code. Use the /memreserve/ Device Tree directive to mark the first page as off-limits to the kernel. See: raspberrypi/linux#1989 Signed-off-by: Phil Elwell <phil@raspberrypi.org> Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
In order to reduce power consumption and bus traffic, it is sensible for secondary cores to enter a low-power idle state when waiting to be started. The wfe instruction causes a core to wait until an event or interrupt arrives before continuing to the next instruction. The sev instruction sends a wakeup event to the other cores, so call it from bcm2836_smp_boot_secondary, the function that wakes up the waiting cores during booting. It is harmless to use this patch without the corresponding change adding wfe to the ARMv7/ARMv8-32 stubs, but if the stubs are updated and this patch is not applied then the other cores will sleep forever. See: raspberrypi/linux#1989 Signed-off-by: Phil Elwell <phil@raspberrypi.org>
In order to reduce power consumption and bus traffic, it is sensible for secondary cores to enter a low-power idle state when waiting to be started. The wfe instruction causes a core to wait until an event or interrupt arrives before continuing to the next instruction. The sev instruction sends a wakeup event to the other cores, so call it from bcm2836_smp_boot_secondary, the function that wakes up the waiting cores during booting. It is harmless to use this patch without the corresponding change adding wfe to the ARMv7/ARMv8-32 stubs, but if the stubs are updated and this patch is not applied then the other cores will sleep forever. See: raspberrypi/linux#1989 Signed-off-by: Phil Elwell <phil@raspberrypi.org> Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
[ Upstream commit b0804ed0cadd7e38d94d2f15cdcc0d9695818856 ] The Raspberry Pi startup stub files for multi-core BCM283X processors make the secondary CPUs spin until the corresponding mailbox is written. These stubs are loaded at physical address 0x00000xxx (as seen by the ARMs), but this page will be reused by the kernel unless it is explicitly reserved, causing the waiting cores to execute random code. Use the /memreserve/ Device Tree directive to mark the first page as off-limits to the kernel. See: raspberrypi/linux#1989 Signed-off-by: Phil Elwell <phil@raspberrypi.org> Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
As inadvertently discovered by @P33M, booting a Pi2 or Pi3 with
maxcpus=1
on the kernel cmdline.txt stops it from booting with abnormally large timestamps in the kernel log and SD timeouts (presumably because the timer is running too fast). This smells like an issue with the secondary CPU startup and/or the local interrupt controller, but I haven't identified the specific cause yet.The text was updated successfully, but these errors were encountered: