diff mbox series

[RFC,v4,part-3,01/14] mm/asi: Define the test ASI type

Message ID 20200504150235.12171-2-alexandre.chartre@oracle.com (mailing list archive)
State New, archived
Headers show
Series ASI - Part III (ASI Test Driver and CLI) | expand

Commit Message

Alexandre Chartre May 4, 2020, 3:02 p.m. UTC
Define the test ASI type which can be used for testing or experimenting
ASI.

Signed-off-by: Alexandre Chartre <alexandre.chartre@oracle.com>
---
 arch/x86/include/asm/asi.h | 2 ++
 arch/x86/mm/asi.c          | 1 +
 drivers/staging/Makefile   | 1 +
 3 files changed, 4 insertions(+)
diff mbox series

Patch

diff --git a/arch/x86/include/asm/asi.h b/arch/x86/include/asm/asi.h
index eafed750e07f..de4f790c630b 100644
--- a/arch/x86/include/asm/asi.h
+++ b/arch/x86/include/asm/asi.h
@@ -66,6 +66,7 @@  struct asi_tlb_state {
 #ifdef CONFIG_PAGE_TABLE_ISOLATION
 #define ASI_PCID_PREFIX_USER		0x80	/* user ASI */
 #endif
+#define ASI_PCID_PREFIX_TEST		0xff	/* test ASI */
 
 struct asi_type {
 	int			pcid_prefix;	/* PCID prefix */
@@ -156,6 +157,7 @@  extern int asi_init_dpt(struct dpt *dpt);
 #ifdef CONFIG_PAGE_TABLE_ISOLATION
 DECLARE_ASI_TYPE(user);
 #endif
+DECLARE_ASI_TYPE(test);
 
 static inline void asi_set_log_policy(struct asi *asi, int policy)
 {
diff --git a/arch/x86/mm/asi.c b/arch/x86/mm/asi.c
index 8b670ed13729..e0b0d70415d7 100644
--- a/arch/x86/mm/asi.c
+++ b/arch/x86/mm/asi.c
@@ -17,6 +17,7 @@ 
 #ifdef CONFIG_PAGE_TABLE_ISOLATION
 DEFINE_ASI_TYPE(user, ASI_PCID_PREFIX_USER, false);
 #endif
+DEFINE_ASI_TYPE(test, ASI_PCID_PREFIX_TEST, true);
 
 static void asi_log_fault(struct asi *asi, struct pt_regs *regs,
 			   unsigned long error_code, unsigned long address,
diff --git a/drivers/staging/Makefile b/drivers/staging/Makefile
index 4d34198151b3..fb50e669579b 100644
--- a/drivers/staging/Makefile
+++ b/drivers/staging/Makefile
@@ -50,3 +50,4 @@  obj-$(CONFIG_FIELDBUS_DEV)     += fieldbus/
 obj-$(CONFIG_KPC2000)		+= kpc2000/
 obj-$(CONFIG_QLGE)		+= qlge/
 obj-$(CONFIG_WFX)		+= wfx/
+obj-$(CONFIG_ADDRESS_SPACE_ISOLATION) += asi/