aarch64 ivshmem issues
Hi All,
I am using the ivshmem device to create shared memory between an x86_64 host and aarch64 guest. The guest has ubuntu server 14.04 installed with kernel version 3.13.0. I wrote a kernel driver to drive the ivshmem device (as a pci driver) however, the driver was never registered:
Can anyone help me point out what is wrong?
My qemu launch script looks like this:
qemu-system-aarch64 -machine virt,highmem=off -cpu cortex-a57 -m 1024M \ -drive file=<path-to-img>,id=hd0,if=none,format=qcow2 \ -device virtio-blk-device,drive=hd0 \ -device ivshmem,shm=vshmtest,size=16M \ -kernel <path-to-kernel> \ -initrd <path-to-initrd> \
The skeleton of the kernel driver is like this:
static struct pci_device_id vshmem_id_table[] = {
{ 0x1af4, 0x1110, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
{ 0 },
};static struct pci_driver vshmem_driver = {
.name = “vshmtest”,
.id_table = vshmem_id_table,
.probe = vshmem_probe_device,
.remove = vshmem_remove_device,
};
somewhere in module init:
pci_register_driver(&vshmem_driver);
The same driver code works well with x86_64 and ppc64.
Best Regards,
Hello!
Quoted 3 lines
I am using the ivshmem device to create shared memory between an
x86_64host and aarch64 guest. The guest has ubuntu server 14.04 installed with kernel version 3.13.0. I wrote a kernel driver to drive the ivshmem device (as a pci driver) however, the driver was never registered:
There should be no problem with ivshmem itself on ARM64. Last year we did some tests with it, and it worked fine out of the box.
Since you are saying that "the driver was never registered", then, perhaps, something is wrong with your guest kernel config. For the start, check whether PCI subsystem and PCI generic host is enabled. Mainline kernels older than 4.3 do not support generic PCI host controller on ARM64, therefore you have no PCI bus. If your distro has older kernel, it is likely to suffer from this problem. Check 'lspci' output on your guest.
Kind regards,
Pavel Fedin
Expert Engineer
Samsung Electronics Research center Russia
Hi Pavel,
Thanks! That's right, ivshmem works just fine on ARM64 once I switch to the latest kernel and I can see the PCI bridge and devices now.
Thank you for the help,
Meng
Quoted 14 lines · Pavel Fedin
Hello!
Quoted 3 lines
I am using the ivshmem device to create shared memory between an
x86_64host and aarch64 guest. The guest has ubuntu server 14.04 installed with kernel version 3.13.0. I wrote a kernel driver to drive the ivshmem device (as a pci driver) however, the driver was never registered:There should be no problem with ivshmem itself on ARM64. Last year we did some tests with it, and it worked fine out of the box.
Since you are saying that "the driver was never registered", then, perhaps, something is wrong with your guest kernel config. For the start, check whether PCI subsystem and PCI generic host is enabled. Mainline kernels older than 4.3 do not support generic PCI host controller on ARM64, therefore you have no PCI bus. If your distro has older kernel, it is likely to suffer from this problem. Check 'lspci' output on your guest.Kind regards,
Pavel Fedin
Expert Engineer
Samsung Electronics Research center Russia