diff options
Diffstat (limited to 'arch/powerpc/kvm/book3s_64_slb.S')
-rw-r--r-- | arch/powerpc/kvm/book3s_64_slb.S | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/arch/powerpc/kvm/book3s_64_slb.S b/arch/powerpc/kvm/book3s_64_slb.S index 7188c11ed7d1..d07b88617b2c 100644 --- a/arch/powerpc/kvm/book3s_64_slb.S +++ b/arch/powerpc/kvm/book3s_64_slb.S | |||
@@ -212,10 +212,6 @@ kvmppc_handler_trampoline_exit: | |||
212 | mfdar r5 | 212 | mfdar r5 |
213 | mfdsisr r6 | 213 | mfdsisr r6 |
214 | 214 | ||
215 | /* Unset guest state */ | ||
216 | li r9, 0 | ||
217 | stb r9, PACA_KVM_IN_GUEST(r13) | ||
218 | |||
219 | /* | 215 | /* |
220 | * In order for us to easily get the last instruction, | 216 | * In order for us to easily get the last instruction, |
221 | * we got the #vmexit at, we exploit the fact that the | 217 | * we got the #vmexit at, we exploit the fact that the |
@@ -233,18 +229,28 @@ kvmppc_handler_trampoline_exit: | |||
233 | 229 | ||
234 | ld_last_inst: | 230 | ld_last_inst: |
235 | /* Save off the guest instruction we're at */ | 231 | /* Save off the guest instruction we're at */ |
232 | |||
233 | /* Set guest mode to 'jump over instruction' so if lwz faults | ||
234 | * we'll just continue at the next IP. */ | ||
235 | li r9, KVM_GUEST_MODE_SKIP | ||
236 | stb r9, PACA_KVM_IN_GUEST(r13) | ||
237 | |||
236 | /* 1) enable paging for data */ | 238 | /* 1) enable paging for data */ |
237 | mfmsr r9 | 239 | mfmsr r9 |
238 | ori r11, r9, MSR_DR /* Enable paging for data */ | 240 | ori r11, r9, MSR_DR /* Enable paging for data */ |
239 | mtmsr r11 | 241 | mtmsr r11 |
240 | /* 2) fetch the instruction */ | 242 | /* 2) fetch the instruction */ |
241 | /* XXX implement PACA_KVM_IN_GUEST=2 path to safely jump over this */ | 243 | li r0, KVM_INST_FETCH_FAILED /* In case lwz faults */ |
242 | lwz r0, 0(r3) | 244 | lwz r0, 0(r3) |
243 | /* 3) disable paging again */ | 245 | /* 3) disable paging again */ |
244 | mtmsr r9 | 246 | mtmsr r9 |
245 | 247 | ||
246 | no_ld_last_inst: | 248 | no_ld_last_inst: |
247 | 249 | ||
250 | /* Unset guest mode */ | ||
251 | li r9, KVM_GUEST_MODE_NONE | ||
252 | stb r9, PACA_KVM_IN_GUEST(r13) | ||
253 | |||
248 | /* Restore bolted entries from the shadow and fix it along the way */ | 254 | /* Restore bolted entries from the shadow and fix it along the way */ |
249 | 255 | ||
250 | /* We don't store anything in entry 0, so we don't need to take care of it */ | 256 | /* We don't store anything in entry 0, so we don't need to take care of it */ |