Re: [RFC PATCH 2/4] iommu/vt-d: Add first level page table interfaces

2019-09-24 Thread Peter Xu
On Wed, Sep 25, 2019 at 04:38:31AM +, Tian, Kevin wrote: > > From: Peter Xu [mailto:pet...@redhat.com] > > Sent: Wednesday, September 25, 2019 12:31 PM > > > > On Tue, Sep 24, 2019 at 09:38:53AM +0800, Lu Baolu wrote: > > > > > intel_mmmap_range(domain, addr, end, phys_addr, prot) > > > > > >

Re: [RFC PATCH 2/4] iommu/vt-d: Add first level page table interfaces

2019-09-24 Thread Peter Xu
On Mon, Sep 23, 2019 at 08:24:52PM +0800, Lu Baolu wrote: > This adds functions to manipulate first level page tables > which could be used by a scalale mode capable IOMMU unit. > > intel_mmmap_range(domain, addr, end, phys_addr, prot) > - Map an iova range of [addr, end) to the physical memory

RE: [RFC PATCH 3/4] iommu/vt-d: Map/unmap domain with mmmap/mmunmap

2019-09-24 Thread Tian, Kevin
> From: Lu Baolu [mailto:baolu...@linux.intel.com] > Sent: Monday, September 23, 2019 8:25 PM > > If a dmar domain has DOMAIN_FLAG_FIRST_LEVEL_TRANS bit set > in its flags, IOMMU will use the first level page table for > translation. Hence, we need to map or unmap addresses in the > first level

RE: [RFC PATCH 2/4] iommu/vt-d: Add first level page table interfaces

2019-09-24 Thread Tian, Kevin
> From: Peter Xu [mailto:pet...@redhat.com] > Sent: Wednesday, September 25, 2019 12:31 PM > > On Tue, Sep 24, 2019 at 09:38:53AM +0800, Lu Baolu wrote: > > > > intel_mmmap_range(domain, addr, end, phys_addr, prot) > > > > > > Maybe think of a different name..? mmmap seems a bit weird :-) > > > >

Re: [RFC PATCH 2/4] iommu/vt-d: Add first level page table interfaces

2019-09-24 Thread Peter Xu
On Tue, Sep 24, 2019 at 09:38:53AM +0800, Lu Baolu wrote: > > > intel_mmmap_range(domain, addr, end, phys_addr, prot) > > > > Maybe think of a different name..? mmmap seems a bit weird :-) > > Yes. I don't like it either. I've thought about it and haven't > figured out a satisfied one. Do you

Re: [RFC PATCH 0/4] Use 1st-level for DMA remapping in guest

2019-09-24 Thread Lu Baolu
Hi Kevin, On 9/24/19 3:00 PM, Tian, Kevin wrote: '---' '---' This patch series only aims to achieve the first goal, a.k.a using first goal? then what are other goals? I didn't spot such information. The overall goal is to use IOMMU nested mode to avoid shadow

[PATCH v2 2/6] ACPI / utils: Move acpi_dev_get_first_match_dev() under CONFIG_ACPI

