changeset 10850:3a0ff39117e1

Fixes for clean build after latest pull from head
author tide@localhost
date Tue, 28 Jul 2009 11:01:17 -0400
parents a2bd8982b64a
children 565954927ef2
files usr/src/lib/pkcs11/libkcfd/s390/Makefile usr/src/uts/common/fs/fsflush.c usr/src/uts/s390x/os/memnode.c usr/src/uts/s390x/os/startup.c usr/src/uts/s390x/vm/vm_dep.h
diffstat 5 files changed, 157 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/lib/pkcs11/libkcfd/s390/Makefile	Tue Jul 28 11:01:17 2009 -0400
@@ -0,0 +1,37 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2009 Sine Nomine Associates. All rights reserved.
+# Use is subject to license terms.
+#
+# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
+# Use is subject to license terms.
+#
+# lib/pkcs11/libkcfd/s390/Makefile
+#
+
+include $(SRC)/lib/Makefile.filter.com
+include ../Makefile.com
+
+install: all $(ROOTLIBDIR) .WAIT $(ROOTLIBS) $(ROOTLINKS) $(ROOTLINT)
+
+include	$(SRC)/lib/Makefile.filter.targ
--- a/usr/src/uts/common/fs/fsflush.c	Mon Jul 20 13:08:48 2009 -0400
+++ b/usr/src/uts/common/fs/fsflush.c	Tue Jul 28 11:01:17 2009 -0400
@@ -138,12 +138,6 @@
 	static ulong_t	nscan = 0;
 	static pgcnt_t	last_total_pages = 0;
 	static page_t	*pp = NULL;
-uint8_t key;
-#define GET_KEY(p,k)                            \
-        __asm__ ("      lgr     1,%1\n"         \
-                 "      lghi    %0,0\n"         \
-                 "      iske    %0,1\n"         \
-                 : "=r" (k) : "r" (p) : "1");
 
 	/*
 	 * Check to see if total_pages has changed.
--- a/usr/src/uts/s390x/os/memnode.c	Mon Jul 20 13:08:48 2009 -0400
+++ b/usr/src/uts/s390x/os/memnode.c	Tue Jul 28 11:01:17 2009 -0400
@@ -72,6 +72,20 @@
 /*========================= End of Defines =========================*/
 
 /*------------------------------------------------------------------*/
+/*             E x t e r n a l   R e f e r e n c e s 		    */
+/*------------------------------------------------------------------*/
+
+/*
+ * Platform hooks we will need.
+ */
+
+#pragma weak plat_build_mem_nodes
+#pragma weak plat_slice_add
+#pragma weak plat_slice_del
+
+/*========================= End of Externals =======================*/
+
+/*------------------------------------------------------------------*/
 /*                   P r o t o t y p e s                            */
 /*------------------------------------------------------------------*/
 
@@ -359,3 +373,43 @@
 }
 
 /*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/*                                                                  */
+/* Name		- mem_node_add_range.                               */
+/*                                                                  */
+/* Function	- Check for platform specific add routine and call  */
+/*		  it, otherwise call the add_slice routine.    	    */
+/*		                               		 	    */
+/*------------------------------------------------------------------*/
+
+void
+mem_node_add_range(pfn_t start, pfn_t end)
+{
+	if (&plat_slice_add)
+		plat_slice_add(start, end);
+	else
+		mem_node_add_slice(start, end);
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/*                                                                  */
+/* Name		- mem_node_del_range.                               */
+/*                                                                  */
+/* Function	- Check for platform specific del routine and call  */
+/*		  it, otherwise call the del_slice routine.    	    */
+/*		                               		 	    */
+/*------------------------------------------------------------------*/
+
+void
+mem_node_del_range(pfn_t start, pfn_t end)
+{
+	if (&plat_slice_del)
+		plat_slice_del(start, end);
+	else
+		mem_node_del_slice(start, end);
+}
+
+/*========================= End of Function ========================*/
--- a/usr/src/uts/s390x/os/startup.c	Mon Jul 20 13:08:48 2009 -0400
+++ b/usr/src/uts/s390x/os/startup.c	Tue Jul 28 11:01:17 2009 -0400
@@ -475,6 +475,16 @@
 struct seg *segkmap = &kmapseg;	// Kernel generic mapping segment 
 struct seg *segkpm = &kpmseg;	// 64bit kernel physical mapping segment 
 
+/*
+ * A static DR page_t VA map is reserved that can map the page structures
+ * for a domain's entire RA space. The pages that backs this space are
+ * dynamically allocated and need not be physically contiguous.  The DR
+ * map size is derived from KPM size.
+ */
+int ppvm_enable = 0;		/* Static virtual map for page structs */
+page_t *ppvm_base;		/* Base of page struct map */
+pgcnt_t ppvm_size = 0;		/* Size of page struct map */
+
 //
 // Size of nalloc area
 //
@@ -1447,6 +1457,42 @@
 		rw_exit(&kas.a_lock);
 	}
 
