[PATCH v7 0/3] of/pci: Provide common support for PCI DT parsing

2013-04-16 Thread Andrew Murray
. Compared to the v6 sent by Andrew Murray, the following changes have been made in response to build errors/warnings: * Inclusion of linux/of_address.h in of_pci.c as suggested by Michal Simek to prevent compilation failures on Microblaze (and others) and his ack. * Use of externs

[PATCH v7 1/3] of/pci: Unify pci_process_bridge_OF_ranges from Microblaze and PowerPC

2013-04-16 Thread Andrew Murray
The pci_process_bridge_OF_ranges function, used to parse the ranges property of a PCI host device, is found in both Microblaze and PowerPC architectures. These implementations are nearly identical. This patch moves this common code to a common place. Signed-off-by: Andrew Murray andrew.mur

[PATCH v7 2/3] of/pci: Provide support for parsing PCI DT ranges property

2013-04-16 Thread Andrew Murray
with powerpc and microblaze). Signed-off-by: Andrew Murray andrew.mur...@arm.com Signed-off-by: Liviu Dudau liviu.du...@arm.com Signed-off-by: Thomas Petazzoni thomas.petazz...@free-electrons.com Reviewed-by: Rob Herring rob.herr...@calxeda.com Tested-by: Thomas Petazzoni thomas.petazz...@free

[PATCH v7 3/3] of/pci: mips: convert to common of_pci_range_parser

2013-04-16 Thread Andrew Murray
This patch converts the pci_load_of_ranges function to use the new common of_pci_range_parser. Signed-off-by: Andrew Murray andrew.mur...@arm.com Signed-off-by: Liviu Dudau liviu.du...@arm.com Reviewed-by: Rob Herring rob.herr...@calxeda.com --- arch/mips/pci/pci.c | 50

Re: [PATCH v7 1/3] of/pci: Unify pci_process_bridge_OF_ranges from Microblaze and PowerPC

2013-04-16 Thread Andrew Murray
On Tue, Apr 16, 2013 at 11:18:26AM +0100, Andrew Murray wrote: The pci_process_bridge_OF_ranges function, used to parse the ranges property of a PCI host device, is found in both Microblaze and PowerPC architectures. These implementations are nearly identical. This patch moves this common code

Re: [PATCH v7 3/3] of/pci: mips: convert to common of_pci_range_parser

2013-04-18 Thread Andrew Murray
On Wed, Apr 17, 2013 at 04:42:48PM +0100, Linus Walleij wrote: On Tue, Apr 16, 2013 at 12:18 PM, Andrew Murray andrew.mur...@arm.com wrote: This patch converts the pci_load_of_ranges function to use the new common of_pci_range_parser. Signed-off-by: Andrew Murray andrew.mur...@arm.com

Re: [PATCH v7 2/3] of/pci: Provide support for parsing PCI DT ranges property

2013-04-18 Thread Andrew Murray
On Thu, Apr 18, 2013 at 02:44:01PM +0100, Grant Likely wrote: On Tue, 16 Apr 2013 11:18:27 +0100, Andrew Murray andrew.mur...@arm.com wrote: This patch factors out common implementation patterns to reduce overall kernel code and provide a means for host bridge drivers to directly obtain

Re: [PATCH v7 3/3] of/pci: mips: convert to common of_pci_range_parser

2013-04-18 Thread Andrew Murray
On Thu, Apr 18, 2013 at 02:45:35PM +0100, Grant Likely wrote: On Tue, 16 Apr 2013 11:18:28 +0100, Andrew Murray andrew.mur...@arm.com wrote: This patch converts the pci_load_of_ranges function to use the new common of_pci_range_parser. Signed-off-by: Andrew Murray andrew.mur...@arm.com

Re: [PATCH v7 2/3] of/pci: Provide support for parsing PCI DT ranges property

2013-04-18 Thread Andrew Murray
On Thu, Apr 18, 2013 at 04:29:54PM +0100, Grant Likely wrote: On Thu, Apr 18, 2013 at 3:24 PM, Andrew Murray andrew.mur...@arm.com wrote: On Thu, Apr 18, 2013 at 02:44:01PM +0100, Grant Likely wrote: On Tue, 16 Apr 2013 11:18:27 +0100, Andrew Murray andrew.mur...@arm.com wrote

[PATCH v8 3/3] of/pci: mips: convert to common of_pci_range_parser

2013-04-22 Thread Andrew Murray
This patch converts the pci_load_of_ranges function to use the new common of_pci_range_parser. Signed-off-by: Andrew Murray andrew.mur...@arm.com Signed-off-by: Liviu Dudau liviu.du...@arm.com Signed-off-by: Gabor Juhos juh...@openwrt.org Reviewed-by: Rob Herring rob.herr...@calxeda.com Reviewed

[PATCH v8 0/3] of/pci: Provide common support for PCI DT parsing

2013-04-22 Thread Andrew Murray
on PowerPC, x86_64 and MIPS. Compared to the v7 sent by Andrew Murray, the following changes have been made (please note that the first patch is unchanged from v7): * Rename of_pci_range_parser to of_pci_range_parser_init and of_pci_process_ranges to of_pci_range_parser_one as suggested by Grant

[PATCH v8 2/3] of/pci: Provide support for parsing PCI DT ranges property

2013-04-22 Thread Andrew Murray
with powerpc and microblaze). Signed-off-by: Andrew Murray andrew.mur...@arm.com Signed-off-by: Liviu Dudau liviu.du...@arm.com Signed-off-by: Thomas Petazzoni thomas.petazz...@free-electrons.com Reviewed-by: Rob Herring rob.herr...@calxeda.com Tested-by: Thomas Petazzoni thomas.petazz...@free

