@@ -469,6 +469,12 @@ static inline bool arch_irqs_disabled(void)
return arch_irqs_disabled_flags(arch_local_save_flags());
}
+/*for common entry*/
+static __always_inline bool regs_irqs_disabled(struct pt_regs *regs)
+{
+ return arch_irqs_disabled();
+}
+
#define hard_irq_disable() arch_local_irq_disable()
static inline bool arch_irq_disabled_regs(struct pt_regs *regs)
@@ -311,7 +311,9 @@ notrace unsigned long interrupt_exit_user_prepare(struct pt_regs *regs)
BUG_ON(regs_is_unrecoverable(regs));
BUG_ON(arch_irq_disabled_regs(regs));
CT_WARN_ON(ct_state() == CONTEXT_USER);
+#ifdef CONFIG_PPC64
local_paca->irqentry_s = irqentry_enter(regs);
+#endif
/*
* We don't need to restore AMR on the way back to userspace for KUAP.
@@ -424,7 +426,9 @@ notrace unsigned long interrupt_exit_kernel_prepare(struct pt_regs *regs)
* AMR value from the check above.
*/
kuap_kernel_restore(regs, kuap);
+#ifdef CONFIG_PPC64
irqentry_exit(regs, local_paca->irqentry_s);
+#endif
return ret;
}
@@ -8,6 +8,7 @@
#include <linux/seccomp.h>
#include <linux/sched.h>
+#include <linux/irqentry-state.h>
#include <asm/entry-common.h>
/*
fix irqentry in 32bit code path and hw_irq helpers. Signed-off-by: Luming Yu <luming.yu@shingroup.cn> --- arch/powerpc/include/asm/hw_irq.h | 6 ++++++ arch/powerpc/kernel/interrupt.c | 4 ++++ include/linux/entry-common.h | 1 + 3 files changed, 11 insertions(+)