• Paul Mackerras's avatar
    powerpc: Save register r9-r13 values accurately on interrupt with bad stack · 1977b502
    Paul Mackerras authored
    When we take an interrupt or exception from kernel mode and the stack
    pointer is obviously not a kernel address (i.e. the top bit is 0), we
    switch to an emergency stack, save register values and panic.  However,
    on 64-bit server machines, we don't actually save the values of r9 - r13
    at the time of the interrupt, but rather values corrupted by the
    exception entry code for r12-r13, and nothing at all for r9-r11.
    
    This fixes it by passing a pointer to the register save area in the paca
    through to the bad_stack code in r3.  The register values are saved in
    one of the paca register save areas (depending on which exception this
    is).  Using the pointer in r3, the bad_stack code now retrieves the
    saved values of r9 - r13 and stores them in the exception frame on the
    emergency stack.  This also stores the normal exception frame marker
    ("regshere") in the exception frame.
    Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
    Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
    1977b502
exception-64s.h 9.37 KB