Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F139399582
D22606.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D22606.id.diff
View Options
Index: head/sys/arm64/arm64/locore.S
===================================================================
--- head/sys/arm64/arm64/locore.S
+++ head/sys/arm64/arm64/locore.S
@@ -128,6 +128,9 @@
/* Enable the mmu */
bl start_mmu
+ /* Load the new ttbr0 pagetable */
+ adr x27, pagetable_l0_ttbr0
+
/* Jump to the virtual address space */
ldr x15, .Lvirtdone
br x15
@@ -166,6 +169,7 @@
str x25, [x0, #BP_KERN_STACK]
str x24, [x0, #BP_KERN_L0PT]
str x23, [x0, #BP_BOOT_EL]
+ str x27, [x0, 40] /* kern_ttbr0 */
/* trace back starts here */
mov fp, #0
@@ -204,11 +208,14 @@
/* Load the kernel page table */
adr x24, pagetable_l0_ttbr1
/* Load the identity page table */
- adr x27, pagetable_l0_ttbr0
+ adr x27, pagetable_l0_ttbr0_boostrap
/* Enable the mmu */
bl start_mmu
+ /* Load the new ttbr0 pagetable */
+ adr x27, pagetable_l0_ttbr0
+
/* Jump to the virtual address space */
ldr x15, =mp_virtdone
br x15
@@ -218,6 +225,16 @@
ldr x4, =bootstack
ldr x4, [x4]
mov sp, x4
+
+ /* Load the kernel ttbr0 pagetable */
+ msr ttbr0_el1, x27
+ isb
+
+ /* Invalidate the TLB */
+ tlbi vmalle1
+ dsb sy
+ isb
+
b init_secondary
END(mpentry)
#endif
@@ -760,10 +777,13 @@
//.section .init_pagetable
.align 12 /* 4KiB aligned */
/*
- * 3 initial tables (in the following order):
+ * 6 initial tables (in the following order):
* L2 for kernel (High addresses)
* L1 for kernel
- * L1 for user (Low addresses)
+ * L0 for kernel
+ * L1 bootstrap for user (Low addresses)
+ * L0 bootstrap for user
+ * L0 for user
*/
pagetable:
.space PAGE_SIZE
@@ -771,7 +791,9 @@
.space PAGE_SIZE
pagetable_l0_ttbr1:
.space PAGE_SIZE
-pagetable_l1_ttbr0:
+pagetable_l1_ttbr0_bootstrap:
+ .space PAGE_SIZE
+pagetable_l0_ttbr0_boostrap:
.space PAGE_SIZE
pagetable_l0_ttbr0:
.space PAGE_SIZE
Index: head/sys/arm64/arm64/machdep.c
===================================================================
--- head/sys/arm64/arm64/machdep.c
+++ head/sys/arm64/arm64/machdep.c
@@ -1235,6 +1235,8 @@
valid = bus_probe();
cninit();
+ set_ttbr0(abp->kern_ttbr0);
+ cpu_tlb_flushID();
if (!valid)
panic("Invalid bus configuration: %s",
Index: head/sys/arm64/include/machdep.h
===================================================================
--- head/sys/arm64/include/machdep.h
+++ head/sys/arm64/include/machdep.h
@@ -37,6 +37,7 @@
uint64_t kern_delta;
vm_offset_t kern_stack;
vm_offset_t kern_l0pt; /* L1 page table for the kernel */
+ vm_paddr_t kern_ttbr0;
int boot_el; /* EL the kernel booted from */
int pad;
};
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Dec 12, 4:38 PM (7 h, 22 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
26881815
Default Alt Text
D22606.id.diff (2 KB)
Attached To
Mode
D22606: Switch to an empty ttbr0 pagetable when the MMU is enabled
Attached
Detach File
Event Timeline
Log In to Comment