All of lore.kernel.org
 help / color / mirror / Atom feed
From: Suzuki.Poulose@arm.com (Suzuki K. Poulose)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 3/6] arm64/perf: Filter common events based on PMCEIDn_EL0
Date: Thu, 24 Mar 2016 15:28:25 +0000	[thread overview]
Message-ID: <56F40799.1030409@arm.com> (raw)
In-Reply-To: <1458823960-32760-4-git-send-email-ashoks@broadcom.com>

On 24/03/16 12:52, Ashok Kumar wrote:
> The complete common architectural and micro-architectural
> event number structure is filtered based on PMCEIDn_EL0 and
> copied to a new structure which is exposed to /sys
>
> The function which derives event bitmap from PMCEIDn_EL0 is
> executed in the cpus, which has the pmu being initialized,
> for heterogeneous pmu support.
>
> Enforced armv8_pmuv3_event_attrs array for event number
> ordering as this is indexed with event number now.
>
> Signed-off-by: Ashok Kumar <ashoks@broadcom.com>
> ---
>   arch/arm64/kernel/perf_event.c | 281 ++++++++++++++++++++++++++++-------------
>   1 file changed, 195 insertions(+), 86 deletions(-)
>

> +static inline u32 armv8pmu_pmceidn_read(int reg)
> +{
> +	u32 val = 0;
> +
> +	if (reg == 0)
> +		asm volatile("mrs %0, pmceid0_el0" : "=r" (val));
> +	else if (reg == 1)
> +		asm volatile("mrs %0, pmceid1_el0" : "=r" (val));
> +
> +	return val;
> +}

> +	reg[0] = armv8pmu_pmceidn_read(0);
> +	reg[1] = armv8pmu_pmceidn_read(1);

Could we not add definitions for SYS_PMCEID0_EL0 and SYS_PMCEID1_EL0
in asm/sysreg.h and simply do

reg[0] = read_cpuid(SYS_PMCEID0_EL0);
reg[1] = read_cpuid(SYS_PMCEID1_EL0);

?

Thanks
Suzuki

  reply	other threads:[~2016-03-24 15:28 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-24 12:52 [PATCH v2 0/6] arm64: perf: Broadcom Vulcan PMU support Ashok Kumar
2016-03-24 12:52 ` [PATCH v2 1/6] arm64/perf: Changed events naming as per ARM ARM Ashok Kumar
2016-03-24 12:52 ` [PATCH v2 2/6] arm64/perf: Define complete ARMv8 recommended implementation defined events Ashok Kumar
2016-03-24 12:52 ` [PATCH v2 3/6] arm64/perf: Filter common events based on PMCEIDn_EL0 Ashok Kumar
2016-03-24 15:28   ` Suzuki K. Poulose [this message]
2016-03-28 12:31     ` Ashok Sekar
2016-03-24 16:14   ` Mark Rutland
2016-03-28 12:25     ` Ashok Sekar
2016-03-24 12:52 ` [PATCH v2 4/6] arm64/perf: Add Broadcom Vulcan PMU support Ashok Kumar
2016-03-24 12:52 ` [PATCH v2 5/6] arm64: dts: Add Broadcom Vulcan PMU in dts Ashok Kumar
2016-03-24 12:52 ` [PATCH v2 6/6] Documentation: arm64: pmu: Add Broadcom Vulcan PMU binding Ashok Kumar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56F40799.1030409@arm.com \
    --to=suzuki.poulose@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.