Re: [PATCH v2 1/6] iommu: Export iommu_{get,put}_resv_regions()

2021-12-06 Thread Yicong Yang via iommu
On 2021/12/6 19:56, Joerg Roedel wrote: > On Tue, Nov 16, 2021 at 05:06:20PM +0800, Yicong Yang wrote: >> Export iommu_{get,put}_resv_regions() to the modules so that the driver >> can retrieve and use the reserved regions of the device. > > Why should any driver bother? These functions are only

[PATCH v2 6/6] MAINTAINERS: Add maintainer for HiSilicon PTT driver

2021-11-16 Thread Yicong Yang via iommu
Add maintainer for driver and documentation of HiSilicon PTT device. Signed-off-by: Yicong Yang --- MAINTAINERS | 7 +++ 1 file changed, 7 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 7a2345ce8521..823d495ca0d5 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -8601,6 +8601,13 @@

[PATCH v2 0/6] Add support for HiSilicon PCIe Tune and Trace device

2021-11-16 Thread Yicong Yang via iommu
HiSilicon PCIe tune and trace device (PTT) is a PCIe Root Complex integrated Endpoint (RCiEP) device, providing the capability to dynamically monitor and tune the PCIe traffic (tune), and trace the TLP headers (trace). PTT tune is designed for monitoring and adjusting PCIe link parameters. We

[PATCH v2 1/6] iommu: Export iommu_{get,put}_resv_regions()

2021-11-16 Thread Yicong Yang via iommu
Export iommu_{get,put}_resv_regions() to the modules so that the driver can retrieve and use the reserved regions of the device. Signed-off-by: Yicong Yang --- drivers/iommu/iommu.c | 2 ++ include/linux/iommu.h | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git

[PATCH v2 3/6] hwtracing: Add tune function support for HiSilicon PCIe Tune and Trace device

2021-11-16 Thread Yicong Yang via iommu
Add tune function for the HiSilicon Tune and Trace device. The interface of tune is exposed through sysfs attributes of PTT PMU device. Signed-off-by: Yicong Yang --- drivers/hwtracing/hisilicon/hisi_ptt.c | 167 + 1 file changed, 167 insertions(+) diff --git

[PATCH v2 2/6] hwtracing: Add trace function support for HiSilicon PCIe Tune and Trace device

2021-11-16 Thread Yicong Yang via iommu
HiSilicon PCIe tune and trace device(PTT) is a PCIe Root Complex integrated Endpoint(RCiEP) device, providing the capability to dynamically monitor and tune the PCIe traffic(tune), and trace the TLP headers(trace). Add the driver for the device to enable the trace function. The driver will create

[PATCH v2 4/6] perf tool: Add support for HiSilicon PCIe Tune and Trace device driver

2021-11-16 Thread Yicong Yang via iommu
From: Qi Liu 'perf record' and 'perf report --dump-raw-trace' supported in this patch. Example usage: Output will contain raw PTT data and its textual representation, such as: 0 0 0x5810 [0x30]: PERF_RECORD_AUXTRACE size: 0x40 offset: 0 ref: 0xa5d50c725 idx: 0 tid: -1 cpu: 0 . . ...

[PATCH v2 5/6] docs: Add HiSilicon PTT device driver documentation

2021-11-16 Thread Yicong Yang via iommu
Document the introduction and usage of HiSilicon PTT device driver. Signed-off-by: Yicong Yang --- Documentation/trace/hisi-ptt.rst | 305 +++ 1 file changed, 305 insertions(+) create mode 100644 Documentation/trace/hisi-ptt.rst diff --git

Re: [PATCH v2 2/6] hwtracing: Add trace function support for HiSilicon PCIe Tune and Trace device

