Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/x86 Add two pmap fields, will be used by NVMM.
details: https://anonhg.NetBSD.org/src/rev/1a3f218de7de
branches: trunk
changeset: 836802:1a3f218de7de
user: maxv <maxv%NetBSD.org@localhost>
date: Wed Nov 07 07:14:51 2018 +0000
description:
Add two pmap fields, will be used by NVMM.
diffstat:
sys/arch/x86/include/pmap.h | 6 +++++-
sys/arch/x86/x86/pmap.c | 5 +++--
sys/arch/x86/x86/x86_tlb.c | 9 +++++++--
3 files changed, 15 insertions(+), 5 deletions(-)
diffs (76 lines):
diff -r acb9a4cab946 -r 1a3f218de7de sys/arch/x86/include/pmap.h
--- a/sys/arch/x86/include/pmap.h Wed Nov 07 06:47:38 2018 +0000
+++ b/sys/arch/x86/include/pmap.h Wed Nov 07 07:14:51 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.h,v 1.88 2018/08/29 16:26:25 maxv Exp $ */
+/* $NetBSD: pmap.h,v 1.89 2018/11/07 07:14:51 maxv Exp $ */
/*
* Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -258,6 +258,10 @@
ptp mapped */
uint64_t pm_ncsw; /* for assertions */
struct vm_page *pm_gc_ptp; /* pages from pmap g/c */
+
+ /* Used by NVMM. */
+ void (*pm_tlb_flush)(struct pmap *);
+ void *pm_data;
};
/* macro to access pm_pdirpa slots */
diff -r acb9a4cab946 -r 1a3f218de7de sys/arch/x86/x86/pmap.c
--- a/sys/arch/x86/x86/pmap.c Wed Nov 07 06:47:38 2018 +0000
+++ b/sys/arch/x86/x86/pmap.c Wed Nov 07 07:14:51 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.309 2018/10/31 06:26:26 maxv Exp $ */
+/* $NetBSD: pmap.c,v 1.310 2018/11/07 07:14:51 maxv Exp $ */
/*
* Copyright (c) 2008, 2010, 2016, 2017 The NetBSD Foundation, Inc.
@@ -130,7 +130,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.309 2018/10/31 06:26:26 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.310 2018/11/07 07:14:51 maxv Exp $");
#include "opt_user_ldt.h"
#include "opt_lockdebug.h"
@@ -2378,6 +2378,7 @@
#endif
pmap->pm_flags = 0;
pmap->pm_gc_ptp = NULL;
+ pmap->pm_tlb_flush = NULL;
kcpuset_create(&pmap->pm_cpus, true);
kcpuset_create(&pmap->pm_kernel_cpus, true);
diff -r acb9a4cab946 -r 1a3f218de7de sys/arch/x86/x86/x86_tlb.c
--- a/sys/arch/x86/x86/x86_tlb.c Wed Nov 07 06:47:38 2018 +0000
+++ b/sys/arch/x86/x86/x86_tlb.c Wed Nov 07 07:14:51 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: x86_tlb.c,v 1.2 2018/05/19 16:51:32 jakllsch Exp $ */
+/* $NetBSD: x86_tlb.c,v 1.3 2018/11/07 07:14:51 maxv Exp $ */
/*-
* Copyright (c) 2008-2012 The NetBSD Foundation, Inc.
@@ -40,7 +40,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: x86_tlb.c,v 1.2 2018/05/19 16:51:32 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: x86_tlb.c,v 1.3 2018/11/07 07:14:51 maxv Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@@ -227,6 +227,11 @@
KASSERT((pte & PG_G) == 0 || pm == pmap_kernel());
#endif
+ if (__predict_false(pm->pm_tlb_flush != NULL)) {
+ (*pm->pm_tlb_flush)(pm);
+ return;
+ }
+
/*
* If tearing down the pmap, do nothing. We will flush later
* when we are ready to recycle/destroy it.
Home |
Main Index |
Thread Index |
Old Index