diff options
author | Varun Sethi <Varun.Sethi@freescale.com> | 2012-04-24 21:27:34 -0400 |
---|---|---|
committer | Alexander Graf <agraf@suse.de> | 2012-05-06 10:19:09 -0400 |
commit | 30124906db8598255fba32c8bf0adb7e8f1503ab (patch) | |
tree | 5a59fb02e1129c5614ec608739dd1a758db5a091 /arch | |
parent | 3d4c6826ed2a28e69e8ee14f1d58c4c8622f04b3 (diff) |
KVM: PPC: booke(hv): Fix save/restore of guest accessible SPRGs.
For Guest accessible SPRGs 4-7, save/restore must be handled differently for 64bit and
non-64 bit case. Use the PPC_STD/PPC_LD macros for saving/restoring to/from these registers.
Signed-off-by: Varun Sethi <Varun.Sethi@freescale.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/powerpc/kvm/booke_interrupts.S | 8 | ||||
-rw-r--r-- | arch/powerpc/kvm/bookehv_interrupts.S | 16 |
2 files changed, 12 insertions, 12 deletions
diff --git a/arch/powerpc/kvm/booke_interrupts.S b/arch/powerpc/kvm/booke_interrupts.S index c8c4b878795a..8feec2ff3928 100644 --- a/arch/powerpc/kvm/booke_interrupts.S +++ b/arch/powerpc/kvm/booke_interrupts.S | |||
@@ -419,13 +419,13 @@ lightweight_exit: | |||
419 | * written directly to the shared area, so we | 419 | * written directly to the shared area, so we |
420 | * need to reload them here with the guest's values. | 420 | * need to reload them here with the guest's values. |
421 | */ | 421 | */ |
422 | lwz r3, VCPU_SHARED_SPRG4(r5) | 422 | PPC_LD(r3, VCPU_SHARED_SPRG4, r5) |
423 | mtspr SPRN_SPRG4W, r3 | 423 | mtspr SPRN_SPRG4W, r3 |
424 | lwz r3, VCPU_SHARED_SPRG5(r5) | 424 | PPC_LD(r3, VCPU_SHARED_SPRG5, r5) |
425 | mtspr SPRN_SPRG5W, r3 | 425 | mtspr SPRN_SPRG5W, r3 |
426 | lwz r3, VCPU_SHARED_SPRG6(r5) | 426 | PPC_LD(r3, VCPU_SHARED_SPRG6, r5) |
427 | mtspr SPRN_SPRG6W, r3 | 427 | mtspr SPRN_SPRG6W, r3 |
428 | lwz r3, VCPU_SHARED_SPRG7(r5) | 428 | PPC_LD(r3, VCPU_SHARED_SPRG7, r5) |
429 | mtspr SPRN_SPRG7W, r3 | 429 | mtspr SPRN_SPRG7W, r3 |
430 | 430 | ||
431 | #ifdef CONFIG_KVM_EXIT_TIMING | 431 | #ifdef CONFIG_KVM_EXIT_TIMING |
diff --git a/arch/powerpc/kvm/bookehv_interrupts.S b/arch/powerpc/kvm/bookehv_interrupts.S index 41d34850f826..b7608ac52b66 100644 --- a/arch/powerpc/kvm/bookehv_interrupts.S +++ b/arch/powerpc/kvm/bookehv_interrupts.S | |||
@@ -316,13 +316,13 @@ _GLOBAL(kvmppc_resume_host) | |||
316 | PPC_STL r5, VCPU_LR(r4) | 316 | PPC_STL r5, VCPU_LR(r4) |
317 | mfspr r7, SPRN_SPRG5 | 317 | mfspr r7, SPRN_SPRG5 |
318 | PPC_STL r3, VCPU_VRSAVE(r4) | 318 | PPC_STL r3, VCPU_VRSAVE(r4) |
319 | PPC_STL r6, VCPU_SHARED_SPRG4(r11) | 319 | PPC_STD(r6, VCPU_SHARED_SPRG4, r11) |
320 | mfspr r8, SPRN_SPRG6 | 320 | mfspr r8, SPRN_SPRG6 |
321 | PPC_STL r7, VCPU_SHARED_SPRG5(r11) | 321 | PPC_STD(r7, VCPU_SHARED_SPRG5, r11) |
322 | mfspr r9, SPRN_SPRG7 | 322 | mfspr r9, SPRN_SPRG7 |
323 | PPC_STL r8, VCPU_SHARED_SPRG6(r11) | 323 | PPC_STD(r8, VCPU_SHARED_SPRG6, r11) |
324 | mfxer r3 | 324 | mfxer r3 |
325 | PPC_STL r9, VCPU_SHARED_SPRG7(r11) | 325 | PPC_STD(r9, VCPU_SHARED_SPRG7, r11) |
326 | 326 | ||
327 | /* save guest MAS registers and restore host mas4 & mas6 */ | 327 | /* save guest MAS registers and restore host mas4 & mas6 */ |
328 | mfspr r5, SPRN_MAS0 | 328 | mfspr r5, SPRN_MAS0 |
@@ -537,13 +537,13 @@ lightweight_exit: | |||
537 | * SPRGs, so we need to reload them here with the guest's values. | 537 | * SPRGs, so we need to reload them here with the guest's values. |
538 | */ | 538 | */ |
539 | lwz r3, VCPU_VRSAVE(r4) | 539 | lwz r3, VCPU_VRSAVE(r4) |
540 | lwz r5, VCPU_SHARED_SPRG4(r11) | 540 | PPC_LD(r5, VCPU_SHARED_SPRG4, r11) |
541 | mtspr SPRN_VRSAVE, r3 | 541 | mtspr SPRN_VRSAVE, r3 |
542 | lwz r6, VCPU_SHARED_SPRG5(r11) | 542 | PPC_LD(r6, VCPU_SHARED_SPRG5, r11) |
543 | mtspr SPRN_SPRG4W, r5 | 543 | mtspr SPRN_SPRG4W, r5 |
544 | lwz r7, VCPU_SHARED_SPRG6(r11) | 544 | PPC_LD(r7, VCPU_SHARED_SPRG6, r11) |
545 | mtspr SPRN_SPRG5W, r6 | 545 | mtspr SPRN_SPRG5W, r6 |
546 | lwz r8, VCPU_SHARED_SPRG7(r11) | 546 | PPC_LD(r8, VCPU_SHARED_SPRG7, r11) |
547 | mtspr SPRN_SPRG6W, r7 | 547 | mtspr SPRN_SPRG6W, r7 |
548 | mtspr SPRN_SPRG7W, r8 | 548 | mtspr SPRN_SPRG7W, r8 |
549 | 549 | ||