[PATCH v8 1/3] of/pci: Unify pci_process_bridge_OF_ranges from Microblaze and PowerPC

2013-04-22 Thread Andrew Murray
The pci_process_bridge_OF_ranges function, used to parse the ranges property of a PCI host device, is found in both Microblaze and PowerPC architectures. These implementations are nearly identical. This patch moves this common code to a common place. Signed-off-by: Andrew Murray andrew.mur

Re: [PATCH v7 3/3] of/pci: mips: convert to common of_pci_range_parser

2013-04-22 Thread Andrew Murray
branch the drivers that depend on it will need to be updated to reflect the new naming of functions as suggested by Grant. Thanks, Andrew Murray ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH v7 2/3] of/pci: Provide support for parsing PCI DT ranges property

2013-04-22 Thread Andrew Murray
On Thu, Apr 18, 2013 at 02:44:01PM +0100, Grant Likely wrote: On Tue, 16 Apr 2013 11:18:27 +0100, Andrew Murray andrew.mur...@arm.com wrote: Acked-by: Grant Likely grant.lik...@secretlab.ca But comments below... I've updated the patchset (now v8) to reflect your feedback, after

[RFC PATCH 0/3] Unify definations of struct pci_controller

2013-04-25 Thread Andrew Murray
such as pcibios_alloc|free_controller and pcibios_setup_phb_resources type functions. Andrew Murray (3): powerpc: Move struct pci_controller to asm-generic microblaze: Use asm-generic version of pci_controller pci: Use common definations of INDIRECT_TYPE_* arch/microblaze/include/asm/pci-bridge.h | 70

[RFC PATCH 1/3] powerpc: Move struct pci_controller to asm-generic

2013-04-25 Thread Andrew Murray
This patch moves struct pci_controller into asm-generic to allow for use by other architectures thus reducing code duplication in the kernel. Signed-off-by: Andrew Murray andrew.mur...@arm.com --- arch/powerpc/include/asm/pci-bridge.h | 87 +--- include/asm-generic

[RFC PATCH 2/3] microblaze: Use asm-generic version of pci_controller

2013-04-25 Thread Andrew Murray
This patch removes struct pci_controller from Microblaze and instead uses struct pci_controller from asm-generic. Signed-off-by: Andrew Murray andrew.mur...@arm.com --- arch/microblaze/include/asm/pci-bridge.h | 75 ++ include/asm-generic/pci-bridge.h |2

[RFC PATCH 3/3] pci: Use common definations of INDIRECT_TYPE_*

2013-04-25 Thread Andrew Murray
This patch unifies similar definations of INDIRECT_TYPE_* between PowerPC and Microblaze. Signed-off-by: Andrew Murray andrew.mur...@arm.com --- arch/microblaze/include/asm/pci-bridge.h | 23 --- arch/powerpc/include/asm/pci-bridge.h| 23 --- arch

Re: [PATCH v8 1/3] of/pci: Unify pci_process_bridge_OF_ranges from Microblaze and PowerPC

2013-05-07 Thread Andrew Murray
On Sun, May 05, 2013 at 03:41:49AM +0100, Benjamin Herrenschmidt wrote: On Mon, 2013-04-22 at 11:41 +0100, Andrew Murray wrote: The pci_process_bridge_OF_ranges function, used to parse the ranges property of a PCI host device, is found in both Microblaze and PowerPC architectures

[PATCH v9 1/3] of/pci: Provide support for parsing PCI DT ranges property

2013-05-07 Thread Andrew Murray
with powerpc and microblaze). Signed-off-by: Andrew Murray andrew.mur...@arm.com Signed-off-by: Liviu Dudau liviu.du...@arm.com Signed-off-by: Thomas Petazzoni thomas.petazz...@free-electrons.com Reviewed-by: Rob Herring rob.herr...@calxeda.com Tested-by: Thomas Petazzoni thomas.petazz...@free

[PATCH v9 0/3] of/pci: Provide common support for PCI DT parsing

2013-05-07 Thread Andrew Murray
on PowerPC, x86_64, MIPS and Microblaze. Compared to the v8 sent by Andrew Murray, the following changes have been made (please note that the MIPS patch is unchanged from v8): * Remove the unification of pci_process_bridge_OF_ranges between PowerPC and Microblaze. Feedback from Bjorn and Benjamin

[PATCH v9 2/3] of/pci: mips: convert to common of_pci_range_parser

2013-05-07 Thread Andrew Murray
This patch converts the pci_load_of_ranges function to use the new common of_pci_range_parser. Signed-off-by: Andrew Murray andrew.mur...@arm.com Signed-off-by: Liviu Dudau liviu.du...@arm.com Signed-off-by: Gabor Juhos juh...@openwrt.org Reviewed-by: Rob Herring rob.herr...@calxeda.com Reviewed

[PATCH v9 3/3] of/pci: microblaze: convert to common of_pci_range_parser

2013-05-07 Thread Andrew Murray
This patch converts the pci_load_of_ranges function to use the new common of_pci_range_parser. Signed-off-by: Andrew Murray andrew.mur...@arm.com Signed-off-by: Liviu Dudau liviu.du...@arm.com --- arch/microblaze/pci/pci-common.c | 106 ++ 1 files changed, 38

Re: [PATCH] powerpc/pci: Use of_pci_range_parser helper in pci_process_bridge_OF_ranges

