[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1562855138-19507-20-git-send-email-alexandre.chartre@oracle.com>
Date: Thu, 11 Jul 2019 16:25:31 +0200
From: Alexandre Chartre <alexandre.chartre@...cle.com>
To: pbonzini@...hat.com, rkrcmar@...hat.com, tglx@...utronix.de,
mingo@...hat.com, bp@...en8.de, hpa@...or.com,
dave.hansen@...ux.intel.com, luto@...nel.org, peterz@...radead.org,
kvm@...r.kernel.org, x86@...nel.org, linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Cc: konrad.wilk@...cle.com, jan.setjeeilers@...cle.com,
liran.alon@...cle.com, jwadams@...gle.com, graf@...zon.de,
rppt@...ux.vnet.ibm.com, alexandre.chartre@...cle.com
Subject: [RFC v2 19/26] mm/asi: Add option to map RCU data
Add an option to map RCU data when creating an ASI. This will map
the percpu rcu_data (which is not exported by the kernel), and
allow ASI to use RCU without faulting.
Signed-off-by: Alexandre Chartre <alexandre.chartre@...cle.com>
---
arch/x86/include/asm/asi.h | 1 +
arch/x86/mm/asi.c | 4 ++++
2 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/arch/x86/include/asm/asi.h b/arch/x86/include/asm/asi.h
index a277e43..8199618 100644
--- a/arch/x86/include/asm/asi.h
+++ b/arch/x86/include/asm/asi.h
@@ -18,6 +18,7 @@
#define ASI_MAP_STACK_CANARY 0x01 /* map stack canary */
#define ASI_MAP_CPU_PTR 0x02 /* for get_cpu_var()/this_cpu_ptr() */
#define ASI_MAP_CURRENT_TASK 0x04 /* map the current task */
+#define ASI_MAP_RCU_DATA 0x08 /* map rcu data */
enum page_table_level {
PGT_LEVEL_PTE,
diff --git a/arch/x86/mm/asi.c b/arch/x86/mm/asi.c
index acd1135..20c23dc 100644
--- a/arch/x86/mm/asi.c
+++ b/arch/x86/mm/asi.c
@@ -7,6 +7,7 @@
#include <linux/export.h>
#include <linux/gfp.h>
+#include <linux/irq_work.h>
#include <linux/mm.h>
#include <linux/printk.h>
#include <linux/sched/debug.h>
@@ -16,6 +17,8 @@
#include <asm/bug.h>
#include <asm/mmu_context.h>
+#include "../../../kernel/rcu/tree.h"
+
/* ASI sessions, one per cpu */
DEFINE_PER_CPU_PAGE_ALIGNED(struct asi_session, cpu_asi_session);
@@ -29,6 +32,7 @@ struct asi_map_option asi_map_percpu_options[] = {
{ ASI_MAP_STACK_CANARY, &fixed_percpu_data, sizeof(fixed_percpu_data) },
{ ASI_MAP_CPU_PTR, &this_cpu_off, sizeof(this_cpu_off) },
{ ASI_MAP_CURRENT_TASK, ¤t_task, sizeof(current_task) },
+ { ASI_MAP_RCU_DATA, &rcu_data, sizeof(rcu_data) },
};
static void asi_log_fault(struct asi *asi, struct pt_regs *regs,
--
1.7.1
Powered by blists - more mailing lists