Linux IO_MEM session

Johannes Kliemann kliemann at ...543...
Thu Jan 25 11:25:20 CET 2018


Hi Norman,


> just a shot in the dark: Have you called 'Rpc_entrypoint::manage(ds)'
> for your dataspace object? Or to put the question differently: Is the
> dataspace capability that you return in
> 'Io_mem_session_component::dataspace()' valid inside core? If not, you
> have most likely missed to associate your 'Dataspace_component' object
> with core's entrypoint.

I had this issue already in the first email where I tried to do exaclty
this. I read through it again and my explanation wasn't clear.
When I add

> _ds_cap = _ds_ep->manage(&_ds);

It fails to build with

> In file included from /.../genode/repos/base/include/dataspace/capability.h:17:0,
>                  from /.../genode/repos/base/include/dataspace/client.h:17,
>                  from /.../genode/repos/base-linux/src/include/linux_dataspace/client.h:17,
>                  from /.../genode/repos/base-linux/src/core/io_mem_session_component.cc:15:
> /.../genode/repos/base/include/base/capability.h: In instantiation of ‘Genode::Untyped_capability Genode::Capability< <template-parameter-1-1> >::_check_compatibility(const Genode::Capability<FROM_RPC_INTERFACE>&) const [with FROM_RPC_INTERFACE = Genode::Linux_dataspace; RPC_INTERFACE = Genode::Io_mem_dataspace; Genode::Untyped_capability = Genode::Native_capability]’:
> /.../genode/repos/base/include/base/capability.h:153:49:   required from ‘Genode::Capability< <template-parameter-1-1> >::Capability(const Genode::Capability<FROM_RPC_INTERFACE>&) [with FROM_RPC_INTERFACE = Genode::Linux_dataspace; RPC_INTERFACE = Genode::Io_mem_dataspace]’
> /.../genode/repos/base-linux/src/core/io_mem_session_component.cc:72:34:   required from here
> /.../genode/repos/base/include/base/capability.h:134:24: error: cannot convert ‘Genode::Linux_dataspace*’ to ‘Genode::Io_mem_dataspace*’ in initialization
>     RPC_INTERFACE *to = from;

I tried to circumvent this by trying different casts but I could not
find an appropriate solution (fooling the compiler with typedefs is not
one).
When you said that opening the file and adding the file descriptor was
enough I misinterpret that I don't need to call manage.

> Could you point me to a branch where I can have look at the code and
> reproduce the problem?

I have a state on [1] that contains a test `run/io_mem` which tests that
behaviour. I also have added a check to [2] so `attach` does not
segfault but throws an `Invalid_dataspace` exception.
In io_mem_session_component.cc I have already added (but commented out)
the line to call manage which does not build yet.

Thanks for your help and regards,
Johannes

[1]:
https://github.com/jklmnn/genode/tree/ac59709d4af406125454180e5453f30184505a8d
[2]:
https://github.com/jklmnn/genode/blob/ac59709d4af406125454180e5453f30184505a8d/repos/base-linux/src/lib/base/region_map_mmap.cc#L190
[3]:
https://github.com/jklmnn/genode/blob/ac59709d4af406125454180e5453f30184505a8d/repos/base-linux/src/core/io_mem_session_component.cc#L72




More information about the users mailing list