Re: [PATCH V2] vhost: correctly turn on VIRTIO_F_IOMMU_PLATFORM

2020-03-17 Thread Jason Wang
On 2020/3/17 下午10:13, Peter Xu wrote: On Tue, Mar 17, 2020 at 11:04:26AM +0800, Jason Wang wrote: On 2020/3/17 上午2:14, Peter Xu wrote: On Mon, Mar 16, 2020 at 01:19:54PM -0400, Michael S. Tsirkin wrote: On Fri, Mar 13, 2020 at 12:31:22PM -0400, Peter Xu wrote: On Fri, Mar 13, 2020 at

Re: [PATCH V2] vhost: correctly turn on VIRTIO_F_IOMMU_PLATFORM

2020-03-17 Thread Michael S. Tsirkin
On Tue, Mar 17, 2020 at 10:39:04AM -0400, Peter Xu wrote: > On Tue, Mar 17, 2020 at 02:28:42AM -0400, Michael S. Tsirkin wrote: > > On Mon, Mar 16, 2020 at 02:14:05PM -0400, Peter Xu wrote: > > > On Mon, Mar 16, 2020 at 01:19:54PM -0400, Michael S. Tsirkin wrote: > > > > On Fri, Mar 13, 2020 at

Re: [PATCH V2] vhost: correctly turn on VIRTIO_F_IOMMU_PLATFORM

2020-03-17 Thread Peter Xu
On Tue, Mar 17, 2020 at 02:28:42AM -0400, Michael S. Tsirkin wrote: > On Mon, Mar 16, 2020 at 02:14:05PM -0400, Peter Xu wrote: > > On Mon, Mar 16, 2020 at 01:19:54PM -0400, Michael S. Tsirkin wrote: > > > On Fri, Mar 13, 2020 at 12:31:22PM -0400, Peter Xu wrote: > > > > On Fri, Mar 13, 2020 at

Re: [PATCH V2] vhost: correctly turn on VIRTIO_F_IOMMU_PLATFORM

2020-03-17 Thread Peter Xu
On Tue, Mar 17, 2020 at 11:04:26AM +0800, Jason Wang wrote: > > On 2020/3/17 上午2:14, Peter Xu wrote: > > On Mon, Mar 16, 2020 at 01:19:54PM -0400, Michael S. Tsirkin wrote: > > > On Fri, Mar 13, 2020 at 12:31:22PM -0400, Peter Xu wrote: > > > > On Fri, Mar 13, 2020 at 11:29:59AM -0400, Michael S.

Re: [PATCH V2] vhost: correctly turn on VIRTIO_F_IOMMU_PLATFORM

2020-03-17 Thread Michael S. Tsirkin
On Mon, Mar 16, 2020 at 02:14:05PM -0400, Peter Xu wrote: > On Mon, Mar 16, 2020 at 01:19:54PM -0400, Michael S. Tsirkin wrote: > > On Fri, Mar 13, 2020 at 12:31:22PM -0400, Peter Xu wrote: > > > On Fri, Mar 13, 2020 at 11:29:59AM -0400, Michael S. Tsirkin wrote: > > > > On Fri, Mar 13, 2020 at

Re: [PATCH V2] vhost: correctly turn on VIRTIO_F_IOMMU_PLATFORM

2020-03-16 Thread Jason Wang
On 2020/3/17 上午2:14, Peter Xu wrote: On Mon, Mar 16, 2020 at 01:19:54PM -0400, Michael S. Tsirkin wrote: On Fri, Mar 13, 2020 at 12:31:22PM -0400, Peter Xu wrote: On Fri, Mar 13, 2020 at 11:29:59AM -0400, Michael S. Tsirkin wrote: On Fri, Mar 13, 2020 at 01:44:46PM +0100, Halil Pasic wrote:

Re: [PATCH V2] vhost: correctly turn on VIRTIO_F_IOMMU_PLATFORM

2020-03-16 Thread Peter Xu
On Mon, Mar 16, 2020 at 05:57:37PM +0100, Halil Pasic wrote: > On Fri, 13 Mar 2020 12:31:22 -0400 > Peter Xu wrote: > > > On Fri, Mar 13, 2020 at 11:29:59AM -0400, Michael S. Tsirkin wrote: > > > On Fri, Mar 13, 2020 at 01:44:46PM +0100, Halil Pasic wrote: > > > > [..] > > > > > > > > > > > >

Re: [PATCH V2] vhost: correctly turn on VIRTIO_F_IOMMU_PLATFORM

2020-03-16 Thread Peter Xu
On Mon, Mar 16, 2020 at 01:19:54PM -0400, Michael S. Tsirkin wrote: > On Fri, Mar 13, 2020 at 12:31:22PM -0400, Peter Xu wrote: > > On Fri, Mar 13, 2020 at 11:29:59AM -0400, Michael S. Tsirkin wrote: > > > On Fri, Mar 13, 2020 at 01:44:46PM +0100, Halil Pasic wrote: > > > > [..] > > > > > > > > >

Re: [PATCH V2] vhost: correctly turn on VIRTIO_F_IOMMU_PLATFORM

2020-03-16 Thread Halil Pasic
On Fri, 13 Mar 2020 12:31:22 -0400 Peter Xu wrote: > On Fri, Mar 13, 2020 at 11:29:59AM -0400, Michael S. Tsirkin wrote: > > On Fri, Mar 13, 2020 at 01:44:46PM +0100, Halil Pasic wrote: > > > [..] > > > > > > > > > > CCing Tom. @Tom does vhost-vsock work for you with SEV and current > > > > >

Re: [PATCH V2] vhost: correctly turn on VIRTIO_F_IOMMU_PLATFORM

2020-03-16 Thread Michael S. Tsirkin
On Fri, Mar 13, 2020 at 12:31:22PM -0400, Peter Xu wrote: > On Fri, Mar 13, 2020 at 11:29:59AM -0400, Michael S. Tsirkin wrote: > > On Fri, Mar 13, 2020 at 01:44:46PM +0100, Halil Pasic wrote: > > > [..] > > > > > > > > > > CCing Tom. @Tom does vhost-vsock work for you with SEV and current > > >

Re: [PATCH V2] vhost: correctly turn on VIRTIO_F_IOMMU_PLATFORM

2020-03-14 Thread Michael S. Tsirkin
On Fri, Mar 13, 2020 at 03:27:59PM -0500, Brijesh Singh wrote: > > On 3/13/20 7:44 AM, Halil Pasic wrote: > > [..] > >>> CCing Tom. @Tom does vhost-vsock work for you with SEV and current qemu? > >>> > >>> Also, one can specify iommu_platform=on on a device that ain't a part of > >>> a

Re: [PATCH V2] vhost: correctly turn on VIRTIO_F_IOMMU_PLATFORM

2020-03-13 Thread Brijesh Singh
On 3/13/20 7:44 AM, Halil Pasic wrote: > [..] >>> CCing Tom. @Tom does vhost-vsock work for you with SEV and current qemu? >>> >>> Also, one can specify iommu_platform=on on a device that ain't a part of >>> a secure-capable VM, just for the fun of it. And that breaks >>> vhost-vsock. Or is

Re: [PATCH V2] vhost: correctly turn on VIRTIO_F_IOMMU_PLATFORM

2020-03-13 Thread Peter Xu
On Fri, Mar 13, 2020 at 11:29:59AM -0400, Michael S. Tsirkin wrote: > On Fri, Mar 13, 2020 at 01:44:46PM +0100, Halil Pasic wrote: > > [..] > > > > > > > > CCing Tom. @Tom does vhost-vsock work for you with SEV and current qemu? > > > > > > > > Also, one can specify iommu_platform=on on a device

Re: [PATCH V2] vhost: correctly turn on VIRTIO_F_IOMMU_PLATFORM

2020-03-13 Thread Michael S. Tsirkin
On Fri, Mar 13, 2020 at 01:44:46PM +0100, Halil Pasic wrote: > [..] > > > > > > CCing Tom. @Tom does vhost-vsock work for you with SEV and current qemu? > > > > > > Also, one can specify iommu_platform=on on a device that ain't a part of > > > a secure-capable VM, just for the fun of it. And

Re: [PATCH V2] vhost: correctly turn on VIRTIO_F_IOMMU_PLATFORM

2020-03-13 Thread Halil Pasic
[..] > > > > CCing Tom. @Tom does vhost-vsock work for you with SEV and current qemu? > > > > Also, one can specify iommu_platform=on on a device that ain't a part of > > a secure-capable VM, just for the fun of it. And that breaks > > vhost-vsock. Or is setting iommu_platform=on only valid if >

