20 #ifndef __KVM_POWERPC_TLB_H__
21 #define __KVM_POWERPC_TLB_H__
27 unsigned int pid,
unsigned int as);
34 static inline unsigned int get_tlb_size(
const struct kvmppc_44x_tlbe *tlbe)
36 return (tlbe->
word0 >> 4) & 0xf;
41 return tlbe->
word0 & 0xfffffc00;
46 unsigned int pgsize = get_tlb_size(tlbe);
47 return 1 << 10 << (pgsize << 1);
52 return get_tlb_eaddr(tlbe) + get_tlb_bytes(tlbe) - 1;
58 return ((word1 & 0xf) << 32) | (word1 & 0xfffffc00);
61 static inline unsigned int get_tlb_tid(
const struct kvmppc_44x_tlbe *tlbe)
63 return tlbe->
tid & 0xff;
66 static inline unsigned int get_tlb_ts(
const struct kvmppc_44x_tlbe *tlbe)
68 return (tlbe->
word0 >> 8) & 0x1;
71 static inline unsigned int get_tlb_v(
const struct kvmppc_44x_tlbe *tlbe)
73 return (tlbe->
word0 >> 9) & 0x1;
76 static inline unsigned int get_mmucr_stid(
const struct kvm_vcpu *vcpu)
78 return vcpu->
arch.mmucr & 0xff;
81 static inline unsigned int get_mmucr_sts(
const struct kvm_vcpu *vcpu)
83 return (vcpu->
arch.mmucr >> 16) & 0x1;