xref: /titanic_51/usr/src/uts/sun4u/vm/mach_vm_dep.c (revision 1e1e1eec7b6c75bbae2bca96dbbc420e6f85ca3f)
17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * CDDL HEADER START
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
507b65a64Saguzovsk  * Common Development and Distribution License (the "License").
607b65a64Saguzovsk  * You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate  *
87c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate  * and limitations under the License.
127c478bd9Sstevel@tonic-gate  *
137c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate  *
197c478bd9Sstevel@tonic-gate  * CDDL HEADER END
207c478bd9Sstevel@tonic-gate  */
217c478bd9Sstevel@tonic-gate /*
22*1e1e1eecSMichael Corcoran  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
237c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
247c478bd9Sstevel@tonic-gate  */
257c478bd9Sstevel@tonic-gate 
267c478bd9Sstevel@tonic-gate /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
277c478bd9Sstevel@tonic-gate /*	All Rights Reserved   */
287c478bd9Sstevel@tonic-gate 
297c478bd9Sstevel@tonic-gate /*
307c478bd9Sstevel@tonic-gate  * Portions of this source code were derived from Berkeley 4.3 BSD
317c478bd9Sstevel@tonic-gate  * under license from the Regents of the University of California.
327c478bd9Sstevel@tonic-gate  */
337c478bd9Sstevel@tonic-gate 
347c478bd9Sstevel@tonic-gate /*
357c478bd9Sstevel@tonic-gate  * UNIX machine dependent virtual memory support.
367c478bd9Sstevel@tonic-gate  */
377c478bd9Sstevel@tonic-gate 
387c478bd9Sstevel@tonic-gate #include <sys/vm.h>
397c478bd9Sstevel@tonic-gate #include <sys/exec.h>
407c478bd9Sstevel@tonic-gate #include <sys/cmn_err.h>
417c478bd9Sstevel@tonic-gate #include <sys/cpu_module.h>
427c478bd9Sstevel@tonic-gate #include <sys/cpu.h>
437c478bd9Sstevel@tonic-gate #include <sys/elf_SPARC.h>
447c478bd9Sstevel@tonic-gate #include <sys/archsystm.h>
457c478bd9Sstevel@tonic-gate #include <vm/hat_sfmmu.h>
467c478bd9Sstevel@tonic-gate #include <sys/memnode.h>
477c478bd9Sstevel@tonic-gate #include <sys/mem_cage.h>
487c478bd9Sstevel@tonic-gate #include <vm/vm_dep.h>
497c478bd9Sstevel@tonic-gate 
507c478bd9Sstevel@tonic-gate #if defined(__sparcv9) && defined(SF_ERRATA_57)
517c478bd9Sstevel@tonic-gate caddr_t errata57_limit;
527c478bd9Sstevel@tonic-gate #endif
537c478bd9Sstevel@tonic-gate 
547c478bd9Sstevel@tonic-gate uint_t page_colors = 0;
557c478bd9Sstevel@tonic-gate uint_t page_colors_mask = 0;
567c478bd9Sstevel@tonic-gate uint_t page_coloring_shift = 0;
577c478bd9Sstevel@tonic-gate int consistent_coloring;
5885f58038Sdp78419 int update_proc_pgcolorbase_after_fork = 0;
597c478bd9Sstevel@tonic-gate 
607c478bd9Sstevel@tonic-gate uint_t mmu_page_sizes = DEFAULT_MMU_PAGE_SIZES;
617c478bd9Sstevel@tonic-gate uint_t max_mmu_page_sizes = MMU_PAGE_SIZES;
627c478bd9Sstevel@tonic-gate uint_t mmu_hashcnt = DEFAULT_MAX_HASHCNT;
637c478bd9Sstevel@tonic-gate uint_t max_mmu_hashcnt = MAX_HASHCNT;
647c478bd9Sstevel@tonic-gate size_t mmu_ism_pagesize = DEFAULT_ISM_PAGESIZE;
657c478bd9Sstevel@tonic-gate 
667c478bd9Sstevel@tonic-gate /*
677c478bd9Sstevel@tonic-gate  * The sun4u hardware mapping sizes which will always be supported are
687c478bd9Sstevel@tonic-gate  * 8K, 64K, 512K and 4M.  If sun4u based machines need to support other
697c478bd9Sstevel@tonic-gate  * page sizes, platform or cpu specific routines need to modify the value.
707c478bd9Sstevel@tonic-gate  * The base pagesize (p_szc == 0) must always be supported by the hardware.
717c478bd9Sstevel@tonic-gate  */
727c478bd9Sstevel@tonic-gate int mmu_exported_pagesize_mask = (1 << TTE8K) | (1 << TTE64K) |
737c478bd9Sstevel@tonic-gate 	(1 << TTE512K) | (1 << TTE4M);
747c478bd9Sstevel@tonic-gate uint_t mmu_exported_page_sizes;
757c478bd9Sstevel@tonic-gate 
767c478bd9Sstevel@tonic-gate uint_t szc_2_userszc[MMU_PAGE_SIZES];
777c478bd9Sstevel@tonic-gate uint_t userszc_2_szc[MMU_PAGE_SIZES];
787c478bd9Sstevel@tonic-gate 
797c478bd9Sstevel@tonic-gate extern uint_t vac_colors_mask;
807c478bd9Sstevel@tonic-gate extern int vac_shift;
817c478bd9Sstevel@tonic-gate 
827c478bd9Sstevel@tonic-gate hw_pagesize_t hw_page_array[] = {
835d07b933Sdp78419 	{MMU_PAGESIZE, MMU_PAGESHIFT, 0, MMU_PAGESIZE >> MMU_PAGESHIFT},
845d07b933Sdp78419 	{MMU_PAGESIZE64K, MMU_PAGESHIFT64K, 0,
855d07b933Sdp78419 	    MMU_PAGESIZE64K >> MMU_PAGESHIFT},
865d07b933Sdp78419 	{MMU_PAGESIZE512K, MMU_PAGESHIFT512K, 0,
877c478bd9Sstevel@tonic-gate 	    MMU_PAGESIZE512K >> MMU_PAGESHIFT},
885d07b933Sdp78419 	{MMU_PAGESIZE4M, MMU_PAGESHIFT4M, 0, MMU_PAGESIZE4M >> MMU_PAGESHIFT},
895d07b933Sdp78419 	{MMU_PAGESIZE32M, MMU_PAGESHIFT32M, 0,
905d07b933Sdp78419 	    MMU_PAGESIZE32M >> MMU_PAGESHIFT},
915d07b933Sdp78419 	{MMU_PAGESIZE256M, MMU_PAGESHIFT256M, 0,
927c478bd9Sstevel@tonic-gate 	    MMU_PAGESIZE256M >> MMU_PAGESHIFT},
935d07b933Sdp78419 	{0, 0, 0, 0}
947c478bd9Sstevel@tonic-gate };
957c478bd9Sstevel@tonic-gate 
967c478bd9Sstevel@tonic-gate /*
97bb121940Sdp78419  * Maximum page size used to map 64-bit memory segment kmem64_base..kmem64_end
98bb121940Sdp78419  */
99bb121940Sdp78419 int	max_bootlp_tteszc = TTE4M;
100bb121940Sdp78419 
101bb121940Sdp78419 /*
102ec25b48fSsusans  * use_text_pgsz64k and use_text_pgsz512k allow the user to turn on these
103ec25b48fSsusans  * additional text page sizes for USIII-IV+ and OPL by changing the default
104ec25b48fSsusans  * values via /etc/system.
1057c478bd9Sstevel@tonic-gate  */
106ec25b48fSsusans int	use_text_pgsz64K = 0;
107ec25b48fSsusans int	use_text_pgsz512K = 0;
1087c478bd9Sstevel@tonic-gate 
1097c478bd9Sstevel@tonic-gate /*
110ec25b48fSsusans  * Maximum and default segment size tunables for user heap, stack, private
111ec25b48fSsusans  * and shared anonymous memory, and user text and initialized data.
1127c478bd9Sstevel@tonic-gate  */
113ec25b48fSsusans size_t max_uheap_lpsize = MMU_PAGESIZE4M;
114ec25b48fSsusans size_t default_uheap_lpsize = MMU_PAGESIZE;
115ec25b48fSsusans size_t max_ustack_lpsize = MMU_PAGESIZE4M;
116ec25b48fSsusans size_t default_ustack_lpsize = MMU_PAGESIZE;
117ec25b48fSsusans size_t max_privmap_lpsize = MMU_PAGESIZE4M;
118ec25b48fSsusans size_t max_uidata_lpsize = MMU_PAGESIZE;
119ec25b48fSsusans size_t max_utext_lpsize = MMU_PAGESIZE4M;
120ec25b48fSsusans size_t max_shm_lpsize = MMU_PAGESIZE4M;
1217c478bd9Sstevel@tonic-gate 
122ec25b48fSsusans void
123ec25b48fSsusans adjust_data_maxlpsize(size_t ismpagesize)
124ec25b48fSsusans {
125ec25b48fSsusans 	if (max_uheap_lpsize == MMU_PAGESIZE4M) {
126ec25b48fSsusans 		max_uheap_lpsize = ismpagesize;
127ec25b48fSsusans 	}
128ec25b48fSsusans 	if (max_ustack_lpsize == MMU_PAGESIZE4M) {
129ec25b48fSsusans 		max_ustack_lpsize = ismpagesize;
130ec25b48fSsusans 	}
131ec25b48fSsusans 	if (max_privmap_lpsize == MMU_PAGESIZE4M) {
132ec25b48fSsusans 		max_privmap_lpsize = ismpagesize;
133ec25b48fSsusans 	}
134ec25b48fSsusans 	if (max_shm_lpsize == MMU_PAGESIZE4M) {
135ec25b48fSsusans 		max_shm_lpsize = ismpagesize;
136ec25b48fSsusans 	}
137ec25b48fSsusans }
138e12a8a13Ssusans 
139e12a8a13Ssusans /*
1407c478bd9Sstevel@tonic-gate  * map_addr_proc() is the routine called when the system is to
1417c478bd9Sstevel@tonic-gate  * choose an address for the user.  We will pick an address
1427c478bd9Sstevel@tonic-gate  * range which is just below the current stack limit.  The
1437c478bd9Sstevel@tonic-gate  * algorithm used for cache consistency on machines with virtual
1447c478bd9Sstevel@tonic-gate  * address caches is such that offset 0 in the vnode is always
1457c478bd9Sstevel@tonic-gate  * on a shm_alignment'ed aligned address.  Unfortunately, this
1467c478bd9Sstevel@tonic-gate  * means that vnodes which are demand paged will not be mapped
1477c478bd9Sstevel@tonic-gate  * cache consistently with the executable images.  When the
1487c478bd9Sstevel@tonic-gate  * cache alignment for a given object is inconsistent, the
1497c478bd9Sstevel@tonic-gate  * lower level code must manage the translations so that this
1507c478bd9Sstevel@tonic-gate  * is not seen here (at the cost of efficiency, of course).
1517c478bd9Sstevel@tonic-gate  *
15246ab9534Smec  * Every mapping will have a redzone of a single page on either side of
15346ab9534Smec  * the request. This is done to leave one page unmapped between segments.
15446ab9534Smec  * This is not required, but it's useful for the user because if their
15546ab9534Smec  * program strays across a segment boundary, it will catch a fault
15646ab9534Smec  * immediately making debugging a little easier.  Currently the redzone
15746ab9534Smec  * is mandatory.
15846ab9534Smec  *
15946ab9534Smec  *
1607c478bd9Sstevel@tonic-gate  * addrp is a value/result parameter.
1617c478bd9Sstevel@tonic-gate  *	On input it is a hint from the user to be used in a completely
1627c478bd9Sstevel@tonic-gate  *	machine dependent fashion.  For MAP_ALIGN, addrp contains the
16346ab9534Smec  *	minimal alignment, which must be some "power of two" multiple of
16446ab9534Smec  *	pagesize.
1657c478bd9Sstevel@tonic-gate  *
1667c478bd9Sstevel@tonic-gate  *	On output it is NULL if no address can be found in the current
1677c478bd9Sstevel@tonic-gate  *	processes address space or else an address that is currently
1687c478bd9Sstevel@tonic-gate  *	not mapped for len bytes with a page of red zone on either side.
1697c478bd9Sstevel@tonic-gate  *	If vacalign is true, then the selected address will obey the alignment
1707c478bd9Sstevel@tonic-gate  *	constraints of a vac machine based on the given off value.
1717c478bd9Sstevel@tonic-gate  */
1727c478bd9Sstevel@tonic-gate /*ARGSUSED4*/
1737c478bd9Sstevel@tonic-gate void
1747c478bd9Sstevel@tonic-gate map_addr_proc(caddr_t *addrp, size_t len, offset_t off, int vacalign,
1757c478bd9Sstevel@tonic-gate     caddr_t userlimit, struct proc *p, uint_t flags)
1767c478bd9Sstevel@tonic-gate {
1777c478bd9Sstevel@tonic-gate 	struct as *as = p->p_as;
1787c478bd9Sstevel@tonic-gate 	caddr_t addr;
1797c478bd9Sstevel@tonic-gate 	caddr_t base;
1807c478bd9Sstevel@tonic-gate 	size_t slen;
1817c478bd9Sstevel@tonic-gate 	uintptr_t align_amount;
1827c478bd9Sstevel@tonic-gate 	int allow_largepage_alignment = 1;
1837c478bd9Sstevel@tonic-gate 
1847c478bd9Sstevel@tonic-gate 	base = p->p_brkbase;
1857c478bd9Sstevel@tonic-gate 	if (userlimit < as->a_userlimit) {
1867c478bd9Sstevel@tonic-gate 		/*
1877c478bd9Sstevel@tonic-gate 		 * This happens when a program wants to map something in
1887c478bd9Sstevel@tonic-gate 		 * a range that's accessible to a program in a smaller
1897c478bd9Sstevel@tonic-gate 		 * address space.  For example, a 64-bit program might
1907c478bd9Sstevel@tonic-gate 		 * be calling mmap32(2) to guarantee that the returned
1917c478bd9Sstevel@tonic-gate 		 * address is below 4Gbytes.
1927c478bd9Sstevel@tonic-gate 		 */
1937c478bd9Sstevel@tonic-gate 		ASSERT(userlimit > base);
1947c478bd9Sstevel@tonic-gate 		slen = userlimit - base;
1957c478bd9Sstevel@tonic-gate 	} else {
196*1e1e1eecSMichael Corcoran 		slen = p->p_usrstack - base -
197*1e1e1eecSMichael Corcoran 		    ((p->p_stk_ctl + PAGEOFFSET) & PAGEMASK);
1987c478bd9Sstevel@tonic-gate 	}
1997c478bd9Sstevel@tonic-gate 
20046ab9534Smec 	/* Make len be a multiple of PAGESIZE */
20146ab9534Smec 	len = (len + PAGEOFFSET) & PAGEMASK;
2027c478bd9Sstevel@tonic-gate 
2037c478bd9Sstevel@tonic-gate 	/*
2047c478bd9Sstevel@tonic-gate 	 *  If the request is larger than the size of a particular
2057c478bd9Sstevel@tonic-gate 	 *  mmu level, then we use that level to map the request.
2067c478bd9Sstevel@tonic-gate 	 *  But this requires that both the virtual and the physical
2077c478bd9Sstevel@tonic-gate 	 *  addresses be aligned with respect to that level, so we
2087c478bd9Sstevel@tonic-gate 	 *  do the virtual bit of nastiness here.
2097c478bd9Sstevel@tonic-gate 	 *
2107c478bd9Sstevel@tonic-gate 	 *  For 32-bit processes, only those which have specified
2117c478bd9Sstevel@tonic-gate 	 *  MAP_ALIGN or an addr will be aligned on a page size > 4MB. Otherwise
2127c478bd9Sstevel@tonic-gate 	 *  we can potentially waste up to 256MB of the 4G process address
2137c478bd9Sstevel@tonic-gate 	 *  space just for alignment.
2147c478bd9Sstevel@tonic-gate 	 */
2157c478bd9Sstevel@tonic-gate 	if (p->p_model == DATAMODEL_ILP32 && ((flags & MAP_ALIGN) == 0 ||
2167c478bd9Sstevel@tonic-gate 	    ((uintptr_t)*addrp) != 0)) {
2177c478bd9Sstevel@tonic-gate 		allow_largepage_alignment = 0;
2187c478bd9Sstevel@tonic-gate 	}
2197c478bd9Sstevel@tonic-gate 	if ((mmu_page_sizes == max_mmu_page_sizes) &&
2207c478bd9Sstevel@tonic-gate 	    allow_largepage_alignment &&
2217c478bd9Sstevel@tonic-gate 	    (len >= MMU_PAGESIZE256M)) {	/* 256MB mappings */
2227c478bd9Sstevel@tonic-gate 		align_amount = MMU_PAGESIZE256M;
2237c478bd9Sstevel@tonic-gate 	} else if ((mmu_page_sizes == max_mmu_page_sizes) &&
2247c478bd9Sstevel@tonic-gate 	    allow_largepage_alignment &&
2257c478bd9Sstevel@tonic-gate 	    (len >= MMU_PAGESIZE32M)) {	/* 32MB mappings */
2267c478bd9Sstevel@tonic-gate 		align_amount = MMU_PAGESIZE32M;
2277c478bd9Sstevel@tonic-gate 	} else if (len >= MMU_PAGESIZE4M) {  /* 4MB mappings */
2287c478bd9Sstevel@tonic-gate 		align_amount = MMU_PAGESIZE4M;
2297c478bd9Sstevel@tonic-gate 	} else if (len >= MMU_PAGESIZE512K) { /* 512KB mappings */
2307c478bd9Sstevel@tonic-gate 		align_amount = MMU_PAGESIZE512K;
2317c478bd9Sstevel@tonic-gate 	} else if (len >= MMU_PAGESIZE64K) { /* 64KB mappings */
2327c478bd9Sstevel@tonic-gate 		align_amount = MMU_PAGESIZE64K;
2337c478bd9Sstevel@tonic-gate 	} else  {
2347c478bd9Sstevel@tonic-gate 		/*
2357c478bd9Sstevel@tonic-gate 		 * Align virtual addresses on a 64K boundary to ensure
2367c478bd9Sstevel@tonic-gate 		 * that ELF shared libraries are mapped with the appropriate
2377c478bd9Sstevel@tonic-gate 		 * alignment constraints by the run-time linker.
2387c478bd9Sstevel@tonic-gate 		 */
2397c478bd9Sstevel@tonic-gate 		align_amount = ELF_SPARC_MAXPGSZ;
2407c478bd9Sstevel@tonic-gate 		if ((flags & MAP_ALIGN) && ((uintptr_t)*addrp != 0) &&
2417c478bd9Sstevel@tonic-gate 		    ((uintptr_t)*addrp < align_amount))
2427c478bd9Sstevel@tonic-gate 			align_amount = (uintptr_t)*addrp;
2437c478bd9Sstevel@tonic-gate 	}
2447c478bd9Sstevel@tonic-gate 
2457c478bd9Sstevel@tonic-gate 	/*
2467c478bd9Sstevel@tonic-gate 	 * 64-bit processes require 1024K alignment of ELF shared libraries.
2477c478bd9Sstevel@tonic-gate 	 */
2487c478bd9Sstevel@tonic-gate 	if (p->p_model == DATAMODEL_LP64)
2497c478bd9Sstevel@tonic-gate 		align_amount = MAX(align_amount, ELF_SPARCV9_MAXPGSZ);
2507c478bd9Sstevel@tonic-gate #ifdef VAC
2517c478bd9Sstevel@tonic-gate 	if (vac && vacalign && (align_amount < shm_alignment))
2527c478bd9Sstevel@tonic-gate 		align_amount = shm_alignment;
2537c478bd9Sstevel@tonic-gate #endif
2547c478bd9Sstevel@tonic-gate 
2557c478bd9Sstevel@tonic-gate 	if ((flags & MAP_ALIGN) && ((uintptr_t)*addrp > align_amount)) {
2567c478bd9Sstevel@tonic-gate 		align_amount = (uintptr_t)*addrp;
2577c478bd9Sstevel@tonic-gate 	}
25846ab9534Smec 
25946ab9534Smec 	ASSERT(ISP2(align_amount));
26046ab9534Smec 	ASSERT(align_amount == 0 || align_amount >= PAGESIZE);
2617c478bd9Sstevel@tonic-gate 
2627c478bd9Sstevel@tonic-gate 	/*
2637c478bd9Sstevel@tonic-gate 	 * Look for a large enough hole starting below the stack limit.
26446ab9534Smec 	 * After finding it, use the upper part.
2657c478bd9Sstevel@tonic-gate 	 */
2667c478bd9Sstevel@tonic-gate 	as_purge(as);
26746ab9534Smec 	off = off & (align_amount - 1);
26846ab9534Smec 	if (as_gap_aligned(as, len, &base, &slen, AH_HI, NULL, align_amount,
26946ab9534Smec 	    PAGESIZE, off) == 0) {
2707c478bd9Sstevel@tonic-gate 		caddr_t as_addr;
2717c478bd9Sstevel@tonic-gate 
27246ab9534Smec 		/*
27346ab9534Smec 		 * addr is the highest possible address to use since we have
27446ab9534Smec 		 * a PAGESIZE redzone at the beginning and end.
27546ab9534Smec 		 */
27646ab9534Smec 		addr = base + slen - (PAGESIZE + len);
2777c478bd9Sstevel@tonic-gate 		as_addr = addr;
2787c478bd9Sstevel@tonic-gate 		/*
27946ab9534Smec 		 * Round address DOWN to the alignment amount and
28046ab9534Smec 		 * add the offset in.
28146ab9534Smec 		 * If addr is greater than as_addr, len would not be large
28246ab9534Smec 		 * enough to include the redzone, so we must adjust down
28346ab9534Smec 		 * by the alignment amount.
2847c478bd9Sstevel@tonic-gate 		 */
2857c478bd9Sstevel@tonic-gate 		addr = (caddr_t)((uintptr_t)addr & (~(align_amount - 1l)));
28646ab9534Smec 		addr += (long)off;
28746ab9534Smec 		if (addr > as_addr) {
28846ab9534Smec 			addr -= align_amount;
2897c478bd9Sstevel@tonic-gate 		}
2907c478bd9Sstevel@tonic-gate 
29146ab9534Smec 		ASSERT(addr > base);
29246ab9534Smec 		ASSERT(addr + len < base + slen);
2937c478bd9Sstevel@tonic-gate 		ASSERT(((uintptr_t)addr & (align_amount - 1l)) ==
29446ab9534Smec 		    ((uintptr_t)(off)));
2957c478bd9Sstevel@tonic-gate 		*addrp = addr;
2967c478bd9Sstevel@tonic-gate 
2977c478bd9Sstevel@tonic-gate #if defined(SF_ERRATA_57)
2987c478bd9Sstevel@tonic-gate 		if (AS_TYPE_64BIT(as) && addr < errata57_limit) {
2997c478bd9Sstevel@tonic-gate 			*addrp = NULL;
3007c478bd9Sstevel@tonic-gate 		}
3017c478bd9Sstevel@tonic-gate #endif
3027c478bd9Sstevel@tonic-gate 	} else {
3037c478bd9Sstevel@tonic-gate 		*addrp = NULL;	/* no more virtual space */
3047c478bd9Sstevel@tonic-gate 	}
3057c478bd9Sstevel@tonic-gate }
3067c478bd9Sstevel@tonic-gate 
3077c478bd9Sstevel@tonic-gate /*
3087c478bd9Sstevel@tonic-gate  * Platform-dependent page scrub call.
3097c478bd9Sstevel@tonic-gate  */
3107c478bd9Sstevel@tonic-gate void
3117c478bd9Sstevel@tonic-gate pagescrub(page_t *pp, uint_t off, uint_t len)
3127c478bd9Sstevel@tonic-gate {
3137c478bd9Sstevel@tonic-gate 	/*
3147c478bd9Sstevel@tonic-gate 	 * For now, we rely on the fact that pagezero() will
3157c478bd9Sstevel@tonic-gate 	 * always clear UEs.
3167c478bd9Sstevel@tonic-gate 	 */
3177c478bd9Sstevel@tonic-gate 	pagezero(pp, off, len);
3187c478bd9Sstevel@tonic-gate }
3197c478bd9Sstevel@tonic-gate 
3207c478bd9Sstevel@tonic-gate /*ARGSUSED*/
3217c478bd9Sstevel@tonic-gate void
3227c478bd9Sstevel@tonic-gate sync_data_memory(caddr_t va, size_t len)
3237c478bd9Sstevel@tonic-gate {
3247c478bd9Sstevel@tonic-gate 	cpu_flush_ecache();
3257c478bd9Sstevel@tonic-gate }
3267c478bd9Sstevel@tonic-gate 
3277c478bd9Sstevel@tonic-gate /*
3287c478bd9Sstevel@tonic-gate  * platform specific large pages for kernel heap support
3297c478bd9Sstevel@tonic-gate  */
3307c478bd9Sstevel@tonic-gate void
3317c478bd9Sstevel@tonic-gate mmu_init_kcontext()
3327c478bd9Sstevel@tonic-gate {
3337c478bd9Sstevel@tonic-gate 	extern void set_kcontextreg();
3347c478bd9Sstevel@tonic-gate 
3357c478bd9Sstevel@tonic-gate 	if (kcontextreg)
3367c478bd9Sstevel@tonic-gate 		set_kcontextreg();
3377c478bd9Sstevel@tonic-gate }
3387c478bd9Sstevel@tonic-gate 
3397c478bd9Sstevel@tonic-gate void
3407c478bd9Sstevel@tonic-gate contig_mem_init(void)
3417c478bd9Sstevel@tonic-gate {
3427c478bd9Sstevel@tonic-gate 	/* not applicable to sun4u */
3437c478bd9Sstevel@tonic-gate }
344102033aaSdp78419 
345aaa10e67Sha137994 /*ARGSUSED*/
346aaa10e67Sha137994 caddr_t
347aaa10e67Sha137994 contig_mem_prealloc(caddr_t alloc_base, pgcnt_t npages)
348aaa10e67Sha137994 {
349aaa10e67Sha137994 	/* not applicable to sun4u */
350aaa10e67Sha137994 	return (alloc_base);
351aaa10e67Sha137994 }
352aaa10e67Sha137994 
353102033aaSdp78419 size_t
354102033aaSdp78419 exec_get_spslew(void)
355102033aaSdp78419 {
356102033aaSdp78419 	return (0);
357102033aaSdp78419 }
358