diff --git a/target/arm/helper.c b/target/arm/helper.c index 1dd5d64d963cc52ccb22264ff7a7d66210aca75d..80737a8d7ba47b3afb50581e868f530a68cc0ed2 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -168,8 +168,8 @@ bool write_cpustate_to_list(ARMCPU *cpu, bool kvm_sync) if (kvm_sync) { if (is_id_reg(ri)) { /* Only sync if we can sync to KVM successfully. */ - uint64_t oldval; - uint64_t kvmval; + uint64_t oldval = 0; + uint64_t kvmval = 0; if (kvm_arm_get_one_reg(cpu, cpu->cpreg_indexes[i], &oldval)) { continue; diff --git a/target/arm/kvm_arm.h b/target/arm/kvm_arm.h index 82145607ecaa39bb5d7b3a3b018099824a3ff0c7..8b644b3924594be0d3f09d436a0bca48e9eeddfd 100644 --- a/target/arm/kvm_arm.h +++ b/target/arm/kvm_arm.h @@ -377,6 +377,9 @@ void kvm_arm_pvtime_init(CPUState *cs, uint64_t ipa); int kvm_arm_set_irq(int cpu, int irqtype, int irq, int level); +int kvm_arm_get_one_reg(ARMCPU *cpu, uint64_t regidx, uint64_t *target); +int kvm_arm_set_one_reg(ARMCPU *cpu, uint64_t regidx, uint64_t *source); + #else /* @@ -403,6 +406,11 @@ static inline bool kvm_arm_steal_time_supported(void) return false; } +static inline bool kvm_arm_cpu_feature_supported(void) +{ + return false; +} + /* * These functions should never actually be called without KVM support. */ @@ -451,6 +459,18 @@ static inline void kvm_arm_sve_get_vls(CPUState *cs, unsigned long *map) g_assert_not_reached(); } +static inline int kvm_arm_get_one_reg(ARMCPU *cpu, uint64_t regidx, + uint64_t *target) +{ + g_assert_not_reached(); +} + +static inline int kvm_arm_set_one_reg(ARMCPU *cpu, uint64_t regidx, + uint64_t *source) +{ + g_assert_not_reached(); +} + #endif static inline const char *gic_class_name(void) @@ -535,7 +555,4 @@ static inline const char *its_class_name(void) } } -int kvm_arm_get_one_reg(ARMCPU *cpu, uint64_t regidx, uint64_t *target); -int kvm_arm_set_one_reg(ARMCPU *cpu, uint64_t regidx, uint64_t *source); - #endif