Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/powerpc Try to fix PV tracking support.



details:   https://anonhg.NetBSD.org/src/rev/261441e13191
branches:  trunk
changeset: 365976:261441e13191
user:      rin <rin%NetBSD.org@localhost>
date:      Sat May 07 07:10:46 2022 +0000

description:
Try to fix PV tracking support.

* For oea (with real PV tracking support):

  Define __HAVE_PMAP_PV_TRACK. Otherwise, pmap_pv_init() is not called by
  uvm_init().

* For booke and ibm4xx (without PV tracking support):

  For MODULAR kernel and modules, define __HAVE_PMAP_PV_TRACK together with
  PMAP_PV_TRACK_ONLY_STUBS, so that modules can be shared with oea.

Note that PMAP_PV_TRACK_ONLY_STUBS can be used even for oea,
as a compile-time option to strip real PV tracking support.

diffstat:

 sys/arch/powerpc/conf/files.powerpc |   5 +++--
 sys/arch/powerpc/include/oea/pmap.h |   5 ++++-
 sys/arch/powerpc/include/pmap.h     |  13 ++++++++++---
 3 files changed, 17 insertions(+), 6 deletions(-)

diffs (79 lines):

diff -r cb7f68a455cd -r 261441e13191 sys/arch/powerpc/conf/files.powerpc
--- a/sys/arch/powerpc/conf/files.powerpc       Sat May 07 06:53:16 2022 +0000
+++ b/sys/arch/powerpc/conf/files.powerpc       Sat May 07 07:10:46 2022 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: files.powerpc,v 1.100 2022/02/17 16:09:00 macallan Exp $
+#      $NetBSD: files.powerpc,v 1.101 2022/05/07 07:10:46 rin Exp $
 
 defflag        opt_altivec.h   ALTIVEC K_ALTIVEC PPC_HAVE_SPE
 defflag        opt_openpic.h   OPENPIC_DISTRIBUTE
@@ -32,6 +32,8 @@
 file   arch/powerpc/powerpc/fpu.c
 file   arch/powerpc/powerpc/intr_stubs.c               ppc_booke
 
+file   uvm/pmap/pmap_pvt.c                             modular | (ppc_oea | ppc_oea64 | ppc_oea64_bridge | ppc_oea601)
+
 # IBM 4xx Family files (40x)
 file   arch/powerpc/ibm4xx/pmap.c                      ppc_ibm4xx
 file   arch/powerpc/ibm4xx/trap.c                      ppc_ibm4xx
@@ -51,7 +53,6 @@
 file   arch/powerpc/oea/pmap64_bridge.c                ppc_oea64_bridge
 file   arch/powerpc/oea/pmap_kernel.c                  ppc_oea | ppc_oea64 | ppc_oea64_bridge | ppc_oea601
 file   arch/powerpc/powerpc/trap.c                     ppc_oea | ppc_oea64 | ppc_oea64_bridge | ppc_oea601
-file   uvm/pmap/pmap_pvt.c                             ppc_oea | ppc_oea64 | ppc_oea64_bridge | ppc_oea601
 
 # PPC BookE (MPC85xx) Family files
 file   arch/powerpc/booke/booke_machdep.c              ppc_booke
diff -r cb7f68a455cd -r 261441e13191 sys/arch/powerpc/include/oea/pmap.h
--- a/sys/arch/powerpc/include/oea/pmap.h       Sat May 07 06:53:16 2022 +0000
+++ b/sys/arch/powerpc/include/oea/pmap.h       Sat May 07 07:10:46 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap.h,v 1.36 2022/02/16 23:31:13 riastradh Exp $      */
+/*     $NetBSD: pmap.h,v 1.37 2022/05/07 07:10:46 rin Exp $    */
 
 /*-
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -48,6 +48,9 @@
 #endif
 #include <powerpc/oea/pte.h>
 
+#define        __HAVE_PMAP_PV_TRACK
+#include <uvm/pmap/pmap_pvt.h>
+
 /*
  * Pmap stuff
  */
diff -r cb7f68a455cd -r 261441e13191 sys/arch/powerpc/include/pmap.h
--- a/sys/arch/powerpc/include/pmap.h   Sat May 07 06:53:16 2022 +0000
+++ b/sys/arch/powerpc/include/pmap.h   Sat May 07 07:10:46 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap.h,v 1.41 2022/02/16 23:31:13 riastradh Exp $      */
+/*     $NetBSD: pmap.h,v 1.42 2022/05/07 07:10:46 rin Exp $    */
 
 #ifndef _POWERPC_PMAP_H_
 #define _POWERPC_PMAP_H_
@@ -22,8 +22,6 @@
 
 #endif /* !_MODULE */
 
-#include <uvm/pmap/pmap_pvt.h>
-
 #if !defined(_LOCORE) && (defined(MODULAR) || defined(_MODULE))
 /*
  * Both BOOKE and OEA use __HAVE_VM_PAGE_MD but IBM4XX doesn't so define
@@ -41,6 +39,15 @@
 
 __CTASSERT(sizeof(struct vm_page_md) == sizeof(uintptr_t)*5);
 
+#ifndef __HAVE_PMAP_PV_TRACK
+/*
+ * We need empty stubs for modules shared with all sub-archs.
+ */
+#define        __HAVE_PMAP_PV_TRACK
+#define        PMAP_PV_TRACK_ONLY_STUBS
+#include <uvm/pmap/pmap_pvt.h>
+#endif /* !__HAVE_PMAP_PV_TRACK */
+
 #endif /* !LOCORE && (MODULAR || _MODULE) */
 
 #endif /* !_POWERPC_PMAP_H_ */



Home | Main Index | Thread Index | Old Index