2021-11-16 Thread Yicong Yang via iommu
On 2021/11/16 18:56, Robin Murphy wrote: > On 2021-11-16 09:06, Yicong Yang via iommu wrote: > [...] >> +/* >> + * Get RMR address if provided by the firmware. >> + * Return 0 if the IOMMU doesn't present or the policy of the >> + * IOMMU domain is passthrough

Re: [PATCH v2 2/6] hwtracing: Add trace function support for HiSilicon PCIe Tune and Trace device

2021-11-29 Thread Yicong Yang via iommu
On 2021/11/25 23:49, Robin Murphy wrote: > On 2021-11-18 09:01, Yicong Yang via iommu wrote: >> Hi Robin, >> >> On 2021/11/16 19:37, Yicong Yang wrote: >>> On 2021/11/16 18:56, Robin Murphy wrote: >>>> On 2021-11-16 09:06, Yicong Yang via iommu wrote: >

Re: [PATCH v2 2/6] hwtracing: Add trace function support for HiSilicon PCIe Tune and Trace device

2021-11-29 Thread Yicong Yang via iommu
On 2021/11/27 1:10, Mathieu Poirier wrote: > > [...] > >> > + > +#define HISI_PTT_TRACE_DMA_IRQ 0 > +#define HISI_PTT_TRACE_BUFLETS_CNT 4 > +#define HISI_PTT_TRACE_BUFLET_SIZE SZ_4M > +#define HISI_PTT_TRACE_BUFFER_SIZE

Re: [PATCH v2 2/6] hwtracing: Add trace function support for HiSilicon PCIe Tune and Trace device

2021-11-29 Thread Yicong Yang via iommu
On 2021/11/26 2:50, Mathieu Poirier wrote: > On Thu, Nov 25, 2021 at 04:39:46PM +0800, Yicong Yang wrote: >> Hi Mathieu, >> >> Thanks for the comments! Replies inline. >> >> On 2021/11/25 2:51, Mathieu Poirier wrote: >>> Hi Yicong, >>> >>> On Tue, Nov 16, 2021 at 05:06:21PM +0800, Yicong Yang

Re: [PATCH v2 2/6] hwtracing: Add trace function support for HiSilicon PCIe Tune and Trace device

2021-11-25 Thread Yicong Yang via iommu
Hi Mathieu, Thanks for the comments! Replies inline. On 2021/11/25 2:51, Mathieu Poirier wrote: > Hi Yicong, > > On Tue, Nov 16, 2021 at 05:06:21PM +0800, Yicong Yang wrote: >> HiSilicon PCIe tune and trace device(PTT) is a PCIe Root Complex >> integrated Endpoint(RCiEP) device, providing the

Re: [PATCH v2 2/6] hwtracing: Add trace function support for HiSilicon PCIe Tune and Trace device

2021-11-18 Thread Yicong Yang via iommu
Hi Robin, On 2021/11/16 19:37, Yicong Yang wrote: > On 2021/11/16 18:56, Robin Murphy wrote: >> On 2021-11-16 09:06, Yicong Yang via iommu wrote: >> [...] >>> +/* >>> + * Get RMR address if provided by the firmware. >>> + * Return 0 if the IOMMU doesn't

Re: [PATCH v2 2/6] hwtracing: Add trace function support for HiSilicon PCIe Tune and Trace device

2021-12-09 Thread Yicong Yang via iommu
On 2021/12/8 0:31, Robin Murphy wrote: > On 2021-11-29 08:22, Yicong Yang via iommu wrote: >> On 2021/11/25 23:49, Robin Murphy wrote: >>> On 2021-11-18 09:01, Yicong Yang via iommu wrote: >>>> Hi Robin, >>>> >>>> On 2021/11/16 19:37, Yico

Re: [PATCH v5 8/8] MAINTAINERS: Add maintainer for HiSilicon PTT driver

2022-03-08 Thread Yicong Yang via iommu
On 2022/3/8 18:32, Jonathan Cameron wrote: > On Tue, 8 Mar 2022 16:49:30 +0800 > Yicong Yang wrote: > >> Add maintainer for driver and documentation of HiSilicon PTT device. >> >> Signed-off-by: Yicong Yang > FWIW > Reviewed-by: Jonathan Cameron > > I've left the perf tool and iommu patches

Re: [PATCH v5 3/8] hisi_ptt: Register PMU device for PTT trace

2022-03-08 Thread Yicong Yang via iommu
On 2022/3/8 20:06, Jonathan Cameron wrote: > On Tue, 8 Mar 2022 19:13:08 +0800 > Yicong Yang wrote: > >> On 2022/3/8 18:21, Jonathan Cameron wrote: >>> On Tue, 8 Mar 2022 16:49:25 +0800 >>> Yicong Yang wrote: >>> Register PMU device of PTT trace, then users can use trace through perf

Re: [PATCH v5 3/8] hisi_ptt: Register PMU device for PTT trace

2022-03-08 Thread Yicong Yang via iommu
On 2022/3/8 18:21, Jonathan Cameron wrote: > On Tue, 8 Mar 2022 16:49:25 +0800 > Yicong Yang wrote: > >> Register PMU device of PTT trace, then users can use trace through perf >> command. The driver makes use of perf AUX trace and support following >> events to configure the trace: >> >> -

Re: [PATCH v5 2/8] hwtracing: Add trace function support for HiSilicon PCIe Tune and Trace device

2022-03-16 Thread Yicong Yang via iommu
On 2022/3/12 1:55, John Garry wrote: >> + >> +static int hisi_ptt_alloc_trace_buf(struct hisi_ptt *hisi_ptt) > > no caller > >> +{ >> +    struct hisi_ptt_trace_ctrl *ctrl = _ptt->trace_ctrl; >> +    struct device *dev = _ptt->pdev->dev; >> +    int i; >> + >> +    hisi_ptt->trace_ctrl.buf_index

Re: [PATCH v5 1/8] iommu/arm-smmu-v3: Make default domain type of HiSilicon PTT device to identity

2022-03-16 Thread Yicong Yang via iommu
On 2022/3/12 1:27, John Garry wrote: > On 08/03/2022 08:49, Yicong Yang wrote: >> The DMA of HiSilicon PTT device can only work with identical mapping. > > nit: I'd have "DMA operations of the HiSilicon PTT device can only work > properly with identity mappings". > >> So add a quirk for the

[PATCH v5 6/8] perf tool: Add support for HiSilicon PCIe Tune and Trace device driver

2022-03-08 Thread Yicong Yang via iommu
From: Qi Liu 'perf record' and 'perf report --dump-raw-trace' supported in this patch. Example usage: Output will contain raw PTT data and its textual representation, such as: 0 0 0x5810 [0x30]: PERF_RECORD_AUXTRACE size: 0x40 offset: 0 ref: 0xa5d50c725 idx: 0 tid: -1 cpu: 0 . . ...

[PATCH v5 2/8] hwtracing: Add trace function support for HiSilicon PCIe Tune and Trace device

2022-03-08 Thread Yicong Yang via iommu
HiSilicon PCIe tune and trace device(PTT) is a PCIe Root Complex integrated Endpoint(RCiEP) device, providing the capability to dynamically monitor and tune the PCIe traffic, and trace the TLP headers. Add the driver for the device to enable the trace function. This patch adds basic function of

[PATCH v5 4/8] hisi_ptt: Add support for dynamically updating the filter list

2022-03-08 Thread Yicong Yang via iommu
The PCIe devices supported by the PTT trace can be removed/rescanned by hotplug or through sysfs. Add support for dynamically updating the available filter list by registering a PCI bus notifier block. Then user can always get latest information about available tracing filters and driver can

[PATCH v5 3/8] hisi_ptt: Register PMU device for PTT trace

2022-03-08 Thread Yicong Yang via iommu
Register PMU device of PTT trace, then users can use trace through perf command. The driver makes use of perf AUX trace and support following events to configure the trace: - filter: select Root port or Endpoint to trace - type: select the type of traced TLP headers - direction: select the

[PATCH v5 1/8] iommu/arm-smmu-v3: Make default domain type of HiSilicon PTT device to identity

2022-03-08 Thread Yicong Yang via iommu
The DMA of HiSilicon PTT device can only work with identical mapping. So add a quirk for the device to force the domain passthrough. Signed-off-by: Yicong Yang --- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 16 1 file changed, 16 insertions(+) diff --git

[PATCH v5 0/8] Add support for HiSilicon PCIe Tune and Trace device

2022-03-08 Thread Yicong Yang via iommu
HiSilicon PCIe tune and trace device (PTT) is a PCIe Root Complex integrated Endpoint (RCiEP) device, providing the capability to dynamically monitor and tune the PCIe traffic (tune), and trace the TLP headers (trace). PTT tune is designed for monitoring and adjusting PCIe link parameters. We

[PATCH v5 5/8] hisi_ptt: Add tune function support for HiSilicon PCIe Tune and Trace device

2022-03-08 Thread Yicong Yang via iommu
Add tune function for the HiSilicon Tune and Trace device. The interface of tune is exposed through sysfs attributes of PTT PMU device. Reviewed-by: Jonathan Cameron Signed-off-by: Yicong Yang --- drivers/hwtracing/ptt/hisi_ptt.c | 154 +++

[PATCH v5 7/8] docs: Add HiSilicon PTT device driver documentation

2022-03-08 Thread Yicong Yang via iommu
Document the introduction and usage of HiSilicon PTT device driver. Signed-off-by: Yicong Yang Reviewed-by: Jonathan Cameron --- Documentation/trace/hisi-ptt.rst | 303 +++ 1 file changed, 303 insertions(+) create mode 100644 Documentation/trace/hisi-ptt.rst diff

[PATCH v5 8/8] MAINTAINERS: Add maintainer for HiSilicon PTT driver

2022-03-08 Thread Yicong Yang via iommu
Add maintainer for driver and documentation of HiSilicon PTT device. Signed-off-by: Yicong Yang --- MAINTAINERS | 7 +++ 1 file changed, 7 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index ea3e6c914384..237c618a74d5 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -8689,6 +8689,13 @@

Re: [PATCH v3 8/8] iommu/arm-smmu-v3: Make default domain type of HiSilicon PTT device to identity

2022-02-16 Thread Yicong Yang via iommu
On 2022/2/15 22:29, Robin Murphy wrote: > On 2022-02-15 13:42, Will Deacon wrote: >> On Tue, Feb 15, 2022 at 01:30:26PM +, Robin Murphy wrote: >>> On 2022-02-15 13:00, Will Deacon wrote: On Mon, Feb 14, 2022 at 08:55:20PM +0800, Yicong Yang wrote: > On 2022/1/24 21:11, Yicong Yang

Re: [PATCH v4 3/8] hisi_ptt: Register PMU device for PTT trace

2022-02-23 Thread Yicong Yang via iommu
On 2022/2/22 19:17, John Garry wrote: > >> + >>   static irqreturn_t hisi_ptt_irq(int irq, void *context) >>   { >>   struct hisi_ptt *hisi_ptt = context; >> @@ -169,7 +233,7 @@ static irqreturn_t hisi_ptt_irq(int irq, void *context) >>   if (!(status & HISI_PTT_TRACE_INT_STAT_MASK)) >>   

Re: [PATCH v4 2/8] hwtracing: Add trace function support for HiSilicon PCIe Tune and Trace device

2022-02-23 Thread Yicong Yang via iommu
On 2022/2/22 19:06, John Garry wrote: > On 21/02/2022 08:43, Yicong Yang wrote: >> HiSilicon PCIe tune and trace device(PTT) is a PCIe Root Complex >> integrated Endpoint(RCiEP) device, providing the capability >> to dynamically monitor and tune the PCIe traffic, and trace >> the TLP headers. >>

Re: [PATCH v4 2/8] hwtracing: Add trace function support for HiSilicon PCIe Tune and Trace device

2022-02-21 Thread Yicong Yang via iommu
Hi Jonathan, On 2022/2/21 19:18, Jonathan Cameron wrote: > On Mon, 21 Feb 2022 16:43:01 +0800 > Yicong Yang wrote: > >> HiSilicon PCIe tune and trace device(PTT) is a PCIe Root Complex >> integrated Endpoint(RCiEP) device, providing the capability >> to dynamically monitor and tune the PCIe

Re: [PATCH v4 3/8] hisi_ptt: Register PMU device for PTT trace

2022-02-21 Thread Yicong Yang via iommu
On 2022/2/21 19:44, Jonathan Cameron wrote: > On Mon, 21 Feb 2022 16:43:02 +0800 > Yicong Yang wrote: > >> Register PMU device of PTT trace, then users can use >> trace through perf command. The driver makes use of perf >> AUX trace and support following events to configure the >> trace: >> >> -

[PATCH v4 7/8] docs: Add HiSilicon PTT device driver documentation

2022-02-21 Thread Yicong Yang via iommu
Document the introduction and usage of HiSilicon PTT device driver. Signed-off-by: Yicong Yang --- Documentation/trace/hisi-ptt.rst | 303 +++ 1 file changed, 303 insertions(+) create mode 100644 Documentation/trace/hisi-ptt.rst diff --git

[PATCH v4 4/8] hisi_ptt: Add support for dynamically updating the filter list

2022-02-21 Thread Yicong Yang via iommu
The PCIe devices supported by the PTT trace can be removed/rescanned by hotplug or through sysfs. Add support for dynamically updating the available filter list by registering a PCI bus notifier block. Then user can always get latest information about available tracing filters and driver can

[PATCH v4 0/8] Add support for HiSilicon PCIe Tune and Trace device

2022-02-21 Thread Yicong Yang via iommu
HiSilicon PCIe tune and trace device (PTT) is a PCIe Root Complex integrated Endpoint (RCiEP) device, providing the capability to dynamically monitor and tune the PCIe traffic (tune), and trace the TLP headers (trace). PTT tune is designed for monitoring and adjusting PCIe link parameters. We

[PATCH v4 2/8] hwtracing: Add trace function support for HiSilicon PCIe Tune and Trace device

2022-02-21 Thread Yicong Yang via iommu
HiSilicon PCIe tune and trace device(PTT) is a PCIe Root Complex integrated Endpoint(RCiEP) device, providing the capability to dynamically monitor and tune the PCIe traffic, and trace the TLP headers. Add the driver for the device to enable the trace function. This patch adds basic function of

[PATCH v4 3/8] hisi_ptt: Register PMU device for PTT trace

2022-02-21 Thread Yicong Yang via iommu
Register PMU device of PTT trace, then users can use trace through perf command. The driver makes use of perf AUX trace and support following events to configure the trace: - filter: select Root port or Endpoint to trace - type: select the type of traced TLP headers - direction: select the

[PATCH v4 5/8] hisi_ptt: Add tune function support for HiSilicon PCIe Tune and Trace device

2022-02-21 Thread Yicong Yang via iommu
Add tune function for the HiSilicon Tune and Trace device. The interface of tune is exposed through sysfs attributes of PTT PMU device. Reviewed-by: Jonathan Cameron Signed-off-by: Yicong Yang --- drivers/hwtracing/ptt/hisi_ptt.c | 154 +++

[PATCH v4 8/8] MAINTAINERS: Add maintainer for HiSilicon PTT driver

2022-02-21 Thread Yicong Yang via iommu
Add maintainer for driver and documentation of HiSilicon PTT device. Signed-off-by: Yicong Yang --- MAINTAINERS | 7 +++ 1 file changed, 7 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index ea3e6c914384..237c618a74d5 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -8689,6 +8689,13 @@

[PATCH v4 6/8] perf tool: Add support for HiSilicon PCIe Tune and Trace device driver

2022-02-21 Thread Yicong Yang via iommu
From: Qi Liu 'perf record' and 'perf report --dump-raw-trace' supported in this patch. Example usage: Output will contain raw PTT data and its textual representation, such as: 0 0 0x5810 [0x30]: PERF_RECORD_AUXTRACE size: 0x40 offset: 0 ref: 0xa5d50c725 idx: 0 tid: -1 cpu: 0 . . ...

[PATCH v4 1/8] iommu/arm-smmu-v3: Make default domain type of HiSilicon PTT device to identity

2022-02-21 Thread Yicong Yang via iommu
The DMA of HiSilicon PTT device can only work with identical mapping. So add a quirk for the device to force the domain passthrough. Signed-off-by: Yicong Yang --- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 16 1 file changed, 16 insertions(+) diff --git

Re: [PATCH v4 2/8] hwtracing: Add trace function support for HiSilicon PCIe Tune and Trace device

2022-02-24 Thread Yicong Yang via iommu
On 2022/2/24 20:32, John Garry wrote: > On 24/02/2022 03:53, Yicong Yang wrote: >> On 2022/2/22 19:06, John Garry wrote: >>> On 21/02/2022 08:43, Yicong Yang wrote: HiSilicon PCIe tune and trace device(PTT) is a PCIe Root Complex integrated Endpoint(RCiEP) device, providing the

Re: [PATCH v4 3/8] hisi_ptt: Register PMU device for PTT trace

2022-02-21 Thread Yicong Yang via iommu
On 2022/2/21 21:26, Yicong Yang wrote: > On 2022/2/21 19:44, Jonathan Cameron wrote: >> On Mon, 21 Feb 2022 16:43:02 +0800 >> Yicong Yang wrote: >> >>> Register PMU device of PTT trace, then users can use >>> trace through perf command. The driver makes use of perf >>> AUX trace and support

Re: [PATCH v3 8/8] iommu/arm-smmu-v3: Make default domain type of HiSilicon PTT device to identity

2022-02-14 Thread Yicong Yang via iommu
Hi Robin, Is this quirk ok with the SMMU v3 driver? Just want to confirm that I'm on the right way to dealing with the issue of our device. Thanks. On 2022/1/24 21:11, Yicong Yang wrote: > The DMA of HiSilicon PTT device can only work with identical > mapping. So add a quirk for the device to

Re: [PATCH v3 1/8] hwtracing: Add trace function support for HiSilicon PCIe Tune and Trace device

2022-02-14 Thread Yicong Yang via iommu
On 2022/2/8 19:07, Yicong Yang wrote: > On 2022/2/7 19:42, Jonathan Cameron wrote: >> On Mon, 24 Jan 2022 21:11:11 +0800 >> Yicong Yang wrote: >> >>> HiSilicon PCIe tune and trace device(PTT) is a PCIe Root Complex >>> integrated Endpoint(RCiEP) device, providing the capability >>> to dynamically

Re: [PATCH v3 1/8] hwtracing: Add trace function support for HiSilicon PCIe Tune and Trace device

2022-02-08 Thread Yicong Yang via iommu
On 2022/2/7 19:42, Jonathan Cameron wrote: > On Mon, 24 Jan 2022 21:11:11 +0800 > Yicong Yang wrote: > >> HiSilicon PCIe tune and trace device(PTT) is a PCIe Root Complex >> integrated Endpoint(RCiEP) device, providing the capability >> to dynamically monitor and tune the PCIe traffic, and trace

Re: [PATCH v3 8/8] iommu/arm-smmu-v3: Make default domain type of HiSilicon PTT device to identity

2022-02-08 Thread Yicong Yang via iommu
On 2022/2/8 16:05, John Garry wrote: > On 24/01/2022 13:11, Yicong Yang wrote: >> The DMA of HiSilicon PTT device can only work with identical >> mapping. So add a quirk for the device to force the domain >> passthrough. > > This patch should be earlier in the series, before the PTT driver, and

Re: [PATCH v3 8/8] iommu/arm-smmu-v3: Make default domain type of HiSilicon PTT device to identity

2022-02-08 Thread Yicong Yang via iommu
On 2022/2/8 19:56, John Garry wrote: > On 08/02/2022 11:21, Yicong Yang wrote: >>> This patch should be earlier in the series, before the PTT driver, and the >>> comment on hisi_ptt_check_iommu_mapping() should mention what is going on >>> here. >>> >> ok I'll reorder the serives and modify the

Re: [PATCH v3 6/8] docs: Add HiSilicon PTT device driver documentation

2022-02-08 Thread Yicong Yang via iommu
On 2022/2/7 20:12, Jonathan Cameron wrote: > On Mon, 24 Jan 2022 21:11:16 +0800 > Yicong Yang wrote: > >> Document the introduction and usage of HiSilicon PTT device driver. >> >> Signed-off-by: Yicong Yang > Nice document. A few trivial typos inline. > I would give a RB except I've suggested

Re: [PATCH v3 2/8] hisi_ptt: Register PMU device for PTT trace

2022-02-07 Thread Yicong Yang via iommu
On 2022/2/7 19:42, Jonathan Cameron wrote: > On Mon, 24 Jan 2022 21:11:12 +0800 > Yicong Yang wrote: > >> Register PMU device of PTT trace, then users can use >> trace through perf command. The driver makes use of perf >> AUX trace and support following events to configure the >> trace: >> >> -

Re: [PATCH v3 1/8] hwtracing: Add trace function support for HiSilicon PCIe Tune and Trace device

2022-02-08 Thread Yicong Yang via iommu
Hi John, Thanks for the comments. some replies inline. On 2022/2/8 2:11, John Garry wrote: > On 24/01/2022 13:11, Yicong Yang wrote: >> HiSilicon PCIe tune and trace device(PTT) is a PCIe Root Complex >> integrated Endpoint(RCiEP) device, providing the capability >> to dynamically monitor and

Re: [PATCH v3 4/8] hisi_ptt: Add tune function support for HiSilicon PCIe Tune and Trace device

2022-02-07 Thread Yicong Yang via iommu
On 2022/2/7 19:49, Jonathan Cameron wrote: > On Mon, 24 Jan 2022 21:11:14 +0800 > Yicong Yang wrote: > >> Add tune function for the HiSilicon Tune and Trace device. The interface >> of tune is exposed through sysfs attributes of PTT PMU device. >> >> Signed-off-by: Yicong Yang > > A few

Re: [PATCH v3 0/8] Add support for HiSilicon PCIe Tune and Trace device

2022-02-07 Thread Yicong Yang via iommu
Hi perf, ETM and PCI related experts, a gentle ping ... appreciate for the comments. thanks. On 2022/1/24 21:11, Yicong Yang wrote: > HiSilicon PCIe tune and trace device (PTT) is a PCIe Root Complex > integrated Endpoint (RCiEP) device, providing the capability > to dynamically monitor and

[PATCH v3 2/8] hisi_ptt: Register PMU device for PTT trace

2022-01-24 Thread Yicong Yang via iommu
Register PMU device of PTT trace, then users can use trace through perf command. The driver makes use of perf AUX trace and support following events to configure the trace: - filter: select Root port or Endpoint to trace - type: select the type of traced TLP headers - direction: select the

[PATCH v3 5/8] perf tool: Add support for HiSilicon PCIe Tune and Trace device driver

2022-01-24 Thread Yicong Yang via iommu
From: Qi Liu 'perf record' and 'perf report --dump-raw-trace' supported in this patch. Example usage: Output will contain raw PTT data and its textual representation, such as: 0 0 0x5810 [0x30]: PERF_RECORD_AUXTRACE size: 0x40 offset: 0 ref: 0xa5d50c725 idx: 0 tid: -1 cpu: 0 . . ...

[PATCH v3 3/8] hisi_ptt: Add support for dynamically updating the filter list

2022-01-24 Thread Yicong Yang via iommu
The PCIe devices supported by the PTT trace can be removed/rescanned by hotplug or through sysfs. Add support for dynamically updating the available filter list by registering a PCI bus notifier block. Then user can always get latest information about available tracing filters and driver can

[PATCH v3 0/8] Add support for HiSilicon PCIe Tune and Trace device

2022-01-24 Thread Yicong Yang via iommu
HiSilicon PCIe tune and trace device (PTT) is a PCIe Root Complex integrated Endpoint (RCiEP) device, providing the capability to dynamically monitor and tune the PCIe traffic (tune), and trace the TLP headers (trace). PTT tune is designed for monitoring and adjusting PCIe link parameters. We

[PATCH v3 1/8] hwtracing: Add trace function support for HiSilicon PCIe Tune and Trace device

2022-01-24 Thread Yicong Yang via iommu
HiSilicon PCIe tune and trace device(PTT) is a PCIe Root Complex integrated Endpoint(RCiEP) device, providing the capability to dynamically monitor and tune the PCIe traffic, and trace the TLP headers. Add the driver for the device to enable the trace function. This patch adds basic function of

[PATCH v3 7/8] MAINTAINERS: Add maintainer for HiSilicon PTT driver

2022-01-24 Thread Yicong Yang via iommu
Add maintainer for driver and documentation of HiSilicon PTT device. Signed-off-by: Yicong Yang --- MAINTAINERS | 7 +++ 1 file changed, 7 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index ea3e6c914384..237c618a74d5 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -8689,6 +8689,13 @@

[PATCH v3 8/8] iommu/arm-smmu-v3: Make default domain type of HiSilicon PTT device to identity

2022-01-24 Thread Yicong Yang via iommu
The DMA of HiSilicon PTT device can only work with identical mapping. So add a quirk for the device to force the domain passthrough. Signed-off-by: Yicong Yang --- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 16 1 file changed, 16 insertions(+) diff --git

[PATCH v3 4/8] hisi_ptt: Add tune function support for HiSilicon PCIe Tune and Trace device

2022-01-24 Thread Yicong Yang via iommu
Add tune function for the HiSilicon Tune and Trace device. The interface of tune is exposed through sysfs attributes of PTT PMU device. Signed-off-by: Yicong Yang --- drivers/hwtracing/ptt/hisi_ptt.c | 154 +++ drivers/hwtracing/ptt/hisi_ptt.h | 19 2 files

[PATCH v3 6/8] docs: Add HiSilicon PTT device driver documentation

2022-01-24 Thread Yicong Yang via iommu
Document the introduction and usage of HiSilicon PTT device driver. Signed-off-by: Yicong Yang --- Documentation/trace/hisi-ptt.rst | 304 +++ 1 file changed, 304 insertions(+) create mode 100644 Documentation/trace/hisi-ptt.rst diff --git

Re: [PATCH v7 2/7] hwtracing: Add trace function support for HiSilicon PCIe Tune and Trace device

2022-04-12 Thread Yicong Yang via iommu
On 2022/4/12 16:39, John Garry wrote: +static int hisi_ptt_alloc_trace_buf(struct hisi_ptt *hisi_ptt) +{ +    struct hisi_ptt_trace_ctrl *ctrl = _ptt->trace_ctrl; +    struct device *dev = _ptt->pdev->dev; +    int i; + +    hisi_ptt->trace_ctrl.buf_index = 0;

[PATCH v6 1/7] iommu/arm-smmu-v3: Make default domain type of HiSilicon PTT device to identity

2022-04-06 Thread Yicong Yang via iommu
The DMA operations of HiSilicon PTT device can only work properly with identical mappings. So add a quirk for the device to force the domain as passthrough. Signed-off-by: Yicong Yang --- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 16 1 file changed, 16 insertions(+) diff

[PATCH v6 7/7] MAINTAINERS: Add maintainer for HiSilicon PTT driver

2022-04-06 Thread Yicong Yang via iommu
Add maintainer for driver and documentation of HiSilicon PTT device. Signed-off-by: Yicong Yang Reviewed-by: Jonathan Cameron --- MAINTAINERS | 7 +++ 1 file changed, 7 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index fd768d43e048..d30a1698251c 100644 --- a/MAINTAINERS +++

[PATCH v6 0/7] Add support for HiSilicon PCIe Tune and Trace device

2022-04-06 Thread Yicong Yang via iommu
HiSilicon PCIe tune and trace device (PTT) is a PCIe Root Complex integrated Endpoint (RCiEP) device, providing the capability to dynamically monitor and tune the PCIe traffic (tune), and trace the TLP headers (trace). PTT tune is designed for monitoring and adjusting PCIe link parameters. We

[PATCH v6 5/7] perf tool: Add support for HiSilicon PCIe Tune and Trace device driver

2022-04-06 Thread Yicong Yang via iommu
From: Qi Liu 'perf record' and 'perf report --dump-raw-trace' supported in this patch. Example usage: Output will contain raw PTT data and its textual representation, such as: 0 0 0x5810 [0x30]: PERF_RECORD_AUXTRACE size: 0x40 offset: 0 ref: 0xa5d50c725 idx: 0 tid: -1 cpu: 0 . . ...

[PATCH v6 6/7] docs: Add HiSilicon PTT device driver documentation

2022-04-06 Thread Yicong Yang via iommu
Document the introduction and usage of HiSilicon PTT device driver. Signed-off-by: Yicong Yang Reviewed-by: Jonathan Cameron --- Documentation/trace/hisi-ptt.rst | 303 +++ 1 file changed, 303 insertions(+) create mode 100644 Documentation/trace/hisi-ptt.rst diff

[PATCH v6 3/7] hisi_ptt: Add support for dynamically updating the filter list

2022-04-06 Thread Yicong Yang via iommu
The PCIe devices supported by the PTT trace can be removed/rescanned by hotplug or through sysfs. Add support for dynamically updating the available filter list by registering a PCI bus notifier block. Then user can always get latest information about available tracing filters and driver can

[PATCH v6 2/7] hwtracing: Add trace function support for HiSilicon PCIe Tune and Trace device

2022-04-06 Thread Yicong Yang via iommu
HiSilicon PCIe tune and trace device(PTT) is a PCIe Root Complex integrated Endpoint(RCiEP) device, providing the capability to dynamically monitor and tune the PCIe traffic, and trace the TLP headers. Add the driver for the device to enable the trace function. Register PMU device of PTT trace,

[PATCH v6 4/7] hisi_ptt: Add tune function support for HiSilicon PCIe Tune and Trace device

2022-04-06 Thread Yicong Yang via iommu
Add tune function for the HiSilicon Tune and Trace device. The interface of tune is exposed through sysfs attributes of PTT PMU device. Signed-off-by: Yicong Yang Reviewed-by: Jonathan Cameron --- drivers/hwtracing/ptt/hisi_ptt.c | 154 +++

Re: [PATCH v6 4/7] hisi_ptt: Add tune function support for HiSilicon PCIe Tune and Trace device

2022-04-07 Thread Yicong Yang via iommu
On 2022/4/7 12:28, kernel test robot wrote: > Hi Yicong, > > I love your patch! Perhaps something to improve: > > [auto build test WARNING on joro-iommu/next] > [also build test WARNING on linus/master linux/master v5.18-rc1 next-20220406] > [cannot apply to tip/perf/core] > [If your patch is

[PATCH v7 1/7] iommu/arm-smmu-v3: Make default domain type of HiSilicon PTT device to identity

2022-04-07 Thread Yicong Yang via iommu
The DMA operations of HiSilicon PTT device can only work properly with identical mappings. So add a quirk for the device to force the domain as passthrough. Signed-off-by: Yicong Yang --- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 16 1 file changed, 16 insertions(+) diff

[PATCH v7 6/7] docs: Add HiSilicon PTT device driver documentation

2022-04-07 Thread Yicong Yang via iommu
Document the introduction and usage of HiSilicon PTT device driver. Signed-off-by: Yicong Yang Reviewed-by: Jonathan Cameron --- Documentation/trace/hisi-ptt.rst | 303 +++ 1 file changed, 303 insertions(+) create mode 100644 Documentation/trace/hisi-ptt.rst diff

[PATCH v7 4/7] hisi_ptt: Add tune function support for HiSilicon PCIe Tune and Trace device

2022-04-07 Thread Yicong Yang via iommu
Add tune function for the HiSilicon Tune and Trace device. The interface of tune is exposed through sysfs attributes of PTT PMU device. Signed-off-by: Yicong Yang Reviewed-by: Jonathan Cameron --- drivers/hwtracing/ptt/hisi_ptt.c | 154 +++

[PATCH v7 3/7] hisi_ptt: Add support for dynamically updating the filter list

2022-04-07 Thread Yicong Yang via iommu
The PCIe devices supported by the PTT trace can be removed/rescanned by hotplug or through sysfs. Add support for dynamically updating the available filter list by registering a PCI bus notifier block. Then user can always get latest information about available tracing filters and driver can

[PATCH v7 5/7] perf tool: Add support for HiSilicon PCIe Tune and Trace device driver

2022-04-07 Thread Yicong Yang via iommu
From: Qi Liu 'perf record' and 'perf report --dump-raw-trace' supported in this patch. Example usage: Output will contain raw PTT data and its textual representation, such as: 0 0 0x5810 [0x30]: PERF_RECORD_AUXTRACE size: 0x40 offset: 0 ref: 0xa5d50c725 idx: 0 tid: -1 cpu: 0 . . ...

[PATCH v7 2/7] hwtracing: Add trace function support for HiSilicon PCIe Tune and Trace device

2022-04-07 Thread Yicong Yang via iommu
HiSilicon PCIe tune and trace device(PTT) is a PCIe Root Complex integrated Endpoint(RCiEP) device, providing the capability to dynamically monitor and tune the PCIe traffic, and trace the TLP headers. Add the driver for the device to enable the trace function. Register PMU device of PTT trace,

[PATCH v7 0/7] Add support for HiSilicon PCIe Tune and Trace device

2022-04-07 Thread Yicong Yang via iommu
HiSilicon PCIe tune and trace device (PTT) is a PCIe Root Complex integrated Endpoint (RCiEP) device, providing the capability to dynamically monitor and tune the PCIe traffic (tune), and trace the TLP headers (trace). PTT tune is designed for monitoring and adjusting PCIe link parameters. We

[PATCH v7 7/7] MAINTAINERS: Add maintainer for HiSilicon PTT driver

2022-04-07 Thread Yicong Yang via iommu
Add maintainer for driver and documentation of HiSilicon PTT device. Signed-off-by: Yicong Yang Reviewed-by: Jonathan Cameron --- MAINTAINERS | 7 +++ 1 file changed, 7 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index fd768d43e048..d30a1698251c 100644 --- a/MAINTAINERS +++

Re: [PATCH v7 0/7] Add support for HiSilicon PCIe Tune and Trace device

2022-04-14 Thread Yicong Yang via iommu
Hi Bjorn, Since it's a device about tuning and analyzing PCIe link in your realm and you've given helpful comments in RFC and v1 version, looking forward to see your opnion on this driver as the user interface has changed to perf. Also to confirm that the hotplug problem mentioned in RFC[1]

Re: [PATCH v7 2/7] hwtracing: Add trace function support for HiSilicon PCIe Tune and Trace device

2022-04-12 Thread Yicong Yang via iommu
Hi John, Thanks for the comments! some questions replied below. On 2022/4/12 1:02, John Garry wrote: > On 07/04/2022 13:58, Yicong Yang wrote: >> HiSilicon PCIe tune and trace device(PTT) is a PCIe Root Complex integrated >> Endpoint(RCiEP) device, providing the capability to dynamically monitor

Re: [PATCH v7 5/7] perf tool: Add support for HiSilicon PCIe Tune and Trace device driver

2022-04-12 Thread Yicong Yang via iommu
On 2022/4/12 1:19, John Garry wrote: > On 07/04/2022 13:58, Yicong Yang wrote: >> From: Qi Liu >> >> 'perf record' and 'perf report --dump-raw-trace' supported in this >> patch. >> >> Example usage: >> >> Output will contain raw PTT data and its textual representation, such >> as: >> >> 0 0

Re: [PATCH v8 2/8] hwtracing: hisi_ptt: Add trace function support for HiSilicon PCIe Tune and Trace device

2022-05-17 Thread Yicong Yang via iommu
On 2022/5/16 22:03, Jonathan Cameron wrote: > On Mon, 16 May 2022 20:52:17 +0800 > Yicong Yang wrote: > >> HiSilicon PCIe tune and trace device(PTT) is a PCIe Root Complex integrated >> Endpoint(RCiEP) device, providing the capability to dynamically monitor and >> tune the PCIe traffic and trace

Re: [PATCH v8 2/8] hwtracing: hisi_ptt: Add trace function support for HiSilicon PCIe Tune and Trace device

2022-05-17 Thread Yicong Yang via iommu
On 2022/5/17 0:23, John Garry wrote: > On 16/05/2022 13:52, Yicong Yang wrote: >> HiSilicon PCIe tune and trace device(PTT) is a PCIe Root Complex integrated >> Endpoint(RCiEP) device, providing the capability to dynamically monitor and >> tune the PCIe traffic and trace the TLP headers. >> >> Add

Re: [PATCH v8 2/8] hwtracing: hisi_ptt: Add trace function support for HiSilicon PCIe Tune and Trace device

2022-05-17 Thread Yicong Yang via iommu
On 2022/5/17 16:21, John Garry wrote: > On 17/05/2022 09:09, Yicong Yang wrote: +    target = cpumask_any(cpumask_of_node(dev_to_node(_ptt->pdev->dev))); +    if (target < nr_cpumask_bits) { >>> the comment for cpumask_any() hints to check against nr_cpu_ids - any >>> specific

[PATCH v8 2/8] hwtracing: hisi_ptt: Add trace function support for HiSilicon PCIe Tune and Trace device

2022-05-16 Thread Yicong Yang via iommu
HiSilicon PCIe tune and trace device(PTT) is a PCIe Root Complex integrated Endpoint(RCiEP) device, providing the capability to dynamically monitor and tune the PCIe traffic and trace the TLP headers. Add the driver for the device to enable the trace function. Register PMU device of PTT trace,

[PATCH v8 4/8] perf arm: Refactor event list iteration in auxtrace_record__init()

2022-05-16 Thread Yicong Yang via iommu
From: Qi Liu Use find_pmu_for_event() to simplify logic in auxtrace_record__init(). Signed-off-by: Qi Liu Signed-off-by: Yicong Yang --- tools/perf/arch/arm/util/auxtrace.c | 53 ++--- 1 file changed, 34 insertions(+), 19 deletions(-) diff --git

[PATCH v8 6/8] perf tool: Add support for parsing HiSilicon PCIe Trace packet

2022-05-16 Thread Yicong Yang via iommu
From: Qi Liu Add support for using 'perf report --dump-raw-trace' to parse PTT packet. Example usage: Output will contain raw PTT data and its textual representation, such as: 0 0 0x5810 [0x30]: PERF_RECORD_AUXTRACE size: 0x40 offset: 0 ref: 0xa5d50c725 idx: 0 tid: -1 cpu: 0 . . ...

[PATCH v8 7/8] docs: trace: Add HiSilicon PTT device driver documentation

2022-05-16 Thread Yicong Yang via iommu
Document the introduction and usage of HiSilicon PTT device driver. Signed-off-by: Yicong Yang Reviewed-by: Jonathan Cameron --- Documentation/trace/hisi-ptt.rst | 307 +++ Documentation/trace/index.rst| 1 + 2 files changed, 308 insertions(+) create mode

[PATCH v8 1/8] iommu/arm-smmu-v3: Make default domain type of HiSilicon PTT device to identity

2022-05-16 Thread Yicong Yang via iommu
The DMA operations of HiSilicon PTT device can only work properly with identical mappings. So add a quirk for the device to force the domain as passthrough. Acked-by: Will Deacon Signed-off-by: Yicong Yang Reviewed-by: John Garry --- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 21

[PATCH v8 8/8] MAINTAINERS: Add maintainer for HiSilicon PTT driver

2022-05-16 Thread Yicong Yang via iommu
Add maintainer for driver and documentation of HiSilicon PTT device. Signed-off-by: Yicong Yang Reviewed-by: Jonathan Cameron --- MAINTAINERS | 7 +++ 1 file changed, 7 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index fd768d43e048..d30a1698251c 100644 --- a/MAINTAINERS +++

[PATCH v8 0/8] Add support for HiSilicon PCIe Tune and Trace device

2022-05-16 Thread Yicong Yang via iommu
HiSilicon PCIe tune and trace device (PTT) is a PCIe Root Complex integrated Endpoint (RCiEP) device, providing the capability to dynamically monitor and tune the PCIe traffic (tune), and trace the TLP headers (trace). PTT tune is designed for monitoring and adjusting PCIe link parameters. We

[PATCH v8 3/8] hwtracing: hisi_ptt: Add tune function support for HiSilicon PCIe Tune and Trace device

2022-05-16 Thread Yicong Yang via iommu
Add tune function for the HiSilicon Tune and Trace device. The interface of tune is exposed through sysfs attributes of PTT PMU device. Signed-off-by: Yicong Yang Reviewed-by: Jonathan Cameron --- drivers/hwtracing/ptt/hisi_ptt.c | 157 +++

[PATCH v8 5/8] perf tool: Add support for HiSilicon PCIe Tune and Trace device driver

2022-05-16 Thread Yicong Yang via iommu
From: Qi Liu HiSilicon PCIe tune and trace device (PTT) could dynamically tune the PCIe link's events, and trace the TLP headers). This patch add support for PTT device in perf tool, so users could use 'perf record' to get TLP headers trace data. Signed-off-by: Qi Liu Signed-off-by: Yicong

Re: [PATCH v9 7/8] docs: trace: Add HiSilicon PTT device driver documentation

2022-07-07 Thread Yicong Yang via iommu
On 2022/7/7 1:57, Mathieu Poirier wrote: > Hi, > > I have started looking at this set. Thanks! > > On Mon, Jun 06, 2022 at 07:55:54PM +0800, Yicong Yang wrote: >> Document the introduction and usage of HiSilicon PTT device driver. >> >> Signed-off-by: Yicong Yang >> Reviewed-by: Jonathan

Re: [PATCH v9 0/8] Add support for HiSilicon PCIe Tune and Trace device

2022-06-27 Thread Yicong Yang via iommu
Hi Greg, Since the kernel side of this device has been reviewed for 8 versions with all comments addressed and no more comment since v9 posted in 5.19-rc1, is it ok to merge it first (for Patch 1-3 and 7-8)? Thanks. On 2022/6/6 19:55, Yicong Yang wrote: > HiSilicon PCIe tune and trace device

Re: [PATCH v9 5/8] perf tool: Add support for HiSilicon PCIe Tune and Trace device driver

2022-06-27 Thread Yicong Yang via iommu
On 2022/6/27 10:02, Leo Yan wrote: > On Mon, Jun 06, 2022 at 07:55:52PM +0800, Yicong Yang wrote: >> From: Qi Liu >> >> HiSilicon PCIe tune and trace device (PTT) could dynamically tune >> the PCIe link's events, and trace the TLP headers). >> >> This patch add support for PTT device in perf

  1   2   >