Skip to contentSkip to conversation

Unbinding virtio_pci_modern does not release BAR4 in Linux 6.5.0-rc4

DISCUSSION Stefan Hajnoczi 2 participants 3 messages Aug 3, 2023 – Aug 10, 2023 virtio core

lore
Share & tools
lore
#0 lore raw

Hi,
After running "driverctl --nosave set-override 0000:01:00.0 vfio-pci" on a virtio-blk-pci device, /proc/iomem shows that BAR4 is still owned by virtio_pci_modern even though the vfio-pci driver is now bound to the PCI device.

This regression was introduced after 6.4.7 but I don't see the culprit in the git logs.

Unfortunately I don't have time to investigate further right now but I've included instructions on how to reproduce this below.

Can anyone else reproduce this and can we still fix it for the upcoming Linux 6.5?

Thanks,
Stefan
---

$ qemu-system-x86_64 \
    -M q35,accel=kvm,kernel-irqchip=split \
    -cpu host \
    -m 1G \
    -device intel-iommu,intremap=on,device-iotlb=on \
    --blockdev file,filename=test.img,cache.direct=on,node-name=drive0 \
    --device virtio-blk-pci,drive=drive0 \
    -blockdev file,filename=test2.img,cache.direct=on,node-name=drive2 \
    --device ioh3420,id=pcie.1,chassis=1 \
    --device virtio-blk-pci,disable-legacy=on,disable-modern=off,drive=drive2,iommu_platform=on,ats=on,bus=pcie.1

(guest)# driverctl --nosave set-override 0000:01:00.0 vfio-pci (guest)# cat /proc/iomem

_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

#1 lore raw
Quoted 7 lines · Stefan Hajnoczi

Hi,
After running "driverctl --nosave set-override 0000:01:00.0 vfio-pci" on a virtio-blk-pci device, /proc/iomem shows that BAR4 is still owned by virtio_pci_modern even though the vfio-pci driver is now bound to the PCI device.

Quoted 8 lines

This regression was introduced after 6.4.7 but I don't see the culprit in the git logs.

Unfortunately I don't have time to investigate further right now but I've included instructions on how to reproduce this below.

Can anyone else reproduce this and can we still fix it for the upcoming Linux 6.5?

This seems to be fixed by:

https://lore.kernel.org/lkml/[email protected]/T/

Thanks

Quoted 15 lines

Thanks,
Stefan
---

$ qemu-system-x86_64 \
    -M q35,accel=kvm,kernel-irqchip=split \
    -cpu host \
    -m 1G \
    -device intel-iommu,intremap=on,device-iotlb=on \
    --blockdev file,filename=test.img,cache.direct=on,node-name=drive0 \
    --device virtio-blk-pci,drive=drive0 \
    -blockdev file,filename=test2.img,cache.direct=on,node-name=drive2 \
    --device ioh3420,id=pcie.1,chassis=1 \
    --device virtio-blk-pci,disable-legacy=on,disable-modern=off,drive=drive2,iommu_platform=on,ats=on,bus=pcie.1
Quoted 2 lines

(guest)# driverctl --nosave set-override 0000:01:00.0 vfio-pci (guest)# cat /proc/iomem

_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

#2 lore raw
Quoted 14 lines · Jason Wang
Quoted 13 lines · Stefan Hajnoczi

Hi,
After running "driverctl --nosave set-override 0000:01:00.0 vfio-pci" on a virtio-blk-pci device, /proc/iomem shows that BAR4 is still owned by virtio_pci_modern even though the vfio-pci driver is now bound to the PCI device.

This regression was introduced after 6.4.7 but I don't see the culprit in the git logs.

Unfortunately I don't have time to investigate further right now but I've included instructions on how to reproduce this below.

Quoted 6 lines
Quoted 2 lines

Can anyone else reproduce this and can we still fix it for the upcoming Linux 6.5?

This seems to be fixed by:

https://lore.kernel.org/lkml/[email protected]/T/

Awesome, thanks for letting me know!

Stefan

Quoted 21 lines

Thanks

Quoted 17 lines

Thanks,
Stefan
---

$ qemu-system-x86_64 \
    -M q35,accel=kvm,kernel-irqchip=split \
    -cpu host \
    -m 1G \
    -device intel-iommu,intremap=on,device-iotlb=on \
    --blockdev file,filename=test.img,cache.direct=on,node-name=drive0 \
    --device virtio-blk-pci,drive=drive0 \
    -blockdev file,filename=test2.img,cache.direct=on,node-name=drive2 \
    --device ioh3420,id=pcie.1,chassis=1 \
    --device virtio-blk-pci,disable-legacy=on,disable-modern=off,drive=drive2,iommu_platform=on,ats=on,bus=pcie.1

(guest)# driverctl --nosave set-override 0000:01:00.0 vfio-pci (guest)# cat /proc/iomem

_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization