On Thu, 13 Jan 2022 20:54:52 +0100 Halil Pasic <pa...@linux.ibm.com> wrote:
> > > This is the very reason for which commit 7ef7e6e3b ("vhost: correctly > > > turn on VIRTIO_F_IOMMU_PLATFORM") for, which fences _F_ACCESS_PLATFORM > > > form the vhost device that does not need it, because on the vhost > > > interface it only means "I/O address translation is needed". > > > > > > This patch takes inspiration from 7ef7e6e3b ("vhost: correctly turn on > > > VIRTIO_F_IOMMU_PLATFORM"), > > > > Strange, I could not find this commit. Did you mean f7ef7e6e3b? > > > > Right! Copy-paste error. > > Should I spin a v2 to correct this? Sorry for the hunk below. I wanted to post the whole patch in question, then deleted it, but left some leftovers. Another copy-paste error. Grrr > > static void *vhost_memory_map(struct vhost_dev *dev, hwaddr addr, > @@ -765,6 +772,9 @@ static int vhost_dev_set_features(struct vhost_dev *dev, > if (enable_log) { > features |= 0x1ULL << VHOST_F_LOG_ALL; > } > + if (!vhost_dev_has_iommu(dev)) { > + features &= ~(0x1ULL << VIRTIO_F_IOMMU_PLATFORM); > + } > r = dev->vhost_ops->vhost_set_features(dev, features); > if (r < 0) { > VHOST_OPS_DEBUG("vhost_set_features failed"); > > > > and uses the same condition for detecting the