diff options
author | Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com> | 2013-10-30 10:34:56 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2013-12-05 00:04:38 -0500 |
commit | 0440705049b041d84268ea57f6e90e2f16618897 (patch) | |
tree | cd03f6d3cd882b115820d61a6c46533c07925456 /arch/powerpc/kvm/book3s_hv_ras.c | |
parent | 4c703416efc0a23f83a282b9240bb92fbd9e0be9 (diff) |
powerpc/book3s: Add flush_tlb operation in cpu_spec.
This patch introduces flush_tlb operation in cpu_spec structure. This will
help us to invoke appropriate CPU-side flush tlb routine. This patch
adds the foundation to invoke CPU specific flush routine for respective
architectures. Currently this patch introduce flush_tlb for p7 and p8.
Signed-off-by: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
Acked-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/kvm/book3s_hv_ras.c')
-rw-r--r-- | arch/powerpc/kvm/book3s_hv_ras.c | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/arch/powerpc/kvm/book3s_hv_ras.c b/arch/powerpc/kvm/book3s_hv_ras.c index a353c485808c..5c427b41a2f5 100644 --- a/arch/powerpc/kvm/book3s_hv_ras.c +++ b/arch/powerpc/kvm/book3s_hv_ras.c | |||
@@ -58,18 +58,6 @@ static void reload_slb(struct kvm_vcpu *vcpu) | |||
58 | } | 58 | } |
59 | } | 59 | } |
60 | 60 | ||
61 | /* POWER7 TLB flush */ | ||
62 | static void flush_tlb_power7(struct kvm_vcpu *vcpu) | ||
63 | { | ||
64 | unsigned long i, rb; | ||
65 | |||
66 | rb = TLBIEL_INVAL_SET_LPID; | ||
67 | for (i = 0; i < POWER7_TLB_SETS; ++i) { | ||
68 | asm volatile("tlbiel %0" : : "r" (rb)); | ||
69 | rb += 1 << TLBIEL_INVAL_SET_SHIFT; | ||
70 | } | ||
71 | } | ||
72 | |||
73 | /* | 61 | /* |
74 | * On POWER7, see if we can handle a machine check that occurred inside | 62 | * On POWER7, see if we can handle a machine check that occurred inside |
75 | * the guest in real mode, without switching to the host partition. | 63 | * the guest in real mode, without switching to the host partition. |
@@ -96,7 +84,8 @@ static long kvmppc_realmode_mc_power7(struct kvm_vcpu *vcpu) | |||
96 | DSISR_MC_SLB_PARITY | DSISR_MC_DERAT_MULTI); | 84 | DSISR_MC_SLB_PARITY | DSISR_MC_DERAT_MULTI); |
97 | } | 85 | } |
98 | if (dsisr & DSISR_MC_TLB_MULTI) { | 86 | if (dsisr & DSISR_MC_TLB_MULTI) { |
99 | flush_tlb_power7(vcpu); | 87 | if (cur_cpu_spec && cur_cpu_spec->flush_tlb) |
88 | cur_cpu_spec->flush_tlb(TLBIEL_INVAL_SET_LPID); | ||
100 | dsisr &= ~DSISR_MC_TLB_MULTI; | 89 | dsisr &= ~DSISR_MC_TLB_MULTI; |
101 | } | 90 | } |
102 | /* Any other errors we don't understand? */ | 91 | /* Any other errors we don't understand? */ |
@@ -113,7 +102,8 @@ static long kvmppc_realmode_mc_power7(struct kvm_vcpu *vcpu) | |||
113 | reload_slb(vcpu); | 102 | reload_slb(vcpu); |
114 | break; | 103 | break; |
115 | case SRR1_MC_IFETCH_TLBMULTI: | 104 | case SRR1_MC_IFETCH_TLBMULTI: |
116 | flush_tlb_power7(vcpu); | 105 | if (cur_cpu_spec && cur_cpu_spec->flush_tlb) |
106 | cur_cpu_spec->flush_tlb(TLBIEL_INVAL_SET_LPID); | ||
117 | break; | 107 | break; |
118 | default: | 108 | default: |
119 | handled = 0; | 109 | handled = 0; |