aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--arch/arm64/include/asm/assembler.h4
-rw-r--r--arch/arm64/include/asm/irqflags.h35
2 files changed, 29 insertions, 10 deletions
diff --git a/arch/arm64/include/asm/assembler.h b/arch/arm64/include/asm/assembler.h
index 51aaeb7facf6..a94cab1f1e02 100644
--- a/arch/arm64/include/asm/assembler.h
+++ b/arch/arm64/include/asm/assembler.h
@@ -82,6 +82,7 @@
dsb sy
#else
msr daifset, #2
+ dsb sy
#endif
.endm
@@ -93,6 +94,7 @@
dsb sy
#else
msr daifclr, #2
+ dsb sy
#endif
.endm
@@ -114,6 +116,7 @@
dsb sy
#else
msr daif, \olddaif
+ dsb sy
#endif
.endm
@@ -158,6 +161,7 @@
enable_irq \tmp
#else
msr daifclr, #(8 | 2)
+ dsb sy
#endif
.endm
diff --git a/arch/arm64/include/asm/irqflags.h b/arch/arm64/include/asm/irqflags.h
index 585db64456c1..80ed0d4c3191 100644
--- a/arch/arm64/include/asm/irqflags.h
+++ b/arch/arm64/include/asm/irqflags.h
@@ -22,36 +22,47 @@
#ifndef CONFIG_USE_ICC_SYSREGS_FOR_IRQFLAGS
+#include <linux/irqchip/arm-gic-v3.h>
+
/*
* CPU interrupt mask handling.
*/
static inline unsigned long arch_local_irq_save(void)
{
unsigned long flags;
+ unsigned long pmr = 0xef;
asm volatile(
"mrs %0, daif // arch_local_irq_save\n"
- "msr daifset, #2"
+ "msr daifset, #2\n"
+ "msr_s " __stringify(ICC_PMR_EL1) ",%1\n"
+ "dsb sy"
: "=r" (flags)
- :
+ : "r" (pmr)
: "memory");
return flags;
}
static inline void arch_local_irq_enable(void)
{
+ unsigned long pmr = 0xf0;
asm volatile(
- "msr daifclr, #2 // arch_local_irq_enable"
- :
+ "msr daifclr, #2 // arch_local_irq_enable\n"
+ "msr_s " __stringify(ICC_PMR_EL1) ",%0\n"
+ "dsb sy"
:
+ : "r" (pmr)
: "memory");
}
static inline void arch_local_irq_disable(void)
{
+ unsigned long pmr = 0xef;
asm volatile(
- "msr daifset, #2 // arch_local_irq_disable"
- :
+ "msr daifset, #2 // arch_local_irq_disable\n"
+ "msr_s " __stringify(ICC_PMR_EL1) ",%0\n"
+ "dsb sy"
:
+ : "r" (pmr)
: "memory");
}
@@ -74,10 +85,14 @@ static inline unsigned long arch_local_save_flags(void)
*/
static inline void arch_local_irq_restore(unsigned long flags)
{
+ unsigned long pmr = 0xf0;
+
asm volatile(
- "msr daif, %0 // arch_local_irq_restore"
+ "msr daif, %0 // arch_local_irq_restore\n"
+ "msr_s " __stringify(ICC_PMR_EL1) ",%1\n"
+ "dsb sy"
:
- : "r" (flags)
+ : "r" (flags), "r" (pmr)
: "memory");
}
@@ -101,7 +116,7 @@ static inline unsigned long arch_local_irq_save(void)
"// arch_local_irq_save\n"
"mrs_s %0, " __stringify(ICC_PMR_EL1) "\n"
"msr_s " __stringify(ICC_PMR_EL1) ",%1\n"
- "dsb sy\n"
+ //"dsb sy\n"
: "=&r" (flags)
: "r" (masked)
: "memory");
@@ -129,7 +144,7 @@ static inline void arch_local_irq_disable(void)
asm volatile(
"// arch_local_irq_disable\n"
"msr_s " __stringify(ICC_PMR_EL1) ",%0\n"
- "dsb sy\n"
+ //"dsb sy\n"
:
: "r" (masked)
: "memory");