Flexpage: shared Mem

ba_f ba_f at rbg.informatik.tu-darmstadt.de
Tue May 10 16:44:35 CEST 2016


Hello,


writing a L4Linux Driver I'm expiring the C-Interface and low level(?) 
flexpages.

So far, I can push a Dataspace Capability via flexpage, and the 
receiving server is able to read its content.
But, whatever the server writes in that mem-region doesn't appear on the 
clients side.


/* client.c */

   l4_fpage_t fpage = l4_obj_fpage( dataspace, 0, L4_CAP_FPAGE_RW );
   l4_utcb_mr()->mr[0] = size;
   l4_utcb_br()->br[0] = fpage.raw;


/* server.c */

   l4_utcb_br()->br[0] = dataspace | L4_RCV_ITEM_SINGLE_CAP;

   l4_ipc_wait(l4_utcb(), 0, L4_IPC_NEVER);

   // allocate, and attach Dataspace
   ...
   // read & write Dataspace
   ...
   l4_utcb_mr()->mr[0] = returnValue;
   l4_ipc_reply_and_wait(l4_utcb(), l4_msgtag(0, 1, 0, 0),
				0, L4_IPC_NEVER);



As I am creating the fpage with L4_CAP_FPAGE_RW my guess was I can write 
to that mem-region and the client can read my changes.


Anyway, maybe I need some more understandings about capabilities & 
flexpages.
(Are there any precise slides or papers about this topic?)
So, the client creates a dataspace capability and allocates some memory.
But, what happens when the flexpage is pushed to the server?
The capability is copied and both pointing to the same allocated memory, 
or is the Cap and(!) the memory it is pointing to copied to server?



Thanks,
ba_f




More information about the l4-hackers mailing list