Hi, Jan,

I have one new issue and not sure it is a know issue.

The issue is: when I ifconfig up ivshmem-net NIC in root cell firstly and 
then ifconfig up ivshmem NIC in inmate cell (runing Linux),  I can ping 
through between two NICs, but if I ifconfig up NIC in inmate cell before 
ifconfig up the NIC in root cell, I can't ping through between two NICs, 
and I found NIC in inmate can only receive packet sending from root cell 
NIC, but NIC in root cell can't receive any packet and there is also no irq 
received for ivshmem NIC.

Thanks.

Best Regards,
Jiafei.

在2020年11月13日星期五 UTC+8 下午5:55:52<Peter pan> 写道:

> Thanks Jan, now it works with INTx.
>
> Jiafei.
>
> 在2020年11月12日星期四 UTC+8 下午9:05:15<[email protected]> 写道:
>
>> On 12.11.20 09:50, Peter pan wrote: 
>> > Dear Jailhouse Community, 
>> > 
>> > I am runing Jailhouse on kernel v5.4, and port some ivshmem patches 
>> > from http://git.kiszka.org/?p=linux.git;a=summary 
>> > <http://git.kiszka.org/?p=linux.git;a=summary> 
>> > 
>> > The issue I have is uio_shmem and ivshmem-net will probe failed when I 
>> > use MSI-X mode for vPCI after I run Jailhouse enable command.  Please 
>> > find the folowing log: 
>> > 
>> > [   21.581019] jailhouse: loading out-of-tree module taints kernel. 
>> > 
>> > [   30.000988] pci-host-generic fb500000.pci: host bridge /pci@0 
>> ranges: 
>> > 
>> > [   30.000997] pci-host-generic fb500000.pci:   MEM 
>> > 0xfb600000..0xfb603fff -> 0xfb600000 
>> > 
>> > [   30.001028] pci-host-generic fb500000.pci: ECAM at [mem 
>> > 0xfb500000-0xfb5fffff] for [bus 00] 
>> > 
>> > [   30.001081] pci-host-generic fb500000.pci: PCI host bridge to bus 
>> 0003:00 
>> > 
>> > [   30.001085] pci_bus 0003:00: root bus resource [bus 00] 
>> > 
>> > [   30.001087] pci_bus 0003:00: root bus resource [mem 
>> > 0xfb600000-0xfb603fff] 
>> > 
>> > [   30.001105] pci 0003:00:00.0: [110a:4106] type 00 class 0xff0000 
>> > 
>> > [   30.001128] pci 0003:00:00.0: reg 0x10: [mem 0x00000000-0x00000fff] 
>> > 
>> > [   30.001136] pci 0003:00:00.0: reg 0x14: [mem 0x00000000-0x000001ff] 
>> > 
>> > [   30.001340] pci 0003:00:01.0: [110a:4106] type 00 class 0xff0001 
>> > 
>> > [   30.001359] pci 0003:00:01.0: reg 0x10: [mem 0x00000000-0x00000fff] 
>> > 
>> > [   30.001368] pci 0003:00:01.0: reg 0x14: [mem 0x00000000-0x000001ff] 
>> > 
>> > [   30.002389] pci 0003:00:00.0: BAR 0: assigned [mem 
>> 0xfb600000-0xfb600fff] 
>> > 
>> > [   30.002397] pci 0003:00:01.0: BAR 0: assigned [mem 
>> 0xfb601000-0xfb601fff] 
>> > 
>> > [   30.002403] pci 0003:00:00.0: BAR 1: assigned [mem 
>> 0xfb602000-0xfb6021ff] 
>> > 
>> > [   30.002409] pci 0003:00:01.0: BAR 1: assigned [mem 
>> 0xfb602200-0xfb6023ff] 
>> > 
>> > [   30.002478] uio_ivshmem 0003:00:00.0: enabling device (0000 -> 0002) 
>> > 
>> > [   30.002505] uio_ivshmem 0003:00:00.0: state_table at 
>> > 0x00000000fb700000, size 0x0000000000001000 
>> > 
>> > [   30.002512] uio_ivshmem 0003:00:00.0: rw_section at 
>> > 0x00000000fb701000, size 0x0000000000009000 
>> > 
>> > [   30.002520] uio_ivshmem 0003:00:00.0: input_sections at 
>> > 0x00000000fb70a000, size 0x0000000000006000 
>> > 
>> > [   30.002524] uio_ivshmem 0003:00:00.0: output_section at 
>> > 0x00000000fb70a000, size 0x0000000000002000 
>> > 
>> > [   30.002576] uio_ivshmem: probe of 0003:00:00.0 failed with error -28 
>> > 
>> > [   30.002620] ivshmem-net 0003:00:01.0: enabling device (0000 -> 0002) 
>> > 
>> > [   30.002664] ivshmem-net 0003:00:01.0: TX memory at 
>> > 0x00000000fb801000, size 0x000000000007f000 
>> > 
>> > [   30.002667] ivshmem-net 0003:00:01.0: RX memory at 
>> > 0x00000000fb880000, size 0x000000000007f000 
>> > 
>> > [   30.047630] ivshmem-net: probe of 0003:00:01.0 failed with error -28 
>> > 
>> > [   30.047714] The Jailhouse is opening. 
>> > 
>> > 
>> > After some investigation I found the dts node of vPIC is added to root 
>> > cell by using vpci_template.dts,  the Jailhouse 
>> > driver create_vpci_of_overlay() in driver/pci.c can't add the handler 
>> of 
>> > "msi-parent" to this PCI node,  but the kernel driver of the virtual 
>> PCI 
>> > device use the following function  
>> > ret = pci_alloc_irq_vectors(pdev, 1, 2, PCI_IRQ_LEGACY | PCI_IRQ_MSIX); 
>> > So the  driver will probe MSIX irq for the device, because there is no 
>> > msi controller is speficied to vPCI, the result is no irq-domain is 
>> > provided to this PCI and irq allocated failed. 
>> > 
>> > so how to fix such issue? Appreciate any comments and suggestions, 
>> thanks. 
>>
>> The vPCI support in Jailhouse injects interrupts as legacy INTx. For 
>> that, you need to provide up to 4 (less if you have less ivshmem 
>> devices) consecutive SPIs that are not in use by real devices (in any 
>> cell). See other arm64 configs, specifically look for vpci_irq_base. 
>>
>> Jan 
>> -- 
>> Siemens AG, T RDA IOT 
>> 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].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jailhouse-dev/aa38bda6-400a-4342-8b72-e033c56fd89dn%40googlegroups.com.

Reply via email to