Re: [PATCH V2] vhost: correctly turn on VIRTIO_F_IOMMU_PLATFORM

2020-03-03 Thread Halil Pasic
On Thu, 27 Feb 2020 10:47:22 -0500 "Michael S. Tsirkin" wrote: > On Thu, Feb 27, 2020 at 02:02:15PM +0100, Halil Pasic wrote: > > On Wed, 26 Feb 2020 11:52:26 -0500 > > "Michael S. Tsirkin" wrote: > > > > > On Wed, Feb 26, 2020 at 04:36:18PM +0100, Halil Pasic wrote: > > > > On Wed, 26 Feb

Re: [PATCH V2] vhost: correctly turn on VIRTIO_F_IOMMU_PLATFORM

2020-02-27 Thread Tom Lendacky
On 2/27/20 7:02 AM, Halil Pasic wrote: > On Wed, 26 Feb 2020 11:52:26 -0500 > "Michael S. Tsirkin" wrote: > >> On Wed, Feb 26, 2020 at 04:36:18PM +0100, Halil Pasic wrote: >>> On Wed, 26 Feb 2020 08:37:13 -0500 >>> "Michael S. Tsirkin" wrote: >>> On Wed, Feb 26, 2020 at 02:28:39PM +0100,

Re: [PATCH V2] vhost: correctly turn on VIRTIO_F_IOMMU_PLATFORM

2020-02-27 Thread Michael S. Tsirkin
On Thu, Feb 27, 2020 at 02:02:15PM +0100, Halil Pasic wrote: > On Wed, 26 Feb 2020 11:52:26 -0500 > "Michael S. Tsirkin" wrote: > > > On Wed, Feb 26, 2020 at 04:36:18PM +0100, Halil Pasic wrote: > > > On Wed, 26 Feb 2020 08:37:13 -0500 > > > "Michael S. Tsirkin" wrote: > > > > > > > On Wed,

Re: [PATCH V2] vhost: correctly turn on VIRTIO_F_IOMMU_PLATFORM

2020-02-27 Thread Halil Pasic
On Wed, 26 Feb 2020 11:52:26 -0500 "Michael S. Tsirkin" wrote: > On Wed, Feb 26, 2020 at 04:36:18PM +0100, Halil Pasic wrote: > > On Wed, 26 Feb 2020 08:37:13 -0500 > > "Michael S. Tsirkin" wrote: > > > > > On Wed, Feb 26, 2020 at 02:28:39PM +0100, Halil Pasic wrote: > > > > On Wed, 26 Feb

Re: [PATCH V2] vhost: correctly turn on VIRTIO_F_IOMMU_PLATFORM

2020-02-26 Thread Michael S. Tsirkin
On Wed, Feb 26, 2020 at 04:36:18PM +0100, Halil Pasic wrote: > On Wed, 26 Feb 2020 08:37:13 -0500 > "Michael S. Tsirkin" wrote: > > > On Wed, Feb 26, 2020 at 02:28:39PM +0100, Halil Pasic wrote: > > > On Wed, 26 Feb 2020 17:43:57 +0800 > > > Jason Wang wrote: > > > > > > > We turn on device

Re: [PATCH V2] vhost: correctly turn on VIRTIO_F_IOMMU_PLATFORM

2020-02-26 Thread Halil Pasic
On Wed, 26 Feb 2020 08:37:13 -0500 "Michael S. Tsirkin" wrote: > On Wed, Feb 26, 2020 at 02:28:39PM +0100, Halil Pasic wrote: > > On Wed, 26 Feb 2020 17:43:57 +0800 > > Jason Wang wrote: > > > > > We turn on device IOTLB via VIRTIO_F_IOMMU_PLATFORM unconditionally on > > > platform without

Re: [PATCH V2] vhost: correctly turn on VIRTIO_F_IOMMU_PLATFORM

2020-02-26 Thread Michael S. Tsirkin
On Wed, Feb 26, 2020 at 01:55:39PM +0100, Halil Pasic wrote: > On Wed, 26 Feb 2020 04:53:33 -0500 > "Michael S. Tsirkin" wrote: > > > On Wed, Feb 26, 2020 at 05:43:57PM +0800, Jason Wang wrote: > > > We turn on device IOTLB via VIRTIO_F_IOMMU_PLATFORM unconditionally on > > > platform without

