On 6/30/25 6:09 AM, Philippe Mathieu-Daudé wrote:
It is useful to compare PSCI calls of the same guest running
under TCG or HVF.
Signed-off-by: Philippe Mathieu-Daudé <phi...@linaro.org>
---
target/arm/hvf/hvf.c | 3 ++-
target/arm/tcg/psci.c | 3 +++
target/arm/trace-events | 3 +++
3 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/target/arm/hvf/hvf.c b/target/arm/hvf/hvf.c
index 7a99118c8c2..6309c5b872e 100644
--- a/target/arm/hvf/hvf.c
+++ b/target/arm/hvf/hvf.c
@@ -34,6 +34,7 @@
#include "target/arm/multiprocessing.h"
#include "target/arm/gtimer.h"
#include "trace.h"
+#include "../trace.h"
#include "migration/vmstate.h"
#include "gdbstub/enums.h"
@@ -1149,7 +1150,7 @@ static bool hvf_handle_psci_call(CPUState *cpu)
int target_el = 1;
int32_t ret = 0;
- trace_hvf_psci_call(param[0], param[1], param[2], param[3],
+ trace_arm_psci_call(param[0], param[1], param[2], param[3],
arm_cpu_mp_affinity(arm_cpu));
switch (param[0]) {
diff --git a/target/arm/tcg/psci.c b/target/arm/tcg/psci.c
index cabed43e8a8..8df27ca123e 100644
--- a/target/arm/tcg/psci.c
+++ b/target/arm/tcg/psci.c
@@ -25,6 +25,7 @@
#include "internals.h"
#include "arm-powerctl.h"
#include "target/arm/multiprocessing.h"
+#include "../trace.h"
bool arm_is_psci_call(ARMCPU *cpu, int excp_type)
{
@@ -79,6 +80,8 @@ void arm_handle_psci_call(ARMCPU *cpu)
*/
param[i] = is_a64(env) ? env->xregs[i] : env->regs[i];
}
+ trace_arm_psci_call(param[0], param[1], param[2], param[3],
+ arm_cpu_mp_affinity(cpu));
if ((param[0] & QEMU_PSCI_0_2_64BIT) && !is_a64(env)) {
ret = QEMU_PSCI_RET_NOT_SUPPORTED;
diff --git a/target/arm/trace-events b/target/arm/trace-events
index 4438dce7bec..a9cb5e0f5c6 100644
--- a/target/arm/trace-events
+++ b/target/arm/trace-events
@@ -13,3 +13,6 @@ arm_gt_update_irq(int timer, int irqstate) "gt_update_irq: timer
%d irqstate %d"
# kvm.c
kvm_arm_fixup_msi_route(uint64_t iova, uint64_t gpa) "MSI iova = 0x%"PRIx64" is
translated into 0x%"PRIx64
+
+# tcg/psci.c and hvf/hvf.c
+arm_psci_call(uint64_t x0, uint64_t x1, uint64_t x2, uint64_t x3, uint32_t cpuid) "PSCI Call x0=0x%016"PRIx64"
x1=0x%016"PRIx64" x2=0x%016"PRIx64" x3=0x%016"PRIx64" cpuid=0x%x"
Just a nit, using 'target/arm/trace.h' might be more readable than
'../trace.h'.
Reviewed-by: Pierrick Bouvier <pierrick.bouv...@linaro.org>