target/arm/kvm: Move kvm_arm_cpreg_level 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>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
Richard Henderson 2023-12-19 17:57:41 +00:00 committed by Peter Maydell
parent d213f5adf5
commit 676fe6846f
3 changed files with 22 additions and 24 deletions

View File

@ -817,6 +817,28 @@ out:
return ret;
}
/**
* kvm_arm_cpreg_level:
* @regidx: KVM register index
*
* Return the level of this coprocessor/system register. Return value is
* either KVM_PUT_RUNTIME_STATE, KVM_PUT_RESET_STATE, or KVM_PUT_FULL_STATE.
*/
static int kvm_arm_cpreg_level(uint64_t regidx)
{
/*
* All system registers are assumed to be level KVM_PUT_RUNTIME_STATE.
* If a register should be written less often, you must add it here
* with a state of either KVM_PUT_RESET_STATE or KVM_PUT_FULL_STATE.
*/
switch (regidx) {
case KVM_REG_ARM_TIMER_CNT:
case KVM_REG_ARM_PTIMER_CNT:
return KVM_PUT_FULL_STATE;
}
return KVM_PUT_RUNTIME_STATE;
}
bool write_kvmstate_to_list(ARMCPU *cpu)
{
CPUState *cs = CPU(cpu);

View File

@ -361,21 +361,6 @@ bool kvm_arm_reg_syncs_via_cpreg_list(uint64_t regidx)
}
}
int kvm_arm_cpreg_level(uint64_t regidx)
{
/*
* All system registers are assumed to be level KVM_PUT_RUNTIME_STATE.
* If a register should be written less often, you must add it here
* with a state of either KVM_PUT_RESET_STATE or KVM_PUT_FULL_STATE.
*/
switch (regidx) {
case KVM_REG_ARM_TIMER_CNT:
case KVM_REG_ARM_PTIMER_CNT:
return KVM_PUT_FULL_STATE;
}
return KVM_PUT_RUNTIME_STATE;
}
/* Callers must hold the iothread mutex lock */
static void kvm_inject_arm_sea(CPUState *c)
{

View File

@ -87,15 +87,6 @@ int kvm_arm_init_cpreg_list(ARMCPU *cpu);
*/
bool kvm_arm_reg_syncs_via_cpreg_list(uint64_t regidx);
/**
* kvm_arm_cpreg_level:
* @regidx: KVM register index
*
* Return the level of this coprocessor/system register. Return value is
* either KVM_PUT_RUNTIME_STATE, KVM_PUT_RESET_STATE, or KVM_PUT_FULL_STATE.
*/
int kvm_arm_cpreg_level(uint64_t regidx);
/**
* write_list_to_kvmstate:
* @cpu: ARMCPU