Skip to content
Snippets Groups Projects
Commit 471f6468 authored by Avi Kivity's avatar Avi Kivity
Browse files

mmu: verify that virt_to_phys() points to a non-mmaped area

parent f4414341
No related branches found
No related tags found
No related merge requests found
...@@ -55,7 +55,10 @@ namespace mmu { ...@@ -55,7 +55,10 @@ namespace mmu {
phys virt_to_phys(void *virt) 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) unsigned pt_index(void *virt, unsigned level)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment