Re: [PATCH] x86-iommu: Fail flag registration of DEVIOTLB if DT not supported

2022-10-20 Thread Peter Xu
On Thu, Oct 20, 2022 at 11:58:34AM +0800, Jason Wang wrote: > Haven't tried but I guess there would be some issue other than the > suggested configuration "ats=on, device-iotlb=on" > > So we have: > > 1) ats=on, device-iotlb=on, this is the configuration that libvirt is > using and it should work

Re: [PATCH] x86-iommu: Fail flag registration of DEVIOTLB if DT not supported

2022-10-19 Thread Jason Wang
On Wed, Oct 19, 2022 at 10:54 PM Peter Xu wrote: > > On Wed, Oct 19, 2022 at 04:12:22PM +0200, Eric Auger wrote: > > Hi Peter, > > > > On 10/19/22 16:01, Peter Xu wrote: > > > Hi, Eric, > > > > > > On Wed, Oct 19, 2022 at 01:24:15PM +0200, Eric Auger wrote: > > >>> @@ -1484,6 +1485,13 @@ static in

Re: [PATCH] x86-iommu: Fail flag registration of DEVIOTLB if DT not supported

2022-10-19 Thread Peter Xu
On Wed, Oct 19, 2022 at 04:12:22PM +0200, Eric Auger wrote: > Hi Peter, > > On 10/19/22 16:01, Peter Xu wrote: > > Hi, Eric, > > > > On Wed, Oct 19, 2022 at 01:24:15PM +0200, Eric Auger wrote: > >>> @@ -1484,6 +1485,13 @@ static int > >>> amdvi_iommu_notify_flag_changed(IOMMUMemoryRegion *iommu,

Re: [PATCH] x86-iommu: Fail flag registration of DEVIOTLB if DT not supported

2022-10-19 Thread Eric Auger
Hi Peter, On 10/19/22 16:01, Peter Xu wrote: > Hi, Eric, > > On Wed, Oct 19, 2022 at 01:24:15PM +0200, Eric Auger wrote: >>> @@ -1484,6 +1485,13 @@ static int >>> amdvi_iommu_notify_flag_changed(IOMMUMemoryRegion *iommu, >>> PCI_FUNC(as->devfn)); >>> return -EINVAL; >

Re: [PATCH] x86-iommu: Fail flag registration of DEVIOTLB if DT not supported

2022-10-19 Thread Peter Xu
Hi, Eric, On Wed, Oct 19, 2022 at 01:24:15PM +0200, Eric Auger wrote: > > @@ -1484,6 +1485,13 @@ static int > > amdvi_iommu_notify_flag_changed(IOMMUMemoryRegion *iommu, > > PCI_FUNC(as->devfn)); > > return -EINVAL; > > } > > + > > +if ((new & IOMMU_NOTIFIER_

Re: [PATCH] x86-iommu: Fail flag registration of DEVIOTLB if DT not supported

2022-10-19 Thread Eric Auger
Hi Peter, On 10/18/22 23:54, Peter Xu wrote: > All x86 IOMMUs need to fail DEVIOTLB notification registrations if DT is > not supported. Otherwise any device (e.g. vhost) can register with > DEVIOTLB but it'll never receive the notifications, causing device not > operational. > > Fixes: b68ba1ca5

Re: [PATCH] x86-iommu: Fail flag registration of DEVIOTLB if DT not supported

2022-10-18 Thread Jason Wang
在 2022/10/19 05:54, Peter Xu 写道: All x86 IOMMUs need to fail DEVIOTLB notification registrations if DT is not supported. Otherwise any device (e.g. vhost) can register with DEVIOTLB but it'll never receive the notifications, causing device not operational. Fixes: b68ba1ca57 ("memory: Add IOMM