xref: /titanic_51/usr/src/uts/common/vm/seg_kpm.c (revision dc32d872cbeb56532bcea030255db9cd79bac7da)
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
57c478bd9Sstevel@tonic-gate  * Common Development and Distribution License, Version 1.0 only
67c478bd9Sstevel@tonic-gate  * (the "License").  You may not use this file except in compliance
77c478bd9Sstevel@tonic-gate  * with the License.
87c478bd9Sstevel@tonic-gate  *
97c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
107c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
117c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
127c478bd9Sstevel@tonic-gate  * and limitations under the License.
137c478bd9Sstevel@tonic-gate  *
147c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
157c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
167c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
177c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
187c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
197c478bd9Sstevel@tonic-gate  *
207c478bd9Sstevel@tonic-gate  * CDDL HEADER END
217c478bd9Sstevel@tonic-gate  */
227c478bd9Sstevel@tonic-gate /*
234fc2445aSelowe  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
247c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
257c478bd9Sstevel@tonic-gate  */
267c478bd9Sstevel@tonic-gate 
277c478bd9Sstevel@tonic-gate /*
287c478bd9Sstevel@tonic-gate  * Kernel Physical Mapping (kpm) segment driver (segkpm).
297c478bd9Sstevel@tonic-gate  *
307c478bd9Sstevel@tonic-gate  * This driver delivers along with the hat_kpm* interfaces an alternative
317c478bd9Sstevel@tonic-gate  * mechanism for kernel mappings within the 64-bit Solaris operating system,
327c478bd9Sstevel@tonic-gate  * which allows the mapping of all physical memory into the kernel address
337c478bd9Sstevel@tonic-gate  * space at once. This is feasible in 64 bit kernels, e.g. for Ultrasparc II
347c478bd9Sstevel@tonic-gate  * and beyond processors, since the available VA range is much larger than
357c478bd9Sstevel@tonic-gate  * possible physical memory. Momentarily all physical memory is supported,
367c478bd9Sstevel@tonic-gate  * that is represented by the list of memory segments (memsegs).
377c478bd9Sstevel@tonic-gate  *
387c478bd9Sstevel@tonic-gate  * Segkpm mappings have also very low overhead and large pages are used
397c478bd9Sstevel@tonic-gate  * (when possible) to minimize the TLB and TSB footprint. It is also
407c478bd9Sstevel@tonic-gate  * extentable for other than Sparc architectures (e.g. AMD64). Main
417c478bd9Sstevel@tonic-gate  * advantage is the avoidance of the TLB-shootdown X-calls, which are
427c478bd9Sstevel@tonic-gate  * normally needed when a kernel (global) mapping has to be removed.
437c478bd9Sstevel@tonic-gate  *
447c478bd9Sstevel@tonic-gate  * First example of a kernel facility that uses the segkpm mapping scheme
457c478bd9Sstevel@tonic-gate  * is seg_map, where it is used as an alternative to hat_memload().
467c478bd9Sstevel@tonic-gate  * See also hat layer for more information about the hat_kpm* routines.
477c478bd9Sstevel@tonic-gate  * The kpm facilty can be turned off at boot time (e.g. /etc/system).
487c478bd9Sstevel@tonic-gate  */
497c478bd9Sstevel@tonic-gate 
507c478bd9Sstevel@tonic-gate #include <sys/types.h>
517c478bd9Sstevel@tonic-gate #include <sys/param.h>
527c478bd9Sstevel@tonic-gate #include <sys/sysmacros.h>
537c478bd9Sstevel@tonic-gate #include <sys/systm.h>
547c478bd9Sstevel@tonic-gate #include <sys/vnode.h>
557c478bd9Sstevel@tonic-gate #include <sys/cmn_err.h>
567c478bd9Sstevel@tonic-gate #include <sys/debug.h>
577c478bd9Sstevel@tonic-gate #include <sys/thread.h>
587c478bd9Sstevel@tonic-gate #include <sys/cpuvar.h>
597c478bd9Sstevel@tonic-gate #include <sys/bitmap.h>
607c478bd9Sstevel@tonic-gate #include <sys/atomic.h>
611bd5c35fSelowe #include <sys/lgrp.h>
627c478bd9Sstevel@tonic-gate 
637c478bd9Sstevel@tonic-gate #include <vm/seg_kmem.h>
647c478bd9Sstevel@tonic-gate #include <vm/seg_kpm.h>
657c478bd9Sstevel@tonic-gate #include <vm/hat.h>
667c478bd9Sstevel@tonic-gate #include <vm/as.h>
677c478bd9Sstevel@tonic-gate #include <vm/seg.h>
687c478bd9Sstevel@tonic-gate #include <vm/page.h>
697c478bd9Sstevel@tonic-gate 
707c478bd9Sstevel@tonic-gate /*
717c478bd9Sstevel@tonic-gate  * Global kpm controls.
727c478bd9Sstevel@tonic-gate  * See also platform and mmu specific controls.
737c478bd9Sstevel@tonic-gate  *
747c478bd9Sstevel@tonic-gate  * kpm_enable -- global on/off switch for segkpm.
757c478bd9Sstevel@tonic-gate  * . Set by default on 64bit platforms that have kpm support.
767c478bd9Sstevel@tonic-gate  * . Will be disabled from platform layer if not supported.
777c478bd9Sstevel@tonic-gate  * . Can be disabled via /etc/system.
787c478bd9Sstevel@tonic-gate  *
797c478bd9Sstevel@tonic-gate  * kpm_smallpages -- use only regular/system pagesize for kpm mappings.
807c478bd9Sstevel@tonic-gate  * . Can be useful for critical debugging of kpm clients.
817c478bd9Sstevel@tonic-gate  * . Set to zero by default for platforms that support kpm large pages.
827c478bd9Sstevel@tonic-gate  *   The use of kpm large pages reduces the footprint of kpm meta data
837c478bd9Sstevel@tonic-gate  *   and has all the other advantages of using large pages (e.g TLB
847c478bd9Sstevel@tonic-gate  *   miss reduction).
857c478bd9Sstevel@tonic-gate  * . Set by default for platforms that don't support kpm large pages or
867c478bd9Sstevel@tonic-gate  *   where large pages cannot be used for other reasons (e.g. there are
877c478bd9Sstevel@tonic-gate  *   only few full associative TLB entries available for large pages).
887c478bd9Sstevel@tonic-gate  *
897c478bd9Sstevel@tonic-gate  * segmap_kpm -- separate on/off switch for segmap using segkpm:
907c478bd9Sstevel@tonic-gate  * . Set by default.
917c478bd9Sstevel@tonic-gate  * . Will be disabled when kpm_enable is zero.
927c478bd9Sstevel@tonic-gate  * . Will be disabled when MAXBSIZE != PAGESIZE.
937c478bd9Sstevel@tonic-gate  * . Can be disabled via /etc/system.
947c478bd9Sstevel@tonic-gate  *
957c478bd9Sstevel@tonic-gate  */
967c478bd9Sstevel@tonic-gate int kpm_enable = 1;
977c478bd9Sstevel@tonic-gate int kpm_smallpages = 0;
987c478bd9Sstevel@tonic-gate int segmap_kpm = 1;
997c478bd9Sstevel@tonic-gate 
1007c478bd9Sstevel@tonic-gate /*
1017c478bd9Sstevel@tonic-gate  * Private seg op routines.
1027c478bd9Sstevel@tonic-gate  */
1037c478bd9Sstevel@tonic-gate faultcode_t segkpm_fault(struct hat *hat, struct seg *seg, caddr_t addr,
1047c478bd9Sstevel@tonic-gate 			size_t len, enum fault_type type, enum seg_rw rw);
1057c478bd9Sstevel@tonic-gate static void	segkpm_dump(struct seg *);
1067c478bd9Sstevel@tonic-gate static void	segkpm_badop(void);
1077c478bd9Sstevel@tonic-gate static int	segkpm_notsup(void);
1081bd5c35fSelowe static int	segkpm_capable(struct seg *, segcapability_t);
1097c478bd9Sstevel@tonic-gate 
1107c478bd9Sstevel@tonic-gate #define	SEGKPM_BADOP(t)	(t(*)())segkpm_badop
1117c478bd9Sstevel@tonic-gate #define	SEGKPM_NOTSUP	(int(*)())segkpm_notsup
1127c478bd9Sstevel@tonic-gate 
1137c478bd9Sstevel@tonic-gate static struct seg_ops segkpm_ops = {
1147c478bd9Sstevel@tonic-gate 	SEGKPM_BADOP(int),	/* dup */
1157c478bd9Sstevel@tonic-gate 	SEGKPM_BADOP(int),	/* unmap */
1167c478bd9Sstevel@tonic-gate 	SEGKPM_BADOP(void),	/* free */
1177c478bd9Sstevel@tonic-gate 	segkpm_fault,
1187c478bd9Sstevel@tonic-gate 	SEGKPM_BADOP(int),	/* faulta */
1197c478bd9Sstevel@tonic-gate 	SEGKPM_BADOP(int),	/* setprot */
1207c478bd9Sstevel@tonic-gate 	SEGKPM_BADOP(int),	/* checkprot */
1217c478bd9Sstevel@tonic-gate 	SEGKPM_BADOP(int),	/* kluster */
1227c478bd9Sstevel@tonic-gate 	SEGKPM_BADOP(size_t),	/* swapout */
1237c478bd9Sstevel@tonic-gate 	SEGKPM_BADOP(int),	/* sync */
1247c478bd9Sstevel@tonic-gate 	SEGKPM_BADOP(size_t),	/* incore */
1257c478bd9Sstevel@tonic-gate 	SEGKPM_BADOP(int),	/* lockop */
1267c478bd9Sstevel@tonic-gate 	SEGKPM_BADOP(int),	/* getprot */
1277c478bd9Sstevel@tonic-gate 	SEGKPM_BADOP(u_offset_t), /* getoffset */
1287c478bd9Sstevel@tonic-gate 	SEGKPM_BADOP(int),	/* gettype */
1297c478bd9Sstevel@tonic-gate 	SEGKPM_BADOP(int),	/* getvp */
1307c478bd9Sstevel@tonic-gate 	SEGKPM_BADOP(int),	/* advise */
1317c478bd9Sstevel@tonic-gate 	segkpm_dump,		/* dump */
1327c478bd9Sstevel@tonic-gate 	SEGKPM_NOTSUP,		/* pagelock */
1337c478bd9Sstevel@tonic-gate 	SEGKPM_BADOP(int),	/* setpgsz */
1347c478bd9Sstevel@tonic-gate 	SEGKPM_BADOP(int),	/* getmemid */
1351bd5c35fSelowe 	SEGKPM_BADOP(lgrp_mem_policy_info_t *),	/* getpolicy */
1361bd5c35fSelowe 	segkpm_capable,		/* capable */
1379d12795fSRobert Mustacchi 	seg_inherit_notsup	/* inherit */
1387c478bd9Sstevel@tonic-gate };
1397c478bd9Sstevel@tonic-gate 
1407c478bd9Sstevel@tonic-gate /*
1417c478bd9Sstevel@tonic-gate  * kpm_pgsz and kpm_pgshft are set by platform layer.
1427c478bd9Sstevel@tonic-gate  */
1437c478bd9Sstevel@tonic-gate size_t		kpm_pgsz;	/* kpm page size */
1447c478bd9Sstevel@tonic-gate uint_t		kpm_pgshft;	/* kpm page shift */
1457c478bd9Sstevel@tonic-gate u_offset_t	kpm_pgoff;	/* kpm page offset mask */
1467c478bd9Sstevel@tonic-gate uint_t		kpmp2pshft;	/* kpm page to page shift */
1477c478bd9Sstevel@tonic-gate pgcnt_t		kpmpnpgs;	/* how many pages per kpm page */
1487c478bd9Sstevel@tonic-gate 
1497c478bd9Sstevel@tonic-gate 
1507c478bd9Sstevel@tonic-gate #ifdef	SEGKPM_SUPPORT
1517c478bd9Sstevel@tonic-gate 
1527c478bd9Sstevel@tonic-gate int
1537c478bd9Sstevel@tonic-gate segkpm_create(struct seg *seg, void *argsp)
1547c478bd9Sstevel@tonic-gate {
1557c478bd9Sstevel@tonic-gate 	struct segkpm_data *skd;
1567c478bd9Sstevel@tonic-gate 	struct segkpm_crargs *b = (struct segkpm_crargs *)argsp;
1577c478bd9Sstevel@tonic-gate 	ushort_t *p;
1587c478bd9Sstevel@tonic-gate 	int i, j;
1597c478bd9Sstevel@tonic-gate 
1607c478bd9Sstevel@tonic-gate 	ASSERT(seg->s_as && RW_WRITE_HELD(&seg->s_as->a_lock));
1617c478bd9Sstevel@tonic-gate 	ASSERT(btokpmp(seg->s_size) >= 1 &&
1627c478bd9Sstevel@tonic-gate 	    kpmpageoff((uintptr_t)seg->s_base) == 0 &&
1637c478bd9Sstevel@tonic-gate 	    kpmpageoff((uintptr_t)seg->s_base + seg->s_size) == 0);
1647c478bd9Sstevel@tonic-gate 
1657c478bd9Sstevel@tonic-gate 	skd = kmem_zalloc(sizeof (struct segkpm_data), KM_SLEEP);
1667c478bd9Sstevel@tonic-gate 
1677c478bd9Sstevel@tonic-gate 	seg->s_data = (void *)skd;
1687c478bd9Sstevel@tonic-gate 	seg->s_ops = &segkpm_ops;
1697c478bd9Sstevel@tonic-gate 	skd->skd_prot = b->prot;
1707c478bd9Sstevel@tonic-gate 
1717c478bd9Sstevel@tonic-gate 	/*
1727c478bd9Sstevel@tonic-gate 	 * (1) Segkpm virtual addresses are based on physical adresses.
1737c478bd9Sstevel@tonic-gate 	 * From this and in opposite to other segment drivers it is
1747c478bd9Sstevel@tonic-gate 	 * often required to allocate a page first to be able to
1757c478bd9Sstevel@tonic-gate 	 * calculate the final segkpm virtual address.
1767c478bd9Sstevel@tonic-gate 	 * (2) Page  allocation is done by calling page_create_va(),
1777c478bd9Sstevel@tonic-gate 	 * one important input argument is a virtual address (also
1787c478bd9Sstevel@tonic-gate 	 * expressed by the "va" in the function name). This function
1797c478bd9Sstevel@tonic-gate 	 * is highly optimized to select the right page for an optimal
1807c478bd9Sstevel@tonic-gate 	 * processor and platform support (e.g. virtual addressed
1817c478bd9Sstevel@tonic-gate 	 * caches (VAC), physical addressed caches, NUMA).
1827c478bd9Sstevel@tonic-gate 	 *
1837c478bd9Sstevel@tonic-gate 	 * Because of (1) the approach is to generate a faked virtual
1847c478bd9Sstevel@tonic-gate 	 * address for calling page_create_va(). In order to exploit
1857c478bd9Sstevel@tonic-gate 	 * the abilities of (2), especially to utilize the cache
1867c478bd9Sstevel@tonic-gate 	 * hierarchy (3) and to avoid VAC alias conflicts (4) the
1877c478bd9Sstevel@tonic-gate 	 * selection has to be done carefully. For each virtual color
1887c478bd9Sstevel@tonic-gate 	 * a separate counter is provided (4). The count values are
1897c478bd9Sstevel@tonic-gate 	 * used for the utilization of all cache lines (3) and are
1907c478bd9Sstevel@tonic-gate 	 * corresponding to the cache bins.
1917c478bd9Sstevel@tonic-gate 	 */
1927c478bd9Sstevel@tonic-gate 	skd->skd_nvcolors = b->nvcolors;
1937c478bd9Sstevel@tonic-gate 
1947c478bd9Sstevel@tonic-gate 	p = skd->skd_va_select =
1957c478bd9Sstevel@tonic-gate 	    kmem_zalloc(NCPU * b->nvcolors * sizeof (ushort_t), KM_SLEEP);
1967c478bd9Sstevel@tonic-gate 
1977c478bd9Sstevel@tonic-gate 	for (i = 0; i < NCPU; i++)
1987c478bd9Sstevel@tonic-gate 		for (j = 0; j < b->nvcolors; j++, p++)
1997c478bd9Sstevel@tonic-gate 			*p = j;
2007c478bd9Sstevel@tonic-gate 
2017c478bd9Sstevel@tonic-gate 	return (0);
2027c478bd9Sstevel@tonic-gate }
2037c478bd9Sstevel@tonic-gate 
2047c478bd9Sstevel@tonic-gate /*
2057c478bd9Sstevel@tonic-gate  * This routine is called via a machine specific fault handling
2067c478bd9Sstevel@tonic-gate  * routine.
2077c478bd9Sstevel@tonic-gate  */
2087c478bd9Sstevel@tonic-gate /* ARGSUSED */
2097c478bd9Sstevel@tonic-gate faultcode_t
2107c478bd9Sstevel@tonic-gate segkpm_fault(struct hat *hat, struct seg *seg, caddr_t addr, size_t len,
2117c478bd9Sstevel@tonic-gate 	enum fault_type type, enum seg_rw rw)
2127c478bd9Sstevel@tonic-gate {
213*dc32d872SJosef 'Jeff' Sipek 	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as));
2147c478bd9Sstevel@tonic-gate 
2154fc2445aSelowe 	switch (type) {
2164fc2445aSelowe 	case F_INVAL:
2174fc2445aSelowe 		return (hat_kpm_fault(hat, addr));
2184fc2445aSelowe 	case F_SOFTLOCK:
2194fc2445aSelowe 	case F_SOFTUNLOCK:
2204fc2445aSelowe 		return (0);
2214fc2445aSelowe 	default:
2224fc2445aSelowe 		return (FC_NOSUPPORT);
2234fc2445aSelowe 	}
2244fc2445aSelowe 	/*NOTREACHED*/
2257c478bd9Sstevel@tonic-gate }
2267c478bd9Sstevel@tonic-gate 
2277c478bd9Sstevel@tonic-gate #define	addr_to_vcolor(addr, vcolors) \
2287c478bd9Sstevel@tonic-gate 	((int)(((uintptr_t)(addr) & ((vcolors << PAGESHIFT) - 1)) >> PAGESHIFT))
2297c478bd9Sstevel@tonic-gate 
2307c478bd9Sstevel@tonic-gate /*
2317c478bd9Sstevel@tonic-gate  * Create a virtual address that can be used for invocations of
2327c478bd9Sstevel@tonic-gate  * page_create_va. Goal is to utilize the cache hierarchy (round
2337c478bd9Sstevel@tonic-gate  * robin bins) and to select the right color for virtual indexed
2347c478bd9Sstevel@tonic-gate  * caches. It isn't exact since we also increment the bin counter
2357c478bd9Sstevel@tonic-gate  * when the caller uses VOP_GETPAGE and gets a hit in the page
2367c478bd9Sstevel@tonic-gate  * cache, but we keep the bins turning for cache distribution
2377c478bd9Sstevel@tonic-gate  * (see also segkpm_create block comment).
2387c478bd9Sstevel@tonic-gate  */
2397c478bd9Sstevel@tonic-gate caddr_t
2407c478bd9Sstevel@tonic-gate segkpm_create_va(u_offset_t off)
2417c478bd9Sstevel@tonic-gate {
2427c478bd9Sstevel@tonic-gate 	int vcolor;
2437c478bd9Sstevel@tonic-gate 	ushort_t *p;
2447c478bd9Sstevel@tonic-gate 	struct segkpm_data *skd = (struct segkpm_data *)segkpm->s_data;
2457c478bd9Sstevel@tonic-gate 	int nvcolors = skd->skd_nvcolors;
2467c478bd9Sstevel@tonic-gate 	caddr_t	va;
2477c478bd9Sstevel@tonic-gate 
2487c478bd9Sstevel@tonic-gate 	vcolor = (nvcolors > 1) ? addr_to_vcolor(off, nvcolors) : 0;
2497c478bd9Sstevel@tonic-gate 	p = &skd->skd_va_select[(CPU->cpu_id * nvcolors) + vcolor];
2507c478bd9Sstevel@tonic-gate 	va = (caddr_t)ptob(*p);
2517c478bd9Sstevel@tonic-gate 
2527c478bd9Sstevel@tonic-gate 	atomic_add_16(p, nvcolors);
2537c478bd9Sstevel@tonic-gate 
2547c478bd9Sstevel@tonic-gate 	return (va);
2557c478bd9Sstevel@tonic-gate }
2567c478bd9Sstevel@tonic-gate 
2577c478bd9Sstevel@tonic-gate /*
2587c478bd9Sstevel@tonic-gate  * Unload mapping if the instance has an active kpm mapping.
2597c478bd9Sstevel@tonic-gate  */
2607c478bd9Sstevel@tonic-gate void
2617c478bd9Sstevel@tonic-gate segkpm_mapout_validkpme(struct kpme *kpme)
2627c478bd9Sstevel@tonic-gate {
2637c478bd9Sstevel@tonic-gate 	caddr_t vaddr;
2647c478bd9Sstevel@tonic-gate 	page_t *pp;
2657c478bd9Sstevel@tonic-gate 
2667c478bd9Sstevel@tonic-gate retry:
2677c478bd9Sstevel@tonic-gate 	if ((pp = kpme->kpe_page) == NULL) {
2687c478bd9Sstevel@tonic-gate 		return;
2697c478bd9Sstevel@tonic-gate 	}
2707c478bd9Sstevel@tonic-gate 
2717c478bd9Sstevel@tonic-gate 	if (page_lock(pp, SE_SHARED, (kmutex_t *)NULL, P_RECLAIM) == 0)
2727c478bd9Sstevel@tonic-gate 		goto retry;
2737c478bd9Sstevel@tonic-gate 
2747c478bd9Sstevel@tonic-gate 	/*
2757c478bd9Sstevel@tonic-gate 	 * Check if segkpm mapping is not unloaded in the meantime
2767c478bd9Sstevel@tonic-gate 	 */
2777c478bd9Sstevel@tonic-gate 	if (kpme->kpe_page == NULL) {
2787c478bd9Sstevel@tonic-gate 		page_unlock(pp);
2797c478bd9Sstevel@tonic-gate 		return;
2807c478bd9Sstevel@tonic-gate 	}
2817c478bd9Sstevel@tonic-gate 
2827c478bd9Sstevel@tonic-gate 	vaddr = hat_kpm_page2va(pp, 1);
2837c478bd9Sstevel@tonic-gate 	hat_kpm_mapout(pp, kpme, vaddr);
2847c478bd9Sstevel@tonic-gate 	page_unlock(pp);
2857c478bd9Sstevel@tonic-gate }
2867c478bd9Sstevel@tonic-gate 
2877c478bd9Sstevel@tonic-gate static void
2887c478bd9Sstevel@tonic-gate segkpm_badop()
2897c478bd9Sstevel@tonic-gate {
2907c478bd9Sstevel@tonic-gate 	panic("segkpm_badop");
2917c478bd9Sstevel@tonic-gate }
2927c478bd9Sstevel@tonic-gate 
2937c478bd9Sstevel@tonic-gate #else	/* SEGKPM_SUPPORT */
2947c478bd9Sstevel@tonic-gate 
2957c478bd9Sstevel@tonic-gate /* segkpm stubs */
2967c478bd9Sstevel@tonic-gate 
2977c478bd9Sstevel@tonic-gate /*ARGSUSED*/
2987c478bd9Sstevel@tonic-gate int segkpm_create(struct seg *seg, void *argsp) { return (0); }
2997c478bd9Sstevel@tonic-gate 
3007c478bd9Sstevel@tonic-gate /* ARGSUSED */
3017c478bd9Sstevel@tonic-gate faultcode_t
3027c478bd9Sstevel@tonic-gate segkpm_fault(struct hat *hat, struct seg *seg, caddr_t addr, size_t len,
3037c478bd9Sstevel@tonic-gate 	enum fault_type type, enum seg_rw rw)
3047c478bd9Sstevel@tonic-gate {
3057c478bd9Sstevel@tonic-gate 	return ((faultcode_t)0);
3067c478bd9Sstevel@tonic-gate }
3077c478bd9Sstevel@tonic-gate 
3087c478bd9Sstevel@tonic-gate /* ARGSUSED */
3097c478bd9Sstevel@tonic-gate caddr_t segkpm_create_va(u_offset_t off) { return (NULL); }
3107c478bd9Sstevel@tonic-gate 
3117c478bd9Sstevel@tonic-gate /* ARGSUSED */
3127c478bd9Sstevel@tonic-gate void segkpm_mapout_validkpme(struct kpme *kpme) {}
3137c478bd9Sstevel@tonic-gate 
3147c478bd9Sstevel@tonic-gate static void
3157c478bd9Sstevel@tonic-gate segkpm_badop() {}
3167c478bd9Sstevel@tonic-gate 
3177c478bd9Sstevel@tonic-gate #endif	/* SEGKPM_SUPPORT */
3187c478bd9Sstevel@tonic-gate 
3197c478bd9Sstevel@tonic-gate static int
3207c478bd9Sstevel@tonic-gate segkpm_notsup()
3217c478bd9Sstevel@tonic-gate {
3227c478bd9Sstevel@tonic-gate 	return (ENOTSUP);
3237c478bd9Sstevel@tonic-gate }
3247c478bd9Sstevel@tonic-gate 
3257c478bd9Sstevel@tonic-gate /*
3267c478bd9Sstevel@tonic-gate  * segkpm pages are not dumped, so we just return
3277c478bd9Sstevel@tonic-gate  */
3287c478bd9Sstevel@tonic-gate /*ARGSUSED*/
3297c478bd9Sstevel@tonic-gate static void
3307c478bd9Sstevel@tonic-gate segkpm_dump(struct seg *seg)
3317c478bd9Sstevel@tonic-gate {}
3321bd5c35fSelowe 
3331bd5c35fSelowe /*
3341bd5c35fSelowe  * We claim to have no special capabilities.
3351bd5c35fSelowe  */
3361bd5c35fSelowe /*ARGSUSED*/
3371bd5c35fSelowe static int
3381bd5c35fSelowe segkpm_capable(struct seg *seg, segcapability_t capability)
3391bd5c35fSelowe {
3401bd5c35fSelowe 	return (0);
3411bd5c35fSelowe }
342