Re: [PATCH v8 9/9] perf/amd/iommu: Enable support for multiple IOMMUs

2017-01-22 Thread Borislav Petkov
On Mon, Jan 16, 2017 at 01:23:36AM -0600, Suravee Suthikulpanit wrote: > From: Suravee Suthikulpanit > > Add multi-IOMMU support for perf by exposing an AMD IOMMU PMU > for each IOMMU found in the system via: > > /bus/event_source/devices/amd_iommu_x > > where

Re: [PATCH v8 7/9] perf/amd/iommu: Check return value when set and get counter value

2017-01-22 Thread Borislav Petkov
On Mon, Jan 16, 2017 at 01:23:34AM -0600, Suravee Suthikulpanit wrote: > From: Suravee Suthikulpanit > > In, perf_iommu_start(), we need to check the return value from > amd_iommu_set_reg(). In case of failure, we should not enable the PMU. > > Also, in

Re: [PATCH v8 6/9] perf/amd/iommu: Modify amd_iommu_pc_get_set_reg_val() API to allow specifying IOMMU index

2017-01-22 Thread Borislav Petkov
On Mon, Jan 16, 2017 at 01:23:33AM -0600, Suravee Suthikulpanit wrote: > From: Suravee Suthikulpanit > > The current amd_iommu_pc_get_set_reg_val() cannot support multiple IOMMUs > It is also confusing since it is trying to support set and get in > one function. >

Re: [PATCH v8 5/9] perf/amd/iommu: Modify functions to query max banks and counters

2017-01-22 Thread Borislav Petkov
On Mon, Jan 16, 2017 at 01:23:32AM -0600, Suravee Suthikulpanit wrote: > 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