Open altostratous opened 3 years ago
I ran into the same issue. I resolved it by switching out the implementation of get_phys_addr()
with the implementation of virt_to_phys_user()
from this post (where I just used "self" for the pid).
I ran into the same issue. I resolved it by switching out the implementation of
get_phys_addr()
with the implementation ofvirt_to_phys_user()
from this post (where I just used "self" for the pid).
@kevinloughlin if sysconf(_SC_PAGE_SIZE)
returns 4096, both codes seem to do same works except the virt_to_phys_user()
doesn't have the assertion assert(entry & (1ULL << 63));
Does the entire code work well with you?
For this problem, insert a code that bypasses the assertion assert(entry & (1ULL << 63));
AND allocating the v_addr code at rev_mc
if (entry & (1ULL << 63) == 0 and (entry & (1ULL << 62) == 1)
, which means the physical address of the virtual address is not located at main memory(DRAM). I don't know why this happens considering that we have already allocated the memory through mmap.
I guess the reason that the physical address of the virtual address in not located at the main memory
is due to Lazy binding. Simply access the memory at the begining of get_phys_addr
could bypass, like volatile int a = *(int*)v_addr;
.
I'm compiling x86_64 (default build essentials on my system) Seems the read value out of
/proc/self/pagemap
has not the correct bits set. How can I fix the problem. Little bit of context: