Re: IOTLB support for vhost/vsock breaks crosvm on Android

2022-08-17 Thread Michael S. Tsirkin
On Wed, Aug 17, 2022 at 02:48:22PM +0100, Will Deacon wrote: > On Mon, Aug 08, 2022 at 08:45:48AM -0400, Michael S. Tsirkin wrote: > > > > Also yes, I think it's a good idea to change crosvm anyway. While the > > > > work around I describe might make sense upstream I don't think it's a > > > >

Re: IOTLB support for vhost/vsock breaks crosvm on Android

2022-08-17 Thread Will Deacon
On Mon, Aug 08, 2022 at 08:45:48AM -0400, Michael S. Tsirkin wrote: > > > Also yes, I think it's a good idea to change crosvm anyway. While the > > > work around I describe might make sense upstream I don't think it's a > > > reasonable thing to do in stable kernels. > > > I think I'll prepare a

Re: IOTLB support for vhost/vsock breaks crosvm on Android

2022-08-08 Thread Jason Wang
On Mon, Aug 8, 2022 at 8:45 PM Michael S. Tsirkin wrote: > > On Mon, Aug 08, 2022 at 11:18:50AM +0100, Will Deacon wrote: > > Hi Michael, > > > > On Sun, Aug 07, 2022 at 09:14:43AM -0400, Michael S. Tsirkin wrote: > > > Will, thanks very much for the analysis and the writeup! > > > > No problem,

Re: IOTLB support for vhost/vsock breaks crosvm on Android

2022-08-08 Thread Jason Wang
On Sun, Aug 7, 2022 at 9:14 PM Michael S. Tsirkin wrote: > > Will, thanks very much for the analysis and the writeup! > > On Fri, Aug 05, 2022 at 07:11:06PM +0100, Will Deacon wrote: > > So how should we fix this? One possibility is for us to hack crosvm to > > clear the VIRTIO_F_ACCESS_PLATFORM

Re: IOTLB support for vhost/vsock breaks crosvm on Android

2022-08-08 Thread Michael S. Tsirkin
On Mon, Aug 08, 2022 at 11:18:50AM +0100, Will Deacon wrote: > Hi Michael, > > On Sun, Aug 07, 2022 at 09:14:43AM -0400, Michael S. Tsirkin wrote: > > Will, thanks very much for the analysis and the writeup! > > No problem, and thanks for following up. > > > On Fri, Aug 05, 2022 at 07:11:06PM

Re: IOTLB support for vhost/vsock breaks crosvm on Android

2022-08-08 Thread Will Deacon
Hi Michael, On Sun, Aug 07, 2022 at 09:14:43AM -0400, Michael S. Tsirkin wrote: > Will, thanks very much for the analysis and the writeup! No problem, and thanks for following up. > On Fri, Aug 05, 2022 at 07:11:06PM +0100, Will Deacon wrote: > > So how should we fix this? One possibility is

Re: IOTLB support for vhost/vsock breaks crosvm on Android

2022-08-07 Thread Michael S. Tsirkin
On Sat, Aug 06, 2022 at 11:52:13PM -0700, Christoph Hellwig wrote: > It really is vhost that seems to abuse it so that if the guest > claims it can handle VIRTIO_F_ACCESS_PLATFORM (which every modern > guest should) it enables magic behavior, which I don't think is what > the virtio spec intended.

Re: IOTLB support for vhost/vsock breaks crosvm on Android

2022-08-07 Thread Michael S. Tsirkin
On Fri, Aug 05, 2022 at 03:57:08PM -0700, Linus Torvalds wrote: > And hey, it's possible that the bit encoding is *so* incestuous that > it's really hard to split it into two. But it really sounds to me like > somebody mindlessly re-used a feature bit for a *completely* different > thing. Why? >

Re: IOTLB support for vhost/vsock breaks crosvm on Android

