Commit graph

28 commits

Author SHA1 Message Date
Hector Martin
41aac76fff Bring T6020 support up to parity with T6021
Missing smp/cpufreq/soc stuff.

Signed-off-by: Hector Martin <marcan@marcan.st>
2023-04-09 21:05:50 +09:00
Mario Hros
049bc64e36 smp: Add T6021 CPU start offset
Signed-off-by: Mario Hros <git@reversity.org>
2023-04-09 19:46:13 +09:00
Hector Martin
1ac6c7659d smp: Add T8112 support
PMGR cpustart offset moved...

Signed-off-by: Hector Martin <marcan@marcan.st>
2022-06-28 01:47:02 +09:00
Hector Martin
f3ce8a68d0 smp: Fix pathological thrashing with the hypervisor
Writing to the IPI register causes a trap, which sets the event...
causing every CPU to go into a tight loop of traps contended on the BHL.

We don't need to clear IPIs in WFE mode, so don't do that.

Signed-off-by: Hector Martin <marcan@marcan.st>
2022-06-19 21:53:42 +09:00
Hector Martin
ee2949e744 smp: Use stronger barriers around wfe/sev
Not sure if this fixes anything, but it looks more correct.

Signed-off-by: Hector Martin <marcan@marcan.st>
2022-06-19 15:21:59 +09:00
Janne Grunau
4aa4ff98b6 smp: Start CPU cores on the second t6002 die
Signed-off-by: Janne Grunau <j@jannau.net>
2022-04-19 21:39:52 +09:00
Hector Martin
d580963043 smp: Guard CPU indexes > MAX_CPUS
Signed-off-by: Hector Martin <marcan@marcan.st>
2022-03-14 21:08:07 +09:00
Hector Martin
6f525fc0f1 smp: Skip missing CPUs and continue
This will probably fix missing CPUs on low-binned machines

Signed-off-by: Hector Martin <marcan@marcan.st>
2022-02-08 13:35:49 +09:00
Hector Martin
bedcc905a3 gxf, smp: Allocate stacks dynamically
This significantly shrinks our .bss section

Signed-off-by: Hector Martin <marcan@marcan.st>
2021-12-17 21:46:55 +09:00
Hector Martin
b9ec73b019 smp: Leave the default boot stack for CPU#0 set in case it resets
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-11-16 17:26:52 +09:00
Hector Martin
e763ce3f56 hv: Set SMP mode to WFE
This fixes early IRQs getting stuck in idle secondaries and breaking the
guest.

Signed-off-by: Hector Martin <marcan@marcan.st>
2021-11-08 19:57:02 +09:00
Hector Martin
e99138710a smp: Handle IRQ enable reg properly (maybe)
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-11-01 21:00:56 +09:00
Hector Martin
87613dc208 smp: Support more clusters/CPUs properly
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-11-01 21:00:56 +09:00
Hector Martin
a16731e8b3 hv_exc: Avoid delivering spurious HV-triggered IPIs to the guest
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-09-21 17:13:03 +09:00
Hector Martin
977cbdf4f8 hv_exc: New time accounting around Python callbacks
This does an explicit hypervisor rendezvous. It's not great because it
introduces spurious guest IPIs, but xnu doesn't seem to care...

Signed-off-by: Hector Martin <marcan@marcan.st>
2021-09-21 13:17:00 +09:00
Hector Martin
edb32c48a2 smp: Allow switching back to wfe for the smp spinloop
This is what Linux expects, so we'd better do it in kboot.

Signed-off-by: Hector Martin <marcan@marcan.st>
2021-09-19 02:17:04 +09:00
Hector Martin
b1bc4023dc smp: Use wfi and put idle CPUs in deep sleep
This allows a single active P-Core to boost to 3.2GHz.

Signed-off-by: Hector Martin <marcan@marcan.st>
2021-09-17 00:15:52 +09:00
Hector Martin
90b10ef9f7 smp: Add smp_id() and use TPIDR_EL[12] to keep the SMP ID
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-09-15 23:19:37 +09:00
Hector Martin
571a19c9a3 smp: Align secondary_stacks & export to header
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-09-15 22:00:29 +09:00
Hector Martin
95542a4619 kboot: Handle missing CPUs properly
This is necessary to boot Linux in UP mode if we're in EL1 and the HV
does not support SMP yet.

Signed-off-by: Hector Martin <marcan@marcan.st>
2021-05-04 01:52:58 +09:00
Hector Martin
fcdf2aede9 smp: Print success message on CPU#0
SMP secondary prints only go to UART, so we need something on the main
CPU for other iodev consoles.

Signed-off-by: Hector Martin <marcan@marcan.st>
2021-04-17 16:45:19 +09:00
Hector Martin
234a511e35 kboot: add spin-table and SMP support
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-02-05 02:58:08 +09:00
Hector Martin
e35ef6eb8c smp: fix IRQs on secondary CPUs
Seems one of the registers is some kind of system-level CPU spinup flag,
without which the CPU runs but the rest of the system thinks it's still
dead.

Signed-off-by: Hector Martin <marcan@marcan.st>
2021-02-05 02:58:08 +09:00
Hector Martin
c3c6e4e8f9 smp: add scaffolding and proxy funcs for cross-CPU calls
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-01-29 00:36:46 +09:00
Hector Martin
eae3d06e85 smp: fix totally broken stack setup
This worked by accident before...

Signed-off-by: Hector Martin <marcan@marcan.st>
2021-01-28 23:48:35 +09:00
Hector Martin
cffc423024 smp: use ADT data instead of hardcoded info
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-01-28 23:48:35 +09:00
Hector Martin
3733ea153f smp: fix broken spin-table routine
Only read target_cpu once, then keep a pointer our spin table.

Signed-off-by: Hector Martin <marcan@marcan.st>
2021-01-28 23:48:35 +09:00
Hector Martin
d762391a68 Add code to spin up secondary CPUs
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-01-28 16:06:12 +09:00