virtualization.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
* Unbinding virtio_pci_modern does not release BAR4 in Linux 6.5.0-rc4
@ 2023-08-03 14:37 Stefan Hajnoczi
  2023-08-10  3:08 ` Jason Wang
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Hajnoczi @ 2023-08-03 14:37 UTC (permalink / raw)
  To: virtualization; +Cc: Xuan Zhuo, Michael S. Tsirkin


[-- Attachment #1.1: Type: text/plain, Size: 1136 bytes --]

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

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

[-- Attachment #2: Type: text/plain, Size: 183 bytes --]

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Unbinding virtio_pci_modern does not release BAR4 in Linux 6.5.0-rc4
  2023-08-03 14:37 Unbinding virtio_pci_modern does not release BAR4 in Linux 6.5.0-rc4 Stefan Hajnoczi
@ 2023-08-10  3:08 ` Jason Wang
  2023-08-10 14:15   ` Stefan Hajnoczi
  0 siblings, 1 reply; 3+ messages in thread
From: Jason Wang @ 2023-08-10  3:08 UTC (permalink / raw)
  To: Stefan Hajnoczi; +Cc: Xuan Zhuo, Michael S. Tsirkin, virtualization

On Thu, Aug 3, 2023 at 10:37 PM Stefan Hajnoczi <stefanha@redhat.com> wrote:
>
> 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?

This seems to be fixed by:

https://lore.kernel.org/lkml/20230720131423-mutt-send-email-mst@kernel.org/T/

Thanks

>
> 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
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Unbinding virtio_pci_modern does not release BAR4 in Linux 6.5.0-rc4
  2023-08-10  3:08 ` Jason Wang
@ 2023-08-10 14:15   ` Stefan Hajnoczi
  0 siblings, 0 replies; 3+ messages in thread
From: Stefan Hajnoczi @ 2023-08-10 14:15 UTC (permalink / raw)
  To: Jason Wang; +Cc: Xuan Zhuo, Michael S. Tsirkin, virtualization


[-- Attachment #1.1: Type: text/plain, Size: 1627 bytes --]

On Thu, Aug 10, 2023 at 11:08:52AM +0800, Jason Wang wrote:
> On Thu, Aug 3, 2023 at 10:37 PM Stefan Hajnoczi <stefanha@redhat.com> wrote:
> >
> > 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?
> 
> This seems to be fixed by:
> 
> https://lore.kernel.org/lkml/20230720131423-mutt-send-email-mst@kernel.org/T/

Awesome, thanks for letting me know!

Stefan

> 
> Thanks
> 
> >
> > 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
> 

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

[-- Attachment #2: Type: text/plain, Size: 183 bytes --]

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-08-10 14:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-03 14:37 Unbinding virtio_pci_modern does not release BAR4 in Linux 6.5.0-rc4 Stefan Hajnoczi
2023-08-10  3:08 ` Jason Wang
2023-08-10 14:15   ` Stefan Hajnoczi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).