2014-02-25 Thread Andrew Murray
On 25 February 2014 13:25, Benjamin Herrenschmidt b...@kernel.crashing.org wrote: On Tue, 2014-02-25 at 06:32 +, Andrew Murray wrote: This patch updates the implementation of pci_process_bridge_OF_ranges to use the of_pci_range_parser helpers. Signed-off-by: Andrew Murray amur...@embedded

Re: pci and pcie device-tree binding - range No cells

2012-12-12 Thread Andrew Murray
. of_bus_pci_get_flags, bus-count_cells). I'm not just ready to post it - but can do before early next week if you can wait. Andrew Murray ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH] pci: Provide support for parsing PCI DT ranges property

2012-12-12 Thread Andrew Murray
request the obtained resources and pass them on (e.g. pci_add_resource_offset). Signed-off-by: Andrew Murray andrew.mur...@arm.com Signed-off-by: Liviu Dudau liviu.du...@arm.com --- drivers/of/address.c | 53 +++- include/linux/of_address.h |7

Re: pci and pcie device-tree binding - range No cells

2012-12-12 Thread Andrew Murray
On Wed, Dec 12, 2012 at 01:34:24PM +, Thierry Reding wrote: On Wed, Dec 12, 2012 at 12:19:12PM +, Andrew Murray wrote: I've been working on a relatively architecture agnostic PCI host bridge driver and also wanted to avoid duplicating more generic DT parsing code for PCI bindings

Re: [PATCH] pci: Provide support for parsing PCI DT ranges property

2012-12-13 Thread Andrew Murray
another patch for the typo and leave this patch with you for working into your existing series. Andrew Murray ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH] pci: Provide support for parsing PCI DT ranges property

2012-12-13 Thread Andrew Murray
On Thu, Dec 13, 2012 at 10:03:18AM +, Thierry Reding wrote: On Thu, Dec 13, 2012 at 09:45:43AM +, Andrew Murray wrote: On Thu, Dec 13, 2012 at 09:13:33AM +, Thierry Reding wrote: Hi Andrew, I don't like iterator interfaces too much, but I can live with that. Other than

Re: [PATCH] pci: Provide support for parsing PCI DT ranges property

2013-01-14 Thread Andrew Murray
On Thu, Dec 20, 2012 at 08:25:00AM +, Thierry Reding wrote: On Wed, Dec 12, 2012 at 04:37:50PM +, Andrew Murray wrote: [...] diff --git a/drivers/of/address.c b/drivers/of/address.c [...] + start = of_get_property(node, ranges, rlen); + if (start == NULL) + return

Re: [PATCH] pci: Provide support for parsing PCI DT ranges property

2013-01-14 Thread Andrew Murray
On Sat, Dec 15, 2012 at 01:06:41AM +, Grant Likely wrote: On Wed, Dec 12, 2012 at 4:37 PM, Andrew Murray andrew.mur...@arm.com wrote: DT bindings for PCI host bridges often use the ranges property to describe memory and IO ranges - this binding tends to be the same across architectures

[PATCH 02/10] arm: perf/core: generalise event exclusion checking with perf macro

2018-11-16 Thread Andrew Murray
Replace checking of perf event exclusion flags with perf macro. Signed-off-by: Andrew Murray --- arch/arm/mach-imx/mmdc.c | 8 +--- arch/arm/mm/cache-l2x0-pmu.c | 7 +-- 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/arch/arm/mach-imx/mmdc.c b/arch/arm/mach-imx

[PATCH 03/10] arm: perf: add additional validation to set_event_filter

2018-11-16 Thread Andrew Murray
The armv7pmu driver doesn't support host/guest mode exclusion so let's report this when set_event_filter is called with these exclusion flags set. Signed-off-by: Andrew Murray --- arch/arm/kernel/perf_event_v7.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm/kernel/perf_event_v7

[PATCH 06/10] alpha: perf/core: generalise event exclusion checking with perf macro

2018-11-16 Thread Andrew Murray
Replace checking of perf event exclusion flags with perf macro. This is a functional change as __hw_perf_event_init will now indicate that it doesn't support exclude_host and exclude_guest event flags. Signed-off-by: Andrew Murray --- arch/alpha/kernel/perf_event.c | 4 +--- 1 file changed, 1

[PATCH 09/10] drivers/perf: perf/core: generalise event exclusion checking with perf macro

2018-11-16 Thread Andrew Murray
in these files: - drivers/perf/xgene_pmu.c Signed-off-by: Andrew Murray --- drivers/perf/arm-cci.c | 7 +-- drivers/perf/arm-ccn.c | 5 + drivers/perf/arm_dsu_pmu.c | 7 +-- drivers/perf/arm_pmu.c | 9 + drivers

[PATCH 07/10] x86: perf/core: generalise event exclusion checking with perf macro

2018-11-16 Thread Andrew Murray
/uncore.c Signed-off-by: Andrew Murray --- arch/x86/events/amd/ibs.c | 11 +-- arch/x86/events/amd/iommu.c| 3 +-- arch/x86/events/amd/power.c| 8 +--- arch/x86/events/amd/uncore.c | 3 +-- arch/x86/events/intel/cstate.c | 7 +-- arch/x86/events

[PATCH 10/10] perf/doc: update design.txt for exclude_{host|guest} flags

2018-11-16 Thread Andrew Murray
Update design.txt to reflect the presence of the exclude_host and exclude_guest perf flags. Signed-off-by: Andrew Murray --- tools/perf/design.txt | 4 1 file changed, 4 insertions(+) diff --git a/tools/perf/design.txt b/tools/perf/design.txt index a28dca2..7de7d83 100644 --- a/tools/perf

