aboutsummaryrefslogtreecommitdiff
path: root/arch/arm64/include/asm/daifflags.h
diff options
context:
space:
mode:
authorGravatar Marc Zyngier <maz@kernel.org> 2019-10-02 10:06:12 +0100
committerGravatar Catalin Marinas <catalin.marinas@arm.com> 2019-10-15 12:26:09 +0100
commitf226650494c6aa87526d12135b7de8b8c074f3de (patch)
tree1c00f90dac02fdb1240153bab7a9faa8565aa52a /arch/arm64/include/asm/daifflags.h
parentLinux 5.4-rc3 (diff)
downloadlinux-f226650494c6aa87526d12135b7de8b8c074f3de.tar.gz
linux-f226650494c6aa87526d12135b7de8b8c074f3de.tar.bz2
linux-f226650494c6aa87526d12135b7de8b8c074f3de.zip
arm64: Relax ICC_PMR_EL1 accesses when ICC_CTLR_EL1.PMHE is clear
The GICv3 architecture specification is incredibly misleading when it comes to PMR and the requirement for a DSB. It turns out that this DSB is only required if the CPU interface sends an Upstream Control message to the redistributor in order to update the RD's view of PMR. This message is only sent when ICC_CTLR_EL1.PMHE is set, which isn't the case in Linux. It can still be set from EL3, so some special care is required. But the upshot is that in the (hopefuly large) majority of the cases, we can drop the DSB altogether. This relies on a new static key being set if the boot CPU has PMHE set. The drawback is that this static key has to be exported to modules. Cc: Will Deacon <will@kernel.org> Cc: James Morse <james.morse@arm.com> Cc: Julien Thierry <julien.thierry.kdev@gmail.com> Cc: Suzuki K Poulose <suzuki.poulose@arm.com> Signed-off-by: Marc Zyngier <maz@kernel.org> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Diffstat (limited to 'arch/arm64/include/asm/daifflags.h')
-rw-r--r--arch/arm64/include/asm/daifflags.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/arm64/include/asm/daifflags.h b/arch/arm64/include/asm/daifflags.h
index 063c964af705..53cd5fab79a8 100644
--- a/arch/arm64/include/asm/daifflags.h
+++ b/arch/arm64/include/asm/daifflags.h
@@ -8,6 +8,7 @@
#include <linux/irqflags.h>
#include <asm/arch_gicv3.h>
+#include <asm/barrier.h>
#include <asm/cpufeature.h>
#define DAIF_PROCCTX 0
@@ -65,7 +66,7 @@ static inline void local_daif_restore(unsigned long flags)
if (system_uses_irq_prio_masking()) {
gic_write_pmr(GIC_PRIO_IRQON);
- dsb(sy);
+ pmr_sync();
}
} else if (system_uses_irq_prio_masking()) {
u64 pmr;