- The Compare and Swap instruction is used to implement spinlocks. Otherwise,
the load-/store-exclusive instruction pair is used.
+ARMv8.2
+~~~~~~~
+
+This Architecture Extension is targeted when ``ARM_ARCH_MAJOR`` == 8 and
+``ARM_ARCH_MINOR`` >= 2.
+
+- The Common not Private (CnP) bit is enabled to indicate that multiple
+ Page Entries in the same Inner Shareable domain use the same translation
+ table entries for a given stage of translation for a particular translation
+ regime.
+
Code Structure
--------------
((endian) & SPSR_E_MASK) << SPSR_E_SHIFT | \
((aif) & SPSR_AIF_MASK) << SPSR_AIF_SHIFT)
+/*
+ * TTBR definitions
+ */
+#define TTBR_CNP_BIT 0x1
+
/*
* CTR definitions
*/
(((endian) & SPSR_E_MASK) << SPSR_E_SHIFT) | \
(((aif) & SPSR_AIF_MASK) << SPSR_AIF_SHIFT))
+/*
+ * TTBR Definitions
+ */
+#define TTBR_CNP_BIT 0x1
+
/*
* CTR_EL0 definitions
*/
#include <cassert.h>
#include <platform_def.h>
#include <utils.h>
+#include <utils_def.h>
#include <xlat_tables_v2.h>
#include "../xlat_tables_private.h"
/* Set TTBR0 bits as well */
ttbr0 = (uint64_t)(uintptr_t) base_table;
+#if ARM_ARCH_AT_LEAST(8, 2)
+ /*
+ * Enable CnP bit so as to share page tables with all PEs.
+ * Mandatory for ARMv8.2 implementations.
+ */
+ ttbr0 |= TTBR_CNP_BIT;
+#endif
/* Now program the relevant system registers */
write_mair0(mair0);
#include <platform_def.h>
#include <sys/types.h>
#include <utils.h>
+#include <utils_def.h>
#include <xlat_tables_v2.h>
#include "../xlat_tables_private.h"
\
write_mair_el##_el(mair); \
write_tcr_el##_el(tcr); \
+ \
+ /* Set TTBR bits as well */ \
+ if (ARM_ARCH_AT_LEAST(8, 2)) { \
+ /* Enable CnP bit so as to share page tables */ \
+ /* with all PEs. This is mandatory for */ \
+ /* ARMv8.2 implementations. */ \
+ ttbr |= TTBR_CNP_BIT; \
+ } \
write_ttbr0_el##_el(ttbr); \
\
/* Ensure all translation table writes have drained */ \