From: Richard Henderson <richard.henderson@linaro.org>
To: Pierrick Bouvier <pierrick.bouvier@linaro.org>, qemu-devel@nongnu.org
Cc: "Paolo Bonzini" <pbonzini@redhat.com>,
qemu-arm@nongnu.org, anjo@rev.ng, kvm@vger.kernel.org,
"Peter Maydell" <peter.maydell@linaro.org>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
alex.bennee@linaro.org
Subject: Re: [PATCH v4 38/40] target/arm/machine: move cpu_post_load kvm bits to kvm_arm_cpu_post_load function
Date: Sun, 4 May 2025 09:22:04 -0700 [thread overview]
Message-ID: <2d9560be-1120-42f9-85db-69b8407c49b8@linaro.org> (raw)
In-Reply-To: <20250504052914.3525365-39-pierrick.bouvier@linaro.org>
On 5/3/25 22:29, Pierrick Bouvier wrote:
> Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
> ---
> target/arm/kvm_arm.h | 4 +++-
> target/arm/kvm.c | 13 ++++++++++++-
> target/arm/machine.c | 8 +-------
> 3 files changed, 16 insertions(+), 9 deletions(-)
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
r~
>
> diff --git a/target/arm/kvm_arm.h b/target/arm/kvm_arm.h
> index d156c790b66..00fc82db711 100644
> --- a/target/arm/kvm_arm.h
> +++ b/target/arm/kvm_arm.h
> @@ -83,8 +83,10 @@ void kvm_arm_cpu_pre_save(ARMCPU *cpu);
> * @cpu: ARMCPU
> *
> * Called from cpu_post_load() to update KVM CPU state from the cpreg list.
> + *
> + * Returns: true on success, or false if write_list_to_kvmstate failed.
> */
> -void kvm_arm_cpu_post_load(ARMCPU *cpu);
> +bool kvm_arm_cpu_post_load(ARMCPU *cpu);
>
> /**
> * kvm_arm_reset_vcpu:
> diff --git a/target/arm/kvm.c b/target/arm/kvm.c
> index 8f68aa10298..8132f2345c5 100644
> --- a/target/arm/kvm.c
> +++ b/target/arm/kvm.c
> @@ -977,13 +977,24 @@ void kvm_arm_cpu_pre_save(ARMCPU *cpu)
> }
> }
>
> -void kvm_arm_cpu_post_load(ARMCPU *cpu)
> +bool kvm_arm_cpu_post_load(ARMCPU *cpu)
> {
> + if (!write_list_to_kvmstate(cpu, KVM_PUT_FULL_STATE)) {
> + return false;
> + }
> + /* Note that it's OK for the TCG side not to know about
> + * every register in the list; KVM is authoritative if
> + * we're using it.
> + */
> + write_list_to_cpustate(cpu);
> +
> /* KVM virtual time adjustment */
> if (cpu->kvm_adjvtime) {
> cpu->kvm_vtime = *kvm_arm_get_cpreg_ptr(cpu, KVM_REG_ARM_TIMER_CNT);
> cpu->kvm_vtime_dirty = true;
> }
> +
> + return true;
> }
>
> void kvm_arm_reset_vcpu(ARMCPU *cpu)
> diff --git a/target/arm/machine.c b/target/arm/machine.c
> index 868246a98c0..e442d485241 100644
> --- a/target/arm/machine.c
> +++ b/target/arm/machine.c
> @@ -976,15 +976,9 @@ static int cpu_post_load(void *opaque, int version_id)
> }
>
> if (kvm_enabled()) {
> - if (!write_list_to_kvmstate(cpu, KVM_PUT_FULL_STATE)) {
> + if (!kvm_arm_cpu_post_load(cpu)) {
> return -1;
> }
> - /* Note that it's OK for the TCG side not to know about
> - * every register in the list; KVM is authoritative if
> - * we're using it.
> - */
> - write_list_to_cpustate(cpu);
> - kvm_arm_cpu_post_load(cpu);
> } else {
> if (!write_list_to_cpustate(cpu)) {
> return -1;
next prev parent reply other threads:[~2025-05-04 16:22 UTC|newest]
Thread overview: 53+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-04 5:28 [PATCH v4 00/40] single-binary: compile target/arm twice Pierrick Bouvier
2025-05-04 5:28 ` [PATCH v4 01/40] target/arm: Replace target_ulong -> uint64_t for HWBreakpoint Pierrick Bouvier
2025-05-04 5:28 ` [PATCH v4 02/40] include/system/hvf: missing vaddr include Pierrick Bouvier
2025-05-04 5:28 ` [PATCH v4 03/40] meson: add common libs for target and target_system Pierrick Bouvier
2025-05-04 5:28 ` [PATCH v4 04/40] meson: apply target config for picking files from libsystem and libuser Pierrick Bouvier
2025-05-04 5:30 ` Pierrick Bouvier
2025-05-04 5:28 ` [PATCH v4 05/40] target/arm: move kvm stubs and remove CONFIG_KVM from kvm_arm.h Pierrick Bouvier
2025-05-04 5:28 ` [PATCH v4 06/40] target/arm/kvm-stub: add kvm_arm_reset_vcpu stub Pierrick Bouvier
2025-05-04 5:28 ` [PATCH v4 07/40] target/arm/cpu: move arm_cpu_kvm_set_irq to kvm.c Pierrick Bouvier
2025-05-04 5:28 ` [PATCH v4 08/40] accel/hvf: add hvf_enabled() for common code Pierrick Bouvier
2025-05-04 5:28 ` [PATCH v4 09/40] target/arm/cpu: remove TARGET_BIG_ENDIAN dependency Pierrick Bouvier
2025-05-04 5:28 ` [PATCH v4 10/40] target/arm/cpu: remove TARGET_AARCH64 around aarch64_cpu_dump_state common Pierrick Bouvier
2025-05-04 5:28 ` [PATCH v4 11/40] target/arm/cpu: remove TARGET_AARCH64 in arm_cpu_finalize_features Pierrick Bouvier
2025-05-04 5:28 ` [PATCH v4 12/40] target/arm/cpu: compile file twice (user, system) only Pierrick Bouvier
2025-05-04 16:00 ` Richard Henderson
2025-05-04 5:28 ` [PATCH v4 13/40] target/arm/cpu32-stubs.c: compile file twice (user, system) Pierrick Bouvier
2025-05-04 5:28 ` [PATCH v4 14/40] tcg: add vaddr type for helpers Pierrick Bouvier
2025-05-04 16:10 ` Richard Henderson
2025-05-04 5:28 ` [PATCH v4 15/40] target/arm/helper: use vaddr instead of target_ulong for exception_pc_alignment Pierrick Bouvier
2025-05-04 16:11 ` Richard Henderson
2025-05-04 5:28 ` [PATCH v4 16/40] target/arm/helper: use vaddr instead of target_ulong for probe_access Pierrick Bouvier
2025-05-04 16:17 ` Richard Henderson
2025-05-04 16:29 ` Pierrick Bouvier
2025-05-04 5:28 ` [PATCH v4 17/40] target/arm/helper: extract common helpers Pierrick Bouvier
2025-05-04 5:28 ` [PATCH v4 18/40] target/arm/debug_helper: only include " Pierrick Bouvier
2025-05-04 5:28 ` [PATCH v4 19/40] target/arm/debug_helper: remove target_ulong Pierrick Bouvier
2025-05-04 5:28 ` [PATCH v4 20/40] target/arm/debug_helper: compile file twice (user, system) Pierrick Bouvier
2025-05-04 5:28 ` [PATCH v4 21/40] target/arm/helper: restrict include to common helpers Pierrick Bouvier
2025-05-04 5:28 ` [PATCH v4 22/40] target/arm/helper: replace target_ulong by vaddr Pierrick Bouvier
2025-05-04 5:28 ` [PATCH v4 23/40] target/arm/helper: expose aarch64 cpu registration Pierrick Bouvier
2025-05-04 5:28 ` [PATCH v4 24/40] target/arm/helper: remove remaining TARGET_AARCH64 Pierrick Bouvier
2025-05-04 5:28 ` [PATCH v4 25/40] target/arm/helper: compile file twice (user, system) Pierrick Bouvier
2025-05-04 5:29 ` [PATCH v4 26/40] target/arm/vfp_fpscr: " Pierrick Bouvier
2025-05-04 5:29 ` [PATCH v4 27/40] target/arm/arch_dump: remove TARGET_AARCH64 conditionals Pierrick Bouvier
2025-05-04 5:29 ` [PATCH v4 28/40] target/arm/arch_dump: compile file once (system) Pierrick Bouvier
2025-05-04 5:29 ` [PATCH v4 29/40] target/arm/arm-powerctl: " Pierrick Bouvier
2025-05-04 5:29 ` [PATCH v4 30/40] target/arm/cortex-regs: " Pierrick Bouvier
2025-05-04 5:29 ` [PATCH v4 31/40] target/arm/ptw: replace target_ulong with int64_t Pierrick Bouvier
2025-05-04 5:29 ` [PATCH v4 32/40] target/arm/ptw: replace TARGET_AARCH64 by CONFIG_ATOMIC64 from arm_casq_ptw Pierrick Bouvier
2025-05-04 16:18 ` Richard Henderson
2025-05-04 5:29 ` [PATCH v4 33/40] target/arm/ptw: compile file once (system) Pierrick Bouvier
2025-05-04 5:29 ` [PATCH v4 34/40] target/arm/meson: accelerator files are not needed in user mode Pierrick Bouvier
2025-05-04 5:29 ` [PATCH v4 35/40] target/arm/kvm-stub: compile file once (system) Pierrick Bouvier
2025-05-04 5:29 ` [PATCH v4 36/40] target/arm/machine: reduce migration include to avoid target specific definitions Pierrick Bouvier
2025-05-04 16:19 ` Richard Henderson
2025-05-04 5:29 ` [PATCH v4 37/40] target/arm/machine: remove TARGET_AARCH64 from migration state Pierrick Bouvier
2025-05-04 16:20 ` Richard Henderson
2025-05-04 5:29 ` [PATCH v4 38/40] target/arm/machine: move cpu_post_load kvm bits to kvm_arm_cpu_post_load function Pierrick Bouvier
2025-05-04 16:22 ` Richard Henderson [this message]
2025-05-04 5:29 ` [PATCH v4 39/40] target/arm/kvm-stub: add missing stubs Pierrick Bouvier
2025-05-04 16:22 ` Richard Henderson
2025-05-04 5:29 ` [PATCH v4 40/40] target/arm/machine: compile file once (system) Pierrick Bouvier
2025-05-04 16:23 ` Richard Henderson
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=2d9560be-1120-42f9-85db-69b8407c49b8@linaro.org \
--to=richard.henderson@linaro.org \
--cc=alex.bennee@linaro.org \
--cc=anjo@rev.ng \
--cc=kvm@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=philmd@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 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).