From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: qemu-devel@nongnu.org
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
"Alex Bennée" <alex.bennee@linaro.org>,
"Alexander Graf" <agraf@csgraf.de>,
qemu-arm@nongnu.org,
"Pierrick Bouvier" <pierrick.bouvier@linaro.org>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: [PATCH 3/6] target/arm: Better describe PMU depends on TCG or HVF
Date: Mon, 30 Jun 2025 15:09:34 +0200 [thread overview]
Message-ID: <20250630130937.3487-4-philmd@linaro.org> (raw)
In-Reply-To: <20250630130937.3487-1-philmd@linaro.org>
Simplify PMU logic by rewriting '!KVM' as 'TCG || HVF'
(ignoring QTest, because vCPUs are not available there).
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
target/arm/cpu.c | 2 +-
target/arm/machine.c | 10 +++++-----
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/target/arm/cpu.c b/target/arm/cpu.c
index b6a8ba83a46..0311ff315fe 100644
--- a/target/arm/cpu.c
+++ b/target/arm/cpu.c
@@ -2352,7 +2352,7 @@ static void arm_cpu_realizefn(DeviceState *dev, Error **errp)
if (arm_feature(env, ARM_FEATURE_PMU)) {
pmu_init(cpu);
- if (!kvm_enabled()) {
+ if (tcg_enabled() || hvf_enabled()) {
arm_register_pre_el_change_hook(cpu, &pmu_pre_el_change, 0);
arm_register_el_change_hook(cpu, &pmu_post_el_change, 0);
}
diff --git a/target/arm/machine.c b/target/arm/machine.c
index e442d485241..baa7ad25ca9 100644
--- a/target/arm/machine.c
+++ b/target/arm/machine.c
@@ -1,7 +1,7 @@
#include "qemu/osdep.h"
#include "cpu.h"
#include "qemu/error-report.h"
-#include "system/kvm.h"
+#include "system/hvf.h"
#include "system/tcg.h"
#include "kvm_arm.h"
#include "internals.h"
@@ -853,7 +853,7 @@ static int cpu_pre_save(void *opaque)
{
ARMCPU *cpu = opaque;
- if (!kvm_enabled()) {
+ if (tcg_enabled() || hvf_enabled()) {
pmu_op_start(&cpu->env);
}
@@ -888,7 +888,7 @@ static int cpu_post_save(void *opaque)
{
ARMCPU *cpu = opaque;
- if (!kvm_enabled()) {
+ if (tcg_enabled() || hvf_enabled()) {
pmu_op_finish(&cpu->env);
}
@@ -921,7 +921,7 @@ static int cpu_pre_load(void *opaque)
*/
env->irq_line_state = UINT32_MAX;
- if (!kvm_enabled()) {
+ if (tcg_enabled() || hvf_enabled()) {
pmu_op_start(env);
}
@@ -1013,7 +1013,7 @@ static int cpu_post_load(void *opaque, int version_id)
}
}
- if (!kvm_enabled()) {
+ if (tcg_enabled() || hvf_enabled()) {
pmu_op_finish(env);
}
--
2.49.0
next prev parent reply other threads:[~2025-06-30 13:09 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-30 13:09 [PATCH 0/6] target/arm: Few accel cleanups Philippe Mathieu-Daudé
2025-06-30 13:09 ` [PATCH 1/6] target/arm: Only set CPU_INTERRUPT_EXITTB for TCG Philippe Mathieu-Daudé
2025-06-30 13:49 ` Richard Henderson
2025-06-30 16:48 ` Pierrick Bouvier
2025-06-30 13:09 ` [PATCH 2/6] target/arm: Only allow disabling NEON when using TCG Philippe Mathieu-Daudé
2025-06-30 13:51 ` Richard Henderson
2025-06-30 16:49 ` Pierrick Bouvier
2025-07-04 13:03 ` Peter Maydell
2025-07-04 13:17 ` Philippe Mathieu-Daudé
2025-07-04 13:32 ` Peter Maydell
2025-06-30 13:09 ` Philippe Mathieu-Daudé [this message]
2025-06-30 17:03 ` [PATCH 3/6] target/arm: Better describe PMU depends on TCG or HVF Pierrick Bouvier
2025-06-30 17:03 ` Pierrick Bouvier
2025-06-30 13:09 ` [PATCH 4/6] target/arm: Re-use arm_is_psci_call() in HVF Philippe Mathieu-Daudé
2025-06-30 13:52 ` Richard Henderson
2025-06-30 16:50 ` Pierrick Bouvier
2025-06-30 13:09 ` [PATCH 5/6] target/arm: Share ARM_PSCI_CALL trace event between TCG and HVF Philippe Mathieu-Daudé
2025-06-30 13:53 ` Richard Henderson
2025-06-30 15:36 ` Philippe Mathieu-Daudé
2025-06-30 16:53 ` Pierrick Bouvier
2025-07-04 13:14 ` Peter Maydell
2025-07-07 14:02 ` Stefan Hajnoczi
2025-07-07 14:12 ` Peter Maydell
2025-07-07 14:08 ` Daniel P. Berrangé
2025-06-30 13:09 ` [PATCH 6/6] target/arm: Allow arm_cpu_tlb_fill_align optionally set CPUTLBEntryFull Philippe Mathieu-Daudé
2025-06-30 13:56 ` Richard Henderson
2025-06-30 15:35 ` Philippe Mathieu-Daudé
2025-06-30 17:00 ` Pierrick Bouvier
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=20250630130937.3487-4-philmd@linaro.org \
--to=philmd@linaro.org \
--cc=agraf@csgraf.de \
--cc=alex.bennee@linaro.org \
--cc=peter.maydell@linaro.org \
--cc=pierrick.bouvier@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.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.