]> Pileus Git - ~andy/linux/blobdiff - arch/powerpc/include/asm/kvm_host.h
Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm
[~andy/linux] / arch / powerpc / include / asm / kvm_host.h
index 0fe48729d07dd62ac0f1df4be1f38cc45a5803ea..237d1d25b44815d3c65c17465bc3c53bff3e1f5c 100644 (file)
@@ -86,6 +86,9 @@ struct lppaca;
 struct slb_shadow;
 struct dtl_entry;
 
+struct kvmppc_vcpu_book3s;
+struct kvmppc_book3s_shadow_vcpu;
+
 struct kvm_vm_stat {
        u32 remote_tlb_flush;
 };
@@ -221,15 +224,15 @@ struct revmap_entry {
 #define KVMPPC_GOT_PAGE                0x80
 
 struct kvm_arch_memory_slot {
-#ifdef CONFIG_KVM_BOOK3S_64_HV
+#ifdef CONFIG_KVM_BOOK3S_HV_POSSIBLE
        unsigned long *rmap;
        unsigned long *slot_phys;
-#endif /* CONFIG_KVM_BOOK3S_64_HV */
+#endif /* CONFIG_KVM_BOOK3S_HV_POSSIBLE */
 };
 
 struct kvm_arch {
        unsigned int lpid;
-#ifdef CONFIG_KVM_BOOK3S_64_HV
+#ifdef CONFIG_KVM_BOOK3S_HV_POSSIBLE
        unsigned long hpt_virt;
        struct revmap_entry *revmap;
        unsigned int host_lpid;
@@ -253,8 +256,8 @@ struct kvm_arch {
        cpumask_t need_tlb_flush;
        struct kvmppc_vcore *vcores[KVM_MAX_VCORES];
        int hpt_cma_alloc;
-#endif /* CONFIG_KVM_BOOK3S_64_HV */
-#ifdef CONFIG_KVM_BOOK3S_PR
+#endif /* CONFIG_KVM_BOOK3S_HV_POSSIBLE */
+#ifdef CONFIG_KVM_BOOK3S_PR_POSSIBLE
        struct mutex hpt_mutex;
 #endif
 #ifdef CONFIG_PPC_BOOK3S_64
@@ -267,6 +270,7 @@ struct kvm_arch {
 #ifdef CONFIG_KVM_XICS
        struct kvmppc_xics *xics;
 #endif
+       struct kvmppc_ops *kvm_ops;
 };
 
 /*
@@ -345,7 +349,8 @@ struct kvmppc_mmu {
        /* book3s */
        void (*mtsrin)(struct kvm_vcpu *vcpu, u32 srnum, ulong value);
        u32  (*mfsrin)(struct kvm_vcpu *vcpu, u32 srnum);
-       int  (*xlate)(struct kvm_vcpu *vcpu, gva_t eaddr, struct kvmppc_pte *pte, bool data);
+       int  (*xlate)(struct kvm_vcpu *vcpu, gva_t eaddr,
+                     struct kvmppc_pte *pte, bool data, bool iswrite);
        void (*reset_msr)(struct kvm_vcpu *vcpu);
        void (*tlbie)(struct kvm_vcpu *vcpu, ulong addr, bool large);
        int  (*esid_to_vsid)(struct kvm_vcpu *vcpu, ulong esid, u64 *vsid);
@@ -383,17 +388,6 @@ struct kvmppc_slb {
 #define KVMPPC_EPR_USER                1 /* exit to userspace to fill EPR */
 #define KVMPPC_EPR_KERNEL      2 /* in-kernel irqchip */
 
-struct kvmppc_booke_debug_reg {
-       u32 dbcr0;
-       u32 dbcr1;
-       u32 dbcr2;
-#ifdef CONFIG_KVM_E500MC
-       u32 dbcr4;
-#endif
-       u64 iac[KVMPPC_BOOKE_MAX_IAC];
-       u64 dac[KVMPPC_BOOKE_MAX_DAC];
-};
-
 #define KVMPPC_IRQ_DEFAULT     0
 #define KVMPPC_IRQ_MPIC                1
 #define KVMPPC_IRQ_XICS                2
@@ -408,6 +402,10 @@ struct kvm_vcpu_arch {
        int slb_max;            /* 1 + index of last valid entry in slb[] */
        int slb_nr;             /* total number of entries in SLB */
        struct kvmppc_mmu mmu;
+       struct kvmppc_vcpu_book3s *book3s;
+#endif
+#ifdef CONFIG_PPC_BOOK3S_32
+       struct kvmppc_book3s_shadow_vcpu *shadow_vcpu;
 #endif
 
        ulong gpr[32];
@@ -541,7 +539,10 @@ struct kvm_vcpu_arch {
        u32 eptcfg;
        u32 epr;
        u32 crit_save;
-       struct kvmppc_booke_debug_reg dbg_reg;
+       /* guest debug registers*/
+       struct debug_reg dbg_reg;
+       /* hardware visible debug registers when in guest state */
+       struct debug_reg shadow_dbg_reg;
 #endif
        gpa_t paddr_accessed;
        gva_t vaddr_accessed;
@@ -592,7 +593,7 @@ struct kvm_vcpu_arch {
        struct kvmppc_icp *icp; /* XICS presentation controller */
 #endif
 
-#ifdef CONFIG_KVM_BOOK3S_64_HV
+#ifdef CONFIG_KVM_BOOK3S_HV_POSSIBLE
        struct kvm_vcpu_arch_shared shregs;
 
        unsigned long pgfault_addr;