Hey,
I'm using Freescale i,MX53 QSB. I'm trying to transfer data between the secure world and the normal world, at the moment, I manage to transfer data using the CPU registers (using Linux kernel module I wrote), and I manage to receive them on the hypervisor. I would like to transfer larger structure, for example a memory buffer, I'm allocating in the normal world kernel a buffer, I send the physical address (using __pa) to the secure world.
My question is, how in the Genode hypervisor I can access this memory address ? Any idea will be helpful
Thanks Ofer
Hi Ofer,
On 05/05/2015 11:06 AM, Ofer Hasson wrote:
Hey,
I'm using Freescale i,MX53 QSB. I'm trying to transfer data between the secure world and the normal world, at the moment, I manage to transfer data using the CPU registers (using Linux kernel module I wrote), and I manage to receive them on the hypervisor. I would like to transfer larger structure, for example a memory buffer, I'm allocating in the normal world kernel a buffer, I send the physical address (using __pa) to the secure world.
My question is, how in the Genode hypervisor I can access this memory address ? Any idea will be helpful
just as a side-note: we distinguish between hypervisor and virtual-machine monitor. Our hypervisor/kernel does not do anything meaningful with the "normal world", it just reflects exceptions (e.g. secure-monitor-calls) of the "normal world" to the dedicated VMM. The VMM - a simple userland component - should do the actual work.
In our small example, which I assume you were using as starting point, the VMM already has all the physical memory of the "normal world" guest OS already attached (in a way that it does not end up in the cache) to its virtual address space. The abstraction to lookup the virtual address of the VMM with respect to a given physical address of the guest memory is the "Ram" class (repos/src/server/tz_vmm/include/ram.h).
Be careful when using a memory buffer in Linux to propagate content to the "secure world". That memory has to be mapped within the Linux kernel to _not_ end up within the cache too. Otherwise you will get an incoherent view to the memory between both worlds.
Regards Stefan
Thanks Ofer
One dashboard for servers and applications across Physical-Virtual-Cloud Widest out-of-the-box monitoring support with 50+ applications Performance metrics, stats and reports that give you Actionable Insights Deep dive visibility with transaction tracing using APM Insight. http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
genode-main mailing list genode-main@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/genode-main
Hi Ofer,
On 05.05.2015 11:06, Ofer Hasson wrote:
My question is, how in the Genode hypervisor I can access this memory address ? Any idea will be helpful
You should have a look at '_ram_iomem' in [1]. It is the IO_MEM session of the VMM that references the RAM of the normal world. Once estalished, this session provides a refernce to the RAM in form of a so-called dataspace. This dataspace can be used to attach the RAM locally via 'env()->rm_session()'. The VMM stores the resulting local address in 'Vm_base::_ram'. So, if you're in the VMM, you can acces the RAM through this object. If you're in another component you would have to request the VMM to release the IO_MEM-Region to be able to allocate it through a new IO_MEM session.
Cheers, Martin
[1] repos/os/src/server/tz_vmm/include/vm_base.h
Thank you very much, it works.
On Tue, May 5, 2015 at 12:59 PM, Martin Stein <martin.stein@...1...> wrote:
Hi Ofer,
On 05.05.2015 11:06, Ofer Hasson wrote:
My question is, how in the Genode hypervisor I can access this memory address ? Any idea will be helpful
You should have a look at '_ram_iomem' in [1]. It is the IO_MEM session of the VMM that references the RAM of the normal world. Once estalished, this session provides a refernce to the RAM in form of a so-called dataspace. This dataspace can be used to attach the RAM locally via 'env()->rm_session()'. The VMM stores the resulting local address in 'Vm_base::_ram'. So, if you're in the VMM, you can acces the RAM through this object. If you're in another component you would have to request the VMM to release the IO_MEM-Region to be able to allocate it through a new IO_MEM session.
Cheers, Martin
[1] repos/os/src/server/tz_vmm/include/vm_base.h
One dashboard for servers and applications across Physical-Virtual-Cloud Widest out-of-the-box monitoring support with 50+ applications Performance metrics, stats and reports that give you Actionable Insights Deep dive visibility with transaction tracing using APM Insight. http://ad.doubleclick.net/ddm/clk/290420510;117567292;y _______________________________________________ genode-main mailing list genode-main@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/genode-main