shared memory between Linux root cell and erika cell on jetson tx2

Forum related to ERIKA Enterprise and RT-Druid version 3

Moderator: paolo.gai

Post Reply
Posts: 5
Joined: Fri Feb 21, 2020 9:42 am

shared memory between Linux root cell and erika cell on jetson tx2

Post by Matt07 »


I try to set up a shared memory between a Linux root cell and an erika cell on the jetson tx2,

I used this code for the erika cell : ... mem-demo.c

And on Linux I used this driver : ... _ivshmem.c

and this user space application : ... uio_send.c

On Erika side it's ok I am able to find pci devices and the connection seems established :

Code: Select all

Initializing unit: irqchip
Initializing unit: PCI
Adding virtual PCI device 00:00.0 to cell "Jetson-TX2"
Adding virtual PCI device 00:0f.0 to cell "Jetson-TX2"
Page pool usage after late setup: mem 101/16355, remap 101/131072
Activating hypervisor
Adding virtual PCI device 00:00.0 to cell "jetson-tx2-can"
Shared memory connection established: "jetson-tx2-can" <--> "Jetson-TX2"
Created cell "jetson-tx2-can"
Page pool usage after cell creation: mem 119/16355, remap 101/131072
Cell "jetson-tx2-can" can be loaded
Started cell "jetson-tx2-can"
IVSHMEM: Found 1af4:1110 at 00:00.0
IVSHMEM: shmem is at 0x0000000275000000
IVSHMEM: bar0 is at 0x0000000275001000
IVSHMEM: mapped shmem and bars, got position 0x0000000000000001
IVSHMEM: Hello from bare-metal ivshmem-demo inmate!!!
IVSHMEM: Enabled IRQ:0x14c
IVSHMEM: Done setting up...
IVSHMEM: waiting for interrupt.

On Linux side I could insert the uio driver and I am able to see the files /dev/uio*, however the memory map fails in the user space program :

mmap failed (0x0xffffffffffffffff)

I found this jailhouse topic which talk about the same issue :!topic ... O8v1z_-qWI

I changed the bar_mask as recommended in this post :

Memory mappings have to be page-aligned, /wrt the size and start
address. In order to make Linux reserve a full page for an MMIO resource
of some device (so that it can be handed out to userspace separately),
tune the bar_mask for the respective region. 0xfffff000, 0xffffffff, ...
should do the trick here.
but the memory map still fails.

Do you know how I could fix this issue ?

Thank you,

Best regards
Post Reply