@@ -177,6 +177,18 @@ static inline pgd_t *asi_pgd(struct asi *asi)
return asi->pgd;
}
+/* IMPORTANT: Any modification to the name here should also be applied to
+ * include/asm-generic/vmlinux.lds.h */
+#define ASI_NON_SENSITIVE_SECTION_NAME ".data..asi_non_sensitive"
+#define ASI_NON_SENSITIVE_READ_MOSTLY_SECTION_NAME \
+ ".data..asi_non_sensitive_readmostly"
+
+#define __asi_not_sensitive \
+ __section(ASI_NON_SENSITIVE_SECTION_NAME)
+
+#define __asi_not_sensitive_readmostly \
+ __section(ASI_NON_SENSITIVE_READ_MOSTLY_SECTION_NAME)
+
#else /* CONFIG_ADDRESS_SPACE_ISOLATION */
static inline void asi_intr_enter(void) { }
@@ -121,6 +121,12 @@ void asi_flush_tlb_range(struct asi *asi, void *addr, size_t len) { }
#define static_asi_enabled() false
+/* IMPORTANT: Any modification to the name here should also be applied to
+ * include/asm-generic/vmlinux.lds.h */
+
+#define __asi_not_sensitive
+#define __asi_not_sensitive_readmostly
+
#endif /* !_ASSEMBLY_ */
#endif /* !CONFIG_ADDRESS_SPACE_ISOLATION */
@@ -374,10 +374,26 @@
. = ALIGN(PAGE_SIZE); \
__nosave_end = .;
+#ifdef CONFIG_ADDRESS_SPACE_ISOLATION
+#define ASI_NOT_SENSITIVE_DATA(page_align) \
+ . = ALIGN(page_align); \
+ __start_asi_nonsensitive = .; \
+ *(.data..asi_non_sensitive) \
+ . = ALIGN(page_align); \
+ __end_asi_nonsensitive = .; \
+ __start_asi_nonsensitive_readmostly = .; \
+ *(.data..asi_non_sensitive_readmostly) \
+ . = ALIGN(page_align); \
+ __end_asi_nonsensitive_readmostly = .;
+#else
+#define ASI_NOT_SENSITIVE_DATA
+#endif
+
#define PAGE_ALIGNED_DATA(page_align) \
. = ALIGN(page_align); \
*(.data..page_aligned) \
- . = ALIGN(page_align);
+ . = ALIGN(page_align); \
+ ASI_NOT_SENSITIVE_DATA(page_align)
#define READ_MOSTLY_DATA(align) \
. = ALIGN(align); \