Thread (22 messages) 22 messages, 3 authors, 2016-08-01

Re: [RFC PATCH v2 10/11] powerpc: Support to replay PMIs

flat view

From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Date: 2016-08-01 09:14:31

On Mon, 2016-08-01 at 18:07 +1000, Nicholas Piggin wrote:
quoted
+static inline unsigned long soft_irq_set_level(int value)
+{
+     unsigned long flags, zero;
+
+     asm volatile(
+             "li %1,%3; lbz %0,%2(13); stb %1,%2(13)"
+             : "=r" (flags), "=&r" (zero)
+             : "i" (offsetof(struct paca_struct, soft_enabled)),\
+               "i" (value)
+             : "memory");
+
+     return flags;
+}
I would add a WARN_ON (possibly under control
of CONFIG_TRACE_IRQFLAGS(*) to verify we only ever use this to make
interrupts "less enabled".

(*) Or check if distros use CONFIG_TRACE_IRQFLAGS these days, then
create a new CONFIG_DEBUG_IRQ or something like that, and also move
the other use of CONFIG_TRACE_IRQFLAGS in local_irq_restore that
checks the msr as we really don't want that in production kernels.

Cheers,
Ben.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help