2022-08-07 Thread Michael S. Tsirkin
Will, thanks very much for the analysis and the writeup! On Fri, Aug 05, 2022 at 07:11:06PM +0100, Will Deacon wrote: > So how should we fix this? One possibility is for us to hack crosvm to > clear the VIRTIO_F_ACCESS_PLATFORM flag when setting the vhost features, > but others here have

Re: IOTLB support for vhost/vsock breaks crosvm on Android

2022-08-07 Thread Christoph Hellwig
On Fri, Aug 05, 2022 at 03:57:08PM -0700, Linus Torvalds wrote: > Why is "IOMMU support" called "VIRTIO_F_ACCESS_PLATFORM"? Because, as far as the virtio spec and virtio "guest" implementation is concerned it is not about IOMMU support at all. It is about treating virtio DMA as real DMA by the

Re: IOTLB support for vhost/vsock breaks crosvm on Android

2022-08-06 Thread Will Deacon
On Sat, Aug 06, 2022 at 06:52:15AM -0400, Stefan Hajnoczi wrote: > On Sat, Aug 6, 2022 at 5:50 AM Will Deacon wrote: > > On Sat, Aug 06, 2022 at 09:48:28AM +0200, Stefano Garzarella wrote: > > > On Fri, Aug 05, 2022 at 07:11:06PM +0100, Will Deacon wrote: > > > If the VMM implements the

Re: IOTLB support for vhost/vsock breaks crosvm on Android

2022-08-06 Thread Stefano Garzarella
On Sat, Aug 06, 2022 at 10:42:40AM +0100, Will Deacon wrote: Hi Stefano, On Sat, Aug 06, 2022 at 09:48:28AM +0200, Stefano Garzarella wrote: On Fri, Aug 05, 2022 at 07:11:06PM +0100, Will Deacon wrote: > The fundamental issue is, I think, that VIRTIO_F_ACCESS_PLATFORM is > being used for two

Re: IOTLB support for vhost/vsock breaks crosvm on Android

2022-08-06 Thread Will Deacon
On Fri, Aug 05, 2022 at 03:57:08PM -0700, Linus Torvalds wrote: > On Fri, Aug 5, 2022 at 11:11 AM Will Deacon wrote: > > > > [tl;dr a change from ~18 months ago breaks Android userspace and I don't > > know what to do about it] > > Augh. > > I had hoped that android being "closer" to upstream

Re: IOTLB support for vhost/vsock breaks crosvm on Android

2022-08-06 Thread Will Deacon
Hi Stefano, On Sat, Aug 06, 2022 at 09:48:28AM +0200, Stefano Garzarella wrote: > On Fri, Aug 05, 2022 at 07:11:06PM +0100, Will Deacon wrote: > > The fundamental issue is, I think, that VIRTIO_F_ACCESS_PLATFORM is > > being used for two very different things within the same device; for the > >

Re: IOTLB support for vhost/vsock breaks crosvm on Android

2022-08-06 Thread Stefano Garzarella
Hi Linus, On Fri, Aug 05, 2022 at 03:57:08PM -0700, Linus Torvalds wrote: On Fri, Aug 5, 2022 at 11:11 AM Will Deacon wrote: [tl;dr a change from ~18 months ago breaks Android userspace and I don't know what to do about it] Augh. I had hoped that android being "closer" to upstream would

Re: IOTLB support for vhost/vsock breaks crosvm on Android

2022-08-06 Thread Stefano Garzarella
Hi Will, On Fri, Aug 05, 2022 at 07:11:06PM +0100, Will Deacon wrote: Hi folks, [tl;dr a change from ~18 months ago breaks Android userspace and I don't know what to do about it] As part of the development work for next year's Android, we've recently been bringing up a 5.15 KVM host and have

Re: IOTLB support for vhost/vsock breaks crosvm on Android

2022-08-05 Thread Linus Torvalds
On Fri, Aug 5, 2022 at 11:11 AM Will Deacon wrote: > > [tl;dr a change from ~18 months ago breaks Android userspace and I don't > know what to do about it] Augh. I had hoped that android being "closer" to upstream would have meant that somebody actually tests android with upstream kernels.