powerpc: Fix interrupt range check on debug exception
authorBharat Bhushan <r65777@freescale.com>
Mon, 29 Apr 2013 22:18:11 +0000 (22:18 +0000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Thu, 2 May 2013 00:31:01 +0000 (10:31 +1000)
We do not want to take single step and branch-taken debug exception
in kernel exception code. But the address range check was not covering
all kernel exception handlers address range.

With this patch we defined the interrupt_end label which defines the
end on kernel exception code. So now we check interrupt_base to
interrupt_end range for not handling debug exception in kernel
exception entry.

Signed-off-by: Bharat Bhushan <bharat.bhushan@freescale.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
arch/powerpc/kernel/head_44x.S
arch/powerpc/kernel/head_booke.h
arch/powerpc/kernel/head_fsl_booke.S

index 7a2e5e421abfd2f6da2331844471c9eedc3b7847..97e2671cde7f4ae662264d0bbf377f95c0d6e58e 100644 (file)
@@ -769,6 +769,8 @@ finish_tlb_load_47x:
         */
        DEBUG_CRIT_EXCEPTION
 
+interrupt_end:
+
 /*
  * Global functions
  */
index b3853504498dfc27f490c71870603d128a851b43..a620203f7de33fd52b56f4ca12dc227dd24ec139 100644 (file)
@@ -281,13 +281,13 @@ label:
        andis.  r10,r10,(DBSR_IC|DBSR_BT)@h;                                  \
        beq+    2f;                                                           \
                                                                              \
-       lis     r10,KERNELBASE@h;       /* check if exception in vectors */   \
-       ori     r10,r10,KERNELBASE@l;                                         \
+       lis     r10,interrupt_base@h;   /* check if exception in vectors */   \
+       ori     r10,r10,interrupt_base@l;                                     \
        cmplw   r12,r10;                                                      \
        blt+    2f;                     /* addr below exception vectors */    \
                                                                              \
-       lis     r10,DebugDebug@h;                                             \
-       ori     r10,r10,DebugDebug@l;                                         \
+       lis     r10,interrupt_end@h;                                          \
+       ori     r10,r10,interrupt_end@l;                                      \
        cmplw   r12,r10;                                                      \
        bgt+    2f;                     /* addr above exception vectors */    \
                                                                              \
@@ -334,13 +334,13 @@ label:
        andis.  r10,r10,(DBSR_IC|DBSR_BT)@h;                                  \
        beq+    2f;                                                           \
                                                                              \
-       lis     r10,KERNELBASE@h;       /* check if exception in vectors */   \
-       ori     r10,r10,KERNELBASE@l;                                         \
+       lis     r10,interrupt_base@h;   /* check if exception in vectors */   \
+       ori     r10,r10,interrupt_base@l;                                     \
        cmplw   r12,r10;                                                      \
        blt+    2f;                     /* addr below exception vectors */    \
                                                                              \
-       lis     r10,DebugCrit@h;                                              \
-       ori     r10,r10,DebugCrit@l;                                          \
+       lis     r10,interrupt_end@h;                                          \
+       ori     r10,r10,interrupt_end@l;                                      \
        cmplw   r12,r10;                                                      \
        bgt+    2f;                     /* addr above exception vectors */    \
                                                                              \
index 6f62a737f607164d4bd63e9a1992e30df8f16334..d10a7cacccd203b7af0814a19f3ea9f6ed1f000a 100644 (file)
@@ -605,6 +605,8 @@ END_FTR_SECTION_IFSET(CPU_FTR_EMB_HV)
        /* Embedded Hypervisor Privilege */
        EXCEPTION(0, HV_PRIV, Ehvpriv, unknown_exception, EXC_XFER_EE)
 
+interrupt_end:
+
 /*
  * Local functions
  */