On Tue, May 13 2025, Eric Auger <eric.au...@redhat.com> wrote: > On 4/14/25 6:38 PM, Cornelia Huck wrote: >> From: Eric Auger <eric.au...@redhat.com> >> >> At the moment kvm_arm_get_host_cpu_features() reads a subset of the >> ID regs. As we want to introduce properties for all writable ID reg >> fields, we want more genericity and read more default host register >> values. >> >> Introduce a new get_host_cpu_idregs() helper and add a new exhaustive >> boolean parameter to kvm_arm_get_host_cpu_features() and >> kvm_arm_set_cpu_features_from_host() to select the right behavior. >> The host cpu model will keep the legacy behavior unless the writable >> id register interface is available. >> >> A writable_map IdRegMap is introduced in the CPU object. A subsequent >> patch will populate it. >> >> Signed-off-by: Eric Auger <eric.au...@redhat.com> >> Signed-off-by: Cornelia Huck <coh...@redhat.com> >> --- >> target/arm/cpu-sysregs.h | 2 ++ >> target/arm/cpu.h | 3 ++ >> target/arm/cpu64.c | 2 +- >> target/arm/kvm.c | 78 ++++++++++++++++++++++++++++++++++++++-- >> target/arm/kvm_arm.h | 9 +++-- >> target/arm/trace-events | 1 + >> 6 files changed, 89 insertions(+), 6 deletions(-) >>
(...) >> diff --git a/target/arm/cpu.h b/target/arm/cpu.h >> index 775a8aebc5d3..8717c5e7695b 100644 >> --- a/target/arm/cpu.h >> +++ b/target/arm/cpu.h >> @@ -1088,6 +1088,9 @@ struct ArchCPU { >> */ >> ARMIdRegsState writable_id_regs; >> >> + /* ID reg writable bitmask (KVM only) */ >> + IdRegMap *writable_map; > as it is KVM only we may put it in ifdef CONFIG_KVM block above Forgot to reply here; the CONFIG_KVM block is gone with a725f3710231 ("target/arm/cpu: always define kvm related registers")