aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/include
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/include')
-rw-r--r--arch/powerpc/include/asm/kvm_ppc.h29
1 files changed, 6 insertions, 23 deletions
diff --git a/arch/powerpc/include/asm/kvm_ppc.h b/arch/powerpc/include/asm/kvm_ppc.h
index 96d5de90ac5a..aecf95d5fede 100644
--- a/arch/powerpc/include/asm/kvm_ppc.h
+++ b/arch/powerpc/include/asm/kvm_ppc.h
@@ -53,35 +53,13 @@ extern int kvmppc_handle_store(struct kvm_run *run, struct kvm_vcpu *vcpu,
53extern int kvmppc_emulate_instruction(struct kvm_run *run, 53extern int kvmppc_emulate_instruction(struct kvm_run *run,
54 struct kvm_vcpu *vcpu); 54 struct kvm_vcpu *vcpu);
55extern int kvmppc_emulate_mmio(struct kvm_run *run, struct kvm_vcpu *vcpu); 55extern int kvmppc_emulate_mmio(struct kvm_run *run, struct kvm_vcpu *vcpu);
56extern int kvmppc_emul_tlbwe(struct kvm_vcpu *vcpu, u8 ra, u8 rs, u8 ws); 56extern void kvmppc_emulate_dec(struct kvm_vcpu *vcpu);
57extern int kvmppc_emul_tlbsx(struct kvm_vcpu *vcpu, u8 rt, u8 ra, u8 rb, u8 rc);
58 57
59extern void kvmppc_mmu_map(struct kvm_vcpu *vcpu, u64 gvaddr, gfn_t gfn, 58extern void kvmppc_mmu_map(struct kvm_vcpu *vcpu, u64 gvaddr, gfn_t gfn,
60 u64 asid, u32 flags); 59 u64 asid, u32 flags);
61extern void kvmppc_mmu_priv_switch(struct kvm_vcpu *vcpu, int usermode); 60extern void kvmppc_mmu_priv_switch(struct kvm_vcpu *vcpu, int usermode);
62extern void kvmppc_mmu_switch_pid(struct kvm_vcpu *vcpu, u32 pid); 61extern void kvmppc_mmu_switch_pid(struct kvm_vcpu *vcpu, u32 pid);
63 62
64/* Helper function for "full" MSR writes. No need to call this if only EE is
65 * changing. */
66static inline void kvmppc_set_msr(struct kvm_vcpu *vcpu, u32 new_msr)
67{
68 if ((new_msr & MSR_PR) != (vcpu->arch.msr & MSR_PR))
69 kvmppc_mmu_priv_switch(vcpu, new_msr & MSR_PR);
70
71 vcpu->arch.msr = new_msr;
72
73 if (vcpu->arch.msr & MSR_WE)
74 kvm_vcpu_block(vcpu);
75}
76
77static inline void kvmppc_set_pid(struct kvm_vcpu *vcpu, u32 new_pid)
78{
79 if (vcpu->arch.pid != new_pid) {
80 vcpu->arch.pid = new_pid;
81 vcpu->arch.swap_pid = 1;
82 }
83}
84
85/* Core-specific hooks */ 63/* Core-specific hooks */
86 64
87extern int kvmppc_core_check_processor_compat(void); 65extern int kvmppc_core_check_processor_compat(void);
@@ -99,6 +77,11 @@ extern void kvmppc_core_queue_dec(struct kvm_vcpu *vcpu);
99extern void kvmppc_core_queue_external(struct kvm_vcpu *vcpu, 77extern void kvmppc_core_queue_external(struct kvm_vcpu *vcpu,
100 struct kvm_interrupt *irq); 78 struct kvm_interrupt *irq);
101 79
80extern int kvmppc_core_emulate_op(struct kvm_run *run, struct kvm_vcpu *vcpu,
81 unsigned int op, int *advance);
82extern int kvmppc_core_emulate_mtspr(struct kvm_vcpu *vcpu, int sprn, int rs);
83extern int kvmppc_core_emulate_mfspr(struct kvm_vcpu *vcpu, int sprn, int rt);
84
102extern void kvmppc_core_destroy_mmu(struct kvm_vcpu *vcpu); 85extern void kvmppc_core_destroy_mmu(struct kvm_vcpu *vcpu);
103 86
104#endif /* __POWERPC_KVM_PPC_H__ */ 87#endif /* __POWERPC_KVM_PPC_H__ */