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

2017-01-11 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

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

2017-01-11 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

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

2017-01-11 Thread Boris Petkov
On January 11, 2017 4:03:50 AM GMT+01:00, Suravee Suthikulpanit wrote: > >Right Thanks for catching this. Do you want me to send out V8 with >this fix? Send only the corrected version of this patch please, as a reply to this message. Thanks. -- Sent from a

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

2017-01-11 Thread Boris Petkov
On January 11, 2017 4:03:50 AM GMT+01:00, Suravee Suthikulpanit wrote: > >Right Thanks for catching this. Do you want me to send out V8 with >this fix? Send only the corrected version of this patch please, as a reply to this message. Thanks. -- Sent from a small device: formatting sux

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

2017-01-10 Thread Suravee Suthikulpanit
On 1/10/17 21:43, Joerg Roedel wrote: On Mon, Jan 09, 2017 at 09:33:42PM -0600, Suthikulpanit, Suravee wrote: +static struct amd_iommu *get_amd_iommu(uint idx) +{ + uint i = 0; + struct amd_iommu *iommu = NULL; + + for_each_iommu(iommu) { + if (i == idx) +

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

2017-01-10 Thread Suravee Suthikulpanit
On 1/10/17 21:43, Joerg Roedel wrote: On Mon, Jan 09, 2017 at 09:33:42PM -0600, Suthikulpanit, Suravee wrote: +static struct amd_iommu *get_amd_iommu(uint idx) +{ + uint i = 0; + struct amd_iommu *iommu = NULL; + + for_each_iommu(iommu) { + if (i == idx) +

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

2017-01-10 Thread Joerg Roedel
On Mon, Jan 09, 2017 at 09:33:42PM -0600, Suthikulpanit, Suravee wrote: > +static struct amd_iommu *get_amd_iommu(uint idx) > +{ > + uint i = 0; > + struct amd_iommu *iommu = NULL; > + > + for_each_iommu(iommu) { > + if (i == idx) > + break; > +

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

2017-01-10 Thread Joerg Roedel
On Mon, Jan 09, 2017 at 09:33:42PM -0600, Suthikulpanit, Suravee wrote: > +static struct amd_iommu *get_amd_iommu(uint idx) > +{ > + uint i = 0; > + struct amd_iommu *iommu = NULL; > + > + for_each_iommu(iommu) { > + if (i == idx) > + break; > +