[PATCH 00/10] perf/core: Generalise event exclusion checking

2018-11-16 Thread Andrew Murray
on registration. All drivers touched by this patchset have been compile tested. [1] https://lore.kernel.org/patchwork/patch/325116/ ~ Andrew Murray (10): perf/core: Add macro to test for event exclusion flags arm: perf/core

[PATCH 01/10] perf/core: Add macro to test for event exclusion flags

2018-11-16 Thread Andrew Murray
Add a macro that tests if any of the perf event exclusion flags are set on a given event. Signed-off-by: Andrew Murray --- include/linux/perf_event.h | 9 + 1 file changed, 9 insertions(+) diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index 53c500f..89ee7fa

[PATCH 04/10] powerpc: perf/core: generalise event exclusion checking with perf macro

2018-11-16 Thread Andrew Murray
Replace checking of perf event exclusion flags with perf macro. Signed-off-by: Andrew Murray --- arch/powerpc/perf/hv-24x7.c | 7 +-- arch/powerpc/perf/hv-gpci.c | 7 +-- arch/powerpc/perf/imc-pmu.c | 14 ++ 3 files changed, 4 insertions(+), 24 deletions(-) diff --git

[PATCH 05/10] powerpc/pmu/fsl: add additional validation to event_init

2018-11-16 Thread Andrew Murray
The fsl PMU driver doesn't support host/guest mode exclusion so let's report this when event_init is called with these exclusion flags set. Signed-off-by: Andrew Murray --- arch/powerpc/perf/core-fsl-emb.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/powerpc/perf/core-fsl-emb.c b

[PATCH 08/10] perf/core: Remove unused perf_flags

2018-11-16 Thread Andrew Murray
Now that perf_flags is not used we remove it. Signed-off-by: Andrew Murray --- include/uapi/linux/perf_event.h | 2 -- tools/include/uapi/linux/perf_event.h | 2 -- 2 files changed, 4 deletions(-) diff --git a/include/uapi/linux/perf_event.h b/include/uapi/linux/perf_event.h index

Re: [PATCH 10/10] perf/doc: update design.txt for exclude_{host|guest} flags

2018-12-12 Thread Andrew Murray
On Wed, Dec 12, 2018 at 09:07:42AM +0100, Christoffer Dall wrote: > On Tue, Dec 11, 2018 at 01:59:03PM +0000, Andrew Murray wrote: > > On Tue, Dec 11, 2018 at 10:06:53PM +1100, Michael Ellerman wrote: > > > [ Reviving old thread. ] > > > > > > Andrew Murray

Re: [PATCH v3 00/12] perf/core: Generalise event exclusion checking

2018-12-10 Thread Andrew Murray
On Fri, Dec 07, 2018 at 05:25:17PM +, Will Deacon wrote: > On Thu, Dec 06, 2018 at 04:47:17PM +0000, Andrew Murray wrote: > > Many PMU drivers do not have the capability to exclude counting events > > that occur in specific contexts such as idle, kernel, guest, etc. These >

Re: [PATCH 10/10] perf/doc: update design.txt for exclude_{host|guest} flags

2018-12-11 Thread Andrew Murray
On Tue, Dec 11, 2018 at 10:06:53PM +1100, Michael Ellerman wrote: > [ Reviving old thread. ] > > Andrew Murray writes: > > On Tue, Nov 20, 2018 at 10:31:36PM +1100, Michael Ellerman wrote: > >> Andrew Murray writes: > >> > >> > Update design.tx

[PATCH v3 00/12] perf/core: Generalise event exclusion checking

2018-12-06 Thread Andrew Murray
event_has_exclude_flags to event_has_any_exclude_flag and update commit log to reflect it's a function Andrew Murray (12): perf/doc: update design.txt for exclude_{host|guest} flags perf/core: add function to test for event exclusion flags perf/core: add PERF_PMU_CAP_NO_EXCLUDE for exclusion

[PATCH v3 01/12] perf/doc: update design.txt for exclude_{host|guest} flags

2018-12-06 Thread Andrew Murray
Update design.txt to reflect the presence of the exclude_host and exclude_guest perf flags. Signed-off-by: Andrew Murray --- tools/perf/design.txt | 4 1 file changed, 4 insertions(+) diff --git a/tools/perf/design.txt b/tools/perf/design.txt index a28dca2..0453ba2 100644 --- a/tools/perf

[PATCH v3 03/12] perf/core: add PERF_PMU_CAP_NO_EXCLUDE for exclusion incapable PMUs

2018-12-06 Thread Andrew Murray
inconsistent. Let's instead allow PMU drivers to advertise their inability to exclude based on context via a new capability: PERF_PMU_CAP_NO_EXCLUDE. This allows the perf core to reject requests for exclusion events where there is no support in the PMU. Signed-off-by: Andrew Murray --- include/linux

[PATCH v3 05/12] arm: perf: conditionally use PERF_PMU_CAP_NO_EXCLUDE

2018-12-06 Thread Andrew Murray
are set. Signed-off-by: Andrew Murray --- drivers/perf/arm_pmu.c | 15 +-- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/drivers/perf/arm_pmu.c b/drivers/perf/arm_pmu.c index 7f01f6f..ea69067 100644 --- a/drivers/perf/arm_pmu.c +++ b/drivers/perf/arm_pmu.c @@ -357,13 +357,6

[PATCH v3 02/12] perf/core: add function to test for event exclusion flags

2018-12-06 Thread Andrew Murray
Add a function that tests if any of the perf event exclusion flags are set on a given event. Signed-off-by: Andrew Murray --- include/linux/perf_event.h | 9 + 1 file changed, 9 insertions(+) diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index 53c500f..b2e806f

