diff --git a/core/mmu.cc b/core/mmu.cc index cc6bbd9c5f807824907603b7753292bdd06ff6a0..0f879ede7ea348cb54cad6c52130acef9173d36c 100644 --- a/core/mmu.cc +++ b/core/mmu.cc @@ -55,7 +55,10 @@ namespace mmu { phys virt_to_phys(void *virt) { - return reinterpret_cast<phys>(virt) - 0xffff800000000000ull; + // For now, only allow non-mmaped areas. Later, we can either + // bounce such addresses, or lock them in memory and translate + assert(reinterpret_cast<phys>(virt) >= 0xffff800000000000ull); + return reinterpret_cast<phys>(virt) - 0xffff800000000000ull; } unsigned pt_index(void *virt, unsigned level)