powerpc/64s/exception: INT_HANDLER support HDAR/HDSISR and use it in HDSI
authorNicholas Piggin <npiggin@gmail.com>
Fri, 2 Aug 2019 10:56:50 +0000 (20:56 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Fri, 30 Aug 2019 01:14:57 +0000 (11:14 +1000)
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20190802105709.27696-26-npiggin@gmail.com
arch/powerpc/kernel/exceptions-64s.S

index d2aa63b6a8a81499786b9c8ae475aa497007c048..476e4bbf1bf5e8e6c35f7835ec6319b4f582b78d 100644 (file)
@@ -620,11 +620,19 @@ END_FTR_SECTION_IFSET(CPU_FTR_CAN_NAP)
        GET_SCRATCH0(r10)
        std     r10,\area\()+EX_R13(r13)
        .if \dar
+       .if \hsrr
+       mfspr   r10,SPRN_HDAR
+       .else
        mfspr   r10,SPRN_DAR
+       .endif
        std     r10,\area\()+EX_DAR(r13)
        .endif
        .if \dsisr
+       .if \hsrr
+       mfspr   r10,SPRN_HDSISR
+       .else
        mfspr   r10,SPRN_DSISR
+       .endif
        stw     r10,\area\()+EX_DSISR(r13)
        .endif
 
@@ -1563,17 +1571,13 @@ EXC_COMMON(single_step_common, 0xd00, single_step_exception)
 
 
 EXC_REAL_BEGIN(h_data_storage, 0xe00, 0x20)
-       INT_HANDLER h_data_storage, 0xe00, ool=1, hsrr=EXC_HV, kvm=1
+       INT_HANDLER h_data_storage, 0xe00, ool=1, hsrr=EXC_HV, dar=1, dsisr=1, kvm=1
 EXC_REAL_END(h_data_storage, 0xe00, 0x20)
 EXC_VIRT_BEGIN(h_data_storage, 0x4e00, 0x20)
-       INT_HANDLER h_data_storage, 0xe00, ool=1, virt=1, hsrr=EXC_HV, kvm=1
+       INT_HANDLER h_data_storage, 0xe00, ool=1, virt=1, hsrr=EXC_HV, dar=1, dsisr=1, kvm=1
 EXC_VIRT_END(h_data_storage, 0x4e00, 0x20)
 TRAMP_KVM_HV_SKIP(PACA_EXGEN, 0xe00)
 EXC_COMMON_BEGIN(h_data_storage_common)
-       mfspr   r10,SPRN_HDAR
-       std     r10,PACA_EXGEN+EX_DAR(r13)
-       mfspr   r10,SPRN_HDSISR
-       stw     r10,PACA_EXGEN+EX_DSISR(r13)
        EXCEPTION_COMMON(PACA_EXGEN, 0xe00)
        bl      save_nvgprs
        RECONCILE_IRQ_STATE(r10, r11)