Re: possible dmar_init_reserved_ranges() error

2016-12-23 Thread Joerg Roedel
On Thu, Dec 22, 2016 at 06:48:01PM -0600, Bjorn Helgaas wrote: > If we didn't want to use pcibios_resource_to_bus() here for some > reason, we should at least add a comment about why we think it's OK to > use a CPU physical address as an IOVA. Even if there are no such x86 systems out there, I thi

[PATCH V6 0/7] perf/amd/iommu: Enable multi-IOMMU support

2016-12-23 Thread Suravee Suthikulpanit
From: Suravee Suthikulpanit This patch series modifies the existing IOMMU and Perf drivers to support systems with multiple IOMMUs by allocating an amd_iommu PMU per IOMMU instance. This allows users to specify performance events and filters separately for each IOMMU. This has been tested on the

[PATCH V6 1/7] perf/amd/iommu: Misc fix up perf_iommu_read

2016-12-23 Thread Suravee Suthikulpanit
This patch contains the following minor fixup: * Fixed overflow handling since u64 delta would lose the MSB sign bit. * Remove unnecessary local64_set(). * Coding style and make use of GENMASK_ULL macro. Cc: Peter Zijlstra Cc: Borislav Petkov Signed-off-by: Suravee Suthikulpanit --- arch

[PATCH V6 2/7] perf/amd/iommu: Modify functions to query max banks and counters

2016-12-23 Thread Suravee Suthikulpanit
Currently, amd_iommu_pc_get_max_[banks|counters]() use end-point device ID to locate an IOMMU and check the reported max banks/counters. The logic assumes that the IOMMU_BASE_DEVID belongs to the first IOMMU, and uses it to acquire a reference to the first IOMMU, which does not work on certain syst

[PATCH V6 7/7] perf/amd/iommu: Enable support for multiple IOMMUs

2016-12-23 Thread Suravee Suthikulpanit
This patch adds multi-IOMMU support for perf by exposing an AMD IOMMU PMU for each IOMMU found in the system via: /sys/device/amd_iommu_x /* where x is the IOMMU index. */ This allows users to specify different events to be programed onto performance counters of each IOMMU. Cc: Peter Zijls

[PATCH V6 6/7] iommu/amd: Introduce amd_iommu_get_num_iommus()

2016-12-23 Thread Suravee Suthikulpanit
This patch introduces amd_iommu_get_num_iommus(). This is intended for Perf AMD IOMMU driver. Cc: Joerg Roedel Signed-off-by: Suravee Suthikulpanit --- arch/x86/events/amd/iommu.h | 2 ++ drivers/iommu/amd_iommu_init.c | 7 ++- drivers/iommu/amd_iommu_proto.h | 1 + 3 files changed, 9

[PATCH V6 4/7] perf/amd/iommu: Declare pr_fmt and remove unnecessary pr_debug

2016-12-23 Thread Suravee Suthikulpanit
This patch declare pr_fmt for perf/amd_iommu and remove unnecessary pr_debug. Cc: Peter Zijlstra Cc: Borislav Petkov Signed-off-by: Suravee Suthikulpanit --- arch/x86/events/amd/iommu.c | 12 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/arch/x86/events/amd/iommu.c

[PATCH V6 3/7] perf/amd/iommu: Modify IOMMU API to allow specifying IOMMU index

2016-12-23 Thread Suravee Suthikulpanit
The current amd_iommu_pc_get_set_reg_val() cannot support multi-IOMMU. It is also confusing since it is trying to support set and get in one function. So, this patch breaks it down to amd_iommu_pc_[get|set]_counter(), and modifies them to allow callers to specify IOMMU index. This prepares the dri

[PATCH V6 5/7] perf/amd/iommu: Clean up perf_iommu_enable_event

2016-12-23 Thread Suravee Suthikulpanit
This patch cleans up: * Various bitwise operations in perf_iommu_enable_event * Make use macros BIT(x) This should not affect logic and functionality. Cc: Peter Zijlstra Cc: Borislav Petkov Signed-off-by: Suravee Suthikulpanit --- arch/x86/events/amd/iommu.c | 12 ++-- 1 file chan

Re: [RFC v4 15/16] vfio/type1: Check MSI remapping at irq domain level

2016-12-23 Thread Geetha Akula
Hi Eric, Seeing same issue reported by Diana on ThunderX with you v4.9-reserved-v4 branch. Vfio passthough work fine when allow_unsafe_interrupts is set. Thank you, Geetha. On Thu, Dec 22, 2016 at 6:32 PM, Auger Eric wrote: > Hi Diana, > > On 22/12/2016 13:41, Diana Madalina Craciun wrote: >

Re: [RFC v4 15/16] vfio/type1: Check MSI remapping at irq domain level

2016-12-23 Thread Auger Eric
Hi Geetha, On 23/12/2016 14:33, Geetha Akula wrote: > Hi Eric, > > Seeing same issue reported by Diana on ThunderX with you > v4.9-reserved-v4 branch. > Vfio passthough work fine when allow_unsafe_interrupts is set. Thank you for testing! I will fix the security assessment by better studying flag

Re: [PATCH v7 00/12] Fix kdump faults on system with amd iommu

2016-12-23 Thread Baoquan He
Hi Joerg, Ping! Could you help review this version? Not sure this could catch up to v4.10 merging. Thanks Baoqaun On 11/25/16 at 01:13pm, Baoquan He wrote: > This is v7 post. > > The principle of the fix is similar to intel iommu. Just defer the assignment > of device to domain to device drive