powerpc: Improve behaviour of irq tracing on 64-bit exception entry
Some exceptions would unconditionally disable interrupts on entry, which is fine, but calling lockdep every time not only adds more overhead than strictly needed, but also means we get quite a few "redudant" disable logged, which makes it hard to spot the really bad ones. So instead, split the macro used by the exception code into a normal one and a separate one used when CONFIG_TRACE_IRQFLAGS is enabled, and make the later skip th tracing if interrupts were already disabled. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
This commit is contained in:
parent
1421ae0b29
commit
1b70117924
|
@ -272,15 +272,34 @@ label##_hv: \
|
||||||
_MASKABLE_EXCEPTION_PSERIES(vec, label, \
|
_MASKABLE_EXCEPTION_PSERIES(vec, label, \
|
||||||
EXC_HV, SOFTEN_TEST_HV)
|
EXC_HV, SOFTEN_TEST_HV)
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Our exception common code can be passed various "additions"
|
||||||
|
* to specify the behaviour of interrupts, whether to kick the
|
||||||
|
* runlatch, etc...
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Exception addition: Hard disable interrupts */
|
||||||
|
#ifdef CONFIG_TRACE_IRQFLAGS
|
||||||
|
#define DISABLE_INTS \
|
||||||
|
lbz r10,PACASOFTIRQEN(r13); \
|
||||||
|
li r11,0; \
|
||||||
|
cmpwi cr0,r10,0; \
|
||||||
|
stb r11,PACAHARDIRQEN(r13); \
|
||||||
|
beq 44f; \
|
||||||
|
stb r11,PACASOFTIRQEN(r13); \
|
||||||
|
TRACE_DISABLE_INTS; \
|
||||||
|
44:
|
||||||
|
#else
|
||||||
#define DISABLE_INTS \
|
#define DISABLE_INTS \
|
||||||
li r11,0; \
|
li r11,0; \
|
||||||
stb r11,PACASOFTIRQEN(r13); \
|
stb r11,PACASOFTIRQEN(r13); \
|
||||||
stb r11,PACAHARDIRQEN(r13); \
|
stb r11,PACAHARDIRQEN(r13)
|
||||||
TRACE_DISABLE_INTS
|
#endif /* CONFIG_TRACE_IRQFLAGS */
|
||||||
|
|
||||||
|
/* Exception addition: Keep interrupt state */
|
||||||
#define ENABLE_INTS \
|
#define ENABLE_INTS \
|
||||||
ld r12,_MSR(r1); \
|
|
||||||
mfmsr r11; \
|
mfmsr r11; \
|
||||||
|
ld r12,_MSR(r1); \
|
||||||
rlwimi r11,r12,0,MSR_EE; \
|
rlwimi r11,r12,0,MSR_EE; \
|
||||||
mtmsrd r11,1
|
mtmsrd r11,1
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue