diff options
author | Richard Henderson <richard.henderson@linaro.org> | 2023-12-19 17:57:41 +0000 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2023-12-19 17:57:41 +0000 |
commit | f38ce925eb2eca680ece6f9c31ad00e8466a609c (patch) | |
tree | c935e5af07ec5c831d73e84f4d86480210db5062 /target | |
parent | 676fe6846f8554087bad3b0809cb158a6a2f6207 (diff) | |
download | qemu-f38ce925eb2eca680ece6f9c31ad00e8466a609c.zip qemu-f38ce925eb2eca680ece6f9c31ad00e8466a609c.tar.gz qemu-f38ce925eb2eca680ece6f9c31ad00e8466a609c.tar.bz2 |
target/arm/kvm: Move kvm_arm_reg_syncs_via_cpreg_list and unexport
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Gavin Shan <gshan@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org>
[PMM: merged two duplicate comments, as suggested by Gavin]
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'target')
-rw-r--r-- | target/arm/kvm.c | 19 | ||||
-rw-r--r-- | target/arm/kvm64.c | 15 | ||||
-rw-r--r-- | target/arm/kvm_arm.h | 10 |
3 files changed, 19 insertions, 25 deletions
diff --git a/target/arm/kvm.c b/target/arm/kvm.c index dadc3fd..05e06f1 100644 --- a/target/arm/kvm.c +++ b/target/arm/kvm.c @@ -740,6 +740,25 @@ static uint64_t *kvm_arm_get_cpreg_ptr(ARMCPU *cpu, uint64_t regidx) return &cpu->cpreg_values[res - cpu->cpreg_indexes]; } +/** + * kvm_arm_reg_syncs_via_cpreg_list: + * @regidx: KVM register index + * + * Return true if this KVM register should be synchronized via the + * cpreg list of arbitrary system registers, false if it is synchronized + * by hand using code in kvm_arch_get/put_registers(). + */ +static bool kvm_arm_reg_syncs_via_cpreg_list(uint64_t regidx) +{ + switch (regidx & KVM_REG_ARM_COPROC_MASK) { + case KVM_REG_ARM_CORE: + case KVM_REG_ARM64_SVE: + return false; + default: + return true; + } +} + /* Initialize the ARMCPU cpreg list according to the kernel's * definition of what CPU registers it knows about (and throw away * the previous TCG-created cpreg list). diff --git a/target/arm/kvm64.c b/target/arm/kvm64.c index a184cca..52c0a6d 100644 --- a/target/arm/kvm64.c +++ b/target/arm/kvm64.c @@ -346,21 +346,6 @@ int kvm_arch_destroy_vcpu(CPUState *cs) return 0; } -bool kvm_arm_reg_syncs_via_cpreg_list(uint64_t regidx) -{ - /* Return true if the regidx is a register we should synchronize - * via the cpreg_tuples array (ie is not a core or sve reg that - * we sync by hand in kvm_arch_get/put_registers()) - */ - switch (regidx & KVM_REG_ARM_COPROC_MASK) { - case KVM_REG_ARM_CORE: - case KVM_REG_ARM64_SVE: - return false; - default: - return true; - } -} - /* Callers must hold the iothread mutex lock */ static void kvm_inject_arm_sea(CPUState *c) { diff --git a/target/arm/kvm_arm.h b/target/arm/kvm_arm.h index 2755ee8..1043123 100644 --- a/target/arm/kvm_arm.h +++ b/target/arm/kvm_arm.h @@ -78,16 +78,6 @@ void kvm_arm_register_device(MemoryRegion *mr, uint64_t devid, uint64_t group, int kvm_arm_init_cpreg_list(ARMCPU *cpu); /** - * kvm_arm_reg_syncs_via_cpreg_list: - * @regidx: KVM register index - * - * Return true if this KVM register should be synchronized via the - * cpreg list of arbitrary system registers, false if it is synchronized - * by hand using code in kvm_arch_get/put_registers(). - */ -bool kvm_arm_reg_syncs_via_cpreg_list(uint64_t regidx); - -/** * write_list_to_kvmstate: * @cpu: ARMCPU * @level: the state level to sync |