Skip to content

pci_devices test: device should be conneted to downstream port using device number 0 #1557

Open
@rayx

Description

@rayx

See this test for example:


065-type_specific.io-github-autotest-qemu.pci_devices.three_devices.xhci_controller.bus_in_bus.bridge_switch_switch

(BTW, its name is confusing. It should be called "root_switch_switch" test. But that's another issue and I filed #1543 against it).

It generates this command line:


MALLOC_PERTURB_=1  /usr/bin/qemu-system-aarch64 \
    ...
    -device ioh3420,id=test_pci_root1,bus=pcie.0, addr=0x1 \
    -device x3130-upstream,id=test_pci_switch1,bus=test_pci_root1,addr=0x0 \
    -device xio3130-downstream,bus=test_pci_switch1,id=test_pci_switch1.0,addr=0x0,chassis=1 \
    -device x3130-upstream,id=test_pci_switch2,bus=test_pci_switch1.0,addr=0x0  \
    -device xio3130-downstream,bus=test_pci_switch2,id=test_pci_switch2.0,addr=0x0,chassis=2 \
    -device nec-usb-xhci,id=test_xhci1,addr=0x0,bus=test_pci_switch2.0 \
    -device xio3130-downstream,bus=test_pci_switch2,id=test_pci_switch2.27,addr=0x1b,chassis=3 \
    -device nec-usb-xhci,id=test_xhci2,addr=0x1b,bus=test_pci_switch2.27 \
    -device xio3130-downstream,bus=test_pci_switch2,id=test_pci_switch2.31,addr=0x1f,chassis=4 \
    -device nec-usb-xhci,id=test_xhci3,addr=0x1f,bus=test_pci_switch2.31 \
    ...

And then test fails. The symptom is that the second and third xhci controller is not seen by guest kernel.

I believe the issue is with their attr value. Downstream port can have only one slot. The device plugged into that slot should have its device number as 0. So, their attr value in QEMU CLI should be something like "0x0".

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions