[PATCH] iommu/arm-smmu: fix null-pointer dereference in arm_smmu_add_device

2017-08-08 Thread Artem Savkov
Commit c54451a "iommu/arm-smmu: Fix the error path in arm_smmu_add_device" removed fwspec assignment in legacy_binding path as redundant which is wrong. It needs to be updated after fwspec initialisation in arm_smmu_register_legacy_master() as it is dereferenced later. Without this there is a

Re: [PATCH] iommu/arm-smmu: fix null-pointer dereference in arm_smmu_add_device

2017-08-08 Thread Will Deacon
Hi Artem, Thanks for the patch. On Tue, Aug 08, 2017 at 10:58:01AM +0200, Artem Savkov wrote: > Commit c54451a "iommu/arm-smmu: Fix the error path in arm_smmu_add_device" > removed fwspec assignment in legacy_binding path as redundant which is > wrong. It needs to be updated after fwspec

Re: [PATCH v2 0/4] Optimise 64-bit IOVA allocations

2017-08-08 Thread Leizhen (ThunderTown)
On 2017/8/8 20:03, Ganapatrao Kulkarni wrote: > On Wed, Jul 26, 2017 at 4:47 PM, Leizhen (ThunderTown) > wrote: >> >> >> On 2017/7/26 19:08, Joerg Roedel wrote: >>> Hi Robin. >>> >>> On Fri, Jul 21, 2017 at 12:41:57PM +0100, Robin Murphy wrote: Hi all,

Re: [PATCH v2 0/4] Optimise 64-bit IOVA allocations

2017-08-08 Thread Ganapatrao Kulkarni
On Wed, Aug 9, 2017 at 7:12 AM, Leizhen (ThunderTown) wrote: > > > On 2017/8/8 20:03, Ganapatrao Kulkarni wrote: >> On Wed, Jul 26, 2017 at 4:47 PM, Leizhen (ThunderTown) >> wrote: >>> >>> >>> On 2017/7/26 19:08, Joerg Roedel wrote: Hi

Re: [PATCH v2 0/4] Optimise 64-bit IOVA allocations

2017-08-08 Thread Leizhen (ThunderTown)
On 2017/8/9 11:24, Ganapatrao Kulkarni wrote: > On Wed, Aug 9, 2017 at 7:12 AM, Leizhen (ThunderTown) > wrote: >> >> >> On 2017/8/8 20:03, Ganapatrao Kulkarni wrote: >>> On Wed, Jul 26, 2017 at 4:47 PM, Leizhen (ThunderTown) >>> wrote:

Re: [PATCH 2/2] iommu/arm-smmu: Add system PM support

2017-08-08 Thread Robin Murphy
On 08/08/17 12:18, Will Deacon wrote: > On Tue, Jul 18, 2017 at 01:44:42PM +0100, Robin Murphy wrote: >> With all our hardware state tracked in such a way that we can naturally >> restore it as part of the necessary reset, resuming is trivial, and >> there's nothing to do on suspend at all. >> >>

Re: [PATCH v2 0/4] Optimise 64-bit IOVA allocations

2017-08-08 Thread Ganapatrao Kulkarni
On Wed, Jul 26, 2017 at 4:47 PM, Leizhen (ThunderTown) wrote: > > > On 2017/7/26 19:08, Joerg Roedel wrote: >> Hi Robin. >> >> On Fri, Jul 21, 2017 at 12:41:57PM +0100, Robin Murphy wrote: >>> Hi all, >>> >>> In the wake of the ARM SMMU optimisation efforts, it seems

Re: [PATCH 1/2] iommu/arm-smmu: Track context bank state

2017-08-08 Thread Robin Murphy
On 08/08/17 12:11, Will Deacon wrote: > Hi Robin, > > I like the idea, but I think there are a few minor issues with the patch. > Comments below. > > On Tue, Jul 18, 2017 at 01:44:41PM +0100, Robin Murphy wrote: >> Echoing what we do for Stream Map Entries, maintain a software shadow >> state

Re: [PATCH v2] iommu/arm-smmu: fix null-pointer dereference in arm_smmu_add_device

2017-08-08 Thread Robin Murphy
On 08/08/17 11:26, Artem Savkov wrote: > Commit c54451a "iommu/arm-smmu: Fix the error path in arm_smmu_add_device" > removed fwspec assignment in legacy_binding path as redundant which is > wrong. It needs to be updated after fwspec initialisation in > arm_smmu_register_legacy_master() as it is

Re: [PATCH 2/2] iommu/arm-smmu: Add system PM support

2017-08-08 Thread Will Deacon
On Tue, Jul 18, 2017 at 01:44:42PM +0100, Robin Murphy wrote: > With all our hardware state tracked in such a way that we can naturally > restore it as part of the necessary reset, resuming is trivial, and > there's nothing to do on suspend at all. > > Signed-off-by: Robin Murphy

Re: [PATCH v2] iommu/arm-smmu: fix null-pointer dereference in arm_smmu_add_device

2017-08-08 Thread Will Deacon
[+ Joerg] On Tue, Aug 08, 2017 at 11:37:40AM +0100, Robin Murphy wrote: > On 08/08/17 11:26, Artem Savkov wrote: > > Commit c54451a "iommu/arm-smmu: Fix the error path in arm_smmu_add_device" > > removed fwspec assignment in legacy_binding path as redundant which is > > wrong. It needs to be

[PATCH v2] iommu/arm-smmu: fix null-pointer dereference in arm_smmu_add_device

2017-08-08 Thread Artem Savkov
Commit c54451a "iommu/arm-smmu: Fix the error path in arm_smmu_add_device" removed fwspec assignment in legacy_binding path as redundant which is wrong. It needs to be updated after fwspec initialisation in arm_smmu_register_legacy_master() as it is dereferenced later. Without this there is a

Re: [PATCH 1/2] iommu/arm-smmu: Track context bank state

2017-08-08 Thread Will Deacon
Hi Robin, I like the idea, but I think there are a few minor issues with the patch. Comments below. On Tue, Jul 18, 2017 at 01:44:41PM +0100, Robin Murphy wrote: > Echoing what we do for Stream Map Entries, maintain a software shadow > state for context bank configuration. With this in place, we

RE: [PATCH v5 1/2] ACPI/IORT: Add ITS address regions reservation helper

2017-08-08 Thread Shameerali Kolothum Thodi
> -Original Message- > From: Lorenzo Pieralisi [mailto:lorenzo.pieral...@arm.com] > Sent: Monday, August 07, 2017 6:09 PM > To: Shameerali Kolothum Thodi > Cc: Robin Murphy; marc.zyng...@arm.com; sudeep.ho...@arm.com; > will.dea...@arm.com; hanjun@linaro.org; Gabriele Paoloni; John

[PATCH v2 1/2] iommu/arm-smmu: Track context bank state

2017-08-08 Thread Robin Murphy
Echoing what we do for Stream Map Entries, maintain a software shadow state for context bank configuration. With this in place, we are mere moments away from blissfully easy suspend/resume support. Reviewed-by: Sricharan R Signed-off-by: Robin Murphy

[PATCH v2 2/2] iommu/arm-smmu: Add system PM support

2017-08-08 Thread Robin Murphy
With all our hardware state tracked in such a way that we can naturally restore it as part of the necessary reset, resuming is trivial, and there's nothing to do on suspend at all. Signed-off-by: Robin Murphy --- v2: Whitespace fixes drivers/iommu/arm-smmu.c | 11

[PATCH 0/4] Patches to support ring0 SVM and devtlb

2017-08-08 Thread Ashok Raj
Hi Sorry for resending.. iommu list email was mistyped :-( The first 2 patches in the series fix some simple bugs in Intel vt-d driver. The 3rd patch Adds support for kmem notify required to support ring0 SVM. 4th patch uses the hooks to perform device tlb invalidations. Ashok Raj (3):

[PATCH 1/4] iommu/vt-d: IOMMU Page Request needs to check if address is canonical.

2017-08-08 Thread Ashok Raj
Page Request from devices that support device-tlb would request translation to pre-cache them in device to avoid overhead of IOMMU lookups. IOMMU needs to check for canonicallity of the address before performing page-fault processing. To: Joerg Roedel To:

[PATCH 2/4] iommu/vt-d: Avoid calling virt_to_phys() on null pointer

2017-08-08 Thread Ashok Raj
New kernels with debug show panic() from __phys_addr() checks. Avoid calling virt_to_phys() when pasid_state_tbl pointer is null To: Joerg Roedel To: linux-ker...@vger.kernel.org> Cc: iommu@lists.linux-foundation.org Cc: David Woodhouse Cc: Jacob Pan

[PATCH 3/4] mm: Add kernel MMU notifier to manage remote TLB

2017-08-08 Thread Ashok Raj
From: Huang Ying Shared Virtual Memory (SVM) devices have TLBs that cache entries from the CPU's page tables. We need SVM device drivers to flush them at the same time that we flush the CPU TLBs. We can use the existing MMU notifiers for userspace updates, but we lack a

[PATCH 4/4] iommu/vt-d: Hooks to invalidate iotlb/devtlb when using supervisor PASID's.

2017-08-08 Thread Ashok Raj
When a kernel client uses intel_svm_bind_mm() and requests a supervisor PASID, IOMMU needs to track changes to these addresses. Otherwise the device tlb will be stale compared to what's on the cpu for kernel mappings. This is similar to what's done for user space registrations via