aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kvm/book3s_hv_rmhandlers.S
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2013-02-04 13:10:51 -0500
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2013-02-15 00:54:33 -0500
commit0acb91112a148fbb31678e66839ef757f3be3aa4 (patch)
tree9516f90d03a55bc07f8b13b67d497dea8062430c /arch/powerpc/kvm/book3s_hv_rmhandlers.S
parent1707dd161349e6c54170c88d94fed012e3d224e3 (diff)
powerpc/kvm/book3s_hv: Preserve guest CFAR register value
The CFAR (Come-From Address Register) is a useful debugging aid that exists on POWER7 processors. Currently HV KVM doesn't save or restore the CFAR register for guest vcpus, making the CFAR of limited use in guests. This adds the necessary code to capture the CFAR value saved in the early exception entry code (it has to be saved before any branch is executed), save it in the vcpu.arch struct, and restore it on entry to the guest. Signed-off-by: Paul Mackerras <paulus@samba.org> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/kvm/book3s_hv_rmhandlers.S')
-rw-r--r--arch/powerpc/kvm/book3s_hv_rmhandlers.S9
1 files changed, 9 insertions, 0 deletions
diff --git a/arch/powerpc/kvm/book3s_hv_rmhandlers.S b/arch/powerpc/kvm/book3s_hv_rmhandlers.S
index 10b6c358dd77..e33d11f1b977 100644
--- a/arch/powerpc/kvm/book3s_hv_rmhandlers.S
+++ b/arch/powerpc/kvm/book3s_hv_rmhandlers.S
@@ -539,6 +539,11 @@ fast_guest_return:
539 539
540 /* Enter guest */ 540 /* Enter guest */
541 541
542BEGIN_FTR_SECTION
543 ld r5, VCPU_CFAR(r4)
544 mtspr SPRN_CFAR, r5
545END_FTR_SECTION_IFSET(CPU_FTR_CFAR)
546
542 ld r5, VCPU_LR(r4) 547 ld r5, VCPU_LR(r4)
543 lwz r6, VCPU_CR(r4) 548 lwz r6, VCPU_CR(r4)
544 mtlr r5 549 mtlr r5
@@ -604,6 +609,10 @@ kvmppc_interrupt:
604 lwz r4, HSTATE_SCRATCH1(r13) 609 lwz r4, HSTATE_SCRATCH1(r13)
605 std r3, VCPU_GPR(R12)(r9) 610 std r3, VCPU_GPR(R12)(r9)
606 stw r4, VCPU_CR(r9) 611 stw r4, VCPU_CR(r9)
612BEGIN_FTR_SECTION
613 ld r3, HSTATE_CFAR(r13)
614 std r3, VCPU_CFAR(r9)
615END_FTR_SECTION_IFSET(CPU_FTR_CFAR)
607 616
608 /* Restore R1/R2 so we can handle faults */ 617 /* Restore R1/R2 so we can handle faults */
609 ld r1, HSTATE_HOST_R1(r13) 618 ld r1, HSTATE_HOST_R1(r13)