[PATCH v3 04/12] alpha: perf/core: use PERF_PMU_CAP_NO_EXCLUDE

2018-12-06 Thread Andrew Murray
-by: Andrew Murray --- arch/alpha/kernel/perf_event.c | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/arch/alpha/kernel/perf_event.c b/arch/alpha/kernel/perf_event.c index 5613aa37..4341ccf 100644 --- a/arch/alpha/kernel/perf_event.c +++ b/arch/alpha/kernel/perf_event.c

[PATCH v3 06/12] arm: perf/core: use PERF_PMU_CAP_NO_EXCLUDE for exclude incapable PMUs

2018-12-06 Thread Andrew Murray
For drivers that do not support context exclusion let's advertise the PERF_PMU_CAP_NO_EXCLUDE capability. This ensures that perf will prevent us from handling events where any exclusion flags are set. Let's also remove the now unnecessary check for exclusion flags. Signed-off-by: Andrew Murray

[PATCH v3 07/12] drivers/perf: perf/core: use PERF_PMU_CAP_NO_EXCLUDE for exclude incapable PMUs

2018-12-06 Thread Andrew Murray
For drivers that do not support context exclusion let's advertise the PERF_PMU_CAP_NO_EXCLUDE capability. This ensures that perf will prevent us from handling events where any exclusion flags are set. Let's also remove the now unnecessary check for exclusion flags. Signed-off-by: Andrew Murray

[PATCH v3 08/12] drivers/perf: perf/core: use PERF_PMU_CAP_NO_EXCLUDE for exclude incapable PMUs

2018-12-06 Thread Andrew Murray
the perf_event_open system call with fallback event attributes that do not fail. Signed-off-by: Andrew Murray --- drivers/perf/qcom_l2_pmu.c | 9 + drivers/perf/qcom_l3_pmu.c | 8 +--- drivers/perf/xgene_pmu.c | 6 +- 3 files changed, 3 insertions(+), 20 deletions(-) diff --git

[PATCH v3 09/12] powerpc: perf/core: use PERF_PMU_CAP_NO_EXCLUDE for exclude incapable PMUs

2018-12-06 Thread Andrew Murray
For PowerPC PMUs that do not support context exclusion let's advertise the PERF_PMU_CAP_NO_EXCLUDE capability. This ensures that perf will prevent us from handling events where any exclusion flags are set. Let's also remove the now unnecessary check for exclusion flags. Signed-off-by: Andrew

[PATCH v3 10/12] x86: perf/core: use PERF_PMU_CAP_NO_EXCLUDE for exclude incapable PMUs

2018-12-06 Thread Andrew Murray
For drivers that do not support context exclusion let's advertise the PERF_PMU_CAP_NOEXCLUDE capability. This ensures that perf will prevent us from handling events where any exclusion flags are set. Let's also remove the now unnecessary check for exclusion flags. Signed-off-by: Andrew Murray

[PATCH v3 11/12] x86: perf/core: use PERF_PMU_CAP_NO_EXCLUDE for exclude incapable PMUs

2018-12-06 Thread Andrew Murray
/iommu and amd/uncore will now also indicate that they do not support exclude_{hv|idle} and intel/uncore that it does not support exclude_{guest|host}. Signed-off-by: Andrew Murray --- arch/x86/events/amd/iommu.c| 6 +- arch/x86/events/amd/uncore.c | 7 ++- arch/x86/events/intel

[PATCH v3 12/12] perf/core: remove unused perf_flags

2018-12-06 Thread Andrew Murray
Now that perf_flags is not used we remove it. Signed-off-by: Andrew Murray --- include/uapi/linux/perf_event.h | 2 -- tools/include/uapi/linux/perf_event.h | 2 -- 2 files changed, 4 deletions(-) diff --git a/include/uapi/linux/perf_event.h b/include/uapi/linux/perf_event.h index

Re: [PATCH 01/10] perf/core: Add macro to test for event exclusion flags

2018-11-23 Thread Andrew Murray
On Tue, Nov 20, 2018 at 10:28:34PM +1100, Michael Ellerman wrote: > Andrew Murray writes: > > > Add a macro that tests if any of the perf event exclusion flags > > are set on a given event. > > > > Signed-off-by: Andrew Murray > > --- > > include/li

Re: [PATCH 09/10] drivers/perf: perf/core: generalise event exclusion checking with perf macro

2018-11-23 Thread Andrew Murray
On Mon, Nov 19, 2018 at 04:03:52PM +, Mark Rutland wrote: > On Fri, Nov 16, 2018 at 10:24:12AM +0000, Andrew Murray wrote: > > Replace checking of perf event exclusion flags with perf macro. > > > > This is a functional change as exclude_host and exclude_guest are added

[PATCH v2 05/20] alpha: perf/core: remove unnecessary checks for exclusion

2018-11-26 Thread Andrew Murray
-by: Andrew Murray --- arch/alpha/kernel/perf_event.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/arch/alpha/kernel/perf_event.c b/arch/alpha/kernel/perf_event.c index 5613aa37..5c17077 100644 --- a/arch/alpha/kernel/perf_event.c +++ b/arch/alpha/kernel/perf_event.c @@ -630,12 +630,6 @@ static

[PATCH v2 06/20] arc: perf/core: advertise PMU exclusion capability

2018-11-26 Thread Andrew Murray
The ARC PMU has the capability to exclude events based on context. Let's advertise that we support the PERF_PMU_CAP_EXCLUDE capability to ensure that perf doesn't prevent us from handling events where any exclusion flags are set. Signed-off-by: Andrew Murray --- arch/arc/kernel/perf_event.c | 1

