Bump and cleanup kvm oi_151a
authorJon Tibble <meths@btinternet.com>
Sat, 07 Sep 2013 14:03:06 +0100
branchoi_151a
changeset 346 37f8043c21bc
parent 345 c70756cc487c
child 347 93f2186c7aae
Bump and cleanup kvm
.hgignore
components/kvm/Makefile
components/kvm/illumos/README
components/kvm/illumos/usr/src/cmd/devfsadm/devfsadm.h
components/kvm/illumos/usr/src/cmd/devfsadm/mapfile-vers
components/kvm/illumos/usr/src/cmd/mdb/common/sys/mdb_modapi.h
components/kvm/illumos/usr/src/common/mapfiles/common/map.noexdata
components/kvm/illumos/usr/src/common/mapfiles/common/map.pagealign
components/kvm/illumos/usr/src/uts/common/sys/ontrap.h
components/kvm/illumos/usr/src/uts/i86pc/sys/mach_mmu.h
components/kvm/illumos/usr/src/uts/i86pc/sys/machcpuvar.h
components/kvm/illumos/usr/src/uts/i86pc/sys/machparam.h
components/kvm/illumos/usr/src/uts/i86pc/sys/pc_mmu.h
components/kvm/illumos/usr/src/uts/i86pc/sys/rm_platter.h
components/kvm/illumos/usr/src/uts/i86pc/sys/vm_machparam.h
components/kvm/illumos/usr/src/uts/i86pc/sys/x_call.h
components/kvm/illumos/usr/src/uts/i86pc/sys/xc_levels.h
components/kvm/patches/Makefile.patch
--- a/.hgignore	Sat Sep 07 13:14:05 2013 +0100
+++ b/.hgignore	Sat Sep 07 14:03:06 2013 +0100
@@ -5,7 +5,7 @@
 components/ca-certificates/ca-certificates*
 components/illumos-gcc/illumos-gcc-*
 components/jq/jq-1.3*
-components/kvm/joyent-illumos-kvm-b0749fb*
+components/kvm/illumos-kvm-2bbad6a*
 components/libffi/libffi-3.0.13*
 components/mbuffer/mbuffer-*
 components/meta-packages/history/build*
--- a/components/kvm/Makefile	Sat Sep 07 13:14:05 2013 +0100
+++ b/components/kvm/Makefile	Sat Sep 07 14:03:06 2013 +0100
@@ -19,12 +19,12 @@
 include ../../make-rules/shared-macros.mk
 
 COMPONENT_NAME=		illumos-kvm
-COMPONENT_VERSION=	b0749fb
-IPS_COMPONENT_VERSION=	0.0.1.20120809
-COMPONENT_SRC=		joyent-illumos-kvm-$(COMPONENT_VERSION)
+COMPONENT_VERSION=	2bbad6a
+IPS_COMPONENT_VERSION=	0.0.1.20130320
+COMPONENT_SRC=		illumos-kvm-$(COMPONENT_VERSION)
 COMPONENT_ARCHIVE=	$(COMPONENT_SRC).tar.gz
-COMPONENT_ARCHIVE_HASH=	sha256:f2531c80e4360723700c7c609746882104418be41543d8e1ab20b84df462788d
-COMPONENT_ARCHIVE_URL=	https://nodeload.github.com/joyent/illumos-kvm/tarball/$(COMPONENT_VERSION)
+COMPONENT_ARCHIVE_HASH=	sha256:9e00376e18b35c32f22b7cc639ed59ab139be94f44160dc7ad6c9e4049d775e9
+COMPONENT_ARCHIVE_URL=	https://codeload.github.com/joyent/illumos-kvm/tar.gz/$(COMPONENT_VERSION)
 
 ifeq ($(MACH), sparc)
 PUBLISH_STAMP=
