summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kvm/book3s_interrupts.S
diff options
context:
space:
mode:
authorAlexander Graf <agraf@suse.de>2012-03-05 16:00:28 +0100
committerPaul Mackerras <paulus@samba.org>2012-04-03 08:42:34 +0200
commite1f8acf8380abfd52aefbfa524e74af5ce0c8492 (patch)
tree39f2637c1a941185003e9e270bf0b4580acde029 /arch/powerpc/kvm/book3s_interrupts.S
parentKVM: PPC: Book3S HV: Save and restore CR in __kvmppc_vcore_entry (diff)
downloadlinux-e1f8acf8380abfd52aefbfa524e74af5ce0c8492.tar.xz
linux-e1f8acf8380abfd52aefbfa524e74af5ce0c8492.zip
KVM: PPC: Save/Restore CR over vcpu_run
On PPC, CR2-CR4 are nonvolatile, thus have to be saved across function calls. We didn't respect that for any architecture until Paul spotted it in his patch for Book3S-HV. This patch saves/restores CR for all KVM capable PPC hosts. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/kvm/book3s_interrupts.S')
-rw-r--r--arch/powerpc/kvm/book3s_interrupts.S7
1 files changed, 7 insertions, 0 deletions
diff --git a/arch/powerpc/kvm/book3s_interrupts.S b/arch/powerpc/kvm/book3s_interrupts.S
index 0a8515a5c042..3e35383bdb21 100644
--- a/arch/powerpc/kvm/book3s_interrupts.S
+++ b/arch/powerpc/kvm/book3s_interrupts.S
@@ -84,6 +84,10 @@ kvm_start_entry:
/* Save non-volatile registers (r14 - r31) */
SAVE_NVGPRS(r1)
+ /* Save CR */
+ mfcr r14
+ stw r14, _CCR(r1)
+
/* Save LR */
PPC_STL r0, _LINK(r1)
@@ -165,6 +169,9 @@ kvm_exit_loop:
PPC_LL r4, _LINK(r1)
mtlr r4
+ lwz r14, _CCR(r1)
+ mtcr r14
+
/* Restore non-volatile host registers (r14 - r31) */
REST_NVGPRS(r1)