[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: |
Cornelia Huck |
Subject: |
Re: [PATCH v3 07/10] arm/kvm: write back modified ID regs to KVM |
Date: |
Tue, 15 Apr 2025 11:54:44 +0200 |
User-agent: |
Notmuch/0.38.3 (https://notmuchmail.org) |
On Tue, Apr 15 2025, Philippe Mathieu-Daudé <philmd@linaro.org> wrote:
> 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/?
Indeed, that's more obvious. Thanks!
- Re: [PATCH v3 02/10] arm/cpu: Add sysreg properties generation, (continued)
- [PATCH v3 03/10] arm/cpu: Add generated sysreg properties, Cornelia Huck, 2025/04/14
- [PATCH v3 04/10] kvm: kvm_get_writable_id_regs, Cornelia Huck, 2025/04/14
- [PATCH v3 05/10] arm/cpu: accessors for writable id registers, Cornelia Huck, 2025/04/14
- [PATCH v3 06/10] arm/kvm: Allow reading all the writable ID registers, Cornelia Huck, 2025/04/14
- [PATCH v3 08/10] arm/cpu: more customization for the kvm host cpu model, Cornelia Huck, 2025/04/14
- [PATCH v3 07/10] arm/kvm: write back modified ID regs to KVM, Cornelia Huck, 2025/04/14
- [PATCH v3 09/10] arm-qmp-cmds: introspection for ID register props, Cornelia Huck, 2025/04/14
- [PATCH v3 10/10] arm/cpu-features: document ID reg properties, Cornelia Huck, 2025/04/14