+	if (ppvm_enable) {
+		caddr_t ppvm_max;
+
+		/*
+		 * ppvm refers to the static VA space used to map
+		 * the page_t's for dynamically added memory.
+		 *
+		 * ppvm_base should not cross a potential VA hole.
+		 *
+		 * ppvm_size should be large enough to map the
+		 * page_t's needed to manage all of KPM range.
+		 */
+		ppvm_size =
+		    roundup(mmu_btop(kpm_size * vac_colors) * sizeof (page_t),
+		    MMU_PAGESIZE);
+		ppvm_max = (caddr_t)(0ull - ppvm_size);
+		ppvm_base = (page_t *)va;
+
+		if ((caddr_t)ppvm_base <= hole_end) {
+			cmn_err(CE_WARN,
+			    "Memory DR disabled: invalid DR map base: 0x%p\n",
+			    (void *)ppvm_base);
+			ppvm_enable = 0;
+		} else if ((caddr_t)ppvm_base > ppvm_max) {
+			uint64_t diff = (caddr_t)ppvm_base - ppvm_max;
+
+			cmn_err(CE_WARN,
+			    "Memory DR disabled: insufficient DR map size:"
+			    " 0x%lx (needed 0x%lx)\n",
+			    ppvm_size - diff, ppvm_size);
+			ppvm_enable = 0;
+		}
+		PRM_DEBUG(ppvm_size);
+		PRM_DEBUG(ppvm_base);
+	}
+
 	/*
 	 * Now create generic mapping segment.  This mapping
 	 * goes SEGMAPSIZE beyond SEGMAPBASE.  But if the total
--- a/usr/src/uts/s390x/vm/vm_dep.h	Mon Jul 20 13:08:48 2009 -0400
+++ b/usr/src/uts/s390x/vm/vm_dep.h	Tue Jul 28 11:01:17 2009 -0400
@@ -408,6 +408,26 @@
 }
 
 /*
+ * macro to call page_ctrs_adjust() when memory is added
+ * during a DR operation.
+ */
+#define	PAGE_CTRS_ADJUST(pfn, cnt, rv) {			       \
+	spgcnt_t _cnt = (spgcnt_t)(cnt);			       \
+	int _mn;						       \
+	pgcnt_t _np;						       \
+	pfn_t _pfn = (pfn);					       \
+	pfn_t _endpfn = _pfn + _cnt;				       \
+	while (_pfn < _endpfn) {				       \
+		_mn = PFN_2_MEM_NODE(_pfn);			       \
+		_np = MIN(_endpfn, mem_node_config[_mn].physmax + 1) - \
+		    _pfn;					       \
+		_pfn += _np;					       \
+		if ((rv = page_ctrs_adjust(_mn)) != 0)		       \
+			break;					       \
+	}							       \
+}
+
+/*
  * get the ecache setsize for the current cpu.
  */
 #define	CPUSETSIZE()	CACHE_SETSIZE