Re: [PATCH v2 02/11] PCI: Add ats_supported host bridge flag

2020-03-12 Thread Bjorn Helgaas
On Wed, Mar 11, 2020 at 01:44:57PM +0100, Jean-Philippe Brucker wrote: > Each vendor has their own way of describing whether a host bridge > supports ATS. The Intel and AMD ACPI tables selectively enable or > disable ATS per device or sub-tree, while Arm has a single bit for each > host bridge. F

Re: [PATCH v2 05/11] PCI/ATS: Gather checks into pci_ats_supported()

2020-03-12 Thread Bjorn Helgaas
On Wed, Mar 11, 2020 at 01:45:00PM +0100, Jean-Philippe Brucker wrote: > IOMMU drivers need to perform several tests when checking if a device > supports ATS. Move them all into a new function that returns true when > a device and its host bridge support ATS. > > Since pci_enable_ats() now calls

Re: [PATCH v2 04/11] ACPI/IORT: Check ATS capability in root complex node

2020-03-12 Thread Bjorn Helgaas
On Wed, Mar 11, 2020 at 01:44:59PM +0100, Jean-Philippe Brucker wrote: > When initializing a PCI root bridge, copy its "ATS supported" attribute > into the root bridge. > > Acked-by: Hanjun Guo > Signed-off-by: Jean-Philippe Brucker > --- > drivers/acpi/arm64/iort.c | 27 +++

Re: [PATCH v2 03/11] PCI: OF: Check whether the host bridge supports ATS

2020-03-12 Thread Bjorn Helgaas
On Wed, Mar 11, 2020 at 01:44:58PM +0100, Jean-Philippe Brucker wrote: > When setting up a generic host on a device-tree based system, copy the > ats-supported flag into the pci_host_bridge structure. > > Signed-off-by: Jean-Philippe Brucker > --- > v1->v2: keep the helper in pci-host-common.c >

[RFC PATCH] vfio: Ignore -ENODEV when getting MSI cookie

2020-03-12 Thread Andre Przywara
When we try to get an MSI cookie for a VFIO device, that can fail if CONFIG_IOMMU_DMA is not set. In this case iommu_get_msi_cookie() returns -ENODEV, and that should not be fatal. Ignore that case and proceed with the initialisation. This fixes VFIO with a platform device on the Calxeda Midway (

[PATCH v3] [dma-coherent] Fix integer overflow in the reserved-memory dma allocation

2020-03-12 Thread Kevin Grandemange
pageno is an int and the PAGE_SHIFT shift is done on an int, overflowing if the memory is bigger than 2G This can be reproduced using for example a reserved-memory of 4G reserved-memory { #address-cells = <2>; #size-cells = <2>; ranges;

Re: [PATCH] iommu/vt-d: Unlock on error paths

2020-03-12 Thread Dan Carpenter
On Thu, Mar 12, 2020 at 08:02:41PM +0800, Lu Baolu wrote: > On 2020/3/12 19:37, Dan Carpenter wrote: > > There were a couple places where we need to unlock before returning. > > > > Fixes: 91391b919e19 ("iommu/vt-d: Populate debugfs if IOMMUs are detected") > > Signed-off-by: Dan Carpenter > > --

Re: [PATCH 0/3] Request direct mapping for modem firmware subdevice

2020-03-12 Thread Robin Murphy
On 2020-03-12 6:28 am, Sai Prakash Ranjan wrote: Hi Robin, On 2020-03-10 22:14, Robin Murphy wrote: On 10/03/2020 4:23 pm, Joerg Roedel wrote: On Tue, Mar 10, 2020 at 07:30:50PM +0530, Sibi Sankar wrote: The accesses are initiated by the firmware and they access modem reserved regions. Howeve

Re: [PATCH] iommu/vt-d: Unlock on error paths

2020-03-12 Thread Lu Baolu
On 2020/3/12 19:37, Dan Carpenter wrote: There were a couple places where we need to unlock before returning. Fixes: 91391b919e19 ("iommu/vt-d: Populate debugfs if IOMMUs are detected") Signed-off-by: Dan Carpenter --- drivers/iommu/intel-iommu-debugfs.c | 6 -- 1 file changed, 4 inserti

[PATCH] iommu/vt-d: Unlock on error paths

2020-03-12 Thread Dan Carpenter
There were a couple places where we need to unlock before returning. Fixes: 91391b919e19 ("iommu/vt-d: Populate debugfs if IOMMUs are detected") Signed-off-by: Dan Carpenter --- drivers/iommu/intel-iommu-debugfs.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/

[PATCH] iommu/amd: Fix IOMMU AVIC not properly update the is_run bit in IRTE

2020-03-12 Thread Suravee Suthikulpanit
Commit b9c6ff94e43a ("iommu/amd: Re-factor guest virtual APIC (de-)activation code") accidentally left out the ir_data pointer when calling modity_irte_ga(), which causes the function amd_iommu_update_ga() to return prematurely due to struct amd_ir_data.ref is NULL and the "is_run" bit of IRTE does

Re: [PATCH v2 08/11] iommu/vt-d: Use pci_ats_supported()

2020-03-12 Thread Lu Baolu
On 2020/3/12 15:54, Jean-Philippe Brucker wrote: Hi Baolu, On Thu, Mar 12, 2020 at 09:44:16AM +0800, Lu Baolu wrote: Hi Jean, On 2020/3/11 20:45, Jean-Philippe Brucker wrote: The pci_ats_supported() function checks if a device supports ATS and is allowed to use it. Signed-off-by: Jean-Philip

Re: [PATCH v2 08/11] iommu/vt-d: Use pci_ats_supported()

2020-03-12 Thread Jean-Philippe Brucker
Hi Baolu, On Thu, Mar 12, 2020 at 09:44:16AM +0800, Lu Baolu wrote: > Hi Jean, > > On 2020/3/11 20:45, Jean-Philippe Brucker wrote: > > The pci_ats_supported() function checks if a device supports ATS and is > > allowed to use it. > > > > Signed-off-by: Jean-Philippe Brucker > > --- > > drive