Re: [Qemu-devel] [PATCH RFC 0/4] intel_iommu: Do sanity check of vfio-pci earlier

2019-09-15 Thread Peter Xu
On Wed, Aug 21, 2019 at 09:50:43AM +0200, Paolo Bonzini wrote: > On 21/08/19 07:03, Peter Xu wrote: > > On Tue, Aug 20, 2019 at 08:24:49AM +0200, Paolo Bonzini wrote: > >> On 20/08/19 07:22, Peter Xu wrote: > >>> On Mon, Aug 12, 2019 at 09:45:27AM +0200, Peter Xu wrote: > This is a RFC series.

Re: [Qemu-devel] [PATCH RFC 0/4] intel_iommu: Do sanity check of vfio-pci earlier

2019-08-29 Thread Peter Xu
On Thu, Aug 29, 2019 at 10:46:42AM +0200, Auger Eric wrote: > If I understand correctly PT mode is a bypass mode. With the ARM SMMUv3 > the IOMMU MR translate() function gets called but implements a direct > mapping. I understand that on your side, you destroy the IOMMU MR, right? > > At the momen

Re: [Qemu-devel] [PATCH RFC 0/4] intel_iommu: Do sanity check of vfio-pci earlier

2019-08-29 Thread Auger Eric
Hi Peter, On 8/29/19 10:21 AM, Peter Xu wrote: > On Thu, Aug 29, 2019 at 10:05:27AM +0200, Auger Eric wrote: >> Hi Peter, > > Hi, Eric, > >> On 8/29/19 3:18 AM, Peter Xu wrote: >>> On Wed, Aug 28, 2019 at 02:59:45PM +0200, Auger Eric wrote: Hi Peter, >>> >>> Hi, Eric, >>> >>> [...] >>>

Re: [Qemu-devel] [PATCH RFC 0/4] intel_iommu: Do sanity check of vfio-pci earlier

2019-08-29 Thread Peter Xu
On Thu, Aug 29, 2019 at 10:05:27AM +0200, Auger Eric wrote: > Hi Peter, Hi, Eric, > On 8/29/19 3:18 AM, Peter Xu wrote: > > On Wed, Aug 28, 2019 at 02:59:45PM +0200, Auger Eric wrote: > >> Hi Peter, > > > > Hi, Eric, > > > > [...] > > > >> In > >> [PATCH v4 2/5] memory: Add IOMMU_ATTR_HW_NESTE

Re: [Qemu-devel] [PATCH RFC 0/4] intel_iommu: Do sanity check of vfio-pci earlier

