Module Name:    src
Committed By:   rin
Date:           Sat May  7 07:10:47 UTC 2022

Modified Files:
        src/sys/arch/powerpc/conf: files.powerpc
        src/sys/arch/powerpc/include: pmap.h
        src/sys/arch/powerpc/include/oea: pmap.h

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.100 -r1.101 src/sys/arch/powerpc/conf/files.powerpc
cvs rdiff -u -r1.41 -r1.42 src/sys/arch/powerpc/include/pmap.h
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/powerpc/include/oea/pmap.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/powerpc/conf/files.powerpc
diff -u src/sys/arch/powerpc/conf/files.powerpc:1.100 src/sys/arch/powerpc/conf/files.powerpc:1.101
--- src/sys/arch/powerpc/conf/files.powerpc:1.100	Thu Feb 17 16:09:00 2022
+++ src/sys/arch/powerpc/conf/files.powerpc	Sat May  7 07:10:46 2022
@@ -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/db_trace.c			d
 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.c			ppc_oea
 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

Index: src/sys/arch/powerpc/include/pmap.h
diff -u src/sys/arch/powerpc/include/pmap.h:1.41 src/sys/arch/powerpc/include/pmap.h:1.42
--- src/sys/arch/powerpc/include/pmap.h:1.41	Wed Feb 16 23:31:13 2022
+++ src/sys/arch/powerpc/include/pmap.h	Sat May  7 07:10:46 2022
@@ -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 @@ struct vm_page_md {
 
 __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_ */

Index: src/sys/arch/powerpc/include/oea/pmap.h
diff -u src/sys/arch/powerpc/include/oea/pmap.h:1.36 src/sys/arch/powerpc/include/oea/pmap.h:1.37
--- src/sys/arch/powerpc/include/oea/pmap.h:1.36	Wed Feb 16 23:31:13 2022
+++ src/sys/arch/powerpc/include/oea/pmap.h	Sat May  7 07:10:46 2022
@@ -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
  */

Reply via email to