diff mbox series

[12/21] target/arm/kvm: Move kvm_arm_cpreg_level and unexport

Message ID 20231123044219.896776-13-richard.henderson@linaro.org
State New
Headers show
Series target/arm: kvm cleanups | expand

Commit Message

Richard Henderson Nov. 23, 2023, 4:42 a.m. UTC
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 target/arm/kvm_arm.h |  9 ---------
 target/arm/kvm.c     | 22 ++++++++++++++++++++++
 target/arm/kvm64.c   | 15 ---------------
 3 files changed, 22 insertions(+), 24 deletions(-)

Comments

Philippe Mathieu-Daudé Nov. 24, 2023, 11:34 a.m. UTC | #1
On 23/11/23 05:42, Richard Henderson wrote:
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>   target/arm/kvm_arm.h |  9 ---------
>   target/arm/kvm.c     | 22 ++++++++++++++++++++++
>   target/arm/kvm64.c   | 15 ---------------
>   3 files changed, 22 insertions(+), 24 deletions(-)

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Gavin Shan Nov. 27, 2023, 12:08 a.m. UTC | #2
On 11/23/23 15:42, Richard Henderson wrote:
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>   target/arm/kvm_arm.h |  9 ---------
>   target/arm/kvm.c     | 22 ++++++++++++++++++++++
>   target/arm/kvm64.c   | 15 ---------------
>   3 files changed, 22 insertions(+), 24 deletions(-)
> 

Reviewed-by: Gavin Shan <gshan@redhat.com>
diff mbox series

Patch

diff --git a/target/arm/kvm_arm.h b/target/arm/kvm_arm.h
index e59d713973..2755ee8366 100644
--- a/target/arm/kvm_arm.h
+++ b/target/arm/kvm_arm.h
@@ -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
diff --git a/target/arm/kvm.c b/target/arm/kvm.c
index ffe0db4293..dadc3fd755 100644
--- a/target/arm/kvm.c
+++ b/target/arm/kvm.c
@@ -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);
diff --git a/target/arm/kvm64.c b/target/arm/kvm64.c
index 61fb9dbde0..a184cca4dc 100644
--- a/target/arm/kvm64.c
+++ b/target/arm/kvm64.c
@@ -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)
 {