On 06.03.19 01:07, [email protected] wrote:
On Monday, March 4, 2019 at 3:42:47 AM UTC-7, J. Kiszka wrote:
On 03.03.19 08:42, [email protected] wrote:
Thank you for the responses. I tried your suggestions, but I haven't got it
working yet.
The issue is that I'm still getting errors trying to mmap /dev/uio0 at offset 0. No
matter what I do (change page size, etc.), I keep getting a "No such device"
error. See https://groups.google.com/d/msg/jailhouse-dev/fFDwXrzrBy0/jxe-0iRiEAAJ.
This needs to be be resolved first. Likely, the uio driver in the guest is not
bound to the ivshmem device. Check "lspci -k".
Is it possible that the register space address space is configured wrongly in
Jailhouse? Do I need to adjust the BAR masks or something? Is there a good
place in Jailhouse to insert a print statement? I have no idea how to debug
this.
I tried mmapping /sys/class/uio/uio0/device/resource0 instead, and it mmapped
successfully, but it doesn't seem to be the register address space. Or if it
is, I'm not writing to it correctly.
If not driver is bound, the device is disabled /wrt MMIO in the PCI control
register.
Jan
`lspci -k` shows uio_ivshmem listed under both "kernel driver in use" and "kernel
modules." So I think it's bound. Plus, I'm able to access the shared memory region from both
root cell and inmate. It's just the first memory region from /dev/uio0 (device registers) that I
can't mmap().
Is there anything else I can look at? Or any part in the code I could insert a
print statement that could help me debug this?
OK, this is what should happen from device perspective:
- driver programs the MMIO register address into BAR0:
pci_cfg_write_moderate() -> device->bar[0]
- driver enables the device via the PCI control registers:
ivshmem_write_command(), setting PCI_CMD_MASTER for MSI-X and
PCI_CMD_MEM for MMIO register access
- device "maps" the register region into the guest at ive->bar0_address
(practically, it registers a callback when intercepted MMIO accesses
hit this window)
- on MMIO acceses ivshmem_register_mmio() is invoked and dispatches the
request
There is a similar pattern for emulating the MSI-X register region which is used
by the driver to program the interrupt vectors. But you already have troubles
with the main registers, so this is secondary.
HTH,
Jan
--
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux
--
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.