[PATCH v2 01/20] perf/doc: update design.txt for exclude_{host|guest} flags

2018-11-26 Thread Andrew Murray
Update design.txt to reflect the presence of the exclude_host and exclude_guest perf flags. Signed-off-by: Andrew Murray --- tools/perf/design.txt | 4 1 file changed, 4 insertions(+) diff --git a/tools/perf/design.txt b/tools/perf/design.txt index a28dca2..5b2b23b 100644 --- a/tools/perf

[PATCH v2 00/20] perf/core: Generalise event exclusion checking

2018-11-26 Thread Andrew Murray
to reflect it's a function Andrew Murray (20): perf/doc: update design.txt for exclude_{host|guest} flags perf/core: add function to test for event exclusion flags perf/core: add PERF_PMU_CAP_EXCLUDE for exclusion capable PMUs perf/hw_breakpoint: perf/core: advertise PMU exclusion capability

[PATCH v2 02/20] perf/core: add function to test for event exclusion flags

2018-11-26 Thread Andrew Murray
Add a function that tests if any of the perf event exclusion flags are set on a given event. Signed-off-by: Andrew Murray --- include/linux/perf_event.h | 9 + 1 file changed, 9 insertions(+) diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index 53c500f..b2e806f

[PATCH v2 03/20] perf/core: add PERF_PMU_CAP_EXCLUDE for exclusion capable PMUs

2018-11-26 Thread Andrew Murray
inconsistent. Let's instead allow PMU drivers to advertise their ability to exclude based on context via a new capability: PERF_PMU_CAP_EXCLUDE. This allows the perf core to reject requests for exclusion events where there is no support in the PMU. Signed-off-by: Andrew Murray --- include/linux

[PATCH v2 04/20] perf/hw_breakpoint: perf/core: advertise PMU exclusion capability

2018-11-26 Thread Andrew Murray
The breakpoint PMU has the capability to exclude kernel contexts, let's advertise that we support the PERF_PMU_CAP_EXCLUDE capability so that perf doesn't prevent us from handling events with any exclusion flags set. Signed-off-by: Andrew Murray --- kernel/events/hw_breakpoint.c | 2 ++ 1 file

[PATCH v2 08/20] arm: perf/core: remove unnecessary checks for exclusion

2018-11-26 Thread Andrew Murray
For drivers that do not support context exclusion we do not advertise the PERF_PMU_CAP_EXCLUDE capability. This ensures that perf will prevent us from handling events where any exclusion flags are set. Let's remove the now unnecessary check for exclusion flags. Signed-off-by: Andrew Murray

[PATCH v2 07/20] arm: perf: conditionally advertise PMU exclusion capability

2018-11-26 Thread Andrew Murray
are set. Signed-off-by: Andrew Murray --- drivers/perf/arm_pmu.c | 15 +-- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/drivers/perf/arm_pmu.c b/drivers/perf/arm_pmu.c index 7f01f6f..4409035 100644 --- a/drivers/perf/arm_pmu.c +++ b/drivers/perf/arm_pmu.c @@ -357,13

Re: [PATCH 00/10] perf/core: Generalise event exclusion checking

2018-11-22 Thread Andrew Murray
On Thu, Nov 22, 2018 at 01:26:37PM +0100, Peter Zijlstra wrote: > On Thu, Nov 22, 2018 at 12:21:43PM +0000, Andrew Murray wrote: > > On Mon, Nov 19, 2018 at 02:08:00PM +0100, Peter Zijlstra wrote: > > > > diff --git a/kernel/events/core.c b/kernel/events/core.c >

Re: [PATCH 00/10] perf/core: Generalise event exclusion checking

2018-11-22 Thread Andrew Murray
On Mon, Nov 19, 2018 at 02:08:00PM +0100, Peter Zijlstra wrote: > On Fri, Nov 16, 2018 at 10:24:03AM +0000, Andrew Murray wrote: > > Many PMU drivers do not have the capability to exclude counting events > > that occur in specific contexts such as idle, kernel, guest, etc. Th

Re: [PATCH 10/10] perf/doc: update design.txt for exclude_{host|guest} flags

2018-11-20 Thread Andrew Murray
On Tue, Nov 20, 2018 at 10:31:36PM +1100, Michael Ellerman wrote: > Andrew Murray writes: > > > Update design.txt to reflect the presence of the exclude_host > > and exclude_guest perf flags. > > > > Signed-off-by: Andrew Murray > > --- > > tools/perf/

[PATCH v2 13/20] powerpc: perf/core: advertise PMU exclusion capability

2018-11-26 Thread Andrew Murray
For PowerPC PMUs that have the capability to exclude events based on context. Let's advertise that we support the PERF_PMU_CAP_EXCLUDE capability to ensure that perf doesn't prevent us from handling events where any exclusion flags are set. Signed-off-by: Andrew Murray --- arch/powerpc/perf

[PATCH v2 18/20] x86: perf/core remove unnecessary checks for exclusion

2018-11-26 Thread Andrew Murray
and amd/uncore will now also indicate that they do not support exclude_{hv|idle} and intel/uncore that it does not support exclude_{guest|host}. Signed-off-by: Andrew Murray --- arch/x86/events/amd/iommu.c| 5 - arch/x86/events/amd/uncore.c | 5 - arch/x86/events/intel/uncore.c | 8

[PATCH v2 11/20] drivers/perf: perf/core: advertise PMU exclusion capability

