Merge branch kvm-arm64/smccc-filtering into kvmarm-master/next
[linux-2.6-microblaze.git] / arch / arm64 / include / asm / kvm_host.h
index 2682b3f..ce75309 100644 (file)
@@ -200,6 +200,9 @@ struct kvm_arch {
        /* Mandated version of PSCI */
        u32 psci_version;
 
+       /* Protects VM-scoped configuration data */
+       struct mutex config_lock;
+
        /*
         * If we encounter a data abort without valid instruction syndrome
         * information, report this to user space.  User space can (and
@@ -222,8 +225,12 @@ struct kvm_arch {
 #define KVM_ARCH_FLAG_EL1_32BIT                                4
        /* PSCI SYSTEM_SUSPEND enabled for the guest */
 #define KVM_ARCH_FLAG_SYSTEM_SUSPEND_ENABLED           5
+       /* VM counter offset */
+#define KVM_ARCH_FLAG_VM_COUNTER_OFFSET                        6
+       /* Timer PPIs made immutable */
+#define KVM_ARCH_FLAG_TIMER_PPIS_IMMUTABLE             7
        /* SMCCC filter initialized for the VM */
-#define KVM_ARCH_FLAG_SMCCC_FILTER_CONFIGURED          6
+#define KVM_ARCH_FLAG_SMCCC_FILTER_CONFIGURED          8
        unsigned long flags;
 
        /*
@@ -368,6 +375,10 @@ enum vcpu_sysreg {
        TPIDR_EL2,      /* EL2 Software Thread ID Register */
        CNTHCTL_EL2,    /* Counter-timer Hypervisor Control register */
        SP_EL2,         /* EL2 Stack Pointer */
+       CNTHP_CTL_EL2,
+       CNTHP_CVAL_EL2,
+       CNTHV_CTL_EL2,
+       CNTHV_CVAL_EL2,
 
        NR_SYS_REGS     /* Nothing after this line! */
 };
@@ -525,6 +536,7 @@ struct kvm_vcpu_arch {
 
        /* vcpu power state */
        struct kvm_mp_state mp_state;
+       spinlock_t mp_state_lock;
 
        /* Cache some mmu pages needed inside spinlock regions */
        struct kvm_mmu_memory_cache mmu_page_cache;
@@ -925,6 +937,9 @@ void kvm_reset_sys_regs(struct kvm_vcpu *vcpu);
 
 int __init kvm_sys_reg_table_init(void);
 
+bool lock_all_vcpus(struct kvm *kvm);
+void unlock_all_vcpus(struct kvm *kvm);
+
 /* MMIO helpers */
 void kvm_mmio_write_buf(void *buf, unsigned int len, unsigned long data);
 unsigned long kvm_mmio_read_buf(const void *buf, unsigned int len);
@@ -1010,6 +1025,8 @@ int kvm_arm_vcpu_arch_has_attr(struct kvm_vcpu *vcpu,
 
 long kvm_vm_ioctl_mte_copy_tags(struct kvm *kvm,
                                struct kvm_arm_copy_mte_tags *copy_tags);
+int kvm_vm_ioctl_set_counter_offset(struct kvm *kvm,
+                                   struct kvm_arm_counter_offset *offset);
 
 /* Guest/host FPSIMD coordination helpers */
 int kvm_arch_vcpu_run_map_fp(struct kvm_vcpu *vcpu);