--- zzzz-none-000/linux-3.10.107/arch/powerpc/include/asm/kvm_booke.h 2017-06-27 09:49:32.000000000 +0000 +++ scorpion-7490-727/linux-3.10.107/arch/powerpc/include/asm/kvm_booke.h 2021-02-04 17:41:59.000000000 +0000 @@ -23,10 +23,16 @@ #include #include -/* LPIDs we support with this build -- runtime limit may be lower */ +/* + * Number of available lpids. Only the low-order 6 bits of LPID rgister are + * implemented on e500mc+ cores. + */ #define KVMPPC_NR_LPIDS 64 -#define KVMPPC_INST_EHPRIV 0x7c00021c +#define KVMPPC_INST_EHPRIV 0x7c00021c +#define EHPRIV_OC_SHIFT 11 +/* "ehpriv 1" : ehpriv with OC = 1 is used for debug emulation */ +#define EHPRIV_OC_DEBUG 1 static inline void kvmppc_set_gpr(struct kvm_vcpu *vcpu, int num, ulong val) { @@ -48,19 +54,20 @@ return vcpu->arch.cr; } -static inline void kvmppc_set_xer(struct kvm_vcpu *vcpu, u32 val) +static inline void kvmppc_set_xer(struct kvm_vcpu *vcpu, ulong val) { vcpu->arch.xer = val; } -static inline u32 kvmppc_get_xer(struct kvm_vcpu *vcpu) +static inline ulong kvmppc_get_xer(struct kvm_vcpu *vcpu) { return vcpu->arch.xer; } -static inline u32 kvmppc_get_last_inst(struct kvm_vcpu *vcpu) +static inline bool kvmppc_need_byteswap(struct kvm_vcpu *vcpu) { - return vcpu->arch.last_inst; + /* XXX Would need to check TLB entry */ + return false; } static inline void kvmppc_set_ctr(struct kvm_vcpu *vcpu, ulong val) @@ -98,8 +105,13 @@ return vcpu->arch.fault_dear; } -static inline ulong kvmppc_get_msr(struct kvm_vcpu *vcpu) +static inline bool kvmppc_supports_magic_page(struct kvm_vcpu *vcpu) { - return vcpu->arch.shared->msr; + /* Magic page is only supported on e500v2 */ +#ifdef CONFIG_KVM_E500V2 + return true; +#else + return false; +#endif } #endif /* __ASM_KVM_BOOKE_H__ */