aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMihai Caraman <mihai.caraman@freescale.com>2014-07-23 12:06:18 -0400
committerAlexander Graf <agraf@suse.de>2014-07-28 09:23:13 -0400
commitb5741bb3d4dc751a76f6caaaec8e2b271ff8ca48 (patch)
treedc75d2508900cb42b32cac84ae2d0c74379cce9a
parent34f754b99e2f642c661967b456764b2c7ccc096e (diff)
KVM: PPC: e500mc: Revert "add load inst fixup"
The commit 1d628af7 "add load inst fixup" made an attempt to handle failures generated by reading the guest current instruction. The fixup code that was added works by chance hiding the real issue. Load external pid (lwepx) instruction, used by KVM to read guest instructions, is executed in a subsituted guest translation context (EPLC[EGS] = 1). In consequence lwepx's TLB error and data storage interrupts need to be handled by KVM, even though these interrupts are generated from host context (MSR[GS] = 0) where lwepx is executed. Currently, KVM hooks only interrupts generated from guest context (MSR[GS] = 1), doing minimal checks on the fast path to avoid host performance degradation. As a result, the host kernel handles lwepx faults searching the faulting guest data address (loaded in DEAR) in its own Logical Partition ID (LPID) 0 context. In case a host translation is found the execution returns to the lwepx instruction instead of the fixup, the host ending up in an infinite loop. Revert the commit "add load inst fixup". lwepx issue will be addressed in a subsequent patch without needing fixup code. Signed-off-by: Mihai Caraman <mihai.caraman@freescale.com> Signed-off-by: Alexander Graf <agraf@suse.de>
-rw-r--r--arch/powerpc/kvm/bookehv_interrupts.S26
1 files changed, 1 insertions, 25 deletions
diff --git a/arch/powerpc/kvm/bookehv_interrupts.S b/arch/powerpc/kvm/bookehv_interrupts.S
index a1712b818a5f..6ff448046301 100644
--- a/arch/powerpc/kvm/bookehv_interrupts.S
+++ b/arch/powerpc/kvm/bookehv_interrupts.S
@@ -29,7 +29,6 @@
29#include <asm/asm-compat.h> 29#include <asm/asm-compat.h>
30#include <asm/asm-offsets.h> 30#include <asm/asm-offsets.h>
31#include <asm/bitsperlong.h> 31#include <asm/bitsperlong.h>
32#include <asm/thread_info.h>
33 32
34#ifdef CONFIG_64BIT 33#ifdef CONFIG_64BIT
35#include <asm/exception-64e.h> 34#include <asm/exception-64e.h>
@@ -164,32 +163,9 @@
164 PPC_STL r30, VCPU_GPR(R30)(r4) 163 PPC_STL r30, VCPU_GPR(R30)(r4)
165 PPC_STL r31, VCPU_GPR(R31)(r4) 164 PPC_STL r31, VCPU_GPR(R31)(r4)
166 mtspr SPRN_EPLC, r8 165 mtspr SPRN_EPLC, r8
167
168 /* disable preemption, so we are sure we hit the fixup handler */
169 CURRENT_THREAD_INFO(r8, r1)
170 li r7, 1
171 stw r7, TI_PREEMPT(r8)
172
173 isync 166 isync
174 167 lwepx r9, 0, r5
175 /*
176 * In case the read goes wrong, we catch it and write an invalid value
177 * in LAST_INST instead.
178 */
1791: lwepx r9, 0, r5
1802:
181.section .fixup, "ax"
1823: li r9, KVM_INST_FETCH_FAILED
183 b 2b
184.previous
185.section __ex_table,"a"
186 PPC_LONG_ALIGN
187 PPC_LONG 1b,3b
188.previous
189
190 mtspr SPRN_EPLC, r3 168 mtspr SPRN_EPLC, r3
191 li r7, 0
192 stw r7, TI_PREEMPT(r8)
193 stw r9, VCPU_LAST_INST(r4) 169 stw r9, VCPU_LAST_INST(r4)
194 .endif 170 .endif
195 171