2018-11-26 Thread Andrew Murray
The arm_pse PMU has the capability to exclude events based on context. Let's advertise that we support the PERF_PMU_CAP_EXCLUDE capability to ensure that perf doesn't prevent us from handling events where any exclusion flags are set. Signed-off-by: Andrew Murray --- drivers/perf/arm_spe_pmu.c

[PATCH v2 15/20] s390: perf/events: advertise PMU exclusion capability

2018-11-26 Thread Andrew Murray
The s390 cpum_cf and cpum_sf PMUs have the capability to exclude events based on context. Let's advertise that we support the PERF_PMU_CAP_EXCLUDE capability to ensure that perf doesn't prevent us from handling events where any exclusion flags are set. Signed-off-by: Andrew Murray --- arch/s390

[PATCH v2 19/20] x86: perf/core: advertise PMU exclusion capability

2018-11-26 Thread Andrew Murray
For PMUs that have the capability to exclude events based on context. Let's advertise that we support the PERF_PMU_CAP_EXCLUDE capability to ensure that perf doesn't prevent us from handling events where any exclusion flags are set. Signed-off-by: Andrew Murray --- arch/x86/events/core.c

[PATCH v2 12/20] mips: perf/core: advertise PMU exclusion capability

2018-11-26 Thread Andrew Murray
The MIPS PMU has the capability to exclude events based on context. Let's advertise that we support the PERF_PMU_CAP_EXCLUDE capability to ensure that perf doesn't prevent us from handling events where any exclusion flags are set. Signed-off-by: Andrew Murray --- arch/mips/kernel

[PATCH v2 14/20] powerpc: perf/core: remove unnecessary checks for exclusion

2018-11-26 Thread Andrew Murray
For PowerPC PMUs that do not support context exclusion we do not advertise the PERF_PMU_CAP_EXCLUDE capability. This ensures that perf will prevent us from handling events where any exclusion flags are set. Let's remove the now unnecessary check for exclusion flags. Signed-off-by: Andrew Murray

Re: [PATCH v2 03/20] perf/core: add PERF_PMU_CAP_EXCLUDE for exclusion capable PMUs

2018-11-26 Thread Andrew Murray
On Mon, Nov 26, 2018 at 02:10:24PM +, Robin Murphy wrote: > Hi Andrew, > > On 26/11/2018 11:12, Andrew Murray wrote: > > Many PMU drivers do not have the capability to exclude counting events > > that occur in specific contexts such as idle, kernel, guest, etc. These

[PATCH v2 09/20] drivers/perf: perf/core: remove unnecessary checks for exclusion

2018-11-26 Thread Andrew Murray
For drivers that do not support context exclusion we do not advertise the PERF_PMU_CAP_EXCLUDE capability. This ensures that perf will prevent us from handling events where any exclusion flags are set. Let's remove the now unnecessary check for exclusion flags. Signed-off-by: Andrew Murray

[PATCH v2 17/20] x86: perf/core: remove unnecessary checks for exclusion

2018-11-26 Thread Andrew Murray
For drivers that do not support context exclusion we do not advertise the PERF_PMU_CAP_EXCLUDE capability. This ensures that perf will prevent us from handling events where any exclusion flags are set. Let's remove the now unnecessary check for exclusion flags. Signed-off-by: Andrew Murray

[PATCH v2 10/20] drivers/perf: perf/core: remove unnecessary checks for exclusion

2018-11-26 Thread Andrew Murray
the perf_event_open system call with fallback event attributes that do not fail. Signed-off-by: Andrew Murray --- drivers/perf/qcom_l2_pmu.c | 8 drivers/perf/qcom_l3_pmu.c | 7 --- drivers/perf/xgene_pmu.c | 5 - 3 files changed, 20 deletions(-) diff --git a/drivers/perf/qcom_l2_pmu.c

[PATCH v2 16/20] sparc: perf/core: advertise PMU exclusion capability

2018-11-26 Thread Andrew Murray
The SPARC PMU has the capability to exclude events based on context - let's advertise that we support the PERF_PMU_CAP_EXCLUDE capability to ensure that perf doesn't prevent us from handling events where any exclusion flags are set. Signed-off-by: Andrew Murray --- arch/sparc/kernel

[PATCH v2 20/20] perf/core: remove unused perf_flags

2018-11-26 Thread Andrew Murray
Now that perf_flags is not used we remove it. Signed-off-by: Andrew Murray --- include/uapi/linux/perf_event.h | 2 -- tools/include/uapi/linux/perf_event.h | 2 -- 2 files changed, 4 deletions(-) diff --git a/include/uapi/linux/perf_event.h b/include/uapi/linux/perf_event.h index

[PATCH v5 01/12] perf/doc: update design.txt for exclude_{host|guest} flags

2019-01-10 Thread Andrew Murray
Update design.txt to reflect the presence of the exclude_host and exclude_guest perf flags. Signed-off-by: Andrew Murray --- tools/perf/design.txt | 4 1 file changed, 4 insertions(+) diff --git a/tools/perf/design.txt b/tools/perf/design.txt index a28dca2..0453ba2 100644 --- a/tools/perf

[PATCH v5 04/12] alpha: perf/core: strengthen exclude checks with PERF_PMU_CAP_NO_EXCLUDE

2019-01-10 Thread Andrew Murray
-by: Andrew Murray --- arch/alpha/kernel/perf_event.c | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/arch/alpha/kernel/perf_event.c b/arch/alpha/kernel/perf_event.c index 5613aa37..4341ccf 100644 --- a/arch/alpha/kernel/perf_event.c +++ b/arch/alpha/kernel/perf_event.c

