Discussion:
Accessing virtual address of normal world in secure world in genode-tz
Abhishek Kumar
2017-06-12 08:32:07 UTC
Permalink
Hello
I am trying to convert virtual address (corresponding to normal world)
stored in instruction pointer into virtual address in tz_vmm, in order to
read the instruction which caused the exception in normal world linux and
process accordingly. Though we do have physical address (using va_to_pa
function), but it is not helping in any way to read the instruction stored
at that physical address. Is there any way other than switching MMU off.

Thanks
Abhishek
r***@mpi-sws.org
2017-06-12 16:10:49 UTC
Permalink
Can we use the following function in
repos/os/src/server/tz_vmm/include/ram.h for this? Take normal world
virtal address from _state->ip, get corresponding physical address using
va_to_pa function, and call the following with that physical address?

Genode::addr_t va(Genode::addr_t phys)
{
if ((phys < _base) || (phys > (_base + _size)))
throw Invalid_addr();
return _local + (phys - _base);
}

Looks like a one-to-one mapping between va to pa here. So should the
following give the correct value in _state->ip?

Genode::addr_t temp = va_to_pa(_state->ip);
printf("ip val:%d\n",*(int*)temp);

Thanks!
Riju
Post by Abhishek Kumar
Hello
I am trying to convert virtual address (corresponding to normal world)
stored in instruction pointer into virtual address in tz_vmm, in order to
read the instruction which caused the exception in normal world linux and
process accordingly. Though we do have physical address (using va_to_pa
function), but it is not helping in any way to read the instruction stored
at that physical address. Is there any way other than switching MMU off.
Thanks
Abhishek
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org!
http://sdm.link/slashdot_______________________________________________
genode-main mailing list
https://lists.sourceforge.net/lists/listinfo/genode-main
Loading...