Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F106234394
D47244.id145358.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
920 B
Referenced Files
None
Subscribers
None
D47244.id145358.diff
View Options
diff --git a/sys/arm64/arm64/machdep.c b/sys/arm64/arm64/machdep.c
--- a/sys/arm64/arm64/machdep.c
+++ b/sys/arm64/arm64/machdep.c
@@ -924,6 +924,12 @@
__asm __volatile(
"mov x18, %0 \n"
"msr tpidr_el1, %0" :: "r"(pcpup));
+ /*
+ * If we are in VHE also set tpidr_el2. It can be used when tpidr_el1
+ * is known to have been trashed.
+ */
+ if (in_vhe())
+ WRITE_SPECIALREG(tpidr_el2, pcpup);
/* locore.S sets sp_el0 to &thread0 so no need to set it here. */
PCPU_SET(curthread, &thread0);
diff --git a/sys/arm64/arm64/mp_machdep.c b/sys/arm64/arm64/mp_machdep.c
--- a/sys/arm64/arm64/mp_machdep.c
+++ b/sys/arm64/arm64/mp_machdep.c
@@ -220,6 +220,10 @@
pcpup->pc_midr = get_midr();
identify_cpu(cpu);
+ /* As in machdep.c set tpidr_el2 */
+ if (in_vhe())
+ WRITE_SPECIALREG(tpidr_el2, pcpup);
+
/* Ensure the stores in identify_cpu have completed */
atomic_thread_fence_acq_rel();
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Dec 28, 3:58 PM (7 h, 8 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15624171
Default Alt Text
D47244.id145358.diff (920 B)
Attached To
Mode
D47244: arm64: Also populate tpidr_el2
Attached
Detach File
Event Timeline
Log In to Comment