From: Shaoqin Huang <shahuang@redhat.com>
To: Raghavendra Rao Ananta <rananta@google.com>,
Oliver Upton <oliver.upton@linux.dev>,
Marc Zyngier <maz@kernel.org>
Cc: James Morse <james.morse@arm.com>,
Suzuki K Poulose <suzuki.poulose@arm.com>,
Paolo Bonzini <pbonzini@redhat.com>,
Zenghui Yu <yuzenghui@huawei.com>,
linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev,
linux-kernel@vger.kernel.org, kvm@vger.kernel.org
Subject: Re: [PATCH] KVM: selftests: aarch64: Remove unused functions from vpmu test
Date: Thu, 23 Nov 2023 14:43:15 +0800 [thread overview]
Message-ID: <d5cc3cf1-7b39-9ca3-adf2-224007c751fe@redhat.com> (raw)
In-Reply-To: <20231122221526.2750966-1-rananta@google.com>
Hi Raghavendra,
Those functions might be useful for other pmu tests. Recently I just
wrote a pmu_event_filter_test[1] and use the enable_counter().
There may have more pmu tests which can use the helper functions, so I
think we can keep it now. And in my series[1], I have moved them into
the lib/ as the helper function.
[1]https://lore.kernel.org/all/20231123063750.2176250-1-shahuang@redhat.com/
Thanks,
Shaoqin
On 11/23/23 06:15, Raghavendra Rao Ananta wrote:
> vpmu_counter_access's disable_counter() carries a bug that disables
> all the counters that are enabled, instead of just the requested one.
> Fortunately, it's not an issue as there are no callers of it. Hence,
> instead of fixing it, remove the definition entirely.
>
> Remove enable_counter() as it's unused as well.
>
> Signed-off-by: Raghavendra Rao Ananta <rananta@google.com>
> ---
> .../selftests/kvm/aarch64/vpmu_counter_access.c | 16 ----------------
> 1 file changed, 16 deletions(-)
>
> diff --git a/tools/testing/selftests/kvm/aarch64/vpmu_counter_access.c b/tools/testing/selftests/kvm/aarch64/vpmu_counter_access.c
> index 5ea78986e665f..e2f0b720cbfcf 100644
> --- a/tools/testing/selftests/kvm/aarch64/vpmu_counter_access.c
> +++ b/tools/testing/selftests/kvm/aarch64/vpmu_counter_access.c
> @@ -94,22 +94,6 @@ static inline void write_sel_evtyper(int sel, unsigned long val)
> isb();
> }
>
> -static inline void enable_counter(int idx)
> -{
> - uint64_t v = read_sysreg(pmcntenset_el0);
> -
> - write_sysreg(BIT(idx) | v, pmcntenset_el0);
> - isb();
> -}
> -
> -static inline void disable_counter(int idx)
> -{
> - uint64_t v = read_sysreg(pmcntenset_el0);
> -
> - write_sysreg(BIT(idx) | v, pmcntenclr_el0);
> - isb();
> -}
> -
> static void pmu_disable_reset(void)
> {
> uint64_t pmcr = read_sysreg(pmcr_el0);
next prev parent reply other threads:[~2023-11-23 6:43 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-22 22:15 [PATCH] KVM: selftests: aarch64: Remove unused functions from vpmu test Raghavendra Rao Ananta
2023-11-23 2:51 ` Zenghui Yu
2023-11-23 6:43 ` Shaoqin Huang [this message]
2023-11-27 21:41 ` Raghavendra Rao Ananta
2024-02-29 6:37 ` Oliver Upton
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=d5cc3cf1-7b39-9ca3-adf2-224007c751fe@redhat.com \
--to=shahuang@redhat.com \
--cc=james.morse@arm.com \
--cc=kvm@vger.kernel.org \
--cc=kvmarm@lists.linux.dev \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maz@kernel.org \
--cc=oliver.upton@linux.dev \
--cc=pbonzini@redhat.com \
--cc=rananta@google.com \
--cc=suzuki.poulose@arm.com \
--cc=yuzenghui@huawei.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox