aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kvm/bookehv_interrupts.S
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/kvm/bookehv_interrupts.S')
-rw-r--r--arch/powerpc/kvm/bookehv_interrupts.S30
1 files changed, 29 insertions, 1 deletions
diff --git a/arch/powerpc/kvm/bookehv_interrupts.S b/arch/powerpc/kvm/bookehv_interrupts.S
index 63023ae14da4..e9e735057939 100644
--- a/arch/powerpc/kvm/bookehv_interrupts.S
+++ b/arch/powerpc/kvm/bookehv_interrupts.S
@@ -28,6 +28,7 @@
28#include <asm/asm-compat.h> 28#include <asm/asm-compat.h>
29#include <asm/asm-offsets.h> 29#include <asm/asm-offsets.h>
30#include <asm/bitsperlong.h> 30#include <asm/bitsperlong.h>
31#include <asm/thread_info.h>
31 32
32#include "../kernel/head_booke.h" /* for THREAD_NORMSAVE() */ 33#include "../kernel/head_booke.h" /* for THREAD_NORMSAVE() */
33 34
@@ -171,9 +172,36 @@
171 PPC_STL r30, VCPU_GPR(r30)(r4) 172 PPC_STL r30, VCPU_GPR(r30)(r4)
172 PPC_STL r31, VCPU_GPR(r31)(r4) 173 PPC_STL r31, VCPU_GPR(r31)(r4)
173 mtspr SPRN_EPLC, r8 174 mtspr SPRN_EPLC, r8
175
176 /* disable preemption, so we are sure we hit the fixup handler */
177#ifdef CONFIG_PPC64
178 clrrdi r8,r1,THREAD_SHIFT
179#else
180 rlwinm r8,r1,0,0,31-THREAD_SHIFT /* current thread_info */
181#endif
182 li r7, 1
183 stw r7, TI_PREEMPT(r8)
184
174 isync 185 isync
175 lwepx r9, 0, r5 186
187 /*
188 * In case the read goes wrong, we catch it and write an invalid value
189 * in LAST_INST instead.
190 */
1911: lwepx r9, 0, r5
1922:
193.section .fixup, "ax"
1943: li r9, KVM_INST_FETCH_FAILED
195 b 2b
196.previous
197.section __ex_table,"a"
198 PPC_LONG_ALIGN
199 PPC_LONG 1b,3b
200.previous
201
176 mtspr SPRN_EPLC, r3 202 mtspr SPRN_EPLC, r3
203 li r7, 0
204 stw r7, TI_PREEMPT(r8)
177 stw r9, VCPU_LAST_INST(r4) 205 stw r9, VCPU_LAST_INST(r4)
178 .endif 206 .endif
179 207