aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/include/asm/exception-64s.h
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/include/asm/exception-64s.h
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/include/asm/exception-64s.h')
-rw-r--r--arch/powerpc/include/asm/exception-64s.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/arch/powerpc/include/asm/exception-64s.h b/arch/powerpc/include/asm/exception-64s.h
index 4dfc51588be5..05e6d2ee1db9 100644
--- a/arch/powerpc/include/asm/exception-64s.h
+++ b/arch/powerpc/include/asm/exception-64s.h
@@ -199,10 +199,14 @@ END_FTR_SECTION_NESTED(ftr,ftr,943)
199 199
200#define __KVM_HANDLER(area, h, n) \ 200#define __KVM_HANDLER(area, h, n) \
201do_kvm_##n: \ 201do_kvm_##n: \
202 BEGIN_FTR_SECTION_NESTED(947) \
203 ld r10,area+EX_CFAR(r13); \
204 std r10,HSTATE_CFAR(r13); \
205 END_FTR_SECTION_NESTED(CPU_FTR_CFAR,CPU_FTR_CFAR,947); \
202 ld r10,area+EX_R10(r13); \ 206 ld r10,area+EX_R10(r13); \
203 stw r9,HSTATE_SCRATCH1(r13); \ 207 stw r9,HSTATE_SCRATCH1(r13); \
204 ld r9,area+EX_R9(r13); \ 208 ld r9,area+EX_R9(r13); \
205 std r12,HSTATE_SCRATCH0(r13); \ 209 std r12,HSTATE_SCRATCH0(r13); \
206 li r12,n; \ 210 li r12,n; \
207 b kvmppc_interrupt 211 b kvmppc_interrupt
208 212