Adding another vpci

126 views
Skip to first unread message

Moustafa Nofal

unread,
Jan 10, 2022, 4:31:16 PM1/10/22
to Jailhouse
Hi, 
I intend to add another Linux on Raspberry Pi4. So, I added also a memory region on rpi4.c and extended the size of mem_regions by, and managed to get working. I added a pci device, and extended the array by one, and the pci device is added, but without kernel driver in use? So, how to add the driver to it?

Henning Schild

unread,
Jan 11, 2022, 4:38:52 AM1/11/22
to Moustafa Nofal, Jailhouse
Am Mon, 10 Jan 2022 13:31:16 -0800 (PST)
schrieb Moustafa Nofal <mustafa...@gmail.com>:
What kind of device is it? The kernel should simply find it and bind
any driver that fits, in case it has one that does.

If it is a virtual network device based on ivshmem2 you need to add the
pci device, and multiple memory regions for it
JAILHOUSE_SHMEM_NET_REGIONS for the driver to pick it up correctly you
need to set the shmem_protocol of the pci device to
JAILHOUSE_SHMEM_PROTO_VETH and set the index shmem_regions_start to
your newly added memory regions.

regards,
Henning

Moustafa Nofal

unread,
Jan 11, 2022, 5:10:32 AM1/11/22
to Jailhouse
The device is virtual pci, I was missing this JAILHOUSE_SHMEM_NET_REGIONS. I added it on a reserved place, away from other memory regions and its and another virtual ethernet is added. I have another question regarding particularly these two memroy regions, 
                /* MMIO 1 (permissive) */ {
                        .phys_start = 0xfd500000,
                        .virt_start = 0xfd500000,
                        .size =        0x1b00000,
                        .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
                                JAILHOUSE_MEM_IO,
                },
                /* MMIO 2 (permissive) */{
                        .phys_start = 0x600000000,
                        .virt_start = 0x600000000,
                        .size =         0x4000000,
                        .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
                                JAILHOUSE_MEM_IO,
                },
In my system it points to pcie device and RAM(non-reserved for jailhouse). What are these regions? and are they related to JAILHOUSE_SHMEM_NET_REGIONS, because what I read is that this command reserves four memory regions. 
One more question, on the second linux cell configuration, I added the memory region with correct flags, that was added on the root cell and I am trying to configure the pci communication. 
On root cell:
                        /* IVSHMEM 0001:00:02.0 (networking) */
                {
                        .type = JAILHOUSE_PCI_TYPE_IVSHMEM,
                        .domain = 2,
                        .bdf = 2 << 3,
                        .bar_mask = JAILHOUSE_IVSHMEM_BAR_MASK_INTX,
                        .shmem_regions_start = 12,
                        .shmem_dev_id = 0,
                        .shmem_peers = 2,
                        .shmem_protocol = JAILHOUSE_SHMEM_PROTO_VETH,
                },
and 
                JAILHOUSE_SHMEM_NET_REGIONS(0x30000000, 0),

On 2nd Linux cell:
                { /* IVSHMEM 00:02.0 (networking) */
                        .type = JAILHOUSE_PCI_TYPE_IVSHMEM,
                        .bdf = 2 << 3,
                        .bar_mask = JAILHOUSE_IVSHMEM_BAR_MASK_INTX,
                        .shmem_regions_start = 6,
                        .shmem_dev_id = 1,
                        .shmem_peers = 2,
                        .shmem_protocol = JAILHOUSE_SHMEM_PROTO_VETH,
                },
and                 JAILHOUSE_SHMEM_NET_REGIONS(0x30000000, 1),
I followed the documentation, the .bdf is the same, only 2 peers , and I put also the correct memory region. However, no ethernet is added on the second non-root Linux
Kind regards
Moustafa Noufale

Moustafa Nofal

unread,
Jan 11, 2022, 7:54:17 AM1/11/22
to Jailhouse
Hi, 
Everything is working smoothly now. I have now only question regarding these two memory regions:

Moustafa Nofal

unread,
Jan 11, 2022, 3:01:49 PM1/11/22
to Jailhouse
Almost everything went well, but when I started the fourth cell (bare-metal), I got this error, and jailhouse hangs, so I am able to
1- create two linux non-root cells and inter-cell communication works fine, and(including ethernet)
2- one bare-metal and linux non-root cell.(inter-cell communication works fine (also ethernet)
I added one region for the newly created cell in all files with taking care of correct flags, enlarged the state memory region and the all-cells R/W memory region, and here is what I edited in the root cell:

Adding virtual PCI device 00:00.0 to cell "rpi4-linux-demo-2"
Shared memory connection established, peer cells:
                         /* IVSHMEM 0001:00:00.0 (demo) */
                        .type = JAILHOUSE_PCI_TYPE_IVSHMEM,
                        .domain = 1,
                        .bdf = 0 << 3,
                        .bar_mask = JAILHOUSE_IVSHMEM_BAR_MASK_INTX,
                        .shmem_regions_start = 0,
                        .shmem_dev_id = 0,
                        .shmem_peers = 4,
                        .shmem_protocol = JAILHOUSE_SHMEM_PROTO_UNDEFINED,
                },

And in any other cell i change only the dev_id, so I have 0,1,2,3, the second PCI is an VETH and is working fine for both linux cells together, the problem only comes if I created the baremetal cell.

Bharathiraja Nallathambi

unread,
Oct 30, 2023, 8:23:36 AM10/30/23
to Jailhouse
Hi  Moustafa Nofal,
   I am trying to run two Linux inmate on Raspberry Pi 4, Can you please help me with the root cell configuration, and two Linux inmate cell configuration ?

Thanks and Regards,
Bharathiraja Nallathambi

Di Majo Massimiliano

unread,
Apr 11, 2024, 6:39:03 PMApr 11
to Jailhouse
MT103/202 DIRECT WIRE TRANSFER
PAYPAL TRANSFER
CASHAPP TRANSFER
ZELLE TRANSFER
LOAN DEAL
TRANSFER WISE
WESTERN UNION TRANSFER
BITCOIN FLASHING
BANK ACCOUNT LOADING/FLASHING
IBAN TO IBAN TRANSFER
MONEYGRAM TRANSFER
IPIP/DTC
SLBC PROVIDER
CREDIT CARD TOP UP
DUMPS/ PINS
SEPA TRANSFER
WIRE TRANSFER
BITCOIN TOP UP
GLOBALPAY INC US
SKRILL USA
UNIONPAY RECEIVER

Thanks.


NOTE; ONLY SERIOUS / RELIABLE RECEIVERS CAN CONTACT.

DM ME ON WHATSAPP
+44 7529 555638
Reply all
Reply to author
Forward
0 new messages