Hi,
I am not sure if you are still interested in it but I have just finally found some time to work on it and it seems I got it work. I will be sending a proper patch soon but here is an inlined one you can apply
manually to the current master:
diff --git a/arch/aarch64/arch-setup.cc b/arch/aarch64/arch-setup.cc
index 24e007c4..89dceae9 100644
--- a/arch/aarch64/arch-setup.cc
+++ b/arch/aarch64/arch-setup.cc
@@ -36,12 +36,11 @@
void setup_temporary_phys_map()
{
- // duplicate 1:1 mapping into phys_mem
+ // duplicate 1:1 mapping into the lower part of phys_mem
u64 *pt_ttbr0 = reinterpret_cast<u64*>(processor::read_ttbr0());
- u64 *pt_ttbr1 = reinterpret_cast<u64*>(processor::read_ttbr1());
for (auto&& area : mmu::identity_mapped_areas) {
auto base = reinterpret_cast<void*>(get_mem_area_base(area));
- pt_ttbr1[mmu::pt_index(base, 3)] = pt_ttbr0[0];
+ pt_ttbr0[mmu::pt_index(base, 3)] = pt_ttbr0[0];
}
mmu::flush_tlb_all();
}
diff --git a/core/mmu.cc b/core/mmu.cc
index 007d4331..33ae8407 100644
--- a/core/mmu.cc
+++ b/core/mmu.cc
@@ -78,7 +78,7 @@ public:
};
constexpr uintptr_t lower_vma_limit = 0x0;
-constexpr uintptr_t upper_vma_limit = 0x800000000000;
+constexpr uintptr_t upper_vma_limit = 0x400000000000;
typedef boost::intrusive::set<vma,
bi::compare<vma_compare>,
diff --git a/include/osv/mmu-defs.hh b/include/osv/mmu-defs.hh
index 18edf441..fd6a85a6 100644
--- a/include/osv/mmu-defs.hh
+++ b/include/osv/mmu-defs.hh
@@ -46,12 +46,12 @@ constexpr uintptr_t mem_area_size = uintptr_t(1) << 44;
constexpr uintptr_t get_mem_area_base(mem_area area)
{
- return 0xffff800000000000 | uintptr_t(area) << 44;
+ return 0x400000000000 | uintptr_t(area) << 44;
}
static inline mem_area get_mem_area(void* addr)
{
- return mem_area(reinterpret_cast<uintptr_t>(addr) >> 44 & 7);
+ return mem_area(reinterpret_cast<uintptr_t>(addr) >> 44 & 3);
}
constexpr void* translate_mem_area(mem_area from, mem_area to, void* addr)
diff --git a/scripts/loader.py b/scripts/loader.py
index 6878a7a3..0ce782d0 100755
--- a/scripts/loader.py
+++ b/scripts/loader.py
@@ -27,7 +27,7 @@ class status_enum_class(object):
pass
status_enum = status_enum_class()
-phys_mem = 0xffff800000000000
+phys_mem = 0x400000000000
def pt_index(addr, level):
return (addr >> (12 + 9 * level)) & 511
Best regards,
Waldek