Skip to contentSkip to conversation

arm: add check for global exclusive monitor

PATCH New Vladimir Murzin 1 participant 1 message Feb 22, 2013 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 arm: add check for global exclusive monitor

Since ARMv6 new atomic instructions have been introduced:
ldrex/strex. Several implementation are possible based on (1) global and local exclusive monitors and (2) local exclusive monitor and snoop unit.

In case of the 2nd options exclusive store operation on uncached region may be faulty.

Check for availability of global monitor to provide some hint about possible issues.

---
Changes since
v1:
- Using L_PTE_MT_BUFFERABLE instead of L_PTE_MT_UNCACHABLE Thanks to Russell for ponting this silly error
- added comment about how checking is done

 arch/arm/include/asm/bugs.h |   14 +++++++++--
 arch/arm/mm/fault-armv.c    |   55 +++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 67 insertions(+), 2 deletions(-)
arch/arm/include/asm/bugs.h +12 -2
index a97f1ea..29d73cd 100644
@@ -13,9 +13,19 @@
 #ifdef CONFIG_MMU
 extern void check_writebuffer_bugs(void);
 
-#define check_bugs() check_writebuffer_bugs()
+#if  __LINUX_ARM_ARCH__ < 6
+static void check_gmonitor_bugs(void) {};
 #else
-#define check_bugs() do { } while (0)
+extern void check_gmonitor_bugs(void);
+#endif
+
+static inline void check_bugs(void)
+{
+	check_writebuffer_bugs();
+	check_gmonitor_bugs();
+}
+#else
+static inline void check_bugs(void) { }
 #endif
 
 #endif
arch/arm/mm/fault-armv.c +55 -0

61 lines not on this page · raw message

Signature · 1 line
1.7.10.4