--- a/components/kvm/illumos/README	Sat Sep 07 13:14:05 2013 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-Files in this directory come from illumos-gate Mercurial repository dated 2011.08.18.
--- a/components/kvm/illumos/usr/src/cmd/devfsadm/devfsadm.h	Sat Sep 07 13:14:05 2013 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,255 +0,0 @@
-/*
- * 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 (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
- */
-
-#ifndef _DEVFSADM_H
-#define	_DEVFSADM_H
-
-#include <sys/types.h>
-#include <libdevinfo.h>
-#include <sys/devinfo_impl.h>
-#include <regex.h>
-
-#undef	DEBUG
-#ifndef DEBUG
-#define	NDEBUG 1
-#else
-#undef	NDEBUG
-#endif
-
-#include <assert.h>
-
-#ifdef	__cplusplus
-extern "C" {
-#endif
-
-#define	DEVFSADM_SUCCESS 0
-#define	DEVFSADM_FAILURE -1
-#define	DEVFSADM_MULTIPLE -2
-#define	DEVFSADM_TRUE 0
-#define	DEVFSADM_FALSE -1
-
-#define	ILEVEL_0 0
-#define	ILEVEL_1 1
-#define	ILEVEL_2 2
-#define	ILEVEL_3 3
-#define	ILEVEL_4 4
-#define	ILEVEL_5 5
-#define	ILEVEL_6 6
-#define	ILEVEL_7 7
-#define	ILEVEL_8 8
-#define	ILEVEL_9 9
-
-#define	DEVFSADM_V0 0
-#define	DEVFSADM_V1 1
-
-#define	DEVFSADM_CONTINUE 0
-#define	DEVFSADM_TERMINATE 1
-
-#define	INTEGER 0
-#define	CHARACTER 1
-
-#define	RM_HOT 0x01
-#define	RM_PRE 0x02
-#define	RM_POST 0x04
-#define	RM_ALWAYS 0x08
-#define	RM_NOINTERPOSE 0x10
-
-#define	TYPE_EXACT 0x01
-#define	TYPE_RE 0x02
-#define	TYPE_PARTIAL 0x04
-#define	TYPE_MASK 0x07
-#define	DRV_EXACT 0x10
-#define	DRV_RE 0x20
-#define	DRV_MASK 0x30
-#define	CREATE_DEFER 0x100
-#define	CREATE_MASK 0x100
-
-/* command to start daemon */
-#define	DEVFSADMD_START_PATH	"/usr/lib/devfsadm/devfsadmd"
-#define	DEVFSADMD_START		"devfsadmd"
-
-/* devfsadm event service door */
-#define	DEVFSADM_SERVICE_DOOR	"/etc/sysevent/devfsadm_event_channel"
-#define	DEVNAME_LOOKUP_DOOR	".devname_lookup_door"
-
-/* File of reserved devnames */
-#define	ENUMERATE_RESERVED "/etc/dev/reserved_devnames"
-
-/* flags for devfsadm_mklink */
-#define	DEV_SYNC 0x02	/* synchronous mklink */
-
-#define	INFO_MID		NULL		/* always prints */
-#define	VERBOSE_MID		"verbose"	/* prints with -v */
-#define	CHATTY_MID		"chatty" 	/* prints with -V chatty */
-
-typedef struct devfsadm_create {
-	char	*device_class;	/* eg "disk", "tape", "display" */
-	char	*node_type;	/* eg DDI_NT_TAPE, DDI_NT_BLOCK, etc */
-	char	*drv_name;	/* eg sd, ssd */
-	int	flags;		/* TYPE_{EXACT,RE,PARTIAL}, DRV_{EXACT,RE} */
-	int interpose_lvl;	/* eg ILEVEL_0.. ILEVEL_10 */
-	int (*callback_fcn)(di_minor_t minor, di_node_t node);
-} devfsadm_create_t;
-
-typedef struct devfsadm_remove {
-	char 	*device_class;	/* eg "disk", "tape", "display" */
-	char    *dev_dirs_re;   /* dev dirs regex selector */
-	int	flags;		/* eg POST, PRE, HOT, ALWAYS */
-	int	interpose_lvl;	/* eg ILEVEL_0 .. ILEVEL_10 */
-	void	(*callback_fcn)(char *);
-} devfsadm_remove_t;
-
-typedef struct devfsadm_remove_V1 {
-	char 	*device_class;	/* eg "disk", "tape", "display" */
-	char    *dev_dirs_re;   /* dev dirs regex selector */
-	int	flags;		/* eg POST, PRE, HOT, ALWAYS */
-	int	interpose_lvl;	/* eg ILEVEL_0 .. ILEVEL_10 */
-	int	(*callback_fcn)(char *);
-} devfsadm_remove_V1_t;
-
-typedef struct _devfsadm_create_reg {
-	uint_t version;
-	uint_t count;	/* number of node type registration */
-			/* structures */
-	devfsadm_create_t *tblp;
-} _devfsadm_create_reg_t;
-
-typedef struct _devfsadm_remove_reg {
-	uint_t version;
-	uint_t count;   /* number of node type registration */
-			/* structures */
-	devfsadm_remove_t *tblp;
-} _devfsadm_remove_reg_t;
-
-typedef struct _devfsadm_remove_reg_V1 {
-	uint_t version;
-	uint_t count;   /* number of node type registration */
-			/* structures */
-	devfsadm_remove_V1_t *tblp;
-} _devfsadm_remove_reg_V1_t;
-/*
- * "flags" in the devfs_enumerate structure can take the following values.
- * These values specify the substring of devfs path to be used for
- * enumeration. Components (see MATCH_ADDR/MATCH_MINOR) may be specified
- * by using the "match_arg" member in the devfsadm_enumerate structure.
- */
-#define	MATCH_ALL	0x001	/* Match entire devfs path */
-#define	MATCH_PARENT	0x002	/* Match upto last '/' in devfs path */
-#define	MATCH_ADDR	0x004	/* Match upto nth component of last address */
-#define	MATCH_MINOR	0x008	/* Match upto nth component of minor name */
-#define	MATCH_CALLBACK	0x010	/* Use callback to derive match string */
-
-/*
- * The following flags are private to devfsadm and the disks module.
- * NOT to be used by other modules.
- */
-#define	MATCH_NODE	0x020
-#define	MATCH_MASK	0x03F
-#define	MATCH_UNCACHED	0x040 /* retry flags for disks module */
-
-typedef struct devfsadm_enumerate {
-	char *re;
-	int subexp;
-	uint_t flags;
-	char *match_arg;
-	char *(*sel_fcn)(const char *path, void *cb_arg);
-	void *cb_arg;
-} devfsadm_enumerate_t;
-
-#define	DEVFSADM_CREATE_INIT_V0(tbl) \
-	_devfsadm_create_reg_t _devfsadm_create_reg = { \
-	DEVFSADM_V0, \
-	(sizeof (tbl) / sizeof (devfsadm_create_t)), \
-	((devfsadm_create_t *)(tbl)) }
-
-#define	DEVFSADM_REMOVE_INIT_V0(tbl)\
-	_devfsadm_remove_reg_t _devfsadm_remove_reg = {\
-	DEVFSADM_V0, \
-	(sizeof (tbl) / sizeof (devfsadm_remove_t)), \
-	((devfsadm_remove_t *)(tbl)) }
-
-#define	DEVFSADM_REMOVE_INIT_V1(tbl)\
-	_devfsadm_remove_reg_V1_t _devfsadm_remove_reg = {\
-	DEVFSADM_V1, \
-	(sizeof (tbl) / sizeof (devfsadm_remove_V1_t)), \
-	((devfsadm_remove_V1_t *)(tbl)) }
-
-/* reserved devname support */
-typedef struct devlink_re {
-	char *d_re;
-	int d_subexp;
-	regex_t d_rcomp;
-	regmatch_t *d_pmatch;
-} devlink_re_t;
-
-typedef struct enumerate_file {
-	char *er_file;
-	char *er_id;
-	struct enumerate_file *er_next;
-} enumerate_file_t;
-
-int devfsadm_noupdate(void);
-const char *devfsadm_root_path(void);
-int devfsadm_link_valid(di_node_t anynode, char *link);
-int devfsadm_mklink(char *link, di_node_t node, di_minor_t minor, int flags);
-int devfsadm_secondary_link(char *link, char *primary_link, int flags);
-void devfsadm_rm_link(char *file);
-void devfsadm_rm_all(char *file);
-void devfsadm_rm_stale_links(char *dir_re, char *valid_link, di_node_t node,
-		di_minor_t minor);
-void devfsadm_errprint(char *message, ...);
-void devfsadm_print(char *mid, char *message, ...);
-int devfsadm_enumerate_int(char *devfs_path, int index, char **buf,
-			    devfsadm_enumerate_t rules[], int nrules);
-int devfsadm_enumerate_char(char *devfs_path, int index, char **buf,
-			    devfsadm_enumerate_t rules[], int nrules);
-char **devfsadm_lookup_dev_names(char *phys_path, char *re, int *lenp);
-void devfsadm_free_dev_names(char **dev_names, int len);
-
-/* devlink cache related */
-di_devlink_handle_t devfsadm_devlink_cache(void);
-
-/*
- * Private enumerate interface for disks and sgen modules
- */
-int disk_enumerate_int(char *devfs_path, int index, char **buf,
-			    devfsadm_enumerate_t rules[], int nrules);
-/*
- * Private interfaces for ports module (port_link.c).
- */
-int devfsadm_enumerate_char_start(char *devfs_path, int index,
-    char **buf, devfsadm_enumerate_t rules[], int nrules, char *start);
-int devfsadm_read_link(di_node_t node, char *link, char **devfs_path);
-char *s_strdup(const char *ptr);
-
-/* Private interface between reserve subsystm and disks link generator */
-int devfsadm_have_reserved(void);
-int devfsadm_is_reserved(devlink_re_t re_array[], char *devlink);
-int devfsadm_reserve_id_cache(devlink_re_t re_array[], enumerate_file_t *head);
-
-#ifdef	__cplusplus
-}
-#endif
-
-#endif	/* _DEVFSADM_H */
--- a/components/kvm/illumos/usr/src/cmd/devfsadm/mapfile-vers	Sat Sep 07 13:14:05 2013 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,64 +0,0 @@
-#
-# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
-#
-# 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
-#
-
-#
-# MAPFILE HEADER START
-#
-# WARNING:  STOP NOW.  DO NOT MODIFY THIS FILE.
-# Object versioning must comply with the rules detailed in
-#
-#	usr/src/lib/README.mapfiles
-#
-# You should not be making modifications here until you've read the most current
-# copy of that file. If you need help, contact a gatekeeper for guidance.
-#
-# MAPFILE HEADER END
-#
-$mapfile_version 2
-
-# External interface requirements
-SYMBOL_SCOPE {
-	global:
-		devfsadm_devlink_cache		{ FLAGS = EXTERN };
-		devfsadm_enumerate_char_start	{ FLAGS = EXTERN };
-		devfsadm_enumerate_int		{ FLAGS = EXTERN };
-		devfsadm_errprint		{ FLAGS = EXTERN };
-		devfsadm_free_dev_names		{ FLAGS = EXTERN };
-		devfsadm_have_reserved		{ FLAGS = EXTERN };
-		devfsadm_is_reserved		{ FLAGS = EXTERN };
-		devfsadm_link_valid		{ FLAGS = EXTERN };
-		devfsadm_lookup_dev_names	{ FLAGS = EXTERN };
-		devfsadm_mklink			{ FLAGS = EXTERN };
-		devfsadm_noupdate		{ FLAGS = EXTERN };
-		devfsadm_print			{ FLAGS = EXTERN };
-		devfsadm_read_link		{ FLAGS = EXTERN };
-		devfsadm_reserve_id_cache	{ FLAGS = EXTERN };
-		devfsadm_rm_all			{ FLAGS = EXTERN };
-		devfsadm_rm_link		{ FLAGS = EXTERN };
-		devfsadm_rm_stale_links		{ FLAGS = EXTERN };
-		devfsadm_root_path		{ FLAGS = EXTERN };
-		devfsadm_secondary_link		{ FLAGS = EXTERN };
-		disk_enumerate_int		{ FLAGS = EXTERN };
-		s_strdup			{ FLAGS = EXTERN };
-		system_labeled			{ FLAGS = EXTERN };
-};
--- a/components/kvm/illumos/usr/src/cmd/mdb/common/sys/mdb_modapi.h	Sat Sep 07 13:14:05 2013 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,386 +0,0 @@
-/*
- * 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 (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
- */
-
-#ifndef	_MDB_MODAPI_H
-#define	_MDB_MODAPI_H
-
-/*
- * MDB Module API
- *
- * The debugger provides a set of interfaces for use in writing loadable
- * debugger modules.  Modules that call functions not listed in this header
- * file may not be compatible with future versions of the debugger.
- */
-
-#include <sys/types.h>
-#include <gelf.h>
-
-#ifdef	__cplusplus
-extern "C" {
-#endif
-
-/*
- * Make sure that NULL, TRUE, FALSE, MIN, and MAX have the usual definitions
- * so module writers can depend on these macros and defines.
- */
-#ifndef NULL
-#if defined(_LP64) && !defined(__cplusplus)
-#define	NULL	0L
-#else
-#define	NULL	0
-#endif
-#endif
-
-#ifndef TRUE
-#define	TRUE	1
-#endif
-
-#ifndef FALSE
-#define	FALSE	0
-#endif
-
-#ifndef MIN
-#define	MIN(x, y) ((x) < (y) ? (x) : (y))
-#endif
-
-#ifndef MAX
-#define	MAX(x, y) ((x) > (y) ? (x) : (y))
-#endif
-
-#define	MDB_API_VERSION	3	/* Current API version number */
-
-/*
- * Debugger command function flags:
- */
-#define	DCMD_ADDRSPEC	0x01	/* Dcmd invoked with explicit address */
-#define	DCMD_LOOP	0x02	/* Dcmd invoked in loop with ,cnt syntax */
-#define	DCMD_LOOPFIRST	0x04	/* Dcmd invoked as first iteration of LOOP */
-#define	DCMD_PIPE	0x08	/* Dcmd invoked with input from pipe */
-#define	DCMD_PIPE_OUT	0x10	/* Dcmd invoked with output set to pipe */
-
-#define	DCMD_HDRSPEC(fl)	(((fl) & DCMD_LOOPFIRST) || !((fl) & DCMD_LOOP))
-
-/*
- * Debugger command function return values:
- */
-#define	DCMD_OK		0	/* Dcmd completed successfully */
-#define	DCMD_ERR	1	/* Dcmd failed due to an error */
-#define	DCMD_USAGE	2	/* Dcmd usage error; abort and print usage */
-#define	DCMD_NEXT	3	/* Invoke next dcmd in precedence list */
-#define	DCMD_ABORT	4	/* Dcmd failed; abort current loop or pipe */
-
-#define	OFFSETOF(s, m)		(size_t)(&(((s *)0)->m))
-
-extern int mdb_prop_postmortem;	/* Are we looking at a static dump? */
-extern int mdb_prop_kernel;	/* Are we looking at a kernel? */
-
-typedef enum {
-	MDB_TYPE_STRING,	/* a_un.a_str is valid */
-	MDB_TYPE_IMMEDIATE,	/* a_un.a_val is valid */
-	MDB_TYPE_CHAR		/* a_un.a_char is valid */
-} mdb_type_t;
-
-typedef struct mdb_arg {
-	mdb_type_t a_type;
-	union {
-		const char *a_str;
-		uintmax_t a_val;
-		char a_char;
-	} a_un;
-} mdb_arg_t;
-
-typedef int mdb_dcmd_f(uintptr_t, uint_t, int, const mdb_arg_t *);
-
-typedef struct mdb_dcmd {
-	const char *dc_name;		/* Command name */
-	const char *dc_usage;		/* Usage message (optional) */
-	const char *dc_descr;		/* Description */
-	mdb_dcmd_f *dc_funcp;		/* Command function */
-	void (*dc_help)(void);		/* Command help function (or NULL) */
-} mdb_dcmd_t;
-
-#define	WALK_ERR	-1		/* Walk fatal error (terminate walk) */
-#define	WALK_NEXT	0		/* Walk should continue to next step */
-#define	WALK_DONE	1		/* Walk is complete (no errors) */
-
-typedef int (*mdb_walk_cb_t)(uintptr_t, const void *, void *);
-
-typedef struct mdb_walk_state {
-	mdb_walk_cb_t walk_callback;	/* Callback to issue */
-	void *walk_cbdata;		/* Callback private data */
-	uintptr_t walk_addr;		/* Current address */
-	void *walk_data;		/* Walk private data */
-	void *walk_arg;			/* Walk private argument */
-	const void *walk_layer;		/* Data from underlying layer */
-} mdb_walk_state_t;
-
-typedef struct mdb_walker {
-	const char *walk_name;		/* Walk type name */
-	const char *walk_descr;		/* Walk description */
-	int (*walk_init)(mdb_walk_state_t *);	/* Walk constructor */
-	int (*walk_step)(mdb_walk_state_t *);	/* Walk iterator */
-	void (*walk_fini)(mdb_walk_state_t *);	/* Walk destructor */
-	void *walk_init_arg;		/* Walk constructor argument */
-} mdb_walker_t;
-
-typedef struct mdb_modinfo {
-	ushort_t mi_dvers;		/* Debugger version number */
-	const mdb_dcmd_t *mi_dcmds;	/* NULL-terminated list of dcmds */
-	const mdb_walker_t *mi_walkers;	/* NULL-terminated list of walks */
-} mdb_modinfo_t;
-
-typedef struct mdb_bitmask {
-	const char *bm_name;		/* String name to print */
-	u_longlong_t bm_mask;		/* Mask for bits */
-	u_longlong_t bm_bits;		/* Result required for value & mask */
-} mdb_bitmask_t;
-
-typedef struct mdb_pipe {
-	uintptr_t *pipe_data;		/* Array of pipe values */
-	size_t pipe_len;		/* Array length */
-} mdb_pipe_t;
-
-typedef struct mdb_object {
-	const char *obj_name;		/* name of object */
-	const char *obj_fullname;	/* full name of object */
-	uintptr_t obj_base;		/* base address of object */
-	uintptr_t obj_size;		/* in memory size of object in bytes */
-} mdb_object_t;
-
-extern int mdb_pwalk(const char *, mdb_walk_cb_t, void *, uintptr_t);
-extern int mdb_walk(const char *, mdb_walk_cb_t, void *);
-
-extern int mdb_pwalk_dcmd(const char *, const char *,
-	int, const mdb_arg_t *, uintptr_t);
-
-extern int mdb_walk_dcmd(const char *, const char *, int, const mdb_arg_t *);
-
-extern int mdb_layered_walk(const char *, mdb_walk_state_t *);
-
-extern int mdb_call_dcmd(const char *, uintptr_t,
-	uint_t, int, const mdb_arg_t *);
-
-extern int mdb_add_walker(const mdb_walker_t *);
-extern int mdb_remove_walker(const char *);
-
-extern ssize_t mdb_vread(void *, size_t, uintptr_t);
-extern ssize_t mdb_vwrite(const void *, size_t, uintptr_t);
-
-extern ssize_t mdb_fread(void *, size_t, uintptr_t);
-extern ssize_t mdb_fwrite(const void *, size_t, uintptr_t);
-
-extern ssize_t mdb_pread(void *, size_t, uint64_t);
-extern ssize_t mdb_pwrite(const void *, size_t, uint64_t);
-
-extern ssize_t mdb_readstr(char *, size_t, uintptr_t);
-extern ssize_t mdb_writestr(const char *, uintptr_t);
-
-extern ssize_t mdb_readsym(void *, size_t, const char *);
-extern ssize_t mdb_writesym(const void *, size_t, const char *);
-
-extern ssize_t mdb_readvar(void *, const char *);
-extern ssize_t mdb_writevar(const void *, const char *);
-
-#define	MDB_SYM_NAMLEN	1024			/* Recommended max name len */
-
-#define	MDB_SYM_FUZZY	0			/* Match closest address */
-#define	MDB_SYM_EXACT	1			/* Match exact address only */
-
-#define	MDB_OBJ_EXEC	((const char *)0L)	/* Primary executable file */
-#define	MDB_OBJ_RTLD	((const char *)1L)	/* Run-time link-editor */
-#define	MDB_OBJ_EVERY	((const char *)-1L)	/* All known symbols */
-
-extern int mdb_lookup_by_name(const char *, GElf_Sym *);
-extern int mdb_lookup_by_obj(const char *, const char *, GElf_Sym *);
-extern int mdb_lookup_by_addr(uintptr_t, uint_t, char *, size_t, GElf_Sym *);
-
-typedef uintptr_t mdb_tid_t;
-typedef uint64_t mdb_reg_t;
-
-extern int mdb_getareg(mdb_tid_t, const char *, mdb_reg_t *);
-
-#define	MDB_OPT_SETBITS	1			/* Set specified flag bits */
-#define	MDB_OPT_CLRBITS	2			/* Clear specified flag bits */
-#define	MDB_OPT_STR	3			/* const char * argument */
-#define	MDB_OPT_UINTPTR	4			/* uintptr_t argument */
-#define	MDB_OPT_UINT64	5			/* uint64_t argument */
-#define	MDB_OPT_UINTPTR_SET	6		/* boolean_t+uintptr_t args */
-
-extern int mdb_getopts(int, const mdb_arg_t *, ...);
-
-extern u_longlong_t mdb_strtoull(const char *);
-
-#define	UM_NOSLEEP	0x0	/* Do not call failure handler; may fail */
-#define	UM_SLEEP	0x1	/* Can block for memory; will always succeed */
-#define	UM_GC		0x2	/* Garbage-collect this block automatically */
-
-extern void *mdb_alloc(size_t, uint_t);
-extern void *mdb_zalloc(size_t, uint_t);
-extern void mdb_free(void *, size_t);
-
-extern size_t mdb_snprintf(char *, size_t, const char *, ...);
-extern void mdb_printf(const char *, ...);
-extern void mdb_warn(const char *, ...);
-extern void mdb_flush(void);
-
-extern int mdb_ffs(uintmax_t);
-
-extern void mdb_nhconvert(void *, const void *, size_t);
-
-#define	MDB_DUMP_RELATIVE	0x0001	/* Start numbering at 0 */
-#define	MDB_DUMP_ALIGN		0x0002	/* Enforce paragraph alignment */
-#define	MDB_DUMP_PEDANT		0x0004	/* Full-width addresses */
-#define	MDB_DUMP_ASCII		0x0008	/* Display ASCII values */
-#define	MDB_DUMP_HEADER		0x0010	/* Display a header */
-#define	MDB_DUMP_TRIM		0x0020	/* Trim at boundaries */
-#define	MDB_DUMP_SQUISH		0x0040	/* Eliminate redundant lines */
-#define	MDB_DUMP_NEWDOT		0x0080	/* Update dot when done */
-#define	MDB_DUMP_ENDIAN		0x0100	/* Adjust for endianness */
-#define	MDB_DUMP_WIDTH(x)	((((x) - 1) & 0xf) << 16) /* paragraphs/line */
-#define	MDB_DUMP_GROUP(x)	((((x) - 1) & 0xff) << 20) /* bytes/group */
-
-typedef ssize_t (*mdb_dumpptr_cb_t)(void *, size_t, uintptr_t, void *);
-typedef ssize_t (*mdb_dump64_cb_t)(void *, size_t, uint64_t, void *);
-
-extern int mdb_dumpptr(uintptr_t, size_t, uint_t, mdb_dumpptr_cb_t, void *);
-extern int mdb_dump64(uint64_t, uint64_t, uint_t, mdb_dump64_cb_t, void *);
-
-extern const char *mdb_one_bit(int, int, int);
-extern const char *mdb_inval_bits(int, int, int);
-
-extern ulong_t mdb_inc_indent(ulong_t);
-extern ulong_t mdb_dec_indent(ulong_t);
-
-extern int mdb_eval(const char *);
-extern void mdb_set_dot(uintmax_t);
-extern uintmax_t mdb_get_dot(void);
-
-extern void mdb_get_pipe(mdb_pipe_t *);
-extern void mdb_set_pipe(const mdb_pipe_t *);
-
-extern ssize_t mdb_get_xdata(const char *, void *, size_t);
-
-typedef int (*mdb_object_cb_t)(mdb_object_t *, void *);
-extern int mdb_object_iter(mdb_object_cb_t, void *);
-
-#define	MDB_STATE_IDLE		0	/* Target is idle (not running yet) */
-#define	MDB_STATE_RUNNING	1	/* Target is currently executing */
-#define	MDB_STATE_STOPPED	2	/* Target is stopped */
-#define	MDB_STATE_UNDEAD	3	/* Target is undead (zombie) */
-#define	MDB_STATE_DEAD		4	/* Target is dead (core dump) */
-#define	MDB_STATE_LOST		5	/* Target lost by debugger */
-
-extern int mdb_get_state(void);
-
-#define	MDB_CALLBACK_STCHG	1
-#define	MDB_CALLBACK_PROMPT	2
-
-typedef void (*mdb_callback_f)(void *);
-
-extern void *mdb_callback_add(int, mdb_callback_f, void *);
-extern void mdb_callback_remove(void *);
-
-extern size_t strlcat(char *, const char *, size_t);
-extern char *strcat(char *, const char *);
-extern char *strcpy(char *, const char *);
-extern char *strncpy(char *, const char *, size_t);
-
-/* Need to be consistent with <string.h> C++ definitions */
-#if __cplusplus >= 199711L
-extern const char *strchr(const char *, int);
-#ifndef	_STRCHR_INLINE
-#define	_STRCHR_INLINE
-extern "C++" {
-	inline char *strchr(char *__s, int __c) {
-		return (char *)strchr((const char *)__s, __c);
-	}
-}
-#endif	/* _STRCHR_INLINE */
-extern const char *strrchr(const char *, int);
-#ifndef	_STRRCHR_INLINE
-#define	_STRRCHR_INLINE
-extern	"C++" {
-	inline char *strrchr(char *__s, int __c) {
-		return (char *)strrchr((const char *)__s, __c);
-	}
-}
-#endif	/* _STRRCHR_INLINE */
-extern const char *strstr(const char *, const char *);
-#ifndef	_STRSTR_INLINE
-#define	_STRSTR_INLINE
-extern "C++" {
-	inline char *strstr(char *__s1, const char *__s2) {
-		return (char *)strstr((const char *)__s1, __s2);
-	}
-}
-#endif	/* _STRSTR_INLINE */
-#else
-extern char *strchr(const char *, int);
-extern char *strrchr(const char *, int);
-extern char *strstr(const char *, const char *);
-#endif	/* __cplusplus >= 199711L */
-
-extern int strcmp(const char *, const char *);
-extern int strncmp(const char *, const char *, size_t);
-extern int strcasecmp(const char *, const char *);
-extern int strncasecmp(const char *, const char *, size_t);
-
-extern size_t strlen(const char *);
-
-extern int bcmp(const void *, const void *, size_t);
-extern void bcopy(const void *, void *, size_t);
-extern void bzero(void *, size_t);
-
-extern void *memcpy(void *, const void *, size_t);
-extern void *memmove(void *, const void *, size_t);
-extern int memcmp(const void *, const void *, size_t);
-/* Need to be consistent with <string.h> C++ definitions */
-#if __cplusplus >= 199711L
-extern const void *memchr(const void *, int, size_t);
-#ifndef _MEMCHR_INLINE
-#define	_MEMCHR_INLINE
-extern "C++" {
-	inline void *memchr(void * __s, int __c, size_t __n) {
-		return (void *)memchr((const void *)__s, __c, __n);
-	}
-}
-#endif  /* _MEMCHR_INLINE */
-#else
-extern void *memchr(const void *, int, size_t);
-#endif /* __cplusplus >= 199711L */
-extern void *memset(void *, int, size_t);
-extern void *memccpy(void *, const void *, int, size_t);
-
-extern void *bsearch(const void *, const void *, size_t, size_t,
-    int (*)(const void *, const void *));
-
-extern void qsort(void *, size_t, size_t,
-    int (*)(const void *, const void *));
-
-#ifdef	__cplusplus
-}
-#endif
-
-#endif	/* _MDB_MODAPI_H */
--- a/components/kvm/illumos/usr/src/common/mapfiles/common/map.noexdata	Sat Sep 07 13:14:05 2013 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +0,0 @@
-#
-# Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
-#
-# 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
-#
-# Link-editor mapfile to create a non-executable data segment definition
-# within an executable.  Note that this only functions properly on the
-# x86 architecture.  On SPARC, the data segment contains a Procedure Linkage
-# Table (PLT) that must remain executable.
-#
-# As the data segment is extended by sbrk(2) to enlarge the heap, a
-# non-executable data segment also results in a non-exutable heap.
-#
-# The link-editor does not use this file automatically, so one must use the
-# -M option to cc or ld:
-#
-#       cc -M /usr/lib/ld/map.noexdata myprogram.c
-#
-
-#
-# Executables can also create a separate non-executable bss segment.
-# This segment may use additional memory, but also results in a
-# non-executable heap.  See /usr/lib/ld/map.noexbss.
-#
-# See also /usr/lib/ld/map.execdata.
-
-$mapfile_version 2
-
-$if _sparc
-
-$error SPARC Procedure Linkage Table (PLT) must remain executable
-
-$elif _x86
-
-LOAD_SEGMENT data { FLAGS = READ WRITE };
-
-$else
-$error unknown platform
-$endif
--- a/components/kvm/illumos/usr/src/common/mapfiles/common/map.pagealign	Sat Sep 07 13:14:05 2013 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-#
-# Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
-#
-# 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
-#
-# Linker mapfile to create page-aligned data within an executable.
-# The linker does not use this file automatically, so one must use the -M
-# option to cc or ld:
-#
-#	cc -M /usr/lib/ld/map.pagealign myprogram.c
-#
-
-$mapfile_version 2
-
-$if _sparc
-
-LOAD_SEGMENT data { ROUND = 0x2000 };
-
-$elif _x86
-
-LOAD_SEGMENT data { ROUND = 0x1000 };
-
-$else
-$error unknown platform
-$endif
-
--- a/components/kvm/illumos/usr/src/uts/common/sys/ontrap.h	Sat Sep 07 13:14:05 2013 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,120 +0,0 @@
-/*
- * 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 2007 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#ifndef	_ONTRAP_H
-#define	_ONTRAP_H
-
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
-#if !defined(_ASM)
-#include <sys/types.h>
-#endif
-
-#ifdef	__cplusplus
-extern "C" {
-#endif
-
-/*
- * on_trap() provides protection against various kinds of machine exceptions,
- * and must be used with extreme caution.  Like setjmp(), on_trap() returns
- * zero when explicitly called and non-zero when it returns as the result of
- * an exception.  The caller should not attempt to interpret the actual integer
- * return value except to test whether it is zero or non-zero.  on_trap() and
- * no_trap() are NOT DDI interfaces for public consumption.  For now, the
- * on_trap() mechanism is separate from on_fault() protection and the t_lofault
- * protection used by the various copy routines.
- *
- * Calls to on_trap() may be nested, but only the most recently installed bits
- * apply.  Protection bits may be OR-ed together if the caller wishes to
- * protect against more than one type of trap.  If on_trap() returns non-zero,
- * the bit corresponding to the trap that triggered return to on_trap() will
- * be stored in the ot_trap field of the caller's on_trap_data.
- *
- * After calling on_trap(), the caller may elect to modify ot_trampoline to
- * install a custom trampoline routine prior to executing the protected code
- * region.  No other fields of the on_trap_data should be modified by the
- * caller.  The trampoline may not be applicable on all platforms.
- *
- * The on_trap_data structures are kept in a stack (linked list) whose top
- * is pointed to by the current thread's t_ontrap field.  A no_trap() call
- * pops the top element from the stack and resets t_ontrap to ot_prev.
- * We assume the caller has allocated the on_trap_data on the stack or
- * made other arrangements, so we do not need to worry about deallocation.
- *
- * If repeated calls to on_trap() are made using the same on_trap_data address,
- * the topmost stack element is modified in-place (the same on_trap_data is
- * not pushed twice), allowing callers to use on_trap() in a loop.  The act
- * of catching an exception does NOT modify t_ontrap.  Even if on_trap()
- * returns non-zero, the caller must use no_trap() to clear trap protection.
- *
- * Calls to no_trap() are permitted when the on_trap_data stack is empty; they
- * have no effect.  no_trap() only modifies t_ontrap; it does not modify the
- * internals of the topmost on_trap_data element.  It is therefore legal for
- * callers to examine the contents of the on_trap_data (specifically ot_trap)
- * after the data is popped using no_trap().
- *
- * A given platform may not implement all the forms of on_trap() protection.
- * The on_trap_data will be pushed on the t_ontrap stack with ot_prot set
- * regardless.  We must guarantee that if the platform does not implement
- * a trap protection, the exceptional condition will trigger a panic.  We do
- * not permit a platform to allow the exceptional condition to occur silently
- * and then continue to execute the caller's protected code region.
- */
-
-#define	OT_DATA_ACCESS	0x01		/* data access exception protection */
-#define	OT_DATA_EC	0x02		/* error correction trap protection */
-
-#if defined(__x86)
-#define	OT_SEGMENT_ACCESS 0x03		/* segmentation exception */
-#endif
-
-#if !defined(_ASM)
-
-typedef struct on_trap_data {
-	ushort_t ot_prot;		/* active protection bits (see above) */
-	ushort_t ot_trap;		/* bit of actual trap that occurred */
-	uintptr_t ot_trampoline;	/* %pc for trap return (if any) */
-	label_t ot_jmpbuf;		/* label for longjmp back to on_trap */
-	struct on_trap_data *ot_prev;	/* pointer to previous on_trap_data */
-	void *ot_handle;		/* access handle */
-	void *ot_pad1;			/* reserved for future use */
-} on_trap_data_t;
-
-#if defined(_KERNEL)
-
-extern int on_trap(on_trap_data_t *, uint_t);
-#pragma	unknown_control_flow(on_trap)
-extern void no_trap(void);
-
-extern void on_trap_trampoline(void);	/* default trampoline */
-
-#endif	/* _KERNEL */
-#endif	/* !_ASM */
-
-#ifdef	__cplusplus
-}
-#endif
-
-#endif	/* _ONTRAP_H */
--- a/components/kvm/illumos/usr/src/uts/i86pc/sys/mach_mmu.h	Sat Sep 07 13:14:05 2013 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,173 +0,0 @@
-/*
- * 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 2007 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#ifndef _SYS_MACH_MMU_H
-#define	_SYS_MACH_MMU_H
-
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifndef _ASM
-
-#include <sys/types.h>
-#include <sys/systm.h>
-
-/*
- * Platform-dependent MMU routines and types.
- *
- * WARNING: this header file is used by both dboot and i86pc, so don't go using
- * normal kernel headers.
- */
-
-#define	TWO_MEG		(2 * 1024 * 1024)
-
-/*
- * This is:
- *	The kernel nucleus pagesizes, ie: bi->bi_kseg_size
- *	The grub 64 bit file load address (see multiboot header in dboot_grub.s)
- *	The grub 32 bit and hypervisor physical load addresses of
- *	    the kernel text/data (see Mapfile.unix)
- */
-#define	FOUR_MEG	(4 * 1024 * 1024)
-
-#define	ONE_GIG		(1024 * 1024 * 1024)
-#define	FOUR_GIG	((uint64_t)4 * ONE_GIG)
-
-#define	MMU_STD_PAGESIZE	4096
-#ifdef __amd64
-#define	MMU_STD_PAGEMASK	0xFFFFFFFFFFFFF000ULL
-#else
-#define	MMU_STD_PAGEMASK	0xFFFFF000UL
-#endif
-
-/*
- * Defines for the bits in X86 and AMD64 Page Tables
- *
- * Notes:
- *
- * Largepages and PAT bits:
- *
- * bit 7 at level 0 is the PAT bit
- * bit 7 above level 0 is the Pagesize bit (set for large page)
- * bit 12 (when a large page) is the PAT bit
- *
- * In Solaris the PAT/PWT/PCD values are set up so that:
- *
- * PAT & PWT -> Write Protected
- * PAT & PCD -> Write Combining
- * PAT by itself (PWT == 0 && PCD == 0) yields uncacheable (same as PCD == 1)
- *
- *
- * Permission bits:
- *
- * - PT_USER must be set in all levels for user pages
- * - PT_WRITE must be set in all levels for user writable pages
- * - PT_NX applies if set at any level
- *
- * For these, we use the "allow" settings in all tables above level 0 and only
- * ever disable things in PTEs.
- *
- * The use of PT_GLOBAL and PT_NX depend on being enabled in processor
- * control registers. Hence, we use a variable to reference these bit
- * masks. During hat_kern_setup() if the feature isn't enabled we
- * clear out the variables.
- */
-#define	PT_VALID	(0x001)	/* a valid translation is present */
-#define	PT_WRITABLE	(0x002)	/* the page is writable */
-#define	PT_USER		(0x004)	/* the page is accessible by user mode */
-#define	PT_WRITETHRU	(0x008)	/* write back caching is disabled (non-PAT) */
-#define	PT_NOCACHE	(0x010)	/* page is not cacheable (non-PAT) */
-#define	PT_REF		(0x020)	/* page was referenced */
-#define	PT_MOD		(0x040)	/* page was modified */
-#define	PT_PAGESIZE	(0x080)	/* above level 0, indicates a large page */
-#define	PT_PAT_4K	(0x080) /* at level 0, used for write combining */
-#define	PT_GLOBAL	(0x100)	/* the mapping is global */
-#define	PT_SOFTWARE	(0xe00)	/* software bits */
-
-#define	PT_PAT_LARGE	(0x1000)	/* PAT bit for large pages */
-
-#define	PT_PTPBITS	(PT_VALID | PT_USER | PT_WRITABLE | PT_REF)
-#define	PT_FLAGBITS	(0xfff)	/* for masking off flag bits */
-
-/*
- * The software bits are used by the HAT to track attributes.
- * Note that the attributes are inclusive as the values increase.
- *
- * PT_NOSYNC - The PT_REF/PT_MOD bits are not sync'd to page_t.
- *             The hat will install them as always set.
- *
- * PT_NOCONSIST - There is no hment entry for this mapping.
- *
- * PT_FOREIGN - used for the hypervisor, check via
- *		(pte & PT_SOFTWARE) >= PT_FOREIGN
- *		as it might set	0x800 for foreign grant table mappings.
- */
-#define	PT_NOSYNC	(0x200)	/* PTE was created with HAT_NOSYNC */
-#define	PT_NOCONSIST	(0x400)	/* PTE was created with HAT_LOAD_NOCONSIST */
-#define	PT_FOREIGN	(0x600)	/* MFN mapped on the hypervisor has no PFN */
-
-#ifdef __xpv
-#include <sys/xen_mmu.h>
-#else
-#include <sys/pc_mmu.h>
-#endif
-
-/*
- * The software extraction for a single Page Table Entry will always
- * be a 64 bit unsigned int. If running a non-PAE hat, the page table
- * access routines know to extend/shorten it to 32 bits.
- */
-typedef uint64_t x86pte_t;
-typedef uint32_t x86pte32_t;
-
-x86pte_t get_pteval(paddr_t, uint_t);
-void set_pteval(paddr_t, uint_t, uint_t, x86pte_t);
-paddr_t make_ptable(x86pte_t *, uint_t);
-x86pte_t *find_pte(uint64_t, paddr_t *, uint_t, uint_t);
-x86pte_t *map_pte(paddr_t, uint_t);
-
-#ifndef _BOOT
-ulong_t getcr3();
-#endif
-
-extern uint_t *shift_amt;
-extern uint_t ptes_per_table;
-extern paddr_t top_page_table;
-extern uint_t top_level;
-extern uint_t pte_size;
-extern uint_t shift_amt_nopae[];
-extern uint_t shift_amt_pae[];
-extern uint32_t lpagesize;
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _ASM */
-
-#endif	/* _SYS_MACH_MMU_H */
--- a/components/kvm/illumos/usr/src/uts/i86pc/sys/machcpuvar.h	Sat Sep 07 13:14:05 2013 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,186 +0,0 @@
-/*
- * 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 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-/*
- * Copyright 2011 Joyent, Inc. All rights reserved.
- */
-
-#ifndef	_SYS_MACHCPUVAR_H
-#define	_SYS_MACHCPUVAR_H
-
-#ifdef	__cplusplus
-extern "C" {
-#endif
-
-#include <sys/inttypes.h>
-#include <sys/x_call.h>
-#include <sys/tss.h>
-#include <sys/segments.h>
-#include <sys/rm_platter.h>
-#include <sys/avintr.h>
-#include <sys/pte.h>
-
-#ifndef	_ASM
-/*
- * On a virtualized platform a virtual cpu may not be actually
- * on a physical cpu, especially in situations where a configuration has
- * more vcpus than pcpus.  This function tells us (if it's able) if the
- * specified vcpu is currently running on a pcpu.  Note if it is not
- * known or not able to determine, it will return the unknown state.
- */
-#define	VCPU_STATE_UNKNOWN	0
-#define	VCPU_ON_PCPU		1
-#define	VCPU_NOT_ON_PCPU	2
-
-extern int vcpu_on_pcpu(processorid_t);
-
-/*
- * Machine specific fields of the cpu struct
- * defined in common/sys/cpuvar.h.
- *
- * Note:  This is kinda kludgy but seems to be the best
- * of our alternatives.
- */
-typedef void *cpu_pri_lev_t;
-
-struct cpuid_info;
-struct cpu_ucode_info;
-struct cmi_hdl;
-
-/*
- * A note about the hypervisor affinity bits: a one bit in the affinity mask
- * means the corresponding event channel is allowed to be serviced
- * by this cpu.
- */
-struct xen_evt_data {
-	ulong_t		pending_sel[PIL_MAX + 1]; /* event array selectors */
-	ulong_t		pending_evts[PIL_MAX + 1][sizeof (ulong_t) * 8];
-	ulong_t		evt_affinity[sizeof (ulong_t) * 8]; /* service on cpu */
-};
-
-struct	machcpu {
-	/*
-	 * x_call fields - used for interprocessor cross calls
-	 */
-	struct xc_msg	*xc_msgbox;
-	struct xc_msg	*xc_free;
-	xc_data_t	xc_data;
-	uint32_t	xc_wait_cnt;
-	volatile uint32_t xc_work_cnt;
-
-	int		mcpu_nodeid;		/* node-id */
-	int		mcpu_pri;		/* CPU priority */
-	cpu_pri_lev_t	mcpu_pri_data;		/* ptr to machine dependent */
-						/* data for setting priority */
-						/* level */
-
-	struct hat	*mcpu_current_hat; /* cpu's current hat */
-
-	struct hat_cpu_info	*mcpu_hat_info;
-
-	volatile ulong_t	mcpu_tlb_info;
-
-	/* i86 hardware table addresses that cannot be shared */
-
-	user_desc_t	*mcpu_gdt;	/* GDT */
-	gate_desc_t	*mcpu_idt;	/* current IDT */
-
-	tss_t		*mcpu_tss;	/* TSS */
-
-	kmutex_t	mcpu_ppaddr_mutex;
-	caddr_t		mcpu_caddr1;	/* per cpu CADDR1 */
-	caddr_t		mcpu_caddr2;	/* per cpu CADDR2 */
-	uint64_t	mcpu_caddr1pte;
-	uint64_t	mcpu_caddr2pte;
-
-	struct softint	mcpu_softinfo;
-	uint64_t	pil_high_start[HIGH_LEVELS];
-	uint64_t	intrstat[PIL_MAX + 1][2];
-
-	struct cpuid_info	 *mcpu_cpi;
-
-#if defined(__amd64)
-	greg_t	mcpu_rtmp_rsp;		/* syscall: temporary %rsp stash */
-	greg_t	mcpu_rtmp_r15;		/* syscall: temporary %r15 stash */
-#endif
-
-	struct vcpu_info *mcpu_vcpu_info;
-	uint64_t	mcpu_gdtpa;	/* hypervisor: GDT physical address */
-
-	uint16_t mcpu_intr_pending;	/* hypervisor: pending intrpt levels */
-	uint16_t mcpu_ec_mbox;		/* hypervisor: evtchn_dev mailbox */
-	struct xen_evt_data *mcpu_evt_pend; /* hypervisor: pending events */
-
-	volatile uint32_t *mcpu_mwait;	/* MONITOR/MWAIT buffer */
-	void (*mcpu_idle_cpu)(void);	/* idle function */
-	uint16_t mcpu_idle_type;	/* CPU next idle type */
-	uint16_t max_cstates;		/* supported max cstates */
-
-	struct cpu_ucode_info	*mcpu_ucode_info;
-
-	void			*mcpu_pm_mach_state;
-	struct cmi_hdl		*mcpu_cmi_hdl;
-	void			*mcpu_mach_ctx_ptr;
-
-	/*
-	 * A stamp that is unique per processor and changes
-	 * whenever an interrupt happens. Userful for detecting
-	 * if a section of code gets interrupted.
-	 * The high order 16 bits will hold the cpu->cpu_id.
-	 * The low order bits will be incremented on every interrupt.
-	 */
-	volatile uint32_t	mcpu_istamp;
-};
-
-#define	NINTR_THREADS	(LOCK_LEVEL-1)	/* number of interrupt threads */
-#define	MWAIT_HALTED	(1)		/* mcpu_mwait set when halting */
-#define	MWAIT_RUNNING	(0)		/* mcpu_mwait set to wakeup */
-#define	MWAIT_WAKEUP_IPI	(2)	/* need IPI to wakeup */
-#define	MWAIT_WAKEUP(cpu)	(*((cpu)->cpu_m.mcpu_mwait) = MWAIT_RUNNING)
-
-#endif	/* _ASM */
-
-/* Please DON'T add any more of this namespace-poisoning sewage here */
-
-#define	cpu_nodeid cpu_m.mcpu_nodeid
-#define	cpu_pri cpu_m.mcpu_pri
-#define	cpu_pri_data cpu_m.mcpu_pri_data
-#define	cpu_current_hat cpu_m.mcpu_current_hat
-#define	cpu_hat_info cpu_m.mcpu_hat_info
-#define	cpu_ppaddr_mutex cpu_m.mcpu_ppaddr_mutex
-#define	cpu_gdt cpu_m.mcpu_gdt
-#define	cpu_idt cpu_m.mcpu_idt
-#define	cpu_tss cpu_m.mcpu_tss
-#define	cpu_ldt cpu_m.mcpu_ldt
-#define	cpu_caddr1 cpu_m.mcpu_caddr1
-#define	cpu_caddr2 cpu_m.mcpu_caddr2
-#define	cpu_softinfo cpu_m.mcpu_softinfo
-#define	cpu_caddr1pte cpu_m.mcpu_caddr1pte
-#define	cpu_caddr2pte cpu_m.mcpu_caddr2pte
-
-#ifdef	__cplusplus
-}
-#endif
-
-#endif	/* _SYS_MACHCPUVAR_H */
--- a/components/kvm/illumos/usr/src/uts/i86pc/sys/machparam.h	Sat Sep 07 13:14:05 2013 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,353 +0,0 @@
-/*
- * 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 (c) 1992, 2010, Oracle and/or its affiliates. All rights reserved.
- */
-
-/*	Copyright (c) 1988 AT&T	*/
-/*	  All Rights Reserved  	*/
-
-
-#ifndef _SYS_MACHPARAM_H
-#define	_SYS_MACHPARAM_H
-
-#if !defined(_ASM)
-#include <sys/types.h>
-
-#if defined(__xpv)
-#include <sys/xpv_impl.h>
-#endif
-
-#endif
-
-#ifdef	__cplusplus
-extern "C" {
-#endif
-
-#ifndef _ASM
-#define	ADDRESS_C(c)    c ## ul
-#else   /* _ASM */
-#define	ADDRESS_C(c)    (c)
-#endif  /* _ASM */
-
-/*
- * Machine dependent parameters and limits.
- */
-
-#if defined(__amd64)
-#define	NCPU	256
-#define	NCPU_LOG2	8
-#elif defined(__i386)
-#define	NCPU	32
-#define	NCPU_LOG2	5
-#endif
-
-/* NCPU_P2 is NCPU rounded to a power of 2 */
-#define	NCPU_P2	(1 << NCPU_LOG2)
-
-/*
- * The value defined below could grow to 16. hat structure and
- * page_t have room for 16 nodes.
- */
-#define	MAXNODES 	4
-#define	NUMA_NODEMASK	0x0f
-
-/*
- * Define the FPU symbol if we could run on a machine with an external
- * FPU (i.e. not integrated with the normal machine state like the vax).
- *
- * The fpu is defined in the architecture manual, and the kernel hides
- * its absence if it is not present, that's pretty integrated, no?
- */
-
-/* supported page sizes */
-#define	MMU_PAGE_SIZES	3
-
-/*
- * MMU_PAGES* describes the physical page size used by the mapping hardware.
- * PAGES* describes the logical page size used by the system.
- */
-
-#define	MMU_PAGESIZE	0x1000		/* 4096 bytes */
-#define	MMU_PAGESHIFT	12		/* log2(MMU_PAGESIZE) */
-
-#if !defined(_ASM)
-#define	MMU_PAGEOFFSET	(MMU_PAGESIZE-1) /* Mask of address bits in page */
-#else	/* _ASM */
-#define	MMU_PAGEOFFSET	_CONST(MMU_PAGESIZE-1)	/* assembler lameness */
-#endif	/* _ASM */
-
-#define	MMU_PAGEMASK	(~MMU_PAGEOFFSET)
-
-#define	PAGESIZE	0x1000		/* All of the above, for logical */
-#define	PAGESHIFT	12
-#define	PAGEOFFSET	(PAGESIZE - 1)
-#define	PAGEMASK	(~PAGEOFFSET)
-
-/*
- * DATA_ALIGN is used to define the alignment of the Unix data segment.
- */
-#define	DATA_ALIGN	PAGESIZE
-
-/*
- * DEFAULT KERNEL THREAD stack size (in pages).
- */
-#if defined(__amd64)
-#define	DEFAULTSTKSZ_NPGS	5
-#elif defined(__i386)
-#define	DEFAULTSTKSZ_NPGS	3
-#endif
-
-#if !defined(_ASM)
-#define	DEFAULTSTKSZ	(DEFAULTSTKSZ_NPGS * PAGESIZE)
-#else	/* !_ASM */
-#define	DEFAULTSTKSZ	_MUL(DEFAULTSTKSZ_NPGS, PAGESIZE) /* as(1) lameness */
-#endif	/* !_ASM */
-
-/*
- * KERNELBASE is the virtual address at which the kernel segments start in
- * all contexts.
- *
- * KERNELBASE is not fixed.  The value of KERNELBASE can change with
- * installed memory or on 32 bit systems the eprom variable 'eprom_kernelbase'.
- *
- * common/conf/param.c requires a compile time defined value for KERNELBASE.
- * This value is save in the variable _kernelbase.  _kernelbase may then be
- * modified with to a different value in i86pc/os/startup.c.
- *
- * Most code should be using kernelbase, which resolves to a reference to
- * _kernelbase.
- */
-#define	KERNEL_TEXT_amd64	UINT64_C(0xfffffffffb800000)
-
-#ifdef __i386
-
-#define	KERNEL_TEXT_i386	ADDRESS_C(0xfe800000)
-
-/*
- * We don't use HYPERVISOR_VIRT_START, as we need both the PAE and non-PAE
- * versions in our code. We always compile based on the lower PAE address.
- */
-#define	KERNEL_TEXT_i386_xpv	\
-	(HYPERVISOR_VIRT_START_PAE - 3 * ADDRESS_C(0x400000))
-
-#endif /* __i386 */
-
-#if defined(__amd64)
-
-#define	KERNELBASE	ADDRESS_C(0xfffffd8000000000)
-
-/*
- * Size of the unmapped "red zone" at the very bottom of the kernel's
- * address space.  Corresponds to 1 slot in the toplevel pagetable.
- */
-#define	KERNEL_REDZONE_SIZE   ((uintptr_t)1 << 39)
-
-/*
- * Base of 'core' heap area, which is used for kernel and module text/data
- * that must be within a 2GB range to allow for rip-relative addressing.
- */
-#define	COREHEAP_BASE	ADDRESS_C(0xffffffffc0000000)
-
-/*
- * Beginning of the segkpm window. A lower value than this is used if
- * physical addresses exceed 1TB. See i86pc/os/startup.c
- */
-#define	SEGKPM_BASE	ADDRESS_C(0xfffffe0000000000)
-
-/*
- * This is valloc_base, above seg_kpm, but below everything else.
- * A lower value than this may be used if SEGKPM_BASE is adjusted.
- * See i86pc/os/startup.c
- */
-#define	VALLOC_BASE	ADDRESS_C(0xffffff0000000000)
-
-/*
- * default and boundary sizes for segkp
- */
-#define	SEGKPDEFSIZE	(2L * 1024L * 1024L * 1024L)		/*   2G */
-#define	SEGKPMAXSIZE	(8L * 1024L * 1024L * 1024L)		/*   8G */
-#define	SEGKPMINSIZE	(200L * 1024 * 1024L)			/* 200M */
-
-/*
- * minimum size for segzio
- */
-#define	SEGZIOMINSIZE	(400L * 1024 * 1024L)			/* 400M */
-#define	SEGZIOMAXSIZE	(512L * 1024L * 1024L * 1024L)		/* 512G */
-
-/*
- * During intial boot we limit heap to the top 4Gig.
- */
-#define	BOOT_KERNELHEAP_BASE	ADDRESS_C(0xffffffff00000000)
-
-/*
- * VMWare works best if we don't use the top 64Meg of memory for amd64.
- * Set KERNEL_TEXT to top_o_memory - 64Meg - 8 Meg for 8Meg of nucleus pages.
- */
-#define	PROMSTART	ADDRESS_C(0xffc00000)
-#define	KERNEL_TEXT	KERNEL_TEXT_amd64
-
-/*
- * Virtual address range available to the debugger
- */
-#define	SEGDEBUGBASE	ADDRESS_C(0xffffffffff800000)
-#define	SEGDEBUGSIZE	ADDRESS_C(0x400000)
-
-/*
- * Define upper limit on user address space
- *
- * In amd64, the upper limit on a 64-bit user address space is 1 large page
- * (2MB) below kernelbase.  The upper limit for a 32-bit user address space
- * is 1 small page (4KB) below the top of the 32-bit range.  The 64-bit
- * limit give dtrace the red zone it needs below kernelbase.  The 32-bit
- * limit gives us a small red zone to detect address-space overruns in a
- * user program.
- *
- * On the hypervisor, we limit the user to memory below the VA hole.
- * Subtract 1 large page for a red zone.
- */
-#if defined(__xpv)
-#define	USERLIMIT	ADDRESS_C(0x00007fffffe00000)
-#else
-#define	USERLIMIT	ADDRESS_C(0xfffffd7fffe00000)
-#endif
-
-#ifdef bug_5074717_is_fixed
-#define	USERLIMIT32	ADDRESS_C(0xfffff000)
-#else
-#define	USERLIMIT32	ADDRESS_C(0xfefff000)
-#endif
-
-#elif defined(__i386)
-
-#ifdef DEBUG
-#define	KERNELBASE	ADDRESS_C(0xc8000000)
-#else
-#define	KERNELBASE	ADDRESS_C(0xd4000000)
-#endif
-
-#define	KERNELBASE_MAX	ADDRESS_C(0xe0000000)
-
-/*
- * The i386 ABI requires that the user address space be at least 3Gb
- * in size.  KERNELBASE_ABI_MIN is used as the default KERNELBASE for
- * physical memory configurations > 4gb.
- */
-#define	KERNELBASE_ABI_MIN	ADDRESS_C(0xc0000000)
-
-/*
- * Size of the unmapped "red zone" at the very bottom of the kernel's
- * address space.  Since segmap start immediately above the red zone, this
- * needs to be MAXBSIZE aligned.
- */
-#define	KERNEL_REDZONE_SIZE   MAXBSIZE
-
-/*
- * This is the last 4MB of the 4G address space. Some psm modules
- * need this region of virtual address space mapped 1-1
- * The top 64MB of the address space is reserved for the hypervisor.
- */
-#define	PROMSTART	ADDRESS_C(0xffc00000)
-#ifdef __xpv
-#define	KERNEL_TEXT	KERNEL_TEXT_i386_xpv
-#else
-#define	KERNEL_TEXT	KERNEL_TEXT_i386
-#endif
-
-/*
- * Virtual address range available to the debugger
- * We place it just above the kernel text (4M) and kernel data (4M).
- */
-#define	SEGDEBUGBASE	(KERNEL_TEXT + ADDRESS_C(0x800000))
-#define	SEGDEBUGSIZE	ADDRESS_C(0x400000)
-
-/*
- * Define upper limit on user address space
- */
-#define	USERLIMIT	KERNELBASE
-#define	USERLIMIT32	USERLIMIT
-
-#endif	/* __i386 */
-
-/*
- * Reserve pages just below KERNEL_TEXT for the GDT, IDT, TSS and debug info.
- *
- * For now, DEBUG_INFO_VA must be first in this list for "xm" initiated dumps
- * of solaris domUs to be usable with mdb. Relying on a fixed VA is not viable
- * long term, but it's the best we've got for now.
- */
-#if !defined(_ASM)
-#define	DEBUG_INFO_VA	(KERNEL_TEXT - MMU_PAGESIZE)
-#define	GDT_VA		(DEBUG_INFO_VA - MMU_PAGESIZE)
-#define	IDT_VA		(GDT_VA - MMU_PAGESIZE)
-#define	KTSS_VA		(IDT_VA - MMU_PAGESIZE)
-#define	DFTSS_VA	(KTSS_VA - MMU_PAGESIZE)
-#define	MISC_VA_BASE	(DFTSS_VA)
-#define	MISC_VA_SIZE	(KERNEL_TEXT - MISC_VA_BASE)
-#endif /* !_ASM */
-
-#if !defined(_ASM) && !defined(_KMDB)
-extern uintptr_t kernelbase, segmap_start, segmapsize;
-#endif
-
-/*
- * ARGSBASE is the base virtual address of the range which
- * the kernel uses to map the arguments for exec.
- */
-#define	ARGSBASE	PROMSTART
-
-/*
- * reserve space for modules
- */
-#define	MODTEXT	(1024 * 1024 * 2)
-#define	MODDATA	(1024 * 300)
-
-/*
- * The heap has a region allocated from it of HEAPTEXT_SIZE bytes specifically
- * for module text.
- */
-#define	HEAPTEXT_SIZE		(64 * 1024 * 1024)	/* bytes */
-
-/*
- * Size of a kernel threads stack.  It must be a whole number of pages
- * since the segment it comes from will only allocate space in pages.
- */
-#define	T_STACKSZ	2*PAGESIZE
-
-/*
- * Size of a cpu startup thread stack.  (It must be a whole number of pages
- * since the containing segment only allocates space in pages.)
- */
-
-#define	STARTUP_STKSZ	3*PAGESIZE
-
-/*
- * Bus types
- */
-#define	BTISA		1
-#define	BTEISA		2
-#define	BTMCA		3
-
-#ifdef	__cplusplus
-}
-#endif
-
-#endif	/* _SYS_MACHPARAM_H */
--- a/components/kvm/illumos/usr/src/uts/i86pc/sys/pc_mmu.h	Sat Sep 07 13:14:05 2013 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,66 +0,0 @@
-/*
- * 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 2007 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#ifndef _SYS_PC_MMU_H
-#define	_SYS_PC_MMU_H
-
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * Platform-dependent MMU routines and types for real x86 hardware.
- *
- * WARNING: this header file is used by both dboot and i86pc, so don't go using
- * normal kernel headers.
- */
-
-#define	IN_HYPERVISOR_VA(va) (__lintzero)
-
-void reload_cr3(void);
-
-#define	pa_to_ma(pa) (pa)
-#define	ma_to_pa(ma) (ma)
-#define	pfn_to_mfn(pfn) (pfn)
-#define	mfn_to_pfn(mfn)	(mfn)
-
-#ifndef _BOOT
-
-void mmu_tlbflush_entry(caddr_t);
-void setcr3(ulong_t);
-
-#if defined(__GNUC__)
-#include <asm/mmu.h>
-#endif
-
-#endif /* !_BOOT */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif	/* _SYS_PC_MMU_H */
--- a/components/kvm/illumos/usr/src/uts/i86pc/sys/rm_platter.h	Sat Sep 07 13:14:05 2013 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,131 +0,0 @@
-/*
- * 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 (c) 1992, 2010, Oracle and/or its affiliates. All rights reserved.
- */
-/*
- * Copyright (c) 2010, Intel Corporation.
- * All rights reserved.
- */
-/*
- * Copyright 2011 Joyent, Inc. All rights reserved.
- */
-
-#ifndef	_SYS_RM_PLATTER_H
-#define	_SYS_RM_PLATTER_H
-
-#include <sys/types.h>
-#include <sys/tss.h>
-#include <sys/segments.h>
-
-#ifdef	__cplusplus
-extern "C" {
-#endif
-
-#define	RM_PLATTER_CODE_SIZE		0x400
-#define	RM_PLATTER_CPU_HALT_CODE_SIZE	0x100
-
-typedef	struct rm_platter {
-	char		rm_code[RM_PLATTER_CODE_SIZE];
-	char		rm_cpu_halt_code[RM_PLATTER_CPU_HALT_CODE_SIZE];
-#if defined(__amd64)
-	/*
-	 * The compiler will want to 64-bit align the 64-bit rm_gdt_base
-	 * pointer, so we need to add an extra four bytes of padding here to
-	 * make sure rm_gdt_lim and rm_gdt_base will align to create a proper
-	 * ten byte GDT pseudo-descriptor.
-	 */
-	uint32_t	rm_gdt_pad;
-#endif	/* __amd64 */
-	ushort_t	rm_debug;
-	ushort_t	rm_gdt_lim;	/* stuff for lgdt */
-	user_desc_t	*rm_gdt_base;
-#if defined(__amd64)
-	/*
-	 * The compiler will want to 64-bit align the 64-bit rm_idt_base
-	 * pointer, so we need to add an extra four bytes of padding here to
-	 * make sure rm_idt_lim and rm_idt_base will align to create a proper
-	 * ten byte IDT pseudo-descriptor.
-	 */
-	uint32_t	rm_idt_pad;
-#endif	/* __amd64 */
-	ushort_t	rm_cpu_halted;	/* non-zero if CPU has been halted */
-	ushort_t	rm_idt_lim;	/* stuff for lidt */
-	gate_desc_t	*rm_idt_base;
-	uint_t		rm_pdbr;	/* cr3 value */
-	uint_t		rm_cpu;		/* easy way to know which CPU we are */
-	uint_t		rm_filler3;
-	uint_t		rm_cr4;		/* cr4 value on cpu0 */
-#if defined(__amd64)
-	/*
-	 * Temporary GDT for the brief transition from real mode to protected
-	 * mode before a CPU continues on into long mode.
-	 *
-	 * Putting it here assures it will be located in identity mapped memory
-	 * (va == pa, 1:1).
-	 *
-	 * rm_temp_gdt is sized to hold only a null descriptor in slot zero
-	 * and a 64-bit code descriptor in slot one.
-	 *
-	 * rm_temp_[gi]dt_lim and rm_temp_[gi]dt_base are the pseudo-descriptors
-	 * for the temporary GDT and IDT, respectively.
-	 */
-	uint64_t	rm_temp_gdt[2];
-	ushort_t	rm_temp_gdtdesc_pad;	/* filler to align GDT desc */
-	ushort_t	rm_temp_gdt_lim;
-	uint32_t	rm_temp_gdt_base;
-	ushort_t	rm_temp_idtdesc_pad;	/* filler to align IDT desc */
-	ushort_t	rm_temp_idt_lim;
-	uint32_t	rm_temp_idt_base;
-
-	/*
-	 * The code executing in the rm_platter needs the offset into the
-	 * platter at which the 64-bit code starts, so have mp_startup
-	 * calculate it and store it here.
-	 */
-	uint32_t	rm_longmode64_addr;
-#endif	/* __amd64 */
-} rm_platter_t;
-
-/*
- * cpu tables put within a single structure two of the tables which need to be
- * allocated when a CPU starts up.
- *
- * Note: the tss should be 16 byte aligned for best performance on amd64
- * Since DEFAULTSTKSIZE is a multiple of PAGESIZE tss will be aligned.
- */
-struct cpu_tables {
-	char		ct_stack[DEFAULTSTKSZ];
-	tss_t		ct_tss;
-};
-
-/*
- * gdt entries are 8 bytes long, ensure that we have an even no. of them.
- */
-#if ((NGDT / 2) * 2 != NGDT)
-#error "rm_platter.h: tss not properly aligned"
-#endif
-
-#ifdef	__cplusplus
-}
-#endif
-
-#endif	/* _SYS_RM_PLATTER_H */
--- a/components/kvm/illumos/usr/src/uts/i86pc/sys/vm_machparam.h	Sat Sep 07 13:14:05 2013 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,162 +0,0 @@
-/*
- * 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 (c) 1988 AT&T	*/
-/*	  All Rights Reserved  	*/
-/*
- * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#ifndef _SYS_VM_MACHPARAM_H
-#define	_SYS_VM_MACHPARAM_H
-
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
-#ifdef	__cplusplus
-extern "C" {
-#endif
-
-/*
- * Machine dependent constants for PC.
- */
-
-/*
- * USRTEXT is the start of the user text/data space.
- */
-#define	USRTEXT		USRSTACK
-
-/*
- * Virtual memory related constants for UNIX resource control, all in bytes.
- * The default stack size (initial stack size limit) keeps the stack from
- * taking more than 2 page directory entries in addition to the part of
- * the page directory entry which also maps the initial text and data,
- * and makes the default slightly bigger than the 8MB on SPARC.
- */
-#ifdef __amd64
-/*
- * On amd64, the stack grows down from just below KERNELBASE (see the
- * definition of USERLIMIT in i86pc/sys/machparam.h). Theoretically,
- * it could grow down to the top of the VA hole (0xffff800000000000),
- * giving it a possible maximum of about 125T. For an amd64 xpv
- * kernel, all user VA space is below the VA hole. The theoretical
- * maximum for the stack is about the same, although it can't grow
- * to quite that size, since it would clash with the heap.
- *
- * Pick an upper limit that will work in both cases: 32T.
- *
- * For 32bit processes, the stack is below the text segment.
- */
-#define	MAXSSIZ		(32ULL * 1024ULL * 1024ULL * 1024ULL * 1024ULL)
-#else
-#define	MAXSSIZ		(USRSTACK - 1024*1024)
-#endif /* __amd64 */
-#define	DFLSSIZ		(8*1024*1024 + ((USRSTACK) & 0x3FFFFF))
-
-/*
- * The following are limits beyond which the hard or soft limits for stack
- * and data cannot be increased. These may be viewed as fundamental
- * characteristics of the system. Note: a bug in SVVS requires that the
- * default hard limit be increasable, so the default hard limit must be
- * less than these physical limits.
- */
-#define	DSIZE_LIMIT	(USERLIMIT-USRTEXT)	/* physical data limit */
-#define	SSIZE_LIMIT	(USRSTACK)		/* physical stack limit */
-
-/*
- * Size of the kernel segkmem system pte table.  This virtual
- * space is controlled by the resource map "kernelmap".
- */
-#define	SYSPTSIZE	((61*1024*1024) / MMU_PAGESIZE)
-
-/*
- * Size of the ethernet addressable kernel segkmem system pte table.
- * This virtual space is controlled by the resource map "ekernelmap".
- * The ethernet interfaces in some sun machines can address only
- * the upper 16 Megabytes of memory.  Since the ethernet
- * driver kmem_allocs its memory, we bias all kmem_allocs
- * to try ekernelmap first and if it fails try kernelmap.
- * Folks that allocate directly out of kernelmap, above,
- * get memory that is non-ethernet addressable.
- */
-#define	E_SYSPTSIZE	(0x2000000 / MMU_PAGESIZE)
-
-/*
- * The virtual address space to be used by the seg_map segment
- * driver for fast kernel mappings.
- */
-#if defined(__i386)
-#define	SEGMAPDEFAULT	(16 * 1024 * 1024)
-#define	SEGMAPMAX	(128 * 1024 * 1024)
-#else
-#define	SEGMAPDEFAULT	(64 * 1024 * 1024)
-#endif
-
-/*
- * The time for a process to be blocked before being very swappable.
- * This is a number of seconds which the system takes as being a non-trivial
- * amount of real time. You probably shouldn't change this;
- * it is used in subtle ways (fractions and multiples of it are, that is, like
- * half of a ``long time'', almost a long time, etc.)
- * It is related to human patience and other factors which don't really
- * change over time.
- */
-#define	MAXSLP 		20
-
-/*
- * A swapped in process is given a small amount of core without being bothered
- * by the page replacement algorithm. Basically this says that if you are
- * swapped in you deserve some resources. We protect the last SAFERSS
- * pages against paging and will just swap you out rather than paging you.
- * Note that each process has at least UPAGES pages which are not
- * paged anyways so this number just means a swapped in process is
- * given around 32k bytes.
- */
-/*
- * nominal ``small'' resident set size
- * protected against replacement
- */
-#define	SAFERSS		3
-
-/*
- * DISKRPM is used to estimate the number of paging i/o operations
- * which one can expect from a single disk controller.
- *
- * XXX - The system doesn't account for multiple swap devices.
- */
-#define	DISKRPM		60
-
-/*
- * The maximum value for handspreadpages which is the the distance
- * between the two clock hands in pages.
- */
-#define	MAXHANDSPREADPAGES	((64 * 1024 * 1024) / PAGESIZE)
-
-/*
- * Paged text files that are less than PGTHRESH bytes
- * may be "prefaulted in" instead of demand paged.
- */
-#define	PGTHRESH	(280 * 1024)
-
-#ifdef	__cplusplus
-}
-#endif
-
-#endif	/* _SYS_VM_MACHPARAM_H */
--- a/components/kvm/illumos/usr/src/uts/i86pc/sys/x_call.h	Sat Sep 07 13:14:05 2013 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,90 +0,0 @@
-/*
- * 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 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#ifndef	_SYS_X_CALL_H
-#define	_SYS_X_CALL_H
-
-#ifdef	__cplusplus
-extern "C" {
-#endif
-
-#ifndef _ASM
-
-typedef uintptr_t xc_arg_t;
-typedef int (*xc_func_t)(xc_arg_t, xc_arg_t, xc_arg_t);
-
-/*
- * One of these is stored in each CPU's machcpu data, plus one extra for
- * priority (ie panic) messages
- */
-typedef struct xc_data {
-	xc_func_t	xc_func;
-	xc_arg_t	xc_a1;
-	xc_arg_t	xc_a2;
-	xc_arg_t	xc_a3;
-} xc_data_t;
-
-/*
- * This is kept as small as possible, since for N CPUs we need N * N of them.
- */
-typedef struct xc_msg {
-	uint8_t		xc_command;
-#ifdef __amd64
-	uint16_t	xc_master;
-	uint16_t	xc_slave;
-#else
-	uint8_t		xc_master;
-	uint8_t		xc_slave;
-#endif
-	struct xc_msg	*xc_next;
-} xc_msg_t;
-
-/*
- * Cross-call routines.
- */
-#if defined(_KERNEL)
-
-extern void	xc_init_cpu(struct cpu *);
-extern void	xc_fini_cpu(struct cpu *);
-extern int	xc_flush_cpu(struct cpu *);
-extern uint_t	xc_serv(caddr_t, caddr_t);
-
-#define	CPUSET2BV(set)	((ulong_t *)(void *)&(set))
-extern void	xc_call(xc_arg_t, xc_arg_t, xc_arg_t, ulong_t *, xc_func_t);
-extern void	xc_call_nowait(xc_arg_t, xc_arg_t, xc_arg_t, ulong_t *,
-    xc_func_t);
-extern void	xc_sync(xc_arg_t, xc_arg_t, xc_arg_t, ulong_t *, xc_func_t);
-extern void	xc_priority(xc_arg_t, xc_arg_t, xc_arg_t, ulong_t *, xc_func_t);
-
-#endif	/* _KERNEL */
-
-#endif	/* !_ASM */
-
-#ifdef	__cplusplus
-}
-#endif
-
-#endif	/* _SYS_X_CALL_H */
--- a/components/kvm/illumos/usr/src/uts/i86pc/sys/xc_levels.h	Sat Sep 07 13:14:05 2013 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-/*
- * 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 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#ifndef _SYS_XC_LEVELS_H
-#define	_SYS_XC_LEVELS_H
-
-#ifdef	__cplusplus
-extern "C" {
-#endif
-
-/* PILs associated with cross calls */
-#define	XC_CPUPOKE_PIL	11	/* poke to cause wakeup, no service function */
-#define	XC_SYS_PIL	13	/* should be defined elsewhere */
-#define	XC_HI_PIL	15	/* cross call with service function */
-#define	XCALL_PIL	XC_HI_PIL /* alias for XC_HI_PIL */
-
-#ifdef	__cplusplus
-}
-#endif
-
-#endif	/* _SYS_XC_LEVELS_H */
--- a/components/kvm/patches/Makefile.patch	Sat Sep 07 13:14:05 2013 +0100
+++ b/components/kvm/patches/Makefile.patch	Sat Sep 07 14:03:06 2013 +0100
@@ -1,13 +1,14 @@
---- joyent-illumos-kvm-b0749fb/Makefile.~1~	2012-08-09 19:44:50.000000000 +0100
-+++ joyent-illumos-kvm-b0749fb/Makefile	2012-08-27 14:37:58.457054183 +0100
+--- illumos-kvm-2bbad6a/Makefile.~1~	2013-03-21 05:58:12.000000000 +0000
++++ illumos-kvm-2bbad6a/Makefile	2013-09-07 13:40:55.675235637 +0100
 @@ -2,13 +2,13 @@
  # Copyright (c) 2012, Joyent, Inc.  All Rights Reserved.
  #
  
 -KERNEL_SOURCE =	$(PWD)/../../illumos