2019-08-29 Thread Auger Eric
Hi Peter, On 8/29/19 3:18 AM, Peter Xu wrote: > On Wed, Aug 28, 2019 at 02:59:45PM +0200, Auger Eric wrote: >> Hi Peter, > > Hi, Eric, > > [...] > >> In >> [PATCH v4 2/5] memory: Add IOMMU_ATTR_HW_NESTED_PAGING IOMMU memory >> region attribute (https://patchwork.kernel.org/patch/11109701/) > >

Re: [Qemu-devel] [PATCH RFC 0/4] intel_iommu: Do sanity check of vfio-pci earlier

2019-08-28 Thread Peter Xu
On Wed, Aug 28, 2019 at 02:59:45PM +0200, Auger Eric wrote: > Hi Peter, Hi, Eric, [...] > In > [PATCH v4 2/5] memory: Add IOMMU_ATTR_HW_NESTED_PAGING IOMMU memory > region attribute (https://patchwork.kernel.org/patch/11109701/) [1] > > [PATCH v4 3/5] hw/vfio/common: Fail on VFIO/HW nested pa

Re: [Qemu-devel] [PATCH RFC 0/4] intel_iommu: Do sanity check of vfio-pci earlier

2019-08-28 Thread Auger Eric
Hi Peter, On 8/13/19 10:41 AM, Jason Wang wrote: > > On 2019/8/12 下午3:45, Peter Xu wrote: >> This is a RFC series. >> >> The VT-d code has some defects, one of them is that we cannot detect >> the misuse of vIOMMU and vfio-pci early enough. >> >> For example, logically this is not allowed: >> >>

Re: [Qemu-devel] [PATCH RFC 0/4] intel_iommu: Do sanity check of vfio-pci earlier

2019-08-21 Thread Paolo Bonzini
On 21/08/19 07:03, Peter Xu wrote: > On Tue, Aug 20, 2019 at 08:24:49AM +0200, Paolo Bonzini wrote: >> On 20/08/19 07:22, Peter Xu wrote: >>> On Mon, Aug 12, 2019 at 09:45:27AM +0200, Peter Xu wrote: This is a RFC series. The VT-d code has some defects, one of them is that we cannot

Re: [Qemu-devel] [PATCH RFC 0/4] intel_iommu: Do sanity check of vfio-pci earlier

2019-08-20 Thread Peter Xu
On Tue, Aug 20, 2019 at 08:24:49AM +0200, Paolo Bonzini wrote: > On 20/08/19 07:22, Peter Xu wrote: > > On Mon, Aug 12, 2019 at 09:45:27AM +0200, Peter Xu wrote: > >> This is a RFC series. > >> > >> The VT-d code has some defects, one of them is that we cannot detect > >> the misuse of vIOMMU and v

Re: [Qemu-devel] [PATCH RFC 0/4] intel_iommu: Do sanity check of vfio-pci earlier

2019-08-19 Thread Paolo Bonzini
On 20/08/19 07:22, Peter Xu wrote: > On Mon, Aug 12, 2019 at 09:45:27AM +0200, Peter Xu wrote: >> This is a RFC series. >> >> The VT-d code has some defects, one of them is that we cannot detect >> the misuse of vIOMMU and vfio-pci early enough. >> >> For example, logically this is not allowed: >>

Re: [Qemu-devel] [PATCH RFC 0/4] intel_iommu: Do sanity check of vfio-pci earlier

2019-08-19 Thread Peter Xu
On Mon, Aug 12, 2019 at 09:45:27AM +0200, Peter Xu wrote: > This is a RFC series. > > The VT-d code has some defects, one of them is that we cannot detect > the misuse of vIOMMU and vfio-pci early enough. > > For example, logically this is not allowed: > > -device intel-iommu,caching-mode=off

Re: [Qemu-devel] [PATCH RFC 0/4] intel_iommu: Do sanity check of vfio-pci earlier

2019-08-13 Thread Peter Xu
On Tue, Aug 13, 2019 at 04:41:49PM +0800, Jason Wang wrote: > Do we need a generic solution other than an Intel specific one? I assume you're asking about ARM not AMD, right? :) Yes I think we should have a generic solution. Though I'd like to see whether this idea can be accepted first, then we

Re: [Qemu-devel] [PATCH RFC 0/4] intel_iommu: Do sanity check of vfio-pci earlier

2019-08-13 Thread Jason Wang
On 2019/8/12 下午3:45, Peter Xu wrote: This is a RFC series. The VT-d code has some defects, one of them is that we cannot detect the misuse of vIOMMU and vfio-pci early enough. For example, logically this is not allowed: -device intel-iommu,caching-mode=off \ -device vfio-pci,host=05:00

Re: [Qemu-devel] [PATCH RFC 0/4] intel_iommu: Do sanity check of vfio-pci earlier

2019-08-12 Thread Peter Xu
On Mon, Aug 12, 2019 at 10:24:53AM -0600, Alex Williamson wrote: > On Mon, 12 Aug 2019 09:45:27 +0200 > Peter Xu wrote: > > > This is a RFC series. > > > > The VT-d code has some defects, one of them is that we cannot detect > > the misuse of vIOMMU and vfio-pci early enough. > > > > For exampl

Re: [Qemu-devel] [PATCH RFC 0/4] intel_iommu: Do sanity check of vfio-pci earlier

2019-08-12 Thread Alex Williamson
On Mon, 12 Aug 2019 09:45:27 +0200 Peter Xu wrote: > This is a RFC series. > > The VT-d code has some defects, one of them is that we cannot detect > the misuse of vIOMMU and vfio-pci early enough. > > For example, logically this is not allowed: > > -device intel-iommu,caching-mode=off \ >

[Qemu-devel] [PATCH RFC 0/4] intel_iommu: Do sanity check of vfio-pci earlier

2019-08-12 Thread Peter Xu
This is a RFC series. The VT-d code has some defects, one of them is that we cannot detect the misuse of vIOMMU and vfio-pci early enough. For example, logically this is not allowed: -device intel-iommu,caching-mode=off \ -device vfio-pci,host=05:00.0 Because the caching mode is required to