RE: [PATCH V2 3/5] iommu: Add support to change default domain of an iommu_group

2020-02-23 Thread Prakhya, Sai Praneeth
> On 2020/2/24 15:03, Prakhya, Sai Praneeth wrote: > >> On 2020/2/24 11:20, Prakhya, Sai Praneeth wrote: > > + list_for_each_entry_safe(grp_dev, temp, &group->devices, list) { > > + struct device *dev; > > + > > + dev = grp_dev->dev; > > +

Re: [PATCH 0/2] virtio: decouple protected guest RAM form VIRTIO_F_IOMMU_PLATFORM

2020-02-23 Thread Michael S. Tsirkin
On Mon, Feb 24, 2020 at 02:45:03PM +0800, Jason Wang wrote: > > On 2020/2/24 下午2:06, Michael S. Tsirkin wrote: > > On Mon, Feb 24, 2020 at 12:01:57PM +0800, Jason Wang wrote: > > > On 2020/2/21 下午10:56, Halil Pasic wrote: > > > > On Fri, 21 Feb 2020 14:22:26 +0800 > > > > Jason Wang wrote: > > >

Re: [PATCH V2 3/5] iommu: Add support to change default domain of an iommu_group

2020-02-23 Thread Lu Baolu
On 2020/2/24 15:03, Prakhya, Sai Praneeth wrote: On 2020/2/24 11:20, Prakhya, Sai Praneeth wrote: + list_for_each_entry_safe(grp_dev, temp, &group->devices, list) { + struct device *dev; + + dev = grp_dev->dev; + iommu_release_device(dev); + +

Re: [PATCH] uacce: unmap remaining mmapping from user space

2020-02-23 Thread Xu Zaibo
Hi Zhangfei, On 2020/2/24 15:06, Zhangfei Gao wrote: When uacce parent device module is removed, user app may still keep the mmaped area, which can be accessed unsafely. When rmmod, Parent device drvier will call uacce_remove, which unmap all remaining mapping from user space for safety. VM_FAU

[PATCH] uacce: unmap remaining mmapping from user space

2020-02-23 Thread Zhangfei Gao
When uacce parent device module is removed, user app may still keep the mmaped area, which can be accessed unsafely. When rmmod, Parent device drvier will call uacce_remove, which unmap all remaining mapping from user space for safety. VM_FAULT_SIGBUS is also reported to user space accordingly. Su

RE: [PATCH V2 3/5] iommu: Add support to change default domain of an iommu_group

2020-02-23 Thread Prakhya, Sai Praneeth
> On 2020/2/24 11:20, Prakhya, Sai Praneeth wrote: > >>> + list_for_each_entry_safe(grp_dev, temp, &group->devices, list) { > >>> + struct device *dev; > >>> + > >>> + dev = grp_dev->dev; > >>> + iommu_release_device(dev); > >>> + > >>> + ret = iommu_group_add_device

Re: [PATCH 2/2] virtio: let virtio use DMA API when guest RAM is protected

2020-02-23 Thread David Gibson
On Fri, Feb 21, 2020 at 05:36:45PM +0100, Christoph Hellwig wrote: > On Fri, Feb 21, 2020 at 01:59:15PM +1100, David Gibson wrote: > > > Hell no. This is a detail of the platform DMA direct implementation. > > > Drivers have no business looking at this flag, and virtio finally needs > > > to be fi

Re: [PATCH 0/2] virtio: decouple protected guest RAM form VIRTIO_F_IOMMU_PLATFORM

2020-02-23 Thread Jason Wang
On 2020/2/24 下午2:06, Michael S. Tsirkin wrote: On Mon, Feb 24, 2020 at 12:01:57PM +0800, Jason Wang wrote: On 2020/2/21 下午10:56, Halil Pasic wrote: On Fri, 21 Feb 2020 14:22:26 +0800 Jason Wang wrote: On 2020/2/21 上午12:06, Halil Pasic wrote: Currently if one intends to run a memory protect

Re: [PATCH 0/2] virtio: decouple protected guest RAM form VIRTIO_F_IOMMU_PLATFORM

2020-02-23 Thread David Gibson
On Fri, Feb 21, 2020 at 03:56:02PM +0100, Halil Pasic wrote: > On Fri, 21 Feb 2020 14:22:26 +0800 > Jason Wang wrote: > > > > > On 2020/2/21 上午12:06, Halil Pasic wrote: > > > Currently if one intends to run a memory protection enabled VM with > > > virtio devices and linux as the guest OS, one n

Re: [PATCH 0/2] virtio: decouple protected guest RAM form VIRTIO_F_IOMMU_PLATFORM

2020-02-23 Thread David Gibson
On Fri, Feb 21, 2020 at 05:41:51PM +0100, Christoph Hellwig wrote: > On Thu, Feb 20, 2020 at 04:33:35PM -0500, Michael S. Tsirkin wrote: > > So it sounds like a host issue: the emulation of s390 unnecessarily > > complicated. > > Working around it by the guest looks wrong ... > > Yes. If your ho

Re: [PATCH 2/2] virtio: let virtio use DMA API when guest RAM is protected

2020-02-23 Thread David Gibson
On Fri, Feb 21, 2020 at 09:39:38AM -0600, Tom Lendacky wrote: > On 2/21/20 7:12 AM, Halil Pasic wrote: > > On Thu, 20 Feb 2020 15:55:14 -0500 > > "Michael S. Tsirkin" wrote: > > > >> On Thu, Feb 20, 2020 at 05:06:06PM +0100, Halil Pasic wrote: > >>> Currently the advanced guest memory protection

Re: [PATCH 1/2] mm: move force_dma_unencrypted() to mem_encrypt.h

2020-02-23 Thread David Gibson
On Fri, Feb 21, 2020 at 07:07:02PM +0100, Halil Pasic wrote: > On Fri, 21 Feb 2020 10:48:15 -0500 > "Michael S. Tsirkin" wrote: > > > On Fri, Feb 21, 2020 at 02:06:39PM +0100, Halil Pasic wrote: > > > On Fri, 21 Feb 2020 14:27:27 +1100 > > > David Gibson wrote: > > > > > > > On Thu, Feb 20, 202

Re: [PATCH 0/2] virtio: decouple protected guest RAM form VIRTIO_F_IOMMU_PLATFORM

2020-02-23 Thread Michael S. Tsirkin
On Mon, Feb 24, 2020 at 12:01:57PM +0800, Jason Wang wrote: > > On 2020/2/21 下午10:56, Halil Pasic wrote: > > On Fri, 21 Feb 2020 14:22:26 +0800 > > Jason Wang wrote: > > > > > On 2020/2/21 上午12:06, Halil Pasic wrote: > > > > Currently if one intends to run a memory protection enabled VM with > >

Re: [PATCH V2 3/5] iommu: Add support to change default domain of an iommu_group

2020-02-23 Thread Lu Baolu
Hi Sai, On 2020/2/24 11:20, Prakhya, Sai Praneeth wrote: + list_for_each_entry_safe(grp_dev, temp, &group->devices, list) { + struct device *dev; + + dev = grp_dev->dev; + iommu_release_device(dev); + + ret = iommu_group_add_device(gr

Re: [PATCH 0/2] virtio: decouple protected guest RAM form VIRTIO_F_IOMMU_PLATFORM

2020-02-23 Thread Jason Wang
On 2020/2/21 下午10:56, Halil Pasic wrote: On Fri, 21 Feb 2020 14:22:26 +0800 Jason Wang wrote: On 2020/2/21 上午12:06, Halil Pasic wrote: Currently if one intends to run a memory protection enabled VM with virtio devices and linux as the guest OS, one needs to specify the VIRTIO_F_IOMMU_PLATFOR

RE: [PATCH V2 2/5] iommu/vt-d: Rename device_def_domain_type() to intel_iommu_dev_def_domain_type()

2020-02-23 Thread Prakhya, Sai Praneeth
> >> On 2020/2/17 5:57, Sai Praneeth Prakhya wrote: > >>> The functionality needed for iommu_ops->dev_def_domain_type() is > >>> already provided by device_def_domain_type() in intel_iommu.c. But, > >>> every call back function in intel_iommu_ops starts with intel_iommu > >>> prefix, hence rename >

RE: [PATCH V2 3/5] iommu: Add support to change default domain of an iommu_group

2020-02-23 Thread Prakhya, Sai Praneeth
> On 2020/2/17 5:57, Sai Praneeth Prakhya wrote: > > Presently, the default domain of an iommu_group is allocated during > > boot time (i.e. when a device is being added to a group) and it cannot > > be changed later. So, the device would typically be either in identity > > (also known as pass_thro

RE: [PATCH V2 5/5] iommu: Document usage of "/sys/kernel/iommu_groups//type" file

2020-02-23 Thread Prakhya, Sai Praneeth
> > +What: /sys/kernel/iommu_groups//type > > +Date: February 2020 > > +KernelVersion: v5.6 > > +Contact: Sai Praneeth Prakhya > > mailto:sai.praneeth.prak...@intel.com>> > > +Description: Lets the user know the type of