[PATCH v5 07/12] drivers/perf: perf/core: use PERF_PMU_CAP_NO_EXCLUDE for exclude incapable PMUs

2019-01-10 Thread Andrew Murray
For drivers that do not support context exclusion let's advertise the PERF_PMU_CAP_NO_EXCLUDE capability. This ensures that perf will prevent us from handling events where any exclusion flags are set. Let's also remove the now unnecessary check for exclusion flags. Signed-off-by: Andrew Murray

[PATCH v5 06/12] arm: perf/core: use PERF_PMU_CAP_NO_EXCLUDE for exclude incapable PMUs

2019-01-10 Thread Andrew Murray
For drivers that do not support context exclusion let's advertise the PERF_PMU_CAP_NO_EXCLUDE capability. This ensures that perf will prevent us from handling events where any exclusion flags are set. Let's also remove the now unnecessary check for exclusion flags. Signed-off-by: Andrew Murray

[PATCH v5 08/12] drivers/perf: perf/core: strengthen exclude checks with PERF_PMU_CAP_NO_EXCLUDE

2019-01-10 Thread Andrew Murray
the perf_event_open system call with fallback event attributes that do not fail. Signed-off-by: Andrew Murray Acked-by: Will Deacon --- drivers/perf/qcom_l2_pmu.c | 9 + drivers/perf/qcom_l3_pmu.c | 8 +--- drivers/perf/xgene_pmu.c | 6 +- 3 files changed, 3 insertions(+), 20

[PATCH v5 12/12] perf/core: remove unused perf_flags

2019-01-10 Thread Andrew Murray
Now that perf_flags is not used we remove it. Signed-off-by: Andrew Murray --- include/uapi/linux/perf_event.h | 2 -- tools/include/uapi/linux/perf_event.h | 2 -- 2 files changed, 4 deletions(-) diff --git a/include/uapi/linux/perf_event.h b/include/uapi/linux/perf_event.h index

[PATCH v5 00/12] perf/core: Generalise event exclusion checking

2019-01-10 Thread Andrew Murray
additional information to tools/perf/design.txt - Rename event_has_exclude_flags to event_has_any_exclude_flag and update commit log to reflect it's a function Andrew Murray (12): perf/doc: update design.txt for exclude_{host|guest} flags perf/core: add function to test for event exclusion flags

[PATCH v5 03/12] perf/core: add PERF_PMU_CAP_NO_EXCLUDE for exclusion incapable PMUs

2019-01-10 Thread Andrew Murray
inconsistent. Let's instead allow PMU drivers to advertise their inability to exclude based on context via a new capability: PERF_PMU_CAP_NO_EXCLUDE. This allows the perf core to reject requests for exclusion events where there is no support in the PMU. Signed-off-by: Andrew Murray --- include/linux

[PATCH v5 05/12] arm: perf: conditionally use PERF_PMU_CAP_NO_EXCLUDE

2019-01-10 Thread Andrew Murray
are set. Where an ARM PMU driver has the set_event_filter function implemented, we rely on it to perform exclusion checks. At present some of these functions do not test for all of the available exclude flags. Signed-off-by: Andrew Murray Acked-by: Will Deacon --- drivers/perf/arm_pmu.c | 15

[PATCH v5 09/12] powerpc: perf/core: use PERF_PMU_CAP_NO_EXCLUDE for exclude incapable PMUs

2019-01-10 Thread Andrew Murray
For PowerPC PMUs that do not support context exclusion let's advertise the PERF_PMU_CAP_NO_EXCLUDE capability. This ensures that perf will prevent us from handling events where any exclusion flags are set. Let's also remove the now unnecessary check for exclusion flags. Signed-off-by: Andrew

[PATCH v5 10/12] x86: perf/core: use PERF_PMU_CAP_NO_EXCLUDE for exclude incapable PMUs

2019-01-10 Thread Andrew Murray
at least one exclude flag won't have the PERF_PMU_CAP_NOEXCLUDE capability set - these PMU drivers should still check and fail on unsupported exclude flags. These missing tests are not added in this patch. Signed-off-by: Andrew Murray --- arch/x86/events/amd/ibs.c | 13 + arch/x86

[PATCH v5 02/12] perf/core: add function to test for event exclusion flags

2019-01-10 Thread Andrew Murray
Add a function that tests if any of the perf event exclusion flags are set on a given event. Signed-off-by: Andrew Murray --- include/linux/perf_event.h | 9 + 1 file changed, 9 insertions(+) diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index 1d5c551..54a78d2

[PATCH v5 11/12] x86: perf/core: strengthen exclude checks with PERF_PMU_CAP_NO_EXCLUDE

2019-01-10 Thread Andrew Murray
/iommu and amd/uncore will now also indicate that they do not support exclude_{hv|idle} and intel/uncore that it does not support exclude_{guest|host}. Signed-off-by: Andrew Murray --- arch/x86/events/amd/iommu.c| 6 +- arch/x86/events/amd/uncore.c | 7 ++- arch/x86/events/intel

[PATCH v4 08/13] drivers/perf: perf/core: use PERF_PMU_CAP_NO_EXCLUDE for exclude incapable PMUs

2019-01-07 Thread Andrew Murray
the perf_event_open system call with fallback event attributes that do not fail. Signed-off-by: Andrew Murray Acked-by: Will Deacon --- drivers/perf/qcom_l2_pmu.c | 9 + drivers/perf/qcom_l3_pmu.c | 8 +--- drivers/perf/xgene_pmu.c | 6 +- 3 files changed, 3 insertions(+), 20

  1   2   >