This makes KVM work, with runnable virtual machines.

Signed-off-by: Mohamed Mediouni <[email protected]>
---
 target/arm/hvf/hvf.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/target/arm/hvf/hvf.c b/target/arm/hvf/hvf.c
index 47eeaa0f30..c32c705ddd 100644
--- a/target/arm/hvf/hvf.c
+++ b/target/arm/hvf/hvf.c
@@ -305,6 +305,10 @@ void hvf_arm_init_debug(void)
 #define SYSREG_CNTHCTL_EL2    SYSREG(3, 4, 14, 1, 0)
 #define SYSREG_MDCCINT_EL1    SYSREG(2, 0, 0, 2, 0)
 
+/* VHE registers */
+#define SYSREG_CNTKCTL_EL12 SYSREG(3, 5, 14, 1, 0)
+
+
 #define WFX_IS_WFE (1 << 0)
 
 #define TMR_CTL_ENABLE  (1 << 0)
@@ -1857,6 +1861,9 @@ static int hvf_sysreg_read(CPUState *cpu, uint32_t reg, 
uint64_t *val)
             assert_hvf_ok(hv_vcpu_get_sys_reg(cpu->accel->fd, 
HV_SYS_REG_CNTHCTL_EL2, val));
         }
         return 0;
+    case SYSREG_CNTKCTL_EL12:
+        /* Ignore for now */
+        return 0;
     case SYSREG_MDCCINT_EL1:
         assert_hvf_ok(hv_vcpu_get_sys_reg(cpu->accel->fd, 
HV_SYS_REG_MDCCINT_EL1, val));
         return 0;
@@ -2155,6 +2162,9 @@ static int hvf_sysreg_write(CPUState *cpu, uint32_t reg, 
uint64_t val)
             assert_hvf_ok(hv_vcpu_set_sys_reg(cpu->accel->fd, 
HV_SYS_REG_CNTHCTL_EL2, val));
         }
         return 0;
+    case SYSREG_CNTKCTL_EL12:
+        /* Ignore for now */
+        return 0;
     case SYSREG_MDCCINT_EL1:
         assert_hvf_ok(hv_vcpu_set_sys_reg(cpu->accel->fd, 
HV_SYS_REG_MDCCINT_EL1, val));
         return 0;
-- 
2.54.0 (Apple Git-156)


Reply via email to