On 03.10.18 12:26, Nir Geller wrote:
Hi Jan,
After setting
num_msix_vectors = 0
in the root cell and inmate cell configuration I get good output when starting
up the inmate cell:
Initializing Jailhouse hypervisor v0.7 (220-g2ad429b) on CPU 0
Code location: 0xf0000040
Page pool usage after early setup: mem 30/4072, remap 32/131072
Initializing processors:
CPU 0... OK
CPU 1... OK
Adding virtual PCI device 00:00.0 to cell "AM57XX-EVM"
Page pool usage after late setup: mem 43/4072, remap 38/131072
Activating hypervisor
[ 83.501224] OF: PCI: host bridge /vpci@0 ranges:
[ 83.505887] OF: PCI: MEM 0x30100000..0x30101fff -> 0x30100000
[ 83.514707] pci-host-generic 30000000.vpci: ECAM at [mem
0x30000000-0x300fffff] for [bus 00]
[ 83.526709] pci-host-generic 30000000.vpci: PCI host bridge to bus 0001:00
[ 83.535943] pci_bus 0001:00: root bus resource [bus 00]
[ 83.543374] pci_bus 0001:00: root bus resource [mem 0x30100000-0x30101fff]
[ 83.552696] PCI: bus0: Fast back to back transfers disabled
[ 83.563731] pci 0001:00:00.0: BAR 0: assigned [mem 0x30100000-0x301000ff
64bit]
[ 83.573755] virtio-pci 0001:00:00.0: enabling device (0000 -> 0002)
[ 83.583232] uio_ivshmem 0001:00:00.0: using jailhouse mode
[ 83.591699] The Jailhouse is opening.
Adding virtual PCI device 00:00.0 to cell "AM572X-IDK-ICSS"
Shared memory connection established: "AM572X-IDK-ICSS" <--> "AM57XX-EVM"
Created cell "AM572X-IDK-ICSS"
Page pool usage after cell creation: mem 63/4072, remap 38/131072
[ 84.210960] Created Jailhouse cell "AM572X-IDK-ICSS"
root@am57xx-evm:~# lspci -v
...
0001:00:00.0 Unassigned class [ff00]: Red Hat, Inc Inter-VM shared memory
Subsystem: Red Hat, Inc Inter-VM shared memory
Flags: bus master, fast devsel, latency 0, IRQ 180
Memory at 30100000 (64-bit, non-prefetchable) [size=256]
Kernel driver in use: uio_ivshmem
root@am57xx-evm:~# cat /proc/interrupts
CPU0
17: 0 CBAR 32 Level gp_timer
18: 0 GICv2 29 Level arch_timer
...
180: 0 GICv2 32 Edge uio_ivshmem
...
Though I couldn't fire the interrupt from any cell.
From the linux root cell I tried mmaping 0x30100000, then writing 1 to the
mapped address+3.
I also tried using henning-schild-work/ivshmem-guest-code send_uio to address
/dev/uio0 with no success.
root@am57xx-evm:~# ./uio_send /dev/uio0 1 1 0
[UIO] opening file /dev/uio0
[UIO] count is 1
[UIO] writing 1
[UIO] ping #0
[UIO] Exiting...
root@am57xx-evm:~#
From the RTOS inmate I tried writing 1 to 0x3010000c, which seems to get the
cell stuck without any
error message from the hypervisor.
The current cell configurations are attached.
[...]
.root_cell = {
.name = "AM57XX-EVM",
.cpu_set_size = sizeof(config.cpus),
.num_memory_regions = ARRAY_SIZE(config.mem_regions),
.num_irqchips = ARRAY_SIZE(config.irqchips),
.num_pci_devices = ARRAY_SIZE(config.pci_devices),
/*.vpci_irq_base = 96,*/
},
You need to set .vpci_irq_base now, in both cells. You need a range of 4
consecutive GIC interrupts that are not in use by a physical devices. Each cell
should get its own range, though. In the configs for an AM57xx device I have
lying around here, we were using 96 for the root cell as well and 68 for the
non-root cell. If you non-root cell uses a device tree as well, make sure that
this number is entered there, too. Otherwise, 68 + <pci-device-function> % 3 is
the SPI number the ivshmem device will get on that side, which you have to
hard-code into your RTOS.
Jan
--
You received this message because you are subscribed to the Google Groups
"Jailhouse" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.