Re: How to pass through off-chip USB controller


Tzeng, Tonny <tonny.tzeng@...>
 

Hi Edwin,

 

Oops, the lspci output generated by root this time. Thanks.

01:00.0 USB controller: Fresco Logic FL1100 USB 3.0 Host Controller (rev 20) (prog-if 30 [XHCI])

       Subsystem: Fresco Logic FL1100 USB 3.0 Host Controller

       Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx+

       Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-

       Latency: 0, Cache Line Size: 64 bytes

       Interrupt: pin A routed to IRQ 22

       Region 0: Memory at 91500000 (64-bit, non-prefetchable) [size=64K]

       Region 2: Memory at 91511000 (64-bit, non-prefetchable) [size=4K]

       Region 4: Memory at 91510000 (64-bit, non-prefetchable) [size=4K]

       Capabilities: [40] Power Management version 3

             Flags: PMEClk- DSI- D1+ D2- AuxCurrent=375mA PME(D0+,D1+,D2-,D3hot+,D3cold+)

             Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-

       Capabilities: [50] MSI: Enable- Count=1/8 Maskable- 64bit+

             Address: 0000000000000000  Data: 0000

       Capabilities: [70] Express (v2) Endpoint, MSI 00

             DevCap:      MaxPayload 512 bytes, PhantFunc 0, Latency L0s <64ns, L1 <1us

                    ExtTag- AttnBtn- AttnInd- PwrInd- RBE+ FLReset- SlotPowerLimit 10.000W

             DevCtl:      CorrErr- NonFatalErr- FatalErr- UnsupReq-

                    RlxdOrd+ ExtTag- PhantFunc- AuxPwr- NoSnoop+

                    MaxPayload 256 bytes, MaxReadReq 512 bytes

             DevSta:      CorrErr- NonFatalErr- FatalErr- UnsupReq- AuxPwr+ TransPend-

             LnkCap:      Port #0, Speed 5GT/s, Width x1, ASPM L0s L1, Exit Latency L0s unlimited, L1 unlimited

                    ClockPM- Surprise- LLActRep- BwNot- ASPMOptComp-

             LnkCtl:      ASPM Disabled; RCB 64 bytes Disabled- CommClk+

                    ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-

             LnkSta:      Speed 5GT/s (ok), Width x1 (ok)

                    TrErr- Train- SlotClk+ DLActive- BWMgmt- ABWMgmt-

             DevCap2: Completion Timeout: Not Supported, TimeoutDis+, LTR-, OBFF Not Supported

                    AtomicOpsCap: 32bit- 64bit- 128bitCAS-

             DevCtl2: Completion Timeout: 50us to 50ms, TimeoutDis-, LTR-, OBFF Disabled

                    AtomicOpsCtl: ReqEn-

             LnkCtl2: Target Link Speed: 5GT/s, EnterCompliance- SpeedDis-

                    Transmit Margin: Normal Operating Range, EnterModifiedCompliance- ComplianceSOS-

                    Compliance De-emphasis: -6dB

             LnkSta2: Current De-emphasis Level: -3.5dB, EqualizationComplete-, EqualizationPhase1-

                    EqualizationPhase2-, EqualizationPhase3-, LinkEqualizationRequest-

       Capabilities: [b0] MSI-X: Enable+ Count=8 Masked-

             Vector table: BAR=2 offset=00000000

             PBA: BAR=4 offset=00000000

       Capabilities: [100 v1] Advanced Error Reporting

             UESta: DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-

             UEMsk: DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-

             UESvrt:      DLP+ SDES+ TLP- FCP+ CmpltTO- CmpltAbrt- UnxCmplt- RxOF+ MalfTLP+ ECRC- UnsupReq- ACSViol-

             CESta: RxErr- BadTLP- BadDLLP- Rollover- Timeout- AdvNonFatalErr-

             CEMsk: RxErr- BadTLP- BadDLLP- Rollover- Timeout- AdvNonFatalErr+

             AERCap:      First Error Pointer: 00, ECRCGenCap+ ECRCGenEn- ECRCChkCap+ ECRCChkEn-

                    MultHdrRecCap- MultHdrRecEn- TLPPfxPres- HdrLogCap-

             HeaderLog: 00000000 00000000 00000000 00000000

       Kernel driver in use: xhci_hcd

       Kernel modules: xhci_pci

Regards,

Tonny

 

From: acrn-users@... [mailto:acrn-users@...] On Behalf Of Zhai, Edwin
Sent: Monday, July 30, 2018 4:14 PM
To: acrn-users@...
Subject: Re: [acrn-users] How to pass through off-chip USB controller

 

You didn't dump the pci capabilities, so pls. use sudo for lspci.

The error comes from MSIx accessing, and need debug...

 

On 2018/7/30 15:39, Tzeng, Tonny wrote:

Hi Edwin,

 

