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);