diff options
Diffstat (limited to 'arch/powerpc/kvm/44x_tlb.h')
-rw-r--r-- | arch/powerpc/kvm/44x_tlb.h | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/arch/powerpc/kvm/44x_tlb.h b/arch/powerpc/kvm/44x_tlb.h index 2ccd46b6f6b7..772191f29e62 100644 --- a/arch/powerpc/kvm/44x_tlb.h +++ b/arch/powerpc/kvm/44x_tlb.h | |||
@@ -25,48 +25,52 @@ | |||
25 | 25 | ||
26 | extern int kvmppc_44x_tlb_index(struct kvm_vcpu *vcpu, gva_t eaddr, | 26 | extern int kvmppc_44x_tlb_index(struct kvm_vcpu *vcpu, gva_t eaddr, |
27 | unsigned int pid, unsigned int as); | 27 | unsigned int pid, unsigned int as); |
28 | extern struct tlbe *kvmppc_44x_dtlb_search(struct kvm_vcpu *vcpu, gva_t eaddr); | 28 | extern int kvmppc_44x_dtlb_index(struct kvm_vcpu *vcpu, gva_t eaddr); |
29 | extern struct tlbe *kvmppc_44x_itlb_search(struct kvm_vcpu *vcpu, gva_t eaddr); | 29 | extern int kvmppc_44x_itlb_index(struct kvm_vcpu *vcpu, gva_t eaddr); |
30 | |||
31 | extern int kvmppc_44x_emul_tlbsx(struct kvm_vcpu *vcpu, u8 rt, u8 ra, u8 rb, | ||
32 | u8 rc); | ||
33 | extern int kvmppc_44x_emul_tlbwe(struct kvm_vcpu *vcpu, u8 ra, u8 rs, u8 ws); | ||
30 | 34 | ||
31 | /* TLB helper functions */ | 35 | /* TLB helper functions */ |
32 | static inline unsigned int get_tlb_size(const struct tlbe *tlbe) | 36 | static inline unsigned int get_tlb_size(const struct kvmppc_44x_tlbe *tlbe) |
33 | { | 37 | { |
34 | return (tlbe->word0 >> 4) & 0xf; | 38 | return (tlbe->word0 >> 4) & 0xf; |
35 | } | 39 | } |
36 | 40 | ||
37 | static inline gva_t get_tlb_eaddr(const struct tlbe *tlbe) | 41 | static inline gva_t get_tlb_eaddr(const struct kvmppc_44x_tlbe *tlbe) |
38 | { | 42 | { |
39 | return tlbe->word0 & 0xfffffc00; | 43 | return tlbe->word0 & 0xfffffc00; |
40 | } | 44 | } |
41 | 45 | ||
42 | static inline gva_t get_tlb_bytes(const struct tlbe *tlbe) | 46 | static inline gva_t get_tlb_bytes(const struct kvmppc_44x_tlbe *tlbe) |
43 | { | 47 | { |
44 | unsigned int pgsize = get_tlb_size(tlbe); | 48 | unsigned int pgsize = get_tlb_size(tlbe); |
45 | return 1 << 10 << (pgsize << 1); | 49 | return 1 << 10 << (pgsize << 1); |
46 | } | 50 | } |
47 | 51 | ||
48 | static inline gva_t get_tlb_end(const struct tlbe *tlbe) | 52 | static inline gva_t get_tlb_end(const struct kvmppc_44x_tlbe *tlbe) |
49 | { | 53 | { |
50 | return get_tlb_eaddr(tlbe) + get_tlb_bytes(tlbe) - 1; | 54 | return get_tlb_eaddr(tlbe) + get_tlb_bytes(tlbe) - 1; |
51 | } | 55 | } |
52 | 56 | ||
53 | static inline u64 get_tlb_raddr(const struct tlbe *tlbe) | 57 | static inline u64 get_tlb_raddr(const struct kvmppc_44x_tlbe *tlbe) |
54 | { | 58 | { |
55 | u64 word1 = tlbe->word1; | 59 | u64 word1 = tlbe->word1; |
56 | return ((word1 & 0xf) << 32) | (word1 & 0xfffffc00); | 60 | return ((word1 & 0xf) << 32) | (word1 & 0xfffffc00); |
57 | } | 61 | } |
58 | 62 | ||
59 | static inline unsigned int get_tlb_tid(const struct tlbe *tlbe) | 63 | static inline unsigned int get_tlb_tid(const struct kvmppc_44x_tlbe *tlbe) |
60 | { | 64 | { |
61 | return tlbe->tid & 0xff; | 65 | return tlbe->tid & 0xff; |
62 | } | 66 | } |
63 | 67 | ||
64 | static inline unsigned int get_tlb_ts(const struct tlbe *tlbe) | 68 | static inline unsigned int get_tlb_ts(const struct kvmppc_44x_tlbe *tlbe) |
65 | { | 69 | { |
66 | return (tlbe->word0 >> 8) & 0x1; | 70 | return (tlbe->word0 >> 8) & 0x1; |
67 | } | 71 | } |
68 | 72 | ||
69 | static inline unsigned int get_tlb_v(const struct tlbe *tlbe) | 73 | static inline unsigned int get_tlb_v(const struct kvmppc_44x_tlbe *tlbe) |
70 | { | 74 | { |
71 | return (tlbe->word0 >> 9) & 0x1; | 75 | return (tlbe->word0 >> 9) & 0x1; |
72 | } | 76 | } |
@@ -81,7 +85,7 @@ static inline unsigned int get_mmucr_sts(const struct kvm_vcpu *vcpu) | |||
81 | return (vcpu->arch.mmucr >> 16) & 0x1; | 85 | return (vcpu->arch.mmucr >> 16) & 0x1; |
82 | } | 86 | } |
83 | 87 | ||
84 | static inline gpa_t tlb_xlate(struct tlbe *tlbe, gva_t eaddr) | 88 | static inline gpa_t tlb_xlate(struct kvmppc_44x_tlbe *tlbe, gva_t eaddr) |
85 | { | 89 | { |
86 | unsigned int pgmask = get_tlb_bytes(tlbe) - 1; | 90 | unsigned int pgmask = get_tlb_bytes(tlbe) - 1; |
87 | 91 | ||