Thanks for helping out. The `lspci –s 1:0.0 –vvv’ generates below output:

 

01:00.0 USB controller: Fresco Logic FL1100 USB 3.0 Host Controller (rev 20) (prog-if 30 [XHCI])

       Subsystem: Fresco Logic FL1100 USB 3.0 Host Controller

       Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx+

       Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-

       Latency: 0, Cache Line Size: 64 bytes

       Interrupt: pin A routed to IRQ 22

       Region 0: Memory at 91500000 (64-bit, non-prefetchable) [size=64K]

       Region 2: Memory at 91511000 (64-bit, non-prefetchable) [size=4K]

       Region 4: Memory at 91510000 (64-bit, non-prefetchable) [size=4K]

       Capabilities: <access denied>

       Kernel driver in use: xhci_hcd

       Kernel modules: xhci_pci

 

Debugging DM using gdb indicates the program stops at hw/pci/passthrough.c:560. Any idea what could be the cause? I don’t know how to capture the whole screen output from the UOS kernel, the detailed gdb log is attached for your inspection. Thanks.

 

Regards,

Tonny

 

From: acrn-users@... [mailto:acrn-users@...] On Behalf Of Zhai, Edwin
Sent: Monday, July 30, 2018 1:46 PM
To: acrn-users@...
Subject: Re: [acrn-users] How to pass through off-chip USB controller

 

Tonny,

The config is ok.

Could you pls. try gdb to catch the seg fault? Just replace the 'acrn-dm' with 'gdb --args acrn-dm...' in your launch script.

Did you paste all your console output when launch UOS?  And 'lspci -s 1:0.0 -vvv' in SOS should give some helpful info.

thanks,

Edwin

 

On 2018/7/30 11:21, Tzeng, Tonny wrote:

Hi Edwin,

 

Thanks for asking, here are my setup:

- HV/DM: f815415

- SOS: Clear 24030 w/ 4.14.57-69 kernel

- List of PCI devices

...

00:1f.0 ISA bridge: Intel Corporation Celeron N3350/Pentium N4200/Atom E3900 Series Low Pin Count Interface (rev 0b)

00:1f.1 SMBus: Intel Corporation Celeron N3350/Pentium N4200/Atom E3900 Series SMBus Controller (rev 0b)

01:00.0 USB controller: Fresco Logic FL1100 USB 3.0 Host Controller (rev 20)

02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 0c)

03:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 0c)

- List of USB devices

...

Bus 003 Device 002: ID 03e7:2150 Intel Myriad VPU [Movidius Neural Compute Stick]

...

- I am using my own customized launch_uos.sh as attached. It’s basically logically the same as the reference script, I just added “-s 26,passthru,01/0/0” to pass through the USB controller.

- I got Segmentation fault during the DM boots the UOS kernel. The same Segfault happened both in Ubuntu UOS and ClearLinux UOS.

cpu1 online=1

cpu2 online=1

cpu3 online=1

creating tap device acrn_tap-vm3

adding new tap device to acrn-br0...

...

[    6.965056]  [01] BAD  20 20 01 aa 20 20 01 aa 20 20 01 aa 20 20 01 aa

[    6.980481]  [01] BAD  20 20 01 aa 20 20 01 aa 20 20 01 aa 20 20 01 aa

[    7.010356]  [01] BAD  20 20 01 aa 20 20 01 aa 20 20 01 aa 20 20 01 aa

[    7.043065] xhci_hcd 0000:00:1a.0: hcc params 0x200071e9 hci version 0x100 qu

./launch_uos.sh: line 4:   449 Segmentation fault      (core dumped) acrn-dm -A

s 1:0,lpc -l com1,stdio -s 2,pci-gvt -G "$4" -s 3,virtio-blk,$6.img -s 4,virtio-

ty:pty_port -s 6,virtio-hyper_dmabuf -s 11,wdt-i6300esb -k "$8" -B "maxcpus=$2 $

" $extra_arguments $vm_name

 

Regards,

Tonny

 

From: acrn-users@... [mailto:acrn-users@...] On Behalf Of Zhai, Edwin
Sent: Monday, July 30, 2018 10:18 AM
To: acrn-users@...
Subject: Re: [acrn-users] How to pass through off-chip USB controller

 

Tonny,

Could you pls. paste the detailed error mesg.

We do have some passthrough rules user need follow, e.g. have reset capability for PCIe dev...

 

 

On 2018/7/30 9:07, Tzeng, Tonny wrote:

Hi there,

 

I got an Aaeon’s AI Core, which integrates the Movidius Myriad2 chip and a USB3 controller on a PCIe card, and I’d like to drive it from the UOS on the UP2 board. I follow the Getting Started Guide and I am able to pass through the built-in USB controller (PCI 00:15.0) to the UOS. Since my Movidius PCIe card is presented to the system as a PCI 01:00.0 device, I tried to use the similar way to pass through it to the UOS, but the DM aborts and can’t launch the UOS.

 

Is there any restrictions to pass through PCI devices to UOS? I’ve tried to unbind the device thru the pci-stub, and  add “-s 21,passthru,1/0/0” option to the DM, but the DM can’t launch the UOS with these modifications. What’s the proper procedures to pass through an *external* USB controller? Any pointers would be appreciated.

 

Regards,

Tonny





-- 
Best Rgds,
Edwin




-- 
Best Rgds,
Edwin



-- 
Best Rgds,
Edwin

Join {acrn-users@lists.projectacrn.org to automatically receive all group messages.