qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: qemu-devel@nongnu.org
Cc: "Claudio Fontana" <cfontana@suse.de>,
	"Cameron Esfahani" <dirty@apple.com>,
	"Mohamed Mediouni" <mohamed@unpredictable.fr>,
	"Alexander Graf" <agraf@csgraf.de>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	kvm@vger.kernel.org, "Eric Auger" <eric.auger@redhat.com>,
	qemu-arm@nongnu.org, "Mads Ynddal" <mads@ynddal.dk>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"Alex Bennée" <alex.bennee@linaro.org>,
	"Peter Maydell" <peter.maydell@linaro.org>,
	"Miguel Luis" <miguel.luis@oracle.com>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: [PATCH v2 04/10] target/arm: Factor hvf_psci_get_target_el() out
Date: Tue, 12 Aug 2025 19:28:16 +0200	[thread overview]
Message-ID: <20250812172823.86329-5-philmd@linaro.org> (raw)
In-Reply-To: <20250812172823.86329-1-philmd@linaro.org>

From: Mohamed Mediouni <mohamed@unpredictable.fr>

Factor hvf_psci_get_target_el() out so it will be easier
to allow switching to other EL later.

Signed-off-by: Mohamed Mediouni <mohamed@unpredictable.fr>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
---
 target/arm/hvf/hvf.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/target/arm/hvf/hvf.c b/target/arm/hvf/hvf.c
index 47b0cd3a351..48e86e62945 100644
--- a/target/arm/hvf/hvf.c
+++ b/target/arm/hvf/hvf.c
@@ -1107,6 +1107,10 @@ static void hvf_psci_cpu_off(ARMCPU *arm_cpu)
     assert(ret == QEMU_ARM_POWERCTL_RET_SUCCESS);
 }
 
+static int hvf_psci_get_target_el(CPUARMState *env)
+{
+    return 1;
+}
 /*
  * Handle a PSCI call.
  *
@@ -1128,7 +1132,6 @@ static bool hvf_handle_psci_call(CPUState *cpu)
     CPUState *target_cpu_state;
     ARMCPU *target_cpu;
     target_ulong entry;
-    int target_el = 1;
     int32_t ret = 0;
 
     trace_hvf_psci_call(param[0], param[1], param[2], param[3],
@@ -1182,7 +1185,7 @@ static bool hvf_handle_psci_call(CPUState *cpu)
         entry = param[2];
         context_id = param[3];
         ret = arm_set_cpu_on(mpidr, entry, context_id,
-                             target_el, target_aarch64);
+                             hvf_psci_get_target_el(env), target_aarch64);
         break;
     case QEMU_PSCI_0_1_FN_CPU_OFF:
     case QEMU_PSCI_0_2_FN_CPU_OFF:
-- 
2.49.0



  parent reply	other threads:[~2025-08-12 17:29 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-12 17:28 [RFC PATCH v2 00/10] target/arm: Introduce host_cpu_feature_supported() API Philippe Mathieu-Daudé
2025-08-12 17:28 ` [PATCH v2 01/10] accel/system: Introduce hwaccel_enabled() helper Philippe Mathieu-Daudé
2025-08-12 17:28 ` [PATCH v2 02/10] target/arm: Use generic hwaccel_enabled() to check 'host' cpu type Philippe Mathieu-Daudé
2025-08-12 17:28 ` [PATCH v2 03/10] target/arm: Restrict PMU to system mode Philippe Mathieu-Daudé
2025-08-12 17:28 ` Philippe Mathieu-Daudé [this message]
2025-08-12 17:31 ` [RFC PATCH v2 05/10] target/arm: Introduce host_cpu_feature_supported() Philippe Mathieu-Daudé
2025-08-12 17:31   ` [RFC PATCH v2 06/10] target/arm: Replace kvm_arm_pmu_supported by host_cpu_feature_supported Philippe Mathieu-Daudé
2025-08-12 22:23     ` Richard Henderson
2025-08-12 17:31   ` [RFC PATCH v2 07/10] target/arm: Replace kvm_arm_el2_supported " Philippe Mathieu-Daudé
2025-08-12 22:27     ` Richard Henderson
2025-08-12 22:22   ` [RFC PATCH v2 05/10] target/arm: Introduce host_cpu_feature_supported() Richard Henderson
2025-08-12 17:31 ` [RFC PATCH v2 08/10] target/arm/hvf: Sync registers used at EL2 Philippe Mathieu-Daudé
2025-08-12 17:31   ` [RFC PATCH v2 09/10] target/arm/hvf: Consider EL2 acceleration for Silicon M3+ chipsets Philippe Mathieu-Daudé
2025-08-12 22:32     ` Richard Henderson
2025-08-12 22:31   ` [RFC PATCH v2 08/10] target/arm/hvf: Sync registers used at EL2 Richard Henderson
2025-08-13  7:20     ` Philippe Mathieu-Daudé
2025-08-13  7:35       ` Richard Henderson
2025-08-12 17:32 ` [RFC PATCH v2 10/10] target/arm/hvf: Allow EL2/EL3 emulation on Silicon M1 / M2 Philippe Mathieu-Daudé
2025-08-12 22:34   ` Richard Henderson
2025-08-13  6:08     ` Philippe Mathieu-Daudé

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=20250812172823.86329-5-philmd@linaro.org \
    --to=philmd@linaro.org \
    --cc=agraf@csgraf.de \
    --cc=alex.bennee@linaro.org \
    --cc=cfontana@suse.de \
    --cc=dirty@apple.com \
    --cc=eric.auger@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=mads@ynddal.dk \
    --cc=miguel.luis@oracle.com \
    --cc=mohamed@unpredictable.fr \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).