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

2020-02-22 Thread Lu Baolu
Hi, On 2020/2/23 7:59, Prakhya, Sai Praneeth wrote: 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

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

2020-02-22 Thread Lu Baolu
Hi, On 2020/2/17 5:57, Sai Praneeth Prakhya wrote: The default domain type of an iommu group can be changed using file "/sys/kernel/iommu_groups//type". Hence, document it's usage and more importantly spell out it's limitations. Cc: Christoph Hellwig Cc: Joerg Roedel Cc: Ashok Raj Cc: Will

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

2020-02-22 Thread Lu Baolu
Hi, 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_through) mode

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

2020-02-22 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 2/5] iommu/vt-d: Rename device_def_domain_type() to intel_iommu_dev_def_domain_type()

2020-02-22 Thread Lu Baolu
Hi, 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 0/5] iommu: Add support to change default domain of a group

2020-02-22 Thread Prakhya, Sai Praneeth
Hi Joerg, > Presently, the default domain of a group is allocated during boot time and it > cannot be changed later. So, the device would typically be either in identity > (pass_through) mode or the device would be in DMA mode as long as the system > is up and running. There is no way to change

RE: [PATCH V2 1/5] iommu: Add dev_def_domain_type() call back function to iommu_ops

2020-02-22 Thread Prakhya, Sai Praneeth
> > On 2020/2/17 5:57, Sai Praneeth Prakhya wrote: > > When user requests kernel to change the default domain type of a group > > through sysfs, kernel has to make sure that it's ok to change the > > domain type of every device in the group to the requested domain > > (every device may not

Re: [PATCH V2 1/5] iommu: Add dev_def_domain_type() call back function to iommu_ops

2020-02-22 Thread Lu Baolu
Hi Sai, On 2020/2/17 5:57, Sai Praneeth Prakhya wrote: When user requests kernel to change the default domain type of a group through sysfs, kernel has to make sure that it's ok to change the domain type of every device in the group to the requested domain (every device may not support both the

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

2020-02-22 Thread Michael S. Tsirkin
On Fri, Feb 21, 2020 at 03:33:40PM +0100, Halil Pasic wrote: > AFAIU you have a positive attitude towards the idea, that > !F_VIRTIO_PLATFORM implies 'no DMA API is used by virtio' > should be scrapped. > > I would like to accomplish that without adverse effects to virtio-ccw > (because caring

Re: [PATCH v2] iommu/vt-d: Fix a bug in intel_iommu_iova_to_phys() for huge page

2020-02-22 Thread Moritz Fischer
On Thu, Feb 20, 2020 at 11:44:31AM -0800, Yonghyun Hwang wrote: > intel_iommu_iova_to_phys() has a bug when it translates an IOVA for a huge > page onto its corresponding physical address. This commit fixes the bug by > accomodating the level of page entry for the IOVA and adds IOVA's lower >

Re: [PATCH v2] iommu/vt-d: Fix a bug in intel_iommu_iova_to_phys() for huge page

2020-02-22 Thread Lu Baolu
Hi, On 2020/2/22 21:05, Lu Baolu wrote: Hi, On 2020/2/21 3:44, Yonghyun Hwang wrote: intel_iommu_iova_to_phys() has a bug when it translates an IOVA for a huge page onto its corresponding physical address. This commit fixes the bug by accomodating the level of page entry for the IOVA and

Re: [PATCH v2] iommu/vt-d: Fix a bug in intel_iommu_iova_to_phys() for huge page

2020-02-22 Thread Lu Baolu
Hi, On 2020/2/21 3:44, Yonghyun Hwang wrote: intel_iommu_iova_to_phys() has a bug when it translates an IOVA for a huge page onto its corresponding physical address. This commit fixes the bug by accomodating the level of page entry for the IOVA and adds IOVA's lower address to the physical