Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
rth7680 authored and pm215 committed Dec 19, 2023
1 parent d213f5a commit 676fe68
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 24 deletions.
22 changes: 22 additions & 0 deletions target/arm/kvm.c
Expand Up @@ -817,6 +817,28 @@ int kvm_arm_init_cpreg_list(ARMCPU *cpu)
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);
Expand Down
15 changes: 0 additions & 15 deletions target/arm/kvm64.c
Expand Up @@ -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)
{
Expand Down
9 changes: 0 additions & 9 deletions target/arm/kvm_arm.h
Expand Up @@ -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
Expand Down

0 comments on commit 676fe68

Please sign in to comment.