From: Waldemar Kozaczuk <[email protected]>
Committer: Waldemar Kozaczuk <[email protected]>
Branch: master

arm on firecracker: map first 6GB one-to-one during early boot

Unlike QEMU, firecracker loads OSv kernel at 0x80080000 (slightly above 4GB).
This patch extends early boot mapping from 0-4GB to 0-6GB to allow OSv kernel
execute properly if linked with kernel_base set to 0x80080000 on firecracker.

Signed-off-by: Waldemar Kozaczuk <[email protected]>

---
diff --git a/arch/aarch64/boot.S b/arch/aarch64/boot.S
--- a/arch/aarch64/boot.S
+++ b/arch/aarch64/boot.S
@@ -188,16 +188,17 @@ ident_pt_l4_ttbr0:
         .quad 0
         .endr
 ident_pt_l3_ttbr0:
-        .quad ident_pt_l2_0_ttbr0 + 0x3
-        .quad ident_pt_l2_1_ttbr0 + 0x3
-        .rept 510
+        .quad ident_pt_l2_0_ttbr0 + 0x3 // Map 0GB-2GB one-to-one
+        .quad ident_pt_l2_1_ttbr0 + 0x3 // Map 2GB-4GB one-to-one
+        .quad ident_pt_l2_2_ttbr0 + 0x3 // Map 4GB-6GB one-to-one
+        .rept 509
         .quad 0
         .endr
 ident_pt_l2_0_ttbr0:
         index = 0
         offset = 0x00000000
         .rept 512
-        .quad (index << 21) + 0x401
+        .quad offset + (index << 21) + 0x411
         index = index + 1
         .endr
 ident_pt_l2_1_ttbr0:
@@ -207,6 +208,13 @@ ident_pt_l2_1_ttbr0:
         .quad offset + (index << 21) + 0x411
         index = index + 1
         .endr
+ident_pt_l2_2_ttbr0:
+        index = 0
+        offset = 0x80000000
+        .rept 512
+        .quad offset + (index << 21) + 0x411
+        index = index + 1
+        .endr
 .align 12
 ident_pt_l4_ttbr1:
         .rept 512

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/osv-dev/000000000000022fb205a9128bf5%40google.com.

Reply via email to