qemu-arm
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v3 07/10] arm/kvm: write back modified ID regs to KVM


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH v3 07/10] arm/kvm: write back modified ID regs to KVM
Date: Tue, 15 Apr 2025 09:03:05 +0200
User-agent: Mozilla Thunderbird

On 14/4/25 18:38, Cornelia Huck wrote:
From: Eric Auger <eric.auger@redhat.com>

We want to give a chance to override the value of host ID regs.
In a previous patch we made sure all their values could be fetched
through kvm_get_one_reg() calls before their modification. After
their potential modification we need to make sure we write back
the values through kvm_set_one_reg() calls.

Make sure the cpreg_list is modified with updated values and
transfer those values back to kvm.

Signed-off-by: Eric Auger <eric.auger@redhat.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
---
  target/arm/kvm.c        | 44 ++++++++++++++++++++++++++++++++++++++++-
  target/arm/trace-events |  1 +
  2 files changed, 44 insertions(+), 1 deletion(-)


  void kvm_arm_reset_vcpu(ARMCPU *cpu)
  {
      int ret;
@@ -2050,7 +2083,16 @@ int kvm_arch_init_vcpu(CPUState *cs)
      }
      cpu->mp_affinity = mpidr & ARM64_AFFINITY_MASK;
- return kvm_arm_init_cpreg_list(cpu);
+    ret = kvm_arm_init_cpreg_list(cpu);
+    if (ret) {
+        return ret;
+    }
+    /* overwrite writable ID regs with their updated property values */
+    kvm_arm_writable_idregs_to_cpreg_list(cpu);
+
+    write_list_to_kvmstate(cpu, 3);

s/3/KVM_PUT_FULL_STATE/?

+
+    return 0;
  }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]