Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/uvm/pmap Introduce PMAP_PV_TRACK_ONLY_STUBS option, by w...
details: https://anonhg.NetBSD.org/src/rev/cb7f68a455cd
branches: trunk
changeset: 365975:cb7f68a455cd
user: rin <rin%NetBSD.org@localhost>
date: Sat May 07 06:53:16 2022 +0000
description:
Introduce PMAP_PV_TRACK_ONLY_STUBS option, by which only empty stubs for
global functions in pmap_pvt.h are provided, instead of real support for
PV tracking.
Necessary for powerpc: Only one sub-arch (oea) has PV tracking support.
Others (booke/ibm4xx) do not at the moment (probably never for ibm4xx),
but __HAVE_PMAP_PV_TRACK is necessary, so that modules can be shared by
all of sub-archs.
diffstat:
sys/uvm/pmap/pmap.c | 8 ++++++--
sys/uvm/pmap/pmap.h | 4 ++--
sys/uvm/pmap/pmap_pvt.c | 35 +++++++++++++++++++++++++++++++++--
3 files changed, 41 insertions(+), 6 deletions(-)
diffs (107 lines):
diff -r 265959c4449d -r cb7f68a455cd sys/uvm/pmap/pmap.c
--- a/sys/uvm/pmap/pmap.c Sat May 07 06:31:39 2022 +0000
+++ b/sys/uvm/pmap/pmap.c Sat May 07 06:53:16 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.64 2022/04/09 23:38:33 riastradh Exp $ */
+/* $NetBSD: pmap.c,v 1.65 2022/05/07 06:53:16 rin Exp $ */
/*-
* Copyright (c) 1998, 2001 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.64 2022/04/09 23:38:33 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.65 2022/05/07 06:53:16 rin Exp $");
/*
* Manages physical address maps.
@@ -120,6 +120,10 @@
PMAP_NO_PV_UNCACHED to be defined
#endif
+#if defined(PMAP_PV_TRACK_ONLY_STUBS)
+#undef __HAVE_PMAP_PV_TRACK
+#endif
+
PMAP_COUNTER(remove_kernel_calls, "remove kernel calls");
PMAP_COUNTER(remove_kernel_pages, "kernel pages unmapped");
PMAP_COUNTER(remove_user_calls, "remove user calls");
diff -r 265959c4449d -r cb7f68a455cd sys/uvm/pmap/pmap.h
--- a/sys/uvm/pmap/pmap.h Sat May 07 06:31:39 2022 +0000
+++ b/sys/uvm/pmap/pmap.h Sat May 07 06:53:16 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.h,v 1.20 2021/03/19 07:51:33 skrll Exp $ */
+/* $NetBSD: pmap.h,v 1.21 2022/05/07 06:53:16 rin Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -203,7 +203,7 @@
void pmap_page_cache(struct vm_page_md *, bool);
#endif
-#ifdef __HAVE_PMAP_PV_TRACK
+#if defined(__HAVE_PMAP_PV_TRACK) && !defined(PMAP_PV_TRACK_ONLY_STUBS)
void pmap_pv_protect(paddr_t, vm_prot_t);
#endif
diff -r 265959c4449d -r cb7f68a455cd sys/uvm/pmap/pmap_pvt.c
--- a/sys/uvm/pmap/pmap_pvt.c Sat May 07 06:31:39 2022 +0000
+++ b/sys/uvm/pmap/pmap_pvt.c Sat May 07 06:53:16 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap_pvt.c,v 1.11 2021/07/21 06:35:45 skrll Exp $ */
+/* $NetBSD: pmap_pvt.c,v 1.12 2022/05/07 06:53:16 rin Exp $ */
/*-
* Copyright (c) 2014, 2020 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: pmap_pvt.c,v 1.11 2021/07/21 06:35:45 skrll Exp $");
+__RCSID("$NetBSD: pmap_pvt.c,v 1.12 2022/05/07 06:53:16 rin Exp $");
#include <sys/param.h>
#include <sys/atomic.h>
@@ -40,6 +40,7 @@
#include <uvm/uvm.h>
#include <uvm/pmap/pmap_pvt.h>
+#if !defined(PMAP_PV_TRACK_ONLY_STUBS)
/*
* unmanaged pv-tracked ranges
*
@@ -177,3 +178,33 @@
return &pvt->pvt_pages[pgno];
}
+#else /* PMAP_PV_TRACK_ONLY_STUBS */
+/*
+ * Provide empty stubs just for MODULAR kernels.
+ */
+
+void
+pmap_pv_init(void)
+{
+
+}
+
+void
+pmap_pv_track(paddr_t start, psize_t size)
+{
+
+}
+
+void
+pmap_pv_untrack(paddr_t start, psize_t size)
+{
+
+}
+
+struct pmap_page *
+pmap_pv_tracked(paddr_t pa)
+{
+
+ return NULL;
+}
+#endif
Home |
Main Index |
Thread Index |
Old Index