Re: [PATCH v13 4/8] iommu/vt-d: Add bind guest PASID support

2020-05-15 Thread Lu Baolu
Hi Jacob, On 2020/5/14 23:57, Jacob Pan wrote: Hi Christoph, Thanks a lot for the reviews, comments below. Jacob On Wed, 13 May 2020 22:59:30 -0700 Christoph Hellwig wrote: + if (dev_is_pci(dev)) { + /* VT-d supports devices with full 20 bit PASIDs only */ +

Re: [PATCH v13 4/8] iommu/vt-d: Add bind guest PASID support

2020-05-14 Thread Lu Baolu
Hi Jacob, On 5/14/20 11:57 PM, Jacob Pan wrote: + /* +* PASID table is per device for better security. Therefore, for +* each bind of a new device even with an existing PASID, we need to +* call the nested mode setup function here. +*/ + spin_lock(&iom

Re: [PATCH v13 4/8] iommu/vt-d: Add bind guest PASID support

2020-05-14 Thread Jacob Pan
Hi Christoph, Thanks a lot for the reviews, comments below. Jacob On Wed, 13 May 2020 22:59:30 -0700 Christoph Hellwig wrote: > > + if (dev_is_pci(dev)) { > > + /* VT-d supports devices with full 20 bit PASIDs > > only */ > > + if (pci_max_pasids(to_pci_dev(dev)) != PASID

Re: [PATCH v13 4/8] iommu/vt-d: Add bind guest PASID support

2020-05-13 Thread Christoph Hellwig
> + if (dev_is_pci(dev)) { > + /* VT-d supports devices with full 20 bit PASIDs only */ > + if (pci_max_pasids(to_pci_dev(dev)) != PASID_MAX) > + return -EINVAL; > + } else { > + return -ENOTSUPP; > + } This looks strange. Why no

[PATCH v13 4/8] iommu/vt-d: Add bind guest PASID support

2020-05-13 Thread Jacob Pan
When supporting guest SVA with emulated IOMMU, the guest PASID table is shadowed in VMM. Updates to guest vIOMMU PASID table will result in PASID cache flush which will be passed down to the host as bind guest PASID calls. For the SL page tables, it will be harvested from device's default domain (