Re: [PATCH 1/1] AMD Family15h Model10-1Fh erratum 746 Workaround

2013-01-23 Thread Suravee Suthikulpanit
On 1/23/2013 1:06 AM, Joerg Roedel wrote: On Tue, Jan 22, 2013 at 05:19:10PM -0600, Suthikulpanit, Suravee wrote: From: Suravee Suthikulpanit suravee.suthikulpa...@amd.com @@ -1171,6 +1195,8 @@ static int iommu_init_pci(struct amd_iommu *iommu) for (i = 0; i 0x83; i

Re: [PATCH 1/3] iommu/amd: Add logic to decode AMD IOMMU event flag

2013-04-02 Thread Suravee Suthikulpanit
On 4/2/2013 10:29 AM, Borislav Petkov wrote: On Tue, Apr 02, 2013 at 05:03:04PM +0200, Joerg Roedel wrote: On Tue, Apr 02, 2013 at 04:40:37PM +0200, Borislav Petkov wrote: While you guys are at it, can someone fix this too pls (ASUS board with a PD on it). [0.220342] [Firmware Bug]:

Re: [PATCH 1/2 V2] iommu/amd: Add workaround for ERBT1312

2013-04-18 Thread Suravee Suthikulpanit
On 4/18/2013 1:35 PM, Joerg Roedel wrote: On Thu, Apr 18, 2013 at 11:59:58AM -0500, Suthikulpanit, Suravee wrote: One last concern I have for this patch is the case when we re-enable the interrupt, then another interrupt happens while we processing the log and set the bit. If the interrupt

Re: [PATCH 1/1] iommu/amd: Fix PASID format in INVALIDATE_IOTLB_PAGES command

2014-03-04 Thread Suravee Suthikulpanit
the IOMMUv2 hardware implementation, and has been corrected since version 2.02 of the specification (available through AMD NDA). Signed-off-by: Jay Cornwall jay.cornw...@amd.com Reviewed-by: Suravee Suthikulpanit suravee.suthikulpa...@amd.com Applied, thanks. Does this mean that PASIDs are only 16 bits

Re: [PATCH 1/1] iommu/amd: Fix PASID format in INVALIDATE_IOTLB_PAGES command

2014-03-04 Thread Suravee Suthikulpanit
On 3/4/2014 10:53 AM, Suravee Suthikulpanit wrote: On 3/4/2014 8:12 AM, Joerg Roedel wrote: On Wed, Feb 26, 2014 at 03:49:31PM -0600, suravee.suthikulpa...@amd.com wrote: From: Jay Cornwall jay.cornw...@amd.com This patch corrects the PASID format in the INVALIDATE_IOTLB_PAGES command, which

Re: [PATCH V2] iommu/amd: Fix logic to determine and checking max PASID

2014-03-21 Thread Suravee Suthikulpanit
Joerg, Do you have any concerns about the V2 of this patch? Thanks, Suravee On 3/5/2014 6:54 PM, suravee.suthikulpa...@amd.com wrote: From: Suravee Suthikulpanit suravee.suthikulpa...@amd.com In reality, the spec can only support 16-bit PASID since INVALIDATE_IOTLB_PAGES

[PATCH] perf/x86/amd: Adding support for new IOMMU performance event

2015-12-11 Thread Suravee Suthikulpanit
From: Suravee Suthikulpanit <suravee.suthikulpa...@amd.com> This patch adds new IOMMU performance event based on the information in table 74 of the AMD I/O Virtualization Technology (IOMMU) Specification (Document Id: 4882, Rev 2.62, Feb 2015) Link: http://support.amd.com/Te

[PATCH] iommu/amd: Assign default IOMMU when there is only one IOMMU

2015-12-11 Thread Suravee Suthikulpanit
by always assign devid zero to be handled by the first IOMMU. Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpa...@amd.com> --- drivers/iommu/amd_iommu_init.c | 18 ++ 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/drivers/iommu/amd_iommu_init.c b/d

Re: [PATCH] iommu/amd: Assign default IOMMU when there is only one IOMMU

2015-12-15 Thread Suravee Suthikulpanit
Hi Joerg, On 12/14/2015 09:08 AM, Joerg Roedel wrote: On Fri, Dec 11, 2015 at 04:54:38PM -0600, Suravee Suthikulpanit wrote: Current driver makes assumption that device with devid zero is always included in the range of devices to be managed by IOMMU. However, certain FW does not include devid

Re: [PATCH 0/6] iommu/amd: enable ACPI hardware ID device support

2016-01-05 Thread Suravee Suthikulpanit
ts PCI bus based device. Suravee Suthikulpanit (3): iommu/amd: Modify ivhd_header structure to support type 11h and 40h iommu/amd: Use the most comprehensive IVHD type that the driver can support iommu/amd: Introduces ivrs_acpihid kernel parameter Wan Zongshun (3): iommu/amd: Add n

Re: [PATCH 3/6] iommu/amd: Introduce amd_iommu_get_num_iommus()

2015-12-29 Thread Suravee Suthikulpanit
Hi Jorge, On 12/28/15 09:43, Joerg Roedel wrote: On Tue, Dec 22, 2015 at 01:19:14PM -0600, Suthikulpanit, Suravee wrote: This patch introduces amd_iommu_get_num_iommus(). Initially, this is intended to be used by Perf AMD IOMMU driver. Signed-off-by: Suravee Suthikulpanit <suravee.suthiku

[PATCH v2 1/6] perf/amd/iommu: Consolidate and move perf_event_amd_iommu header

2016-01-01 Thread Suravee Suthikulpanit
This patch consolidates "arch/x86/kernel/cpu/perf_event_amd_iommu.h" and "drivers/iommu/amd_iommu_proto.h", which contain duplicate function declarations, into "include/linux/perf/perf_event_amd_iommu.h" Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpa...@

[PATCH v2 6/6] perf/amd/iommu: Enable support for multiple IOMMUs

2016-01-01 Thread Suravee Suthikulpanit
the same way (i.e with the same events). Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpa...@amd.com> --- arch/x86/kernel/cpu/perf_event_amd_iommu.c | 80 +-- drivers/iommu/amd_iommu_init.c | 87 ++ include/linu

[PATCH v2 5/6] perf/amd/iommu: Introduce get_iommu_bnk_cnt_evt_idx

2016-01-01 Thread Suravee Suthikulpanit
Introduce a helper function to calculate bit-index for assigning performance counter assignment. Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpa...@amd.com> --- arch/x86/kernel/cpu/perf_event_amd_iommu.c | 20 +++- 1 file changed, 15 insertions(+), 5 deletions(-)

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

2016-01-01 Thread Suravee Suthikulpanit
. So, this patch modifies these function to iterate all IOMMU to check the max banks and counters reported by the hardware. Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpa...@amd.com> --- arch/x86/kernel/cpu/perf_event_amd_iommu.c | 17 +++-- drivers/iommu/amd_iommu_

[PATCH v2 0/6] perf/amd/iommu: Enable multi-IOMMU support

2016-01-01 Thread Suravee Suthikulpanit
IOMMU PMU driver initialization issue in some existing CZ platform. Changes from V1 (https://lkml.org/lkml/2015/12/22/535): * Update patch3 and 6 to use amd_iommus_present instead of introducing amd_iommu_cnt static variable since they are the same thing Suravee Suthikulpanit (6): perf/amd

[PATCH v2 3/6] iommu/amd: Introduce amd_iommu_get_num_iommus()

2016-01-01 Thread Suravee Suthikulpanit
This patch introduces amd_iommu_get_num_iommus(). Initially, this is intended to be used by Perf AMD IOMMU driver. Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpa...@amd.com> --- drivers/iommu/amd_iommu_init.c| 8 +++- include/linux/perf/perf_event_amd_iommu.h | 2

[PATCH v2 4/6] perf/amd/iommu: Introduce data structure for tracking prev count.

2016-01-01 Thread Suravee Suthikulpanit
-off-by: Suravee Suthikulpanit <suravee.suthikulpa...@amd.com> --- arch/x86/kernel/cpu/perf_event_amd_iommu.c | 26 ++ 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/arch/x86/kernel/cpu/perf_event_amd_iommu.c b/arch/x86/kernel/cpu/perf_event_amd_iommu.c

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

2015-12-22 Thread Suravee Suthikulpanit
IOMMU PMU driver initialization issue in some existing CZ platform. Suravee Suthikulpanit (6): perf/amd/iommu: Consolidate and move perf_event_amd_iommu header perf/amd/iommu: Modify functions to query max banks and counters iommu/amd: Introduce amd_iommu_get_num_iommus() perf/amd/iommu

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

2015-12-22 Thread Suravee Suthikulpanit
the same way (i.e with the same events). Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpa...@amd.com> --- arch/x86/kernel/cpu/perf_event_amd_iommu.c | 80 +-- drivers/iommu/amd_iommu_init.c | 87 ++ include/linu

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

2015-12-22 Thread Suravee Suthikulpanit
. So, this patch modifies these function to iterate all IOMMU to check the max banks and counters reported by the hardware. Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpa...@amd.com> --- arch/x86/kernel/cpu/perf_event_amd_iommu.c | 17 +++-- drivers/iommu/amd_iommu_

[PATCH 5/6] perf/amd/iommu: Introduce get_iommu_bnk_cnt_evt_idx

2015-12-22 Thread Suravee Suthikulpanit
Introduce a helper function to calculate bit-index for assigning performance counter assignment. Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpa...@amd.com> --- arch/x86/kernel/cpu/perf_event_amd_iommu.c | 20 +++- 1 file changed, 15 insertions(+), 5 deletions(-)

[PATCH 4/6] perf/amd/iommu: Introduce data structure for tracking prev count.

2015-12-22 Thread Suravee Suthikulpanit
-off-by: Suravee Suthikulpanit <suravee.suthikulpa...@amd.com> --- arch/x86/kernel/cpu/perf_event_amd_iommu.c | 26 ++ 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/arch/x86/kernel/cpu/perf_event_amd_iommu.c b/arch/x86/kernel/cpu/perf_event_amd_iommu.c

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

2015-12-22 Thread Suravee Suthikulpanit
This patch introduces amd_iommu_get_num_iommus(). Initially, this is intended to be used by Perf AMD IOMMU driver. Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpa...@amd.com> --- drivers/iommu/amd_iommu_init.c| 16 include/linux/perf/perf_event_amd_i

[PATCH 1/6] perf/amd/iommu: Consolidate and move perf_event_amd_iommu header

2015-12-22 Thread Suravee Suthikulpanit
This patch consolidates "arch/x86/kernel/cpu/perf_event_amd_iommu.h" and "drivers/iommu/amd_iommu_proto.h", which contain duplicate function declarations, into "include/linux/perf/perf_event_amd_iommu.h" Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpa...@

Re: [PATCH V3 0/5] perf/amd/iommu: Enable multi-IOMMU support

2016-02-10 Thread Suravee Suthikulpanit
Hi Boris, On 02/09/2016 06:08 PM, Borislav Petkov wrote: You probably want to redo those against latest tip/master: http://git.kernel.org/tip/5b26547dd7faa84e1293baa144a0f3e74ed7d4c7 -- Regards/Gruss, Boris. Sure, I'll re-base this. By the way, do you have any other comments regarding the

Re: [PATCH V3 1/5] perf/amd/iommu: Consolidate and move perf_event_amd_iommu header

2016-02-10 Thread Suravee Suthikulpanit
Hi, On 2/11/16 01:51, Borislav Petkov wrote: So, I thought it might be alright to put the perf_event_amd_iommu.h >here. > >Having the information in the file arch/x86/events/amd/iommu.h seems >strange for having to specify ../../arch/x86/events/amd/iommu.h in the >IOMMU driver. > >So, you think

Re: [PATCH V3 5/5] perf/amd/iommu: Enable support for multiple IOMMUs

2016-02-11 Thread Suravee Suthikulpanit
Hi Boris, Thank you very much for catching several styling issues. I should have taken care of that earlier. I'll clean them up. Please see my other comments below. Thanks, Suravee On 02/11/2016 12:14 AM, Borislav Petkov wrote: On Tue, Feb 09, 2016 at 04:53:55PM -0600, Suravee

[PATCH V4 5/6] perf/amd/iommu: Enable support for multiple IOMMUs

2016-02-11 Thread Suravee Suthikulpanit
counters among multiple IOMMUs. Note that this implementation makes an assumption that the counters on all IOMMUs will be programmed the same way (i.e with the same events). Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpa...@amd.com> --- arch/x86/events/amd/iommu.c

[PATCH V4 6/6] perf/amd/iommu: Clean up print messages pr_debug

2016-02-11 Thread Suravee Suthikulpanit
From: Suravee Suthikulpanit <suravee.suthikulpa...@amd.com> This patch declares pr_fmt for perf/amd_iommu, removes unnecessary pr_debug, and clean up error messages. Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpa...@amd.com> --- arch/x86/events/amd/iommu.c | 13 +

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

2016-02-11 Thread Suravee Suthikulpanit
. So, this patch modifies these function to iterate all IOMMU to check the max banks and counters reported by the hardware. Reviewed-by: Joerg Roedel <jroe...@suse.de> Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpa...@amd.com> --- arch/x86/events/amd/iommu.c

[PATCH V4 4/6] perf/amd/iommu: Introduce get_iommu_bnk_cnt_evt_idx

2016-02-11 Thread Suravee Suthikulpanit
Introduce a helper function to calculate bit-index for assigning performance counter assignment. Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpa...@amd.com> --- arch/x86/events/amd/iommu.c | 19 ++- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/ar

[PATCH V4 3/6] iommu/amd: Introduce amd_iommu_get_num_iommus()

2016-02-11 Thread Suravee Suthikulpanit
This patch introduces amd_iommu_get_num_iommus(). Initially, this is intended to be used by Perf AMD IOMMU driver. Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpa...@amd.com> --- arch/x86/include/asm/perf/amd/iommu.h | 2 ++ drivers/iommu/amd_iommu_init.c| 7 ++- 2

[PATCH V4 1/6] perf/amd/iommu: Consolidate and move perf_event_amd_iommu header

2016-02-11 Thread Suravee Suthikulpanit
From: Suravee Suthikulpanit <suravee.suthikulpa...@amd.com> First, this patch move arch/x86/events/amd/iommu.h to arch/x86/include/asm/perf/amd/iommu.h so that we easily include it in both perf-amd-iommu and amd-iommu drivers. Then, we consolidate declarion of AMD IOMMU performance counte

[PATCH V4 0/6] perf/amd/iommu: Enable multi-IOMMU support

2016-02-11 Thread Suravee Suthikulpanit
From: Suravee Suthikulpanit <suravee.suthikulpa...@amd.com> This patch series modifies the existing perf_event_amd_iommu driver to support systems with multiple IOMMUs. It introduces new AMD IOMMU APIs, which are used by the AMD IOMMU Perf driver to access performance counters in multiple

Re: [PATCH v2 3/6] iommu/amd: Introduce amd_iommu_get_num_iommus()

2016-02-09 Thread Suravee Suthikulpanit
Hi Joerg, On 01/07/2016 06:15 AM, Joerg Roedel wrote: On Fri, Jan 01, 2016 at 12:13:37PM -0600, Suravee Suthikulpanit wrote: +int amd_iommu_get_num_iommus(void) +{ + return amd_iommus_present; +} +EXPORT_SYMBOL(amd_iommu_get_num_iommus); Is this export needed? The perf code can't

[PATCH V3 3/5] iommu/amd: Introduce amd_iommu_get_num_iommus()

2016-02-09 Thread Suravee Suthikulpanit
This patch introduces amd_iommu_get_num_iommus(). Initially, this is intended to be used by Perf AMD IOMMU driver. Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpa...@amd.com> --- drivers/iommu/amd_iommu_init.c| 7 ++- include/linux/perf/perf_event_amd_iommu.h | 2

[PATCH V3 0/5] perf/amd/iommu: Enable multi-IOMMU support

2016-02-09 Thread Suravee Suthikulpanit
From: Suravee Suthikulpanit <suravee.suthikulpa...@amd.com> This patch series modifies the existing perf_event_amd_iommu driver to support systems with multiple IOMMUs. It introduces new AMD IOMMU APIs, which will are used by the AMD IOMMU Perf driver to access performance counters in mu

[PATCH V3 1/5] perf/amd/iommu: Consolidate and move perf_event_amd_iommu header

2016-02-09 Thread Suravee Suthikulpanit
This patch consolidates "arch/x86/kernel/cpu/perf_event_amd_iommu.h" and "drivers/iommu/amd_iommu_proto.h", which contain duplicate function declarations, into "include/linux/perf/perf_event_amd_iommu.h" Reviewed-by: Joerg Roedel <jroe...@suse.de>

Re: [PATCH V4 5/6] perf/amd/iommu: Enable support for multiple IOMMUs

2016-02-23 Thread Suravee Suthikulpanit
On 02/23/2016 12:24 PM, Alex Williamson wrote: On Tue, 23 Feb 2016 12:12:42 +0700 Suravee Suthikulpanit <suravee.suthikulpa...@amd.com> wrote: Hi On 02/22/2016 09:07 PM, Peter Zijlstra wrote: On Mon, Feb 22, 2016 at 03:00:31PM +0700, Suravee Suthikulpanit wrote: So I really don'

[PATCH V5 09/10] iommu/amd: Introduce amd_iommu_get_num_iommus()

2016-02-23 Thread Suravee Suthikulpanit
This patch introduces amd_iommu_get_num_iommus(). This is intended for Perf AMD IOMMU driver. Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpa...@amd.com> --- arch/x86/include/asm/perf/amd/iommu.h | 2 ++ drivers/iommu/amd_iommu_init.c| 7 ++- 2 files changed, 8 inse

[PATCH V5 01/10] perf/amd/iommu: Misc fix up perf_iommu_read

2016-02-23 Thread Suravee Suthikulpanit
; Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpa...@amd.com> --- arch/x86/events/amd/iommu.c | 23 --- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/arch/x86/events/amd/iommu.c b/arch/x86/events/amd/iommu.c index 629bc70..9da0d16 100644 --- a/a

[PATCH V5 08/10] perf/amd/iommu: Rename struct perf_amd_iommu to perf_iommu

2016-02-23 Thread Suravee Suthikulpanit
Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpa...@amd.com> --- arch/x86/events/amd/iommu.c | 82 + 1 file changed, 38 insertions(+), 44 deletions(-) diff --git a/arch/x86/events/amd/iommu.c b/arch/x86/events/amd/iommu.c index d5e4d39..35

[PATCH V5 00/10] perf/amd/iommu: Enable multi-IOMMU support

2016-02-23 Thread Suravee Suthikulpanit
and in code comment. * Patch 5: modify the logic to update counts to get rid off un-necessary local64_cmpxchg(). Changes from V1 (https://lkml.org/lkml/2015/12/22/535): * Update patch3 and 6 to use amd_iommus_present instead of introducing amd_iommu_cnt static v Suravee Suthikulpanit (10

[PATCH V5 04/10] perf/amd/iommu: Modify IOMMU API to allow specifying IOMMU index

2016-02-23 Thread Suravee Suthikulpanit
|set]_counter(), and modifies them to allow callers to specify IOMMU index. Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpa...@amd.com> --- arch/x86/events/amd/iommu.c | 45 +++ arch/x86/include/asm/perf/amd/iommu.h | 8 +++-- drivers/iommu/amd_iommu_

[PATCH V5 07/10] perf/amd/iommu: Clean up get_next_available_iommu_bnk_cntr

2016-02-23 Thread Suravee Suthikulpanit
This patch cleans up the coding style of this function. This should not affect the logic and functionality. Cc: Borislav Petkov <b...@alien8.de> Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpa...@amd.com> --- arch/x86/events/amd/iommu.c | 18 -- 1 fil

[PATCH V5 05/10] perf/amd/iommu: Declare pr_fmt and remove unnecessary pr_debug

2016-02-23 Thread Suravee Suthikulpanit
This patch declare pr_fmt for perf/amd_iommu and remove unnecessary pr_debug. Cc: Borislav Petkov <b...@alien8.de> Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpa...@amd.com> --- arch/x86/events/amd/iommu.c | 12 1 file changed, 4 insertions(+), 8 deletions(-)

[PATCH V5 06/10] perf/amd/iommu: Clean up perf_iommu_enable_event

2016-02-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: Borislav Petkov <b...@alien8.de> Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpa...@amd.com> --- arch/x86/events

Re: [PATCH V4 5/6] perf/amd/iommu: Enable support for multiple IOMMUs

2016-02-22 Thread Suravee Suthikulpanit
Hi On 02/22/2016 09:07 PM, Peter Zijlstra wrote: On Mon, Feb 22, 2016 at 03:00:31PM +0700, Suravee Suthikulpanit wrote: So I really don't have time to review new muck while I'm hunting perf core fail, but Boris made me look at this. This is crazy, if you have multiple IOMMUs then create

Re: [PATCH V4 0/6] perf/amd/iommu: Enable multi-IOMMU support

2016-02-17 Thread Suravee Suthikulpanit
Hi All, I am wondering if there are any other concerns for this patch series. Thanks, Suravee On 2/11/16 16:15, Suravee Suthikulpanit wrote: From: Suravee Suthikulpanit <suravee.suthikulpa...@amd.com> This patch series modifies the existing perf_event_amd_iommu driver to support s

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

2016-02-21 Thread Suravee Suthikulpanit
Hi, On 02/18/2016 06:11 PM, Borislav Petkov wrote: On Thu, Feb 11, 2016 at 04:15:23PM +0700, Suravee Suthikulpanit wrote: Currently, amd_iommu_pc_get_max_[banks|counters]() require devid, which should not be the case. Why? Commit message could use an explanation. Also, these don't

Re: [PATCH V4 5/6] perf/amd/iommu: Enable support for multiple IOMMUs

2016-02-22 Thread Suravee Suthikulpanit
Hi Peter, On 02/18/2016 08:18 PM, Peter Zijlstra wrote: On Thu, Feb 11, 2016 at 04:15:26PM +0700, Suravee Suthikulpanit wrote: static void perf_iommu_read(struct perf_event *event) { + int i; u64 delta = 0ULL; struct hw_perf_event *hwc = >hw; + str

Re: [PATCH V5 02/10] perf/amd/iommu: Consolidate and move perf_event_amd_iommu header

2016-03-13 Thread Suravee Suthikulpanit
Hi, On 03/12/2016 08:22 PM, Peter Zijlstra wrote: On Tue, Feb 23, 2016 at 08:12:36AM -0600, Suravee Suthikulpanit wrote: From: Suravee Suthikulpanit <suravee.suthikulpa...@amd.com> First, this patch move arch/x86/events/amd/iommu.h to arch/x86/include/asm/perf/amd/iommu.h so that we

Re: [PATCH V5 02/10] perf/amd/iommu: Consolidate and move perf_event_amd_iommu header

2016-03-14 Thread Suravee Suthikulpanit
Hi Peter/Boris/Joerg, On 3/14/16 23:39, Peter Zijlstra wrote: On Mon, Mar 14, 2016 at 03:19:45PM +0100, Borislav Petkov wrote: On Mon, Mar 14, 2016 at 08:37:02PM +0700, Suravee Suthikulpanit wrote: Basically, we are trying to match the current Perf hierarchy for AMD IOMMU (arch/x86/events/amd

Re: [PATCH V5 02/10] perf/amd/iommu: Consolidate and move perf_event_amd_iommu header

2016-03-19 Thread Suravee Suthikulpanit
On 03/18/2016 04:29 PM, Borislav Petkov wrote: On Fri, Mar 18, 2016 at 04:09:33PM +0700, Suravee Suthikulpanit wrote: But the whole point is that since we are moving it to consolidate these duplicated declarations, I think we should just put it in the most common place. The include/linux/amd

Re: [PATCH V5 02/10] perf/amd/iommu: Consolidate and move perf_event_amd_iommu header

2016-03-14 Thread Suravee Suthikulpanit
Hi, On 3/14/16 16:58, Peter Zijlstra wrote: On Mon, Mar 14, 2016 at 12:26:00PM +0700, Suravee Suthikulpanit wrote: Hi, On 03/12/2016 08:22 PM, Peter Zijlstra wrote: On Tue, Feb 23, 2016 at 08:12:36AM -0600, Suravee Suthikulpanit wrote: From: Suravee Suthikulpanit <suravee.suthiku

Re: [PATCH V5 02/10] perf/amd/iommu: Consolidate and move perf_event_amd_iommu header

2016-03-19 Thread Suravee Suthikulpanit
Hi Boris, On 03/18/2016 04:04 PM, Borislav Petkov wrote: On Fri, Mar 18, 2016 at 02:07:25PM +0700, Suravee Suthikulpanit wrote: Actually the exposed APIs (in both files) are from the AMD IOMMU driver, which is not necessary x86-specific. They mostly use struct pci_dev, which is also arch

Re: [PATCH V5 02/10] perf/amd/iommu: Consolidate and move perf_event_amd_iommu header

2016-03-19 Thread Suravee Suthikulpanit
Hi On 03/15/2016 05:53 PM, Peter Zijlstra wrote: On Tue, Mar 15, 2016 at 11:40:17AM +0100, Borislav Petkov wrote: On Tue, Mar 15, 2016 at 07:39:31AM +0700, Suravee Suthikulpanit wrote: What if I just merge the newly introduced arch/x86/include/perf/amd/iommu.h into the include/linux/amd

Re: [PATCH V5 00/10] perf/amd/iommu: Enable multi-IOMMU support

2016-03-06 Thread Suravee Suthikulpanit
Hi Joerg, On 2/25/16 21:54, Joerg Roedel wrote: Hi Suravee, On Tue, Feb 23, 2016 at 08:12:34AM -0600, Suravee Suthikulpanit wrote: This is a two-part patch series: Part1: 1-4 : Introduce a workaround for the current AMD IOMMU perf initialization issue in some existing KV and CZ platforms

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

2017-02-06 Thread Suravee Suthikulpanit
Boris, On 1/23/17 02:55, Borislav Petkov wrote: @@ -421,46 +427,46 @@ static __init void amd_iommu_pc_exit(void) }; static __init int -_init_perf_amd_iommu(struct perf_amd_iommu *perf_iommu, char *name) +init_one_perf_amd_iommu(struct perf_amd_iommu *perf_iommu, unsigned int idx) {

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

2017-02-06 Thread Suravee Suthikulpanit
Peter, On 1/25/17 16:46, Peter Zijlstra wrote: On Mon, Jan 16, 2017 at 01:23:36AM -0600, Suravee Suthikulpanit wrote: + pi = container_of(event->pmu, struct perf_amd_iommu, pmu); + hwc->idx = pi->idx; + hwc->config = event->attr.conf

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

2017-02-06 Thread Suravee Suthikulpanit
Boris, On 1/25/17 16:55, Borislav Petkov wrote: On Wed, Jan 25, 2017 at 10:46:53AM +0100, Peter Zijlstra wrote: Which is absolutely insane. Right, IMO, the simplest thing to do for your purposes is to embed a struct amd_iommu pointer into struct perf_amd_iommu at init time so that you don't

Re: [PATCH v8 3/9] perf/amd/iommu: Misc fix up perf_iommu_read

2017-02-06 Thread Suravee Suthikulpanit
Peter, On 1/23/17 19:33, Peter Zijlstra wrote: On Mon, Jan 16, 2017 at 01:23:30AM -0600, Suravee Suthikulpanit wrote: static void perf_iommu_read(struct perf_event *event) { - u64 count = 0ULL; - u64 prev_raw_count = 0ULL; - u64 delta = 0ULL; + u64 count, prev

[PATCH v9 0/8] perf/amd/iommu: Enable multi-IOMMU support

2017-02-07 Thread Suravee Suthikulpanit
From: Suravee Suthikulpanit <suravee.suthikulpa...@amd.com> 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 fo

[PATCH v9 3/8] perf/amd/iommu: Clean up perf_iommu_read()

2017-02-07 Thread Suravee Suthikulpanit
Fix coding style and make use of GENMASK_ULL macro. Cc: Peter Zijlstra <pet...@infradead.org> Cc: Borislav Petkov <b...@alien8.de> Cc: Joerg Roedel <j...@8bytes.org> Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpa...@amd.com> --- arch/x86/events/amd/iommu.c | 16

[PATCH v9 1/8] perf/amd/iommu: Declare pr_fmt and remove unnecessary pr_debug

2017-02-07 Thread Suravee Suthikulpanit
Declare pr_fmt for perf/amd_iommu and remove unnecessary pr_debug. Also check return value when _init_events_attrs fails. Cc: Peter Zijlstra <pet...@infradead.org> Cc: Borislav Petkov <b...@alien8.de> Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpa...@amd.com> --- a

[PATCH v9 5/8] perf/amd/iommu: Modify functions to query max banks and counters

2017-02-07 Thread Suravee Suthikulpanit
, and will use a proper IOMMU index. Cc: Peter Zijlstra <pet...@infradead.org> Cc: Borislav Petkov <b...@alien8.de> Cc: Joerg Roedel <j...@8bytes.org> Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpa...@amd.com> --- arch/x86/events/amd/iommu.c | 17 +++---

[PATCH v9 4/8] iommu/amd: Introduce amd_iommu_get_num_iommus()

2017-02-07 Thread Suravee Suthikulpanit
del <j...@8bytes.org> Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpa...@amd.com> --- arch/x86/events/amd/iommu.h | 2 ++ drivers/iommu/amd_iommu.c | 6 +++--- drivers/iommu/amd_iommu_init.c | 11 +-- drivers/iommu/amd_iommu_proto.h | 1 + drivers/iommu

[PATCH v9 7/8] perf/amd/iommu: Fix sysfs perf attribute groups

2017-02-07 Thread Suravee Suthikulpanit
From: Suravee Suthikulpanit <suravee.suthikulpa...@amd.com> Introduce static amd_iommu_attr_groups to simplify the sysfs attributes initialization code. Cc: Peter Zijlstra <pet...@infradead.org> Cc: Borislav Petkov <b...@alien8.de> Signed-off-by: Suravee Suthikulpanit &

[PATCH v9 2/8] perf/amd/iommu: Clean up bitwise operations

2017-02-07 Thread Suravee Suthikulpanit
From: Suravee Suthikulpanit <suravee.suthikulpa...@amd.com> Clean up register initialization and make use of BIT_ULL(x) where appropriate. This should not affect logic and functionality. Cc: Peter Zijlstra <pet...@infradead.org> Cc: Borislav Petkov <b...@alien8.de> Sign

[PATCH v9 6/8] perf/amd/iommu: Modify amd_iommu_pc_get_set_reg_val() to allow specifying IOMMU

2017-02-07 Thread Suravee Suthikulpanit
From: Suravee Suthikulpanit <suravee.suthikulpa...@amd.com> The current amd_iommu_pc_get_set_reg_val() cannot support multiple IOMMUs. So, modify it to allow callers to specify IOMMU. This prepares the driver for supporting multi-IOMMU in subsequent patch. Cc: Peter Zijlstr

[PATCH v9 8/8] perf/amd/iommu: Enable support for multiple IOMMUs

2017-02-07 Thread Suravee Suthikulpanit
From: Suravee Suthikulpanit <suravee.suthikulpa...@amd.com> 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 x is the IOMMU index. This allows users to specify different events to be prog

[PATCH v11 00/10] perf/amd/iommu: Enable multi-IOMMU support

2017-02-24 Thread Suravee Suthikulpanit
From: Suravee Suthikulpanit <suravee.suthikulpa...@amd.com> 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 fo

[PATCH v11 01/10] perf/amd/iommu: Declare pr_fmt and remove unnecessary pr_debug

2017-02-24 Thread Suravee Suthikulpanit
Declare pr_fmt for perf/amd_iommu and remove unnecessary pr_debug. Also check return value when _init_events_attrs fails. Cc: Peter Zijlstra <pet...@infradead.org> Cc: Borislav Petkov <b...@alien8.de> Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpa...@amd.com> --- a

[PATCH v11 05/10] iommu/amd: Introduce amd_iommu_get_num_iommus()

2017-02-24 Thread Suravee Suthikulpanit
del <j...@8bytes.org> Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpa...@amd.com> --- arch/x86/events/amd/iommu.h | 2 ++ drivers/iommu/amd_iommu.c | 6 +++--- drivers/iommu/amd_iommu_init.c | 11 +-- drivers/iommu/amd_iommu_proto.h | 1 + drivers/iommu

[PATCH v11 06/10] perf/amd/iommu: Modify functions to query max banks and counters

2017-02-24 Thread Suravee Suthikulpanit
, and will use a proper IOMMU index. Cc: Peter Zijlstra <pet...@infradead.org> Cc: Borislav Petkov <b...@alien8.de> Cc: Joerg Roedel <j...@8bytes.org> Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpa...@amd.com> --- arch/x86/events/amd/iommu.c | 17 +++---

[PATCH v11 02/10] perf/amd/iommu: Clean up bitwise operations

2017-02-24 Thread Suravee Suthikulpanit
From: Suravee Suthikulpanit <suravee.suthikulpa...@amd.com> Clean up register initializaton and make use of BIT_ULL(x) where appropriate. This should not affect logic and functionality. Cc: Peter Zijlstra <pet...@infradead.org> Cc: Borislav Petkov <b...@alien8.de> Sign

[PATCH v11 09/10] perf/amd/iommu: Introduce amd_iommu-specific struct in struct hw_perf_event

2017-02-24 Thread Suravee Suthikulpanit
From: Suravee Suthikulpanit <suravee.suthikulpa...@amd.com> Current AMD IOMMU Perf PMU inappropriately uses hardware struct inside the union inside the struct hw_perf_event, mainly the use of extra_reg. Instead, introduce amd_iommu-specific struct with required parameters to be programme

[PATCH v11 08/10] perf/amd/iommu: Fix sysfs perf attribute groups

2017-02-24 Thread Suravee Suthikulpanit
From: Suravee Suthikulpanit <suravee.suthikulpa...@amd.com> Introduce static amd_iommu_attr_groups to simplify the sysfs attributes initialization code. Cc: Peter Zijlstra <pet...@infradead.org> Cc: Borislav Petkov <b...@alien8.de> Signed-off-by: Suravee Suthikulpanit &

[PATCH v11 10/10] perf/amd/iommu: Enable support for multiple IOMMUs

2017-02-24 Thread Suravee Suthikulpanit
From: Suravee Suthikulpanit <suravee.suthikulpa...@amd.com> 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 x is the IOMMU index. This allows users to specify different events to be prog

[PATCH v11 07/10] perf/amd/iommu: Modify amd_iommu_pc_get_set_reg_val() to allow specifying IOMMU

2017-02-24 Thread Suravee Suthikulpanit
From: Suravee Suthikulpanit <suravee.suthikulpa...@amd.com> The current amd_iommu_pc_get_set_reg_val() cannot support multiple IOMMUs. So, modify it to allow callers to specify IOMMU. This prepares the driver for supporting multi-IOMMU in subsequent patch. Cc: Peter Zijlstr

[PATCH v11 03/10] perf/amd/iommu: Clean up perf_iommu_read()

2017-02-24 Thread Suravee Suthikulpanit
Fix coding style and make use of GENMASK_ULL macro. Cc: Peter Zijlstra <pet...@infradead.org> Cc: Borislav Petkov <b...@alien8.de> Cc: Joerg Roedel <j...@8bytes.org> Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpa...@amd.com> --- arch/x86/events/amd/iommu.c | 16

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

2017-02-23 Thread Suravee Suthikulpanit
On 2/24/17 01:11, Peter Zijlstra wrote: However, I have looked into reworking to not use the extra_regs, and I see that the union in struct hw_perf_event currently contains various PMU-specific structures (hardware, software, tracepoint, intel_cqm, itrace, amd_power, and breakpoint). For

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

2017-02-23 Thread Suravee Suthikulpanit
Peter, On 2/14/17 19:31, Peter Zijlstra wrote: On Tue, Feb 07, 2017 at 08:57:52AM +0700, Suravee Suthikulpanit wrote: But instead it looks like you get the counter form: #define _GET_CNTR(ev) ((u8)(ev->hw.extra_reg.reg)) Which is absolutely insane. So, the IOMMU count

Re: [PATCH v9 8/8] perf/amd/iommu: Enable support for multiple IOMMUs

2017-02-14 Thread Suravee Suthikulpanit
Boris, On 2/9/17 02:33, Borislav Petkov wrote: On Tue, Feb 07, 2017 at 02:40:36AM -0600, Suravee Suthikulpanit wrote: From: Suravee Suthikulpanit <suravee.suthikulpa...@amd.com> [..] + perf_iommu->max_banks= amd_iommu_pc_get_max_banks(idx); + perf_iommu->

[PATCH v10 6/9] perf/amd/iommu: Modify functions to query max banks and counters

2017-02-15 Thread Suravee Suthikulpanit
, and will use a proper IOMMU index. Cc: Peter Zijlstra <pet...@infradead.org> Cc: Borislav Petkov <b...@alien8.de> Cc: Joerg Roedel <j...@8bytes.org> Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpa...@amd.com> --- arch/x86/events/amd/iommu.c | 17 +++---

[PATCH v10 7/9] perf/amd/iommu: Modify amd_iommu_pc_get_set_reg_val() to allow specifying IOMMU

2017-02-15 Thread Suravee Suthikulpanit
From: Suravee Suthikulpanit <suravee.suthikulpa...@amd.com> The current amd_iommu_pc_get_set_reg_val() cannot support multiple IOMMUs. So, modify it to allow callers to specify IOMMU. This prepares the driver for supporting multi-IOMMU in subsequent patch. Cc: Peter Zijlstr

[PATCH v10 5/9] iommu/amd: Introduce amd_iommu_get_num_iommus()

2017-02-15 Thread Suravee Suthikulpanit
del <j...@8bytes.org> Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpa...@amd.com> --- arch/x86/events/amd/iommu.h | 2 ++ drivers/iommu/amd_iommu.c | 6 +++--- drivers/iommu/amd_iommu_init.c | 11 +-- drivers/iommu/amd_iommu_proto.h | 1 + drivers/iommu

[PATCH v10 2/9] perf/amd/iommu: Clean up bitwise operations

2017-02-15 Thread Suravee Suthikulpanit
From: Suravee Suthikulpanit <suravee.suthikulpa...@amd.com> Clean up register initializaton and make use of BIT_ULL(x) where appropriate. This should not affect logic and functionality. Cc: Peter Zijlstra <pet...@infradead.org> Cc: Borislav Petkov <b...@alien8.de> Sign

[PATCH v10 3/9] perf/amd/iommu: Clean up perf_iommu_read()

2017-02-15 Thread Suravee Suthikulpanit
Fix coding style and make use of GENMASK_ULL macro. Cc: Peter Zijlstra <pet...@infradead.org> Cc: Borislav Petkov <b...@alien8.de> Cc: Joerg Roedel <j...@8bytes.org> Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpa...@amd.com> --- arch/x86/events/amd/iommu.c | 16

[PATCH v10 4/9] iommu/amd: Clean up iommu_pc_get_set_reg()

2017-02-15 Thread Suravee Suthikulpanit
From: Suravee Suthikulpanit <suravee.suthikulpa...@amd.com> Clean up coding style and fix a bug in the 64-bit register read logic since it overwrites the upper 32-bit when reading the lower 32-bit. Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpa...@amd.com> --- d

[PATCH v10 1/9] perf/amd/iommu: Declare pr_fmt and remove unnecessary pr_debug

2017-02-15 Thread Suravee Suthikulpanit
Declare pr_fmt for perf/amd_iommu and remove unnecessary pr_debug. Also check return value when _init_events_attrs fails. Cc: Peter Zijlstra <pet...@infradead.org> Cc: Borislav Petkov <b...@alien8.de> Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpa...@amd.com> --- a

[PATCH v10 0/9] perf/amd/iommu: Enable multi-IOMMU support

2017-02-15 Thread Suravee Suthikulpanit
From: Suravee Suthikulpanit <suravee.suthikulpa...@amd.com> 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 fo

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

2017-02-15 Thread Suravee Suthikulpanit
From: Suravee Suthikulpanit <suravee.suthikulpa...@amd.com> 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 x is the IOMMU index. This allows users to specify different events to be prog

[PATCH v10 8/9] perf/amd/iommu: Fix sysfs perf attribute groups

2017-02-15 Thread Suravee Suthikulpanit
From: Suravee Suthikulpanit <suravee.suthikulpa...@amd.com> Introduce static amd_iommu_attr_groups to simplify the sysfs attributes initialization code. Cc: Peter Zijlstra <pet...@infradead.org> Cc: Borislav Petkov <b...@alien8.de> Signed-off-by: Suravee Suthikulpanit &

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

2017-01-15 Thread Suravee Suthikulpanit
From: Suravee Suthikulpanit <suravee.suthikulpa...@amd.com> 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 perf_iommu_read(), we need to check the return value from amd_iommu_get_reg() before

[PATCH v8 4/9] iommu/amd: Introduce amd_iommu_get_num_iommus()

2017-01-15 Thread Suravee Suthikulpanit
bytes.org> Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpa...@amd.com> --- arch/x86/events/amd/iommu.h | 2 ++ drivers/iommu/amd_iommu.c | 6 +++--- drivers/iommu/amd_iommu_init.c | 11 +-- drivers/iommu/amd_iommu_proto.h | 1 + drivers/iommu/amd_iommu_types.h

[PATCH v8 1/9] perf/amd/iommu: Declare pr_fmt and remove unnecessary pr_debug

2017-01-15 Thread Suravee Suthikulpanit
Declare pr_fmt for perf/amd_iommu and remove unnecessary pr_debug. Also check return value when _init_events_attrs fails. Cc: Peter Zijlstra <pet...@infradead.org> Cc: Borislav Petkov <b...@alien8.de> Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpa...@amd.com> --- a

[PATCH v8 2/9] perf/amd/iommu: Clean up perf_iommu_enable_event

2017-01-15 Thread Suravee Suthikulpanit
From: Suravee Suthikulpanit <suravee.suthikulpa...@amd.com> * Clean up various bitwise operations in perf_iommu_enable_event * Make use macros BIT(x) This should not affect logic and functionality. Cc: Peter Zijlstra <pet...@infradead.org> Cc: Borislav Petkov <b...@alien8

[PATCH v8 0/9] perf/amd/iommu: Enable multi-IOMMU support

2017-01-15 Thread Suravee Suthikulpanit
From: Suravee Suthikulpanit <suravee.suthikulpa...@amd.com> 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 fo

  1   2   3   4   >