Re: [PATCH V2] vhost: correctly turn on VIRTIO_F_IOMMU_PLATFORM

2020-02-26 Thread Michael S. Tsirkin
On Wed, Feb 26, 2020 at 02:28:39PM +0100, Halil Pasic wrote: > On Wed, 26 Feb 2020 17:43:57 +0800 > Jason Wang wrote: > > > We turn on device IOTLB via VIRTIO_F_IOMMU_PLATFORM unconditionally on > > platform without IOMMU support. This can lead unnecessary IOTLB > > transactions which will

Re: [PATCH V2] vhost: correctly turn on VIRTIO_F_IOMMU_PLATFORM

2020-02-26 Thread Halil Pasic
On Wed, 26 Feb 2020 17:43:57 +0800 Jason Wang wrote: > We turn on device IOTLB via VIRTIO_F_IOMMU_PLATFORM unconditionally on > platform without IOMMU support. This can lead unnecessary IOTLB > transactions which will damage the performance. > > Fixing this by check whether the device is backed

Re: [PATCH V2] vhost: correctly turn on VIRTIO_F_IOMMU_PLATFORM

2020-02-26 Thread Halil Pasic
On Wed, 26 Feb 2020 04:53:33 -0500 "Michael S. Tsirkin" wrote: > On Wed, Feb 26, 2020 at 05:43:57PM +0800, Jason Wang wrote: > > We turn on device IOTLB via VIRTIO_F_IOMMU_PLATFORM unconditionally on > > platform without IOMMU support. This can lead unnecessary IOTLB > > transactions which will

Re: [PATCH V2] vhost: correctly turn on VIRTIO_F_IOMMU_PLATFORM

2020-02-26 Thread Halil Pasic
On Wed, 26 Feb 2020 06:44:25 -0500 "Michael S. Tsirkin" wrote: > On Wed, Feb 26, 2020 at 06:17:34PM +0800, Jason Wang wrote: > > > > On 2020/2/26 下午5:53, Michael S. Tsirkin wrote: > > > On Wed, Feb 26, 2020 at 05:43:57PM +0800, Jason Wang wrote: > > > > We turn on device IOTLB via

Re: [PATCH V2] vhost: correctly turn on VIRTIO_F_IOMMU_PLATFORM

2020-02-26 Thread Michael S. Tsirkin
On Wed, Feb 26, 2020 at 06:17:34PM +0800, Jason Wang wrote: > > On 2020/2/26 下午5:53, Michael S. Tsirkin wrote: > > On Wed, Feb 26, 2020 at 05:43:57PM +0800, Jason Wang wrote: > > > We turn on device IOTLB via VIRTIO_F_IOMMU_PLATFORM unconditionally on > > > platform without IOMMU support. This

Re: [PATCH V2] vhost: correctly turn on VIRTIO_F_IOMMU_PLATFORM

2020-02-26 Thread Jason Wang
On 2020/2/26 下午5:53, Michael S. Tsirkin wrote: On Wed, Feb 26, 2020 at 05:43:57PM +0800, Jason Wang wrote: We turn on device IOTLB via VIRTIO_F_IOMMU_PLATFORM unconditionally on platform without IOMMU support. This can lead unnecessary IOTLB transactions which will damage the performance.

Re: [PATCH V2] vhost: correctly turn on VIRTIO_F_IOMMU_PLATFORM

2020-02-26 Thread Michael S. Tsirkin
On Wed, Feb 26, 2020 at 05:43:57PM +0800, Jason Wang wrote: > We turn on device IOTLB via VIRTIO_F_IOMMU_PLATFORM unconditionally on > platform without IOMMU support. This can lead unnecessary IOTLB > transactions which will damage the performance. > > Fixing this by check whether the device is

[PATCH V2] vhost: correctly turn on VIRTIO_F_IOMMU_PLATFORM

2020-02-26 Thread Jason Wang
We turn on device IOTLB via VIRTIO_F_IOMMU_PLATFORM unconditionally on platform without IOMMU support. This can lead unnecessary IOTLB transactions which will damage the performance. Fixing this by check whether the device is backed by IOMMU and disable device IOTLB. Reported-by: Halil Pasic