aboutsummaryrefslogtreecommitdiff
path: root/sys/powerpc
diff options
context:
space:
mode:
authorBrandon Bergren <bdragon@FreeBSD.org>2021-03-06 21:26:16 +0000
committerBrandon Bergren <bdragon@FreeBSD.org>2021-03-06 21:46:28 +0000
commitbad9fa56620eb82395c5ab66d300e91a0222dde2 (patch)
treea1b02b886041cde4076eb218c5e2258a182953a5 /sys/powerpc
parentcd84c82c6ad73c804b828bad9caec176e41ab79d (diff)
downloadsrc-bad9fa56620eb82395c5ab66d300e91a0222dde2.tar.gz
src-bad9fa56620eb82395c5ab66d300e91a0222dde2.zip
[PowerPC] Fix AP bringup on 32-bit AIM SMP
In r361544, the pmap drivers were converted to ifuncs. When doing so, this changed the call type of pmap functions to be called via the secure-plt stubs. These stubs depend on the TOC base being loaded to r30 to run properly. On SMP AIM (i.e. a dual processor G4 or running 32-bit on G5), since the APs were being started up from the reset vector instead of going through __start, they had never had r30 initialized properly, so when the cpu_reset code in trap_subr32.S attempted to branch to pmap_cpu_bootstrap(), it was loading the target from the wrong location. Ensure r30 is set up directly in the cpu_reset trap code, so we can make PLT calls as normal. Fixes boot on my SMP G4. Reviewed by: jhibbits MFC after: 3 days Sponsored by: Tag1 Consulting, Inc.
Diffstat (limited to 'sys/powerpc')
-rw-r--r--sys/powerpc/aim/trap_subr32.S1
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/powerpc/aim/trap_subr32.S b/sys/powerpc/aim/trap_subr32.S
index 710a222fd84c..9664dcc92d2d 100644
--- a/sys/powerpc/aim/trap_subr32.S
+++ b/sys/powerpc/aim/trap_subr32.S
@@ -316,6 +316,7 @@ cpu_reset:
1:
mflr %r1
addi %r1,%r1,(124-16)@l
+ lwz %r30,TRAP_TOCBASE(0)
bl CNAME(cpudep_ap_early_bootstrap)
lis %r3,1@l