2019-09-24 Thread Andy Shevchenko
We have a stub defined for the acpi_dev_get_first_match_dev() in acpi.h for the case when CONFIG_ACPI=n. Moreover, acpi_dev_put(), counterpart function, is already placed under CONFIG_ACPI. Thus, move acpi_dev_get_first_match_dev() under CONFIG_ACPI as well. Fixes: 817b4d64da03 ("Introduce

[PATCH v2 3/6] ACPI / utils: Introduce acpi_dev_hid_uid_match() helper

2019-09-24 Thread Andy Shevchenko
There are users outside of ACPI realm which reimplementing the comparator function to check if the given device matches to given HID and UID. For better utilization, introduce a helper for everyone to use. Signed-off-by: Andy Shevchenko --- drivers/acpi/utils.c| 25

[PATCH v2 6/6] iommu/amd: Switch to use acpi_dev_hid_uid_match()

2019-09-24 Thread Andy Shevchenko
Since we have a generic helper, drop custom implementation in the driver. Signed-off-by: Andy Shevchenko --- drivers/iommu/amd_iommu.c | 30 +- 1 file changed, 5 insertions(+), 25 deletions(-) diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c index

[PATCH v2 5/6] mmc: sdhci-acpi: Switch to use acpi_dev_hid_uid_match()

2019-09-24 Thread Andy Shevchenko
Since we have a generic helper, drop custom implementation in the driver. Signed-off-by: Andy Shevchenko --- drivers/mmc/host/sdhci-acpi.c | 49 --- 1 file changed, 16 insertions(+), 33 deletions(-) diff --git a/drivers/mmc/host/sdhci-acpi.c

[PATCH v2 1/6] ACPI / utils: Describe function parameters in kernel-doc

2019-09-24 Thread Andy Shevchenko
Kernel documentation script complains that some of the function parameters are not described: drivers/acpi/utils.c:462: warning: Function parameter or member 'handle' not described in 'acpi_handle_path' drivers/acpi/utils.c:484: warning: Function parameter or member 'level' not described in

[PATCH v2 0/6] ACPI / utils: add new helper for HID/UID match

2019-09-24 Thread Andy Shevchenko
There are few users outside of ACPI realm that re-introduce a custom solution to match ACPI device against HID/UID. Add a generic helper for them. The series is supposed to go via linux-pm tree. In v2: - add patch 2 due to latent issue in the header (lkp) - get rid of match_hid_uid() completely

[PATCH v2 4/6] ACPI / LPSS: Switch to use acpi_dev_hid_uid_match()

2019-09-24 Thread Andy Shevchenko
Since we have a generic helper, drop custom implementation in the driver. Signed-off-by: Andy Shevchenko --- drivers/acpi/acpi_lpss.c | 21 +++-- 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/drivers/acpi/acpi_lpss.c b/drivers/acpi/acpi_lpss.c index

Re: [PATCH v1 4/5] mmc: sdhci-acpi: Switch to use acpi_dev_hid_uid_match()

2019-09-24 Thread kbuild test robot
tree in git format-patch, please see https://stackoverflow.com/a/37406982] url: https://github.com/0day-ci/linux/commits/Andy-Shevchenko/ACPI-utils-Describe-function-parameters-in-kernel-doc/20190924-230504 base: https://kernel.googlesource.com/pub/scm/linux/kernel/git/rafael/linux-pm.git

Re: [PATCH v1 2/5] ACPI / utils: Introduce acpi_dev_hid_uid_match() helper

2019-09-24 Thread kbuild test robot
tree in git format-patch, please see https://stackoverflow.com/a/37406982] url: https://github.com/0day-ci/linux/commits/Andy-Shevchenko/ACPI-utils-Describe-function-parameters-in-kernel-doc/20190924-230504 base: https://kernel.googlesource.com/pub/scm/linux/kernel/git/rafael/linux-pm.git

Re: [PATCH v1 2/5] ACPI / utils: Introduce acpi_dev_hid_uid_match() helper

2019-09-24 Thread kbuild test robot
the base tree in git format-patch, please see https://stackoverflow.com/a/37406982] url: https://github.com/0day-ci/linux/commits/Andy-Shevchenko/ACPI-utils-Describe-function-parameters-in-kernel-doc/20190924-230504 base: https://kernel.googlesource.com/pub/scm/linux/kernel/git/rafael/linux

Re: [PATCH v1 3/5] ACPI / LPSS: Switch to use acpi_dev_hid_uid_match()

2019-09-24 Thread kbuild test robot
tree in git format-patch, please see https://stackoverflow.com/a/37406982] url: https://github.com/0day-ci/linux/commits/Andy-Shevchenko/ACPI-utils-Describe-function-parameters-in-kernel-doc/20190924-230504 base: https://kernel.googlesource.com/pub/scm/linux/kernel/git/rafael/linux-pm.git

Re: [PATCH v1 5/5] iommu/amd: Switch to use acpi_dev_hid_uid_match()

2019-09-24 Thread Andy Shevchenko
On Tue, Sep 24, 2019 at 03:01:53PM +0300, Andy Shevchenko wrote: > Since we have a generic helper, drop custom implementation in the driver. Actually we may get rid of match_hid_uid() completely and thus slightly speed up get_acpihid_device_id(). I'll wait for other comments and then send v2. >

[PATCH v1 2/5] ACPI / utils: Introduce acpi_dev_hid_uid_match() helper

2019-09-24 Thread Andy Shevchenko
There are users outside of ACPI realm which reimplementing the comparator function to check if the given device matches to given HID and UID. For better utilization, introduce a helper for everyone to use. Signed-off-by: Andy Shevchenko --- drivers/acpi/utils.c| 25

[PATCH v1 1/5] ACPI / utils: Describe function parameters in kernel-doc

2019-09-24 Thread Andy Shevchenko
Kernel documentation script complains that some of the function parameters are not described: drivers/acpi/utils.c:462: warning: Function parameter or member 'handle' not described in 'acpi_handle_path' drivers/acpi/utils.c:484: warning: Function parameter or member 'level' not described in

[PATCH v1 3/5] ACPI / LPSS: Switch to use acpi_dev_hid_uid_match()

2019-09-24 Thread Andy Shevchenko
Since we have a generic helper, drop custom implementation in the driver. Signed-off-by: Andy Shevchenko --- drivers/acpi/acpi_lpss.c | 21 +++-- 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/drivers/acpi/acpi_lpss.c b/drivers/acpi/acpi_lpss.c index

[PATCH v1 5/5] iommu/amd: Switch to use acpi_dev_hid_uid_match()

2019-09-24 Thread Andy Shevchenko
Since we have a generic helper, drop custom implementation in the driver. Signed-off-by: Andy Shevchenko --- drivers/iommu/amd_iommu.c | 15 +-- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c index

[PATCH v1 4/5] mmc: sdhci-acpi: Switch to use acpi_dev_hid_uid_match()

2019-09-24 Thread Andy Shevchenko
Since we have a generic helper, drop custom implementation in the driver. Signed-off-by: Andy Shevchenko --- drivers/mmc/host/sdhci-acpi.c | 49 --- 1 file changed, 16 insertions(+), 33 deletions(-) diff --git a/drivers/mmc/host/sdhci-acpi.c

Re: [PATCH 1/5] iommu/amd: Wait for completion of IOTLB flush in attach_device

2019-09-24 Thread Joerg Roedel
On Tue, Sep 10, 2019 at 07:49:21PM +0200, Filippo Sironi wrote: > Signed-off-by: Filippo Sironi > --- > drivers/iommu/amd_iommu.c | 2 ++ > 1 file changed, 2 insertions(+) Applied this one with a commit message and a fixes tag, thanks.

Re: [PATCH 1/4] iommu/amd: Fix pages leak in free_pagetable()

2019-09-24 Thread Joerg Roedel
Hi Andrei, On Fri, Sep 13, 2019 at 04:42:28PM +0200, Andrei Dulea wrote: > Take into account the gathered freelist in free_sub_pt(), otherwise we > end up leaking all that pages. > > Fixes: 409afa44f9ba ("iommu/amd: Introduce free_sub_pt() function") > Signed-off-by: Andrei Dulea > --- >

[PATCH] iommu/ipmmu-vmsa: Hook up r8a774b1 DT matching code

2019-09-24 Thread Biju Das
Support RZ/G2N (R8A774B1) IPMMU. Signed-off-by: Biju Das --- drivers/iommu/ipmmu-vmsa.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/iommu/ipmmu-vmsa.c b/drivers/iommu/ipmmu-vmsa.c index ad0098c..002561b 100644 --- a/drivers/iommu/ipmmu-vmsa.c +++

[PATCH] dt-bindings: iommu: ipmmu-vmsa: Add r8a774b1 support

2019-09-24 Thread Biju Das
Document RZ/G2N (R8A774B1) SoC bindings. Signed-off-by: Biju Das --- Documentation/devicetree/bindings/iommu/renesas,ipmmu-vmsa.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/iommu/renesas,ipmmu-vmsa.txt

RE: [RFC PATCH 0/4] Use 1st-level for DMA remapping in guest

2019-09-24 Thread Tian, Kevin
> From: Raj, Ashok > Sent: Tuesday, September 24, 2019 4:26 AM > > Hi Jacob > > On Mon, Sep 23, 2019 at 12:27:15PM -0700, Jacob Pan wrote: > > > > > > In VT-d 3.0, scalable mode is introduced, which offers two level > > > translation page tables and nested translation mode. Regards to > > >