Add two pmap fields, will be used by NVMM.

This commit is contained in:
maxv 2018-11-07 07:14:51 +00:00
parent 7374a22668
commit 8c426f1bc1
3 changed files with 15 additions and 5 deletions

View File

@ -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 @@ struct pmap {
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 */

View File

@ -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 @@ pmap_create(void)
#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);

View File

@ -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 @@ pmap_tlb_shootdown(struct pmap *pm, vaddr_t va, pt_entry_t pte, tlbwhy_t why)
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.