-+KERNEL_SOURCE =	$(PWD)/../../../illumos
++KERNEL_SOURCE =	$(PWD)/../../../../../illumos
  MDB_SOURCE =	$(KERNEL_SOURCE)/usr/src/cmd/mdb
- PROTO_AREA =	$(PWD)/../../../proto
+-PROTO_AREA =	$(PWD)/../../../proto
++PROTO_AREA =	$(PWD)/../../../../../illumos/proto/root_i386
  
 -CC =		$(PROTO_AREA)/usr/bin/gcc
 -LD =		$(PROTO_AREA)/usr/bin/ld
@@ -18,12 +19,3 @@
  CTFCONVERT =	$(CTFBINDIR)/ctfconvert
  CTFMERGE =	$(CTFBINDIR)/ctfmerge
  CSTYLE =	$(KERNEL_SOURCE)/usr/src/tools/scripts/cstyle
-@@ -298,7 +298,7 @@
- 	@cp kvm.conf $(DESTDIR)/usr/kernel/drv
- 	@mkdir -p $(DESTDIR)/usr/lib/mdb/kvm/amd64
- 	@cp kvm.so $(DESTDIR)/usr/lib/mdb/kvm/amd64
--	@mkdir -p $(DESTDIR)/usr/lib/devfsadm
-+	@mkdir -p $(DESTDIR)/usr/lib/devfsadm/linkmod
- 	@cp JOY_kvm_link.so $(DESTDIR)/usr/lib/devfsadm/linkmod
- 
- check: $(CSTYLE_CHK) $(XXX_CHK) $(USR_HDRCHK) $(SYS_HDRCHK)