From: Michael Ellerman <mpe@ellerman•id.au>
To: Nicholas Piggin <npiggin@gmail•com>, linuxppc-dev@lists•ozlabs.org
Cc: Athira Rajeev <atrajeev@linux•vnet.ibm.com>,
Madhavan Srinivasan <maddy@linux•ibm.com>,
Nicholas Piggin <npiggin@gmail•com>
Subject: Re: [PATCH v1 2/4] powerpc/64s/perf: add power_pmu_running to query whether perf is being used
Date: Tue, 17 Aug 2021 23:42:05 +1000 [thread overview]
Message-ID: <87y290fas2.fsf@mpe.ellerman.id.au> (raw)
In-Reply-To: <20210816072953.1165964-3-npiggin@gmail.com>
Nicholas Piggin <npiggin@gmail•com> writes:
> Interrupt handling code would like to know whether perf is enabled, to
> know whether it should enable MSR[EE] to improve PMI coverage.
>
> Cc: Madhavan Srinivasan <maddy@linux•ibm.com>
> Cc: Athira Rajeev <atrajeev@linux•vnet.ibm.com>
> Signed-off-by: Nicholas Piggin <npiggin@gmail•com>
> ---
> arch/powerpc/include/asm/hw_irq.h | 2 ++
> arch/powerpc/perf/core-book3s.c | 13 +++++++++++++
> 2 files changed, 15 insertions(+)
>
> diff --git a/arch/powerpc/include/asm/hw_irq.h b/arch/powerpc/include/asm/hw_irq.h
> index 21cc571ea9c2..2d5c0d3ccbb6 100644
> --- a/arch/powerpc/include/asm/hw_irq.h
> +++ b/arch/powerpc/include/asm/hw_irq.h
> @@ -306,6 +306,8 @@ static inline bool lazy_irq_pending_nocheck(void)
> return __lazy_irq_pending(local_paca->irq_happened);
> }
>
> +bool power_pmu_running(void);
> +
> /*
> * This is called by asynchronous interrupts to conditionally
> * re-enable hard interrupts after having cleared the source
> diff --git a/arch/powerpc/perf/core-book3s.c b/arch/powerpc/perf/core-book3s.c
> index bb0ee716de91..76114a9afb2b 100644
> --- a/arch/powerpc/perf/core-book3s.c
> +++ b/arch/powerpc/perf/core-book3s.c
> @@ -2380,6 +2380,19 @@ static void perf_event_interrupt(struct pt_regs *regs)
> perf_sample_event_took(sched_clock() - start_clock);
> }
>
> +bool power_pmu_running(void)
> +{
> + struct cpu_hw_events *cpuhw;
> +
> + /* Could this simply test local_paca->pmcregs_in_use? */
I think it could, except that it's under an ifdef:
#ifdef CONFIG_KVM_BOOK3S_HV_POSSIBLE
u8 pmcregs_in_use; /* pseries puts this in lppaca */
#endif
cheers
next prev parent reply other threads:[~2021-08-17 13:42 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-16 7:29 [PATCH v1 0/4] powerpc/64s: interrupt speedups Nicholas Piggin
2021-08-16 7:29 ` [PATCH v1 1/4] powerpc/64: handle MSR EE and RI in interrupt entry wrapper Nicholas Piggin
2021-08-16 7:29 ` [PATCH v1 2/4] powerpc/64s/perf: add power_pmu_running to query whether perf is being used Nicholas Piggin
2021-08-16 18:19 ` kernel test robot
2021-08-17 13:06 ` Madhavan Srinivasan
2021-08-18 11:41 ` Nicholas Piggin
2021-08-18 12:14 ` Athira Rajeev
2021-08-17 13:42 ` Michael Ellerman [this message]
2021-08-16 7:29 ` [PATCH v1 3/4] powerpc/64s/interrupt: Don't enable MSR[EE] in irq handlers unless perf is in use Nicholas Piggin
2021-08-16 7:29 ` [PATCH v1 4/4] powerpc/64s/interrupt: avoid saving CFAR in some asynchronous interrupts Nicholas Piggin
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=87y290fas2.fsf@mpe.ellerman.id.au \
--to=mpe@ellerman$(echo .)id.au \
--cc=atrajeev@linux$(echo .)vnet.ibm.com \
--cc=linuxppc-dev@lists$(echo .)ozlabs.org \
--cc=maddy@linux$(echo .)ibm.com \
--cc=npiggin@gmail$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox