summaryrefslogtreecommitdiff
path: root/usr
diff options
context:
space:
mode:
authorMike Zeller <mike@mikezeller.net>2021-06-01 12:50:48 -0400
committerMike Zeller <mike@mikezeller.net>2021-06-01 12:52:00 -0400
commit1c9dda01d3f89e5ad6fd53c614f28e837e2f4592 (patch)
tree22a9aa3bc13e219b8290ac8df0add64ff7dcfad9 /usr
parentdbc77341934ab60115dd8c98e9689fe531fac379 (diff)
parent10c0779de9b4d8c4ebdb274e17730c49bc925f00 (diff)
downloadillumos-joyent-1c9dda01d3f89e5ad6fd53c614f28e837e2f4592.tar.gz
[illumos-gate merge]
commit 10c0779de9b4d8c4ebdb274e17730c49bc925f00 13740 net-routing-setup should support default gateway via link-local routes commit 05c0ef072824e9e875c8b4ba7db90d3d270fccf7 13815 Trusted extensions /etc/security/tsol/label_encodings file installed with wrong permissions during gate build commit 1a414bb636b35c18399549b05b65aef849e6f9df 13828 beadm: Fix wrong array size commit cf409e3f26ef8db450f46ba9760eb9734f603ae0 13825 consolidate vm-related headers for bhyve commit 3a9318192067bc7735a0a8b261c598c7d4129177 13318 Tidy up libdtrace_jni javadoc commit 3984682357d7bf0332a2f7d5406e349229f168e2 13831 lofi: lofi_close() can not tear down lofi instance commit 5cf013a3c9d3f3ca3a892f013ac067904135da06 13090 junk characters in `zpool online -e` EACCES error message commit 517877177d6b869e3aecde6716479541650da10d 13836 several packages are missing license actions Conflicts: usr/src/Makefile usr/src/man/man1m/route.1m usr/src/cmd/svc/milestone/net-routing-setup usr/src/uts/i86pc/io/vmm/vm/vm_map.h
Diffstat (limited to 'usr')
-rw-r--r--usr/src/Makefile1
-rw-r--r--usr/src/cmd/beadm/beadm.c4
-rw-r--r--usr/src/cmd/svc/milestone/net-routing-setup55
-rw-r--r--usr/src/compat/bhyve/vm/vm.h64
-rw-r--r--usr/src/lib/libdtrace_jni/java/docs/html/fast.html28
-rw-r--r--usr/src/lib/libdtrace_jni/java/src/org/opensolaris/os/dtrace/Aggregate.java12
-rw-r--r--usr/src/lib/libdtrace_jni/java/src/org/opensolaris/os/dtrace/Aggregation.java10
-rw-r--r--usr/src/lib/libdtrace_jni/java/src/org/opensolaris/os/dtrace/Consumer.java42
-rw-r--r--usr/src/lib/libdtrace_jni/java/src/org/opensolaris/os/dtrace/ConsumerListener.java8
-rw-r--r--usr/src/lib/libdtrace_jni/java/src/org/opensolaris/os/dtrace/Flow.java6
-rw-r--r--usr/src/lib/libdtrace_jni/java/src/org/opensolaris/os/dtrace/InterfaceAttributes.java28
-rw-r--r--usr/src/lib/libdtrace_jni/java/src/org/opensolaris/os/dtrace/LocalConsumer.java10
-rw-r--r--usr/src/lib/libdtrace_jni/java/src/org/opensolaris/os/dtrace/Option.java22
-rw-r--r--usr/src/lib/libdtrace_jni/java/src/org/opensolaris/os/dtrace/PrintaRecord.java8
-rw-r--r--usr/src/lib/libdtrace_jni/java/src/org/opensolaris/os/dtrace/PrintfRecord.java6
-rw-r--r--usr/src/lib/libdtrace_jni/java/src/org/opensolaris/os/dtrace/ProbeData.java6
-rw-r--r--usr/src/lib/libdtrace_jni/java/src/org/opensolaris/os/dtrace/StackValueRecord.java6
-rw-r--r--usr/src/lib/libdtrace_jni/java/src/org/opensolaris/os/dtrace/package.html14
-rw-r--r--usr/src/lib/libzfs/common/libzfs_pool.c12
-rw-r--r--usr/src/man/man1m/route.1m22
-rw-r--r--usr/src/pkg/manifests/diagnostic-cpu-counters.mf2
-rw-r--r--usr/src/pkg/manifests/system-boot-loader.mf8
-rw-r--r--usr/src/pkg/manifests/system-kernel.mf4
-rw-r--r--usr/src/pkg/manifests/system-library-platform.mf2
-rw-r--r--usr/src/pkg/manifests/system-library.mf2
-rw-r--r--usr/src/tools/findunref/exception_list.open26
-rw-r--r--usr/src/uts/common/io/lofi.c38
-rw-r--r--usr/src/uts/i86pc/io/vmm/amd/amdvi_hw.c3
-rw-r--r--usr/src/uts/i86pc/io/vmm/amd/ivrs_drv.c3
-rw-r--r--usr/src/uts/i86pc/io/vmm/amd/npt.c4
-rw-r--r--usr/src/uts/i86pc/io/vmm/amd/svm.c10
-rw-r--r--usr/src/uts/i86pc/io/vmm/intel/ept.c6
-rw-r--r--usr/src/uts/i86pc/io/vmm/intel/offsets.in2
-rw-r--r--usr/src/uts/i86pc/io/vmm/intel/vmcs.c3
-rw-r--r--usr/src/uts/i86pc/io/vmm/intel/vmx.c10
-rw-r--r--usr/src/uts/i86pc/io/vmm/intel/vtd.c5
-rw-r--r--usr/src/uts/i86pc/io/vmm/sys/vmm_impl.h1
-rw-r--r--usr/src/uts/i86pc/io/vmm/sys/vmm_vm.h207
-rw-r--r--usr/src/uts/i86pc/io/vmm/vm/pmap.h28
-rw-r--r--usr/src/uts/i86pc/io/vmm/vm/vm_extern.h36
-rw-r--r--usr/src/uts/i86pc/io/vmm/vm/vm_glue.h101
-rw-r--r--usr/src/uts/i86pc/io/vmm/vm/vm_map.h64
-rw-r--r--usr/src/uts/i86pc/io/vmm/vm/vm_object.h32
-rw-r--r--usr/src/uts/i86pc/io/vmm/vm/vm_page.h29
-rw-r--r--usr/src/uts/i86pc/io/vmm/vm/vm_pager.h24
-rw-r--r--usr/src/uts/i86pc/io/vmm/vmm.c34
-rw-r--r--usr/src/uts/i86pc/io/vmm/vmm_instruction_emul.c14
-rw-r--r--usr/src/uts/i86pc/io/vmm/vmm_mem.c20
-rw-r--r--usr/src/uts/i86pc/io/vmm/vmm_sol_dev.c11
-rw-r--r--usr/src/uts/i86pc/io/vmm/vmm_sol_ept.c4
-rw-r--r--usr/src/uts/i86pc/io/vmm/vmm_sol_glue.c1
-rw-r--r--usr/src/uts/i86pc/io/vmm/vmm_sol_rvi.c6
-rw-r--r--usr/src/uts/i86pc/io/vmm/vmm_sol_vm.c8
53 files changed, 479 insertions, 633 deletions
diff --git a/usr/src/Makefile b/usr/src/Makefile
index 01ea95b29f..13a3747cc4 100644
--- a/usr/src/Makefile
+++ b/usr/src/Makefile
@@ -156,6 +156,7 @@ closedbins: bldtools $(ROOTDIRS) FRC
(cd $$CLOSED_ROOT; \
$(TAR) cfX - $(CODEMGR_WS)/exception_lists/closed-bins .) | \
(cd $(ROOT); $(TAR) xBpf -); \
+ $(CHMOD) 0400 $(ROOT)/etc/security/tsol/label_encodings; \
$(ECHO) "Stripping CTF from closed-bins in $$ROOT"; \
( cd $(ROOT); $(CTFSTRIP) $$(cd $$CLOSED_ROOT; $(FIND) \
./kernel ./usr/kernel ./platform/*/kernel -type f -a -perm -u+x | \
diff --git a/usr/src/cmd/beadm/beadm.c b/usr/src/cmd/beadm/beadm.c
index 825a564c4b..6f33c13181 100644
--- a/usr/src/cmd/beadm/beadm.c
+++ b/usr/src/cmd/beadm/beadm.c
@@ -265,7 +265,7 @@ count_widths(enum be_fmt be_fmt, struct hdr_info *hdr, be_node_list_t *be_nodes)
len[i] = hdr->cols[i].width;
for (cur_be = be_nodes; cur_be != NULL; cur_be = cur_be->be_next_node) {
- char name[ZFS_MAX_DATASET_NAME_LEN + 1];
+ char name[ZFS_MAX_DATASET_NAME_LEN];
const char *be_name = cur_be->be_node_name;
const char *root_ds = cur_be->be_root_ds;
char *pos;
@@ -413,7 +413,7 @@ print_be_snapshots(be_node_list_t *be, struct hdr_info *hdr, boolean_t parsable)
for (snap = be->be_node_snapshots; snap != NULL;
snap = snap->be_next_snapshot) {
- char name[ZFS_MAX_DATASET_NAME_LEN + 1];
+ char name[ZFS_MAX_DATASET_NAME_LEN];
const char *datetime_fmt = "%F %R";
const char *be_name = be->be_node_name;
const char *root_ds = be->be_root_ds;
diff --git a/usr/src/cmd/svc/milestone/net-routing-setup b/usr/src/cmd/svc/milestone/net-routing-setup
index 0b294c2630..7f6d457b33 100644
--- a/usr/src/cmd/svc/milestone/net-routing-setup
+++ b/usr/src/cmd/svc/milestone/net-routing-setup
@@ -23,6 +23,7 @@
# Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
#
# Copyright (c) 2012 Joyent, Inc. All rights reserved.
+# Copyright (c) 2021 H. William Welliver
# This script configures IP routing.
@@ -32,8 +33,8 @@ set -o xtrace
#
# In a shared-IP zone we need this service to be up, but all of the work
-# it tries to do is irrelevant (and will actually lead to the service
-# failing if we try to do it), so just bail out.
+# it tries to do is irrelevant (and will actually lead to the service
+# failing if we try to do it), so just bail out.
# In the global zone and exclusive-IP zones we proceed.
#
smf_configure_ip || exit $SMF_EXIT_OK
@@ -95,6 +96,34 @@ if [ -f /etc/inet/static_routes.vmadm ]; then
done
fi
+#
+# See if static routes were created by install. If so, they were created
+# under /etc/svc/volatile. Copy them into their proper place.
+#
+if [ -f /etc/svc/volatile/etc/inet/static_routes ]; then
+ echo "Installing persistent routes"
+ if [ -f /etc/inet/static_routes ]; then
+ cat /etc/svc/volatile/etc/inet/static_routes | grep -v '^#' \
+ >> /etc/inet/static_routes
+ else
+ cp /etc/svc/volatile/etc/inet/static_routes \
+ /etc/inet/static_routes
+ fi
+ /usr/bin/rm /etc/svc/volatile/etc/inet/static_routes
+
+fi
+
+#
+# Read /etc/inet/static_routes and add each link-local route.
+#
+if [ -f /etc/inet/static_routes ]; then
+ echo "Adding persistent link-local routes:"
+ /usr/bin/egrep -v "^(#|$)" /etc/inet/static_routes \
+ | /usr/bin/grep -E -- "-interface |-iface " | while read line; do
+ /usr/sbin/route add $line
+ done
+fi
+
if [ "$_INIT_NET_STRATEGY" = "dhcp" ] && \
[ -n "`/sbin/dhcpinfo Router`" ]; then
defrouters=`/sbin/dhcpinfo Router`
@@ -200,28 +229,12 @@ else
fi
#
-# See if static routes were created by install. If so, they were created
-# under /etc/svc/volatile. Copy them into their proper place.
-#
-if [ -f /etc/svc/volatile/etc/inet/static_routes ]; then
- echo "Installing persistent routes"
- if [ -f /etc/inet/static_routes ]; then
- cat /etc/svc/volatile/etc/inet/static_routes | grep -v '^#' \
- >> /etc/inet/static_routes
- else
- cp /etc/svc/volatile/etc/inet/static_routes \
- /etc/inet/static_routes
- fi
- /usr/bin/rm /etc/svc/volatile/etc/inet/static_routes
-
-fi
-
-#
-# Read /etc/inet/static_routes and add each route.
+# Read /etc/inet/static_routes and add each non-link-local route.
#
if [ -f /etc/inet/static_routes ]; then
echo "Adding persistent routes:"
- /usr/bin/egrep -v "^(#|$)" /etc/inet/static_routes | while read line; do
+ /usr/bin/egrep -v "^(#|$)" /etc/inet/static_routes \
+ | /usr/bin/grep -v -E -- "-interface |-iface " | while read line; do
/usr/sbin/route add $line
done
fi
diff --git a/usr/src/compat/bhyve/vm/vm.h b/usr/src/compat/bhyve/vm/vm.h
deleted file mode 100644
index f5bb7b6eb8..0000000000
--- a/usr/src/compat/bhyve/vm/vm.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * This file and its contents are supplied under the terms of the
- * Common Development and Distribution License ("CDDL"), version 1.0.
- * You may only use this file in accordance with the terms of version
- * 1.0 of the CDDL.
- *
- * A full copy of the text of the CDDL should have accompanied this
- * source. A copy of the CDDL is also available via the Internet at
- * http://www.illumos.org/license/CDDL.
- */
-
-/*
- * Copyright 2014 Pluribus Networks Inc.
- * Copyright 2017 Joyent, Inc.
- */
-
-#ifndef _FREEBSD_VM_VM_H_
-#define _FREEBSD_VM_VM_H_
-
-#include <machine/vm.h>
-#include <sys/mman.h>
-
-typedef u_char vm_prot_t;
-
-/*
- * Even though the FreeBSD VM_PROT defines happen to match illumos, this
- * references the native values directly so there's no risk of breakage.
- */
-#define VM_PROT_NONE ((vm_prot_t) 0x00)
-#define VM_PROT_READ ((vm_prot_t) PROT_READ)
-#define VM_PROT_WRITE ((vm_prot_t) PROT_WRITE)
-#define VM_PROT_EXECUTE ((vm_prot_t) PROT_EXEC)
-
-#define VM_PROT_ALL (VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE)
-#define VM_PROT_RW (VM_PROT_READ|VM_PROT_WRITE)
-
-struct vm_page;
-typedef struct vm_page *vm_page_t;
-
-enum obj_type { OBJT_DEFAULT, OBJT_SWAP, OBJT_VNODE, OBJT_DEVICE, OBJT_PHYS,
- OBJT_DEAD, OBJT_SG, OBJT_MGTDEVICE };
-typedef u_char objtype_t;
-
-union vm_map_object;
-typedef union vm_map_object vm_map_object_t;
-
-struct vm_map_entry;
-typedef struct vm_map_entry *vm_map_entry_t;
-
-struct vm_map;
-typedef struct vm_map *vm_map_t;
-
-struct vm_object;
-typedef struct vm_object *vm_object_t;
-
-/*
- * <sys/promif.h> contains a troublesome preprocessor define for BYTE.
- * Do this ugly workaround to avoid it.
- */
-#define _SYS_PROMIF_H
-#include <vm/hat_i86.h>
-#undef _SYS_PROMIF_H
-
-#endif /* _FREEBSD_VM_VM_H_ */
diff --git a/usr/src/lib/libdtrace_jni/java/docs/html/fast.html b/usr/src/lib/libdtrace_jni/java/docs/html/fast.html
index e5318835c8..23898130c0 100644
--- a/usr/src/lib/libdtrace_jni/java/docs/html/fast.html
+++ b/usr/src/lib/libdtrace_jni/java/docs/html/fast.html
@@ -2,8 +2,6 @@
Copyright 2007 Sun Microsystems, Inc. All rights reserved.
Use is subject to license terms.
- ident "%Z%%M% %I% %E% SMI"
-
CDDL HEADER START
The contents of this file are subject to the terms of the
@@ -60,8 +58,8 @@ line to <tt>/etc/user_attr</tt>:
<br>
<br>
<i>(Substitute your user name.)</i> See the <a
-href=http://docs.sun.com/app/docs/doc/817-6223/6mlkidln0?a=view>
-<b>Security</b></a> chapter of the <i>Solaris Dynamic Tracing Guide</i>
+href=http://dtrace.org/guide/chp-sec.html>
+<b>Security</b></a> chapter of the <i>Dynamic Tracing Guide</i>
for more information.
<br>
<h4><a name="Writing_a_Simple_Consumer"></a>Writing a Simple Consumer</h4>
@@ -110,7 +108,7 @@ Here is a simple example that runs a given D script:<br>
File file = new File(args[0]);
String[] macroArgs = new String[args.length - 1];
System.arraycopy(args, 1, macroArgs, 0, (args.length - 1));</font>
-
+
Consumer consumer = new LocalConsumer();
consumer.addConsumerListener(new ConsumerAdapter() {
public void dataReceived(DataEvent e) {
@@ -203,9 +201,9 @@ such as an aggregation:<br>
<br>
The above script uses the <tt>$$1</tt> macro variable as a placeholder
for whatever executable you'd like to trace. See the <a
-href=http://docs.sun.com/app/docs/doc/817-6223/6mlkidliq?a=view><b>
+href=http://dtrace.org/guide/chp-script.html#chp-script-3><b>
Macro Arguments</b></a> section of the <b>Scripting</b> chapter of the
-<i>Solaris Dynamic Tracing Guide</i>. Using two dollar signs (<tt>$$1</tt>)
+<i>Dynamic Tracing Guide</i>. Using two dollar signs (<tt>$$1</tt>)
instead of one (<tt>$1</tt>) forces expansion of the macro variable to
type string.<br>
<br>
@@ -316,10 +314,10 @@ longer available to the <tt>getAggregate()</tt> method.<br>
<br>
Be aware that you cannot call <tt>getAggregate()</tt> on an interval
faster that the <tt>aggrate</tt> setting. See the <a
-href=http://docs.sun.com/app/docs/doc/817-6223/6mlkidlis?a=view>
-<b>Options and Tunables</b></a> chapter of the <i>Solaris Dynamic
+href=http://dtrace.org/guide/chp-opt.html>
+<b>Options and Tunables</b></a> chapter of the <i>Dynamic
Tracing Guide</i>. See also the <a
-href=http://docs.sun.com/app/docs/doc/817-6223/6mlkidlhf?a=view>
+href=http://dtrace.org/guide/chp-aggs.html#chp-aggs-4>
<b>Minimizing Drops</b></a> section of the <b>Aggregations</b> chapter
for specific information about the <tt>aggrate</tt> option. The default
<tt>aggrate</tt> is once per second. Here's an example of how you might
@@ -358,9 +356,9 @@ href="../api/org/opensolaris/os/dtrace/Aggregation.html">
In addition to supporting macro arguments (see the <tt>syscall.d</tt>
aggregation example above), the Java DTrace API also supports the
<tt>$target</tt> macro variable. (See the <a
-href=http://docs.sun.com/app/docs/doc/817-6223/6mlkidlir?a=view>
+href=http://dtrace.org/guide/chp-script.html#chp-script-4>
<b>Target Process ID</b></a> section of the <b>Scripting</b> chapter of
-the <i>Solaris Dynamic Tracing Guide</i>.) This allows you to trace a
+the <i>Dynamic Tracing Guide</i>.) This allows you to trace a
process from the very beginning of its execution, rather than sometime
after you manually obtain its process ID. The API does this by creating
a process that is initially suspended and allowed to start only after <a
@@ -485,10 +483,10 @@ href=../api/org/opensolaris/os/dtrace/PrintaRecord.html>
action will not be included in the requested aggregate.
<h2><a name="Learning_DTrace"></a>Learning More</h2>
<br>
-The <a href="http://www.opensolaris.org/os/community/dtrace/">
-OpenSolaris DTrace page</a> has links to resources to help you learn
+The <a href="http://dtrace.org/">
+DTrace page</a> has links to resources to help you learn
DTrace. In particular, you should read the <a
-href="http://docs.sun.com/app/docs/doc/817-6223"><i>Solaris Dynamic Tracing
+href="http://dtrace.org/guide/"><i>Dynamic Tracing
Guide</i></a>.<br>
<br>
Try the example Java programs on this page with other D scripts. You
diff --git a/usr/src/lib/libdtrace_jni/java/src/org/opensolaris/os/dtrace/Aggregate.java b/usr/src/lib/libdtrace_jni/java/src/org/opensolaris/os/dtrace/Aggregate.java
index 7954d630a2..fb595333dc 100644
--- a/usr/src/lib/libdtrace_jni/java/src/org/opensolaris/os/dtrace/Aggregate.java
+++ b/usr/src/lib/libdtrace_jni/java/src/org/opensolaris/os/dtrace/Aggregate.java
@@ -22,8 +22,6 @@
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
- *
- * ident "%Z%%M% %I% %E% SMI"
*/
package org.opensolaris.os.dtrace;
@@ -195,7 +193,7 @@ public final class Aggregate implements Serializable
// team that calling getAggregation() with underbar should
// return the unnamed aggregation (same as calling with empty
// string). Underbar is used to identify the unnamed
- // aggregation in libdtrace; in the jave API it is identifed by
+ // aggregation in libdtrace; in the java API it is identified by
// the empty string. The API never presents underbar but
// accepts it as input (just converts underbar to empty string
// everywhere it sees it).
@@ -230,11 +228,11 @@ public final class Aggregate implements Serializable
* can easily be sorted by any arbitrary criteria, for example by
* key ascending:
* <pre><code>
- * List <AggregationRecord> records = aggregate.getRecords();
+ * List &lt;AggregationRecord&gt; records = aggregate.getRecords();
* Collections.sort(records, new Comparator &lt;AggregationRecord&gt; () {
- * public int compare(AggregationRecord r1, AggregationRecord r2) {
- * return r1.getTuple().compareTo(r2.getTuple());
- * }
+ * public int compare(AggregationRecord r1, AggregationRecord r2) {
+ * return r1.getTuple().compareTo(r2.getTuple());
+ * }
* });
* </code></pre>
* Use {@code getOrderedRecords()} instead of {@code getRecords()}
diff --git a/usr/src/lib/libdtrace_jni/java/src/org/opensolaris/os/dtrace/Aggregation.java b/usr/src/lib/libdtrace_jni/java/src/org/opensolaris/os/dtrace/Aggregation.java
index 7a31f39c41..1883400a15 100644
--- a/usr/src/lib/libdtrace_jni/java/src/org/opensolaris/os/dtrace/Aggregation.java
+++ b/usr/src/lib/libdtrace_jni/java/src/org/opensolaris/os/dtrace/Aggregation.java
@@ -22,8 +22,6 @@
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
- *
- * ident "%Z%%M% %I% %E% SMI"
*/
package org.opensolaris.os.dtrace;
@@ -56,10 +54,10 @@ import java.io.*;
* keyed to the empty tuple ({@link Tuple#EMPTY}).
* <p>
* For more information, see the <a
- * href=http://docs.sun.com/app/docs/doc/817-6223/6mlkidlh7?a=view>
- * <b>Aggregations</b></a> chapter of the <i>Solaris Dynamic Tracing
+ * href=http://dtrace.org/guide/chp-aggs.html>
+ * <b>Aggregations</b></a> chapter of the <i>Dynamic Tracing
* Guide</i>. Also, the <a
- * href=http://docs.sun.com/app/docs/doc/817-6223/6mlkidlfv?a=view>
+ * href=http://dtrace.org/guide/chp-variables.html#chp-variables-5>
* <b>Built-in Variables</b></a> section of the <b>Variables</b> chapter
* describes variables like {@code execname}, {@code probefunc}, and
* {@code cpu} useful for aggregating.
@@ -282,7 +280,7 @@ public final class Aggregation implements Serializable {
* @param key The record key, or an empty tuple (see {@link
* Tuple#EMPTY}) to obtain the value from a <i>singleton</i> (a
* non-keyed instance with only a single value) generated from a
- * DTrace aggregation declarated without square brackets, for
+ * DTrace aggregation declared without square brackets, for
* example:
* <pre> {@code @a = count();}</pre>
* @return the record associated with the given key, or {@code null}
diff --git a/usr/src/lib/libdtrace_jni/java/src/org/opensolaris/os/dtrace/Consumer.java b/usr/src/lib/libdtrace_jni/java/src/org/opensolaris/os/dtrace/Consumer.java
index 59270ba21a..b732fa454d 100644
--- a/usr/src/lib/libdtrace_jni/java/src/org/opensolaris/os/dtrace/Consumer.java
+++ b/usr/src/lib/libdtrace_jni/java/src/org/opensolaris/os/dtrace/Consumer.java
@@ -22,8 +22,6 @@
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
- *
- * ident "%Z%%M% %I% %E% SMI"
*/
package org.opensolaris.os.dtrace;
@@ -76,7 +74,7 @@ public interface Consumer {
* @throws NullPointerException if any of the given open flags is
* {@code null}
* @throws IllegalArgumentException if any of the given flags are
- * mutually exlusive
+ * mutually exclusive
* @throws IllegalStateException if this consumer is closed or has
* already been opened
* @throws DTraceException if an exception occurs in the native
@@ -100,9 +98,9 @@ public interface Consumer {
* occurrences of {@code $2}, and so on. {@code $0} is
* automatically replaced by the executable name and should not be
* included in the {@code macroArgs} parameter. See the <a
- * href=http://docs.sun.com/app/docs/doc/817-6223/6mlkidliq?a=view>
+ * href=http://dtrace.org/guide/chp-script.html#chp-script-3>
* <b>Macro Arguments</b></a> section of the <b>Scripting</b>
- * chapter of the <i>Solaris Dynamic Tracing Guide</i>.
+ * chapter of the <i>Dynamic Tracing Guide</i>.
* @return a non-null {@code Program} identifier that may be passed
* to {@link #enable(Program program) enable()}
* @throws NullPointerException if the given program string or any
@@ -129,9 +127,9 @@ public interface Consumer {
* occurrences of {@code $2}, and so on. {@code $0} is
* automatically set to the name of the given file and should not be
* included in the {@code macroArgs} parameter. See the <a
- * href=http://docs.sun.com/app/docs/doc/817-6223/6mlkidliq?a=view>
+ * href=http://dtrace.org/guide/chp-script.html#chp-script-3>
* <b>Macro Arguments</b></a> section of the <b>Scripting</b>
- * chapter of the <i>Solaris Dynamic Tracing Guide</i>.
+ * chapter of the <i>Dynamic Tracing Guide</i>.
* @return a non-null {@code Program} identifier that may be passed
* to {@link #enable(Program program) enable()}
* @throws NullPointerException if the given program file or any of
@@ -259,8 +257,8 @@ public interface Consumer {
* Option#switchrate switchrate} and {@link Option#aggrate aggrate}
* are settable while a consumer is running; others must be set
* before calling {@link #go()}. See the <a
- * href=http://docs.sun.com/app/docs/doc/817-6223/6mlkidlis?a=view>
- * <b>Options and Tunables</b></a> chapter of the <i>Solaris Dynamic
+ * href=http://dtrace.org/guide/chp-opt.html#chp-opt>
+ * <b>Options and Tunables</b></a> chapter of the <i>Dynamic Tracing
* Guide</i> for information about specific options.
*
* @throws NullPointerException if the given option or value is
@@ -392,9 +390,9 @@ public interface Consumer {
* <p>
* A consumer may stop on its own in response to the {@code exit()}
* action (see <b>{@code exit()}</b> in the <a
- * href=http://docs.sun.com/app/docs/doc/817-6223/6mlkidlhm?a=view>
+ * href=http://dtrace.org/guide/chp-actsub.html#chp-actsub-5>
* <b>Special Actions</b></a> section of the <b>Actions and
- * Subroutines</b> chapter of the <i>Solaris Dynamic Tracing
+ * Subroutines</b> chapter of the <i>Dynamic Tracing
* Guide</i>). Similarly, a consumer stops automatically if it has
* at least one target process and all its target processes have
* completed (see {@link #createProcess(String command)
@@ -491,9 +489,9 @@ public interface Consumer {
* <p>
* Provides a programmatic alternative to the {@code printa(})
* action (see <a
- * href=http://docs.sun.com/app/docs/doc/817-6223/6mlkidlhv?a=view>
+ * href=http://dtrace.org/guide/chp-fmt.html#chp-fmt-printa>
* <b>{@code printa()}</b></a> in the <b>Output Formatting</b>
- * chapter of the <i>Solaris Dynamic Tracing Guide</i>).
+ * chapter of the <i>Dynamic Tracing Guide</i>).
*
* @throws IllegalStateException if called before {@link #go()} or
* after {@link #close()}
@@ -511,9 +509,9 @@ public interface Consumer {
* <p>
* Provides a programmatic alternative to the {@code printa(})
* action (see <a
- * href=http://docs.sun.com/app/docs/doc/817-6223/6mlkidlhv?a=view>
+ * href=http://dtrace.org/guide/chp-fmt.html#chp-fmt-printa>
* <b>{@code printa()}</b></a> in the <b>Output Formatting</b>
- * chapter of the <i>Solaris Dynamic Tracing Guide</i>).
+ * chapter of the <i>Dynamic Tracing Guide</i>).
*
* @param includedAggregationNames if {@code null}, all available
* aggregations are included; if non-null, only those aggregations
@@ -542,9 +540,9 @@ public interface Consumer {
* <p>
* Provides a programmatic alternative to the {@code printa(}) (see
* <a
- * href=http://docs.sun.com/app/docs/doc/817-6223/6mlkidlhv?a=view>
+ * href=http://dtrace.org/guide/chp-fmt.html#chp-fmt-printa>
* <b>{@code printa()}</b></a> in the <b>Output Formatting</b>
- * chapter of the <i>Solaris Dynamic Tracing Guide</i>) and {@code
+ * chapter of the <i>Dynamic Tracing Guide</i>) and {@code
* clear()} actions.
*
* @param includedAggregationNames if {@code null}, all available
@@ -574,15 +572,15 @@ public interface Consumer {
* processStateChanged()} method.
* <p>
* See the <a
- * href=http://docs.sun.com/app/docs/doc/817-6223/6mlkidlir?a=view>
+ * href=http://dtrace.org/guide/chp-script.html#chp-script-4>
* <b>Target Process ID</b></a> section of the <b>Scripting</b>
- * chapter of the <i>Solaris Dynamic Tracing Guide</i>.
+ * chapter of the <i>Dynamic Tracing Guide</i>.
*
* @param command a string whose first token is assumed to be the
* name of the command and whose subsequent tokens are the arguments
* to that command.
* @return ID of the created process (pid)
- * @throws NullPointerException if the given command is {@code nul}l
+ * @throws NullPointerException if the given command is {@code null}
* @throws IllegalArgumentException if the given command is empty or
* contains only whitespace
* @throws IllegalStateException if called before {@link
@@ -602,9 +600,9 @@ public interface Consumer {
* processStateChanged()} method.
* <p>
* See the <a
- * href=http://docs.sun.com/app/docs/doc/817-6223/6mlkidlir?a=view>
+ * href=http://dtrace.org/guide/chp-script.html#chp-script-4>
* <b>Target Process ID</b></a> section of the <b>Scripting</b>
- * chapter of the <i>Solaris Dynamic Tracing Guide</i>.
+ * chapter of the <i>Dynamic Tracing Guide</i>.
*
* @param pid process ID of the process to be grabbed
* @throws IllegalStateException if called before {@link
diff --git a/usr/src/lib/libdtrace_jni/java/src/org/opensolaris/os/dtrace/ConsumerListener.java b/usr/src/lib/libdtrace_jni/java/src/org/opensolaris/os/dtrace/ConsumerListener.java
index 7d0ffed97a..ab8d93cbc1 100644
--- a/usr/src/lib/libdtrace_jni/java/src/org/opensolaris/os/dtrace/ConsumerListener.java
+++ b/usr/src/lib/libdtrace_jni/java/src/org/opensolaris/os/dtrace/ConsumerListener.java
@@ -22,8 +22,6 @@
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
- *
- * ident "%Z%%M% %I% %E% SMI"
*/
package org.opensolaris.os.dtrace;
@@ -94,9 +92,9 @@ public interface ConsumerListener extends EventListener {
* request (by calling {@link Consumer#stop()} or {@link
* Consumer#abort()}), terminated normally as a result of the DTrace
* {@code exit()} action (see <a
- * href=http://docs.sun.com/app/docs/doc/817-6223/6mlkidlhm?a=view>
- * <tt>exit()</tt></a> in the <b>Special Actions</b> section of the
- * <b>Actions and Subroutines</b> chapter of the <i>Solaris Dynamic
+ * href=http://dtrace.org/guide/chp-actsub.html#chp-actsub-5>
+ * <b>{@code exit()}</b></a> in the <b>Special Actions</b> section of the
+ * <b>Actions and Subroutines</b> chapter of the <i>Dynamic
* Tracing Guide</i>) or after the completion of all target
* processes, or terminated abnormally because of an exception. It
* is necessary to call {@link Consumer#close()} to release any
diff --git a/usr/src/lib/libdtrace_jni/java/src/org/opensolaris/os/dtrace/Flow.java b/usr/src/lib/libdtrace_jni/java/src/org/opensolaris/os/dtrace/Flow.java
index 7a0fbfb906..7db42fa86f 100644
--- a/usr/src/lib/libdtrace_jni/java/src/org/opensolaris/os/dtrace/Flow.java
+++ b/usr/src/lib/libdtrace_jni/java/src/org/opensolaris/os/dtrace/Flow.java
@@ -22,8 +22,6 @@
/*
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
- *
- * ident "%Z%%M% %I% %E% SMI"
*/
package org.opensolaris.os.dtrace;
@@ -42,9 +40,9 @@ import java.beans.*;
* ...
* </code></pre>
* See the <a
- * href="http://docs.sun.com/app/docs/doc/817-6223/6mlkidlk1?a=view">
+ * href="http://dtrace.org/guide/chp-fbt.html#chp-fbt-10">
* <b>Examples</b></a> section of the <b>{@code fbt}
- * Provider</b> chapter of the <i>Solaris Dynamic Tracing Guide</i>.
+ * Provider</b> chapter of the <i>Dynamic Tracing Guide</i>.
* <p>
* Immutable. Supports persistence using {@link java.beans.XMLEncoder}.
*
diff --git a/usr/src/lib/libdtrace_jni/java/src/org/opensolaris/os/dtrace/InterfaceAttributes.java b/usr/src/lib/libdtrace_jni/java/src/org/opensolaris/os/dtrace/InterfaceAttributes.java
index 226458745f..80f14e5ba6 100644
--- a/usr/src/lib/libdtrace_jni/java/src/org/opensolaris/os/dtrace/InterfaceAttributes.java
+++ b/usr/src/lib/libdtrace_jni/java/src/org/opensolaris/os/dtrace/InterfaceAttributes.java
@@ -22,8 +22,6 @@
/*
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
- *
- * ident "%Z%%M% %I% %E% SMI"
*/
package org.opensolaris.os.dtrace;
@@ -38,8 +36,8 @@ import java.beans.*;
* of future releases. The D compiler includes features to dynamically
* compute the stability levels of D programs you create. For more
* information, refer to the <a
- * href=http://docs.sun.com/app/docs/doc/817-6223/6mlkidlnp?a=view>
- * <b>Stability</b></a> chapter of the <i>Solaris Dynamic Tracing
+ * href=http://dtrace.org/guide/chp-stab.html>
+ * <b>Stability</b></a> chapter of the <i>Dynamic Tracing
* Guide</i>.
* <p>
* Immutable. Supports persistence using {@link java.beans.XMLEncoder}.
@@ -149,7 +147,7 @@ public final class InterfaceAttributes implements Serializable {
/**
* The interface might eventually become Standard or Stable but
* is still in transition. Sun will make reasonable efforts to
- * ensure compatibility with previous releases as it eveolves.
+ * ensure compatibility with previous releases as it evolves.
* When non-upward compatible changes become necessary, they
* will occur in minor and major releases. These changes will
* be avoided in micro releases whenever possible. If such a
@@ -209,7 +207,7 @@ public final class InterfaceAttributes implements Serializable {
/**
* Architectural dependency class. Tells whether an interface is
- * common to all Solaris platforms and processors, or whether the
+ * common to all platforms and processors, or whether the
* interface is associated with a particular architecture such as
* SPARC processors only.
*/
@@ -271,17 +269,17 @@ public final class InterfaceAttributes implements Serializable {
* instruction sets supported by the system using the {@code
* isainfo(1)} utility. The interface might not be supported on
* systems that do not export any of of the same instruction
- * sets. For example, an ISA-dependent interface on a Solaris
- * SPARC system might not be supported on a Solaris x86 system.
+ * sets. For example, an ISA-dependent interface on a
+ * SPARC system might not be supported on an x86 system.
*/
ISA("ISA"),
/**
- * The interface is common to all Solaris systems regardless of the
+ * The interface is common to all systems regardless of the
* underlying hardware. DTrace programs and layered applications that
* depend only on Common interfaces can be executed and deployed on
- * other Solaris systems with the same Solaris and DTrace revisions.
+ * other systems with the same illumos and DTrace revisions.
* The majority of DTrace interfaces are Common, so you can use them
- * wherever you use Solaris.
+ * wherever you use illumos.
*/
COMMON("Common");
@@ -379,7 +377,7 @@ public final class InterfaceAttributes implements Serializable {
}
/**
- * Gets the stabiltiy level of an interface associated with its name
+ * Gets the stability level of an interface associated with its name
* as it appears in a D program. For example, the {@code execname}
* D variable is a {@link Stability#STABLE STABLE} name: Sun
* guarantees this identifier will continue to be supported in D
@@ -407,7 +405,7 @@ public final class InterfaceAttributes implements Serializable {
* Gets the stability level of the data format used by an interface
* and any associated data semantics. For example, the {@code pid}
* D variable is a {@link Stability#STABLE STABLE} interface:
- * process IDs are a stable concept in Solaris, and Sun guarantees
+ * process IDs are a stable concept in illumos, and it is guaranteed
* that the {@code pid} variable will be of type {@code pid_t} with
* the semantic that it is set to the process ID corresponding to
* the thread that fired a given probe in accordance with the rules
@@ -510,9 +508,9 @@ public final class InterfaceAttributes implements Serializable {
/**
* Gets the string representation of this triplet of interface
* attributes. The format follows the convention described in the
- * <a href=http://docs.sun.com/app/docs/doc/817-6223/6mlkidlnt?a=view>
+ * <a href=http://dtrace.org/guide/chp-stab.html#chp-stab-3>
* <b>Interface Attributes</b></a> section of the <b>Stability</b>
- * chapter of the <i>Solaris Dynamic Tracing Guide</i>. The
+ * chapter of the <i>Dynamic Tracing Guide</i>. The
* attributes appear in the following order, separated by slashes:
* <pre><code>
* <i>name-stability / data-stability / dependency-class</i>
diff --git a/usr/src/lib/libdtrace_jni/java/src/org/opensolaris/os/dtrace/LocalConsumer.java b/usr/src/lib/libdtrace_jni/java/src/org/opensolaris/os/dtrace/LocalConsumer.java
index 65dc65e38d..d1506e3408 100644
--- a/usr/src/lib/libdtrace_jni/java/src/org/opensolaris/os/dtrace/LocalConsumer.java
+++ b/usr/src/lib/libdtrace_jni/java/src/org/opensolaris/os/dtrace/LocalConsumer.java
@@ -680,7 +680,7 @@ public class LocalConsumer implements Consumer {
* }
* </code></pre>
* Or if you need to create your own thread:
- * <pre></code>
+ * <pre><code>
* protected Thread
* createThread()
* {
@@ -711,7 +711,7 @@ public class LocalConsumer implements Consumer {
}
/**
- * @inheritDoc
+ * {@inheritDoc}
* @throws IllegalThreadStateException if a subclass calls {@link
* Thread#start()} on the value of {@link #createThread()}
* @see #createThread()
@@ -723,7 +723,7 @@ public class LocalConsumer implements Consumer {
}
/**
- * @inheritDoc
+ * {@inheritDoc}
* @throws IllegalThreadStateException if a subclass calls {@link
* Thread#start()} on the value of {@link #createThread()}
* @see #createThread()
@@ -765,7 +765,7 @@ public class LocalConsumer implements Consumer {
}
/**
- * @inheritDoc
+ * {@inheritDoc}
*
* @throws IllegalThreadStateException if attempting to {@code
* stop()} a running consumer while holding the lock on that
@@ -876,7 +876,7 @@ public class LocalConsumer implements Consumer {
}
/**
- * @inheritDoc
+ * {@inheritDoc}
*
* @throws IllegalThreadStateException if attempting to {@code
* close()} a running consumer while holding the lock on that
diff --git a/usr/src/lib/libdtrace_jni/java/src/org/opensolaris/os/dtrace/Option.java b/usr/src/lib/libdtrace_jni/java/src/org/opensolaris/os/dtrace/Option.java
index a401068400..67f896cff9 100644
--- a/usr/src/lib/libdtrace_jni/java/src/org/opensolaris/os/dtrace/Option.java
+++ b/usr/src/lib/libdtrace_jni/java/src/org/opensolaris/os/dtrace/Option.java
@@ -22,8 +22,6 @@
/*
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
- *
- * ident "%Z%%M% %I% %E% SMI"
*/
package org.opensolaris.os.dtrace;
@@ -44,8 +42,8 @@ import java.beans.*;
* is running.
* <p>
* See the <a
- * href=http://docs.sun.com/app/docs/doc/817-6223/6mlkidlis?a=view>
- * <b>Options and Tunables</b></a> chapter of the <i>Solaris Dynamic
+ * href=http://dtrace.org/guide/chp-opt.html>
+ * <b>Options and Tunables</b></a> chapter of the <i>Dynamic
* Tracing Guide</i>.
* <p>
* Immutable. Supports persistence using {@link java.beans.XMLEncoder}.
@@ -304,17 +302,17 @@ public final class Option implements Serializable {
public static final String VALUE_UNSET = "unset";
/**
- * {@link #bufpolicy} value: use {@code ring} princical buffer
+ * {@link #bufpolicy} value: use {@code ring} principal buffer
* policy.
*/
public static final String VALUE_RING = "ring";
/**
- * {@link #bufpolicy} value: use {@code fill} princical buffer
+ * {@link #bufpolicy} value: use {@code fill} principal buffer
* policy.
*/
public static final String VALUE_FILL = "fill";
/**
- * {@link #bufpolicy} default value: use {@code switch} princical
+ * {@link #bufpolicy} default value: use {@code switch} principal
* buffer policy.
*/
public static final String VALUE_SWITCH = "switch";
@@ -369,7 +367,7 @@ public final class Option implements Serializable {
*/
public static final String defaultargs = "defaultargs";
/**
- * Define symbol when invoking preprocssor (compile-time).
+ * Define symbol when invoking preprocessor (compile-time).
*/
public static final String define = "define";
/**
@@ -484,9 +482,9 @@ public final class Option implements Serializable {
* #VALUE_FILL fill}, or {@link #VALUE_RING ring}). Runtime option.
* <p>
* See the <a
- * href=http://docs.sun.com/app/docs/doc/817-6223/6mlkidlhr?a=view>
+ * href=http://dtrace.org/guide/chp-buf.html#chp-buf-2>
* <b>Principal Buffer Policies</b></a> section of the
- * <b>Buffers and Buffering</b> chapter of the <i>Solaris Dynamic
+ * <b>Buffers and Buffering</b> chapter of the <i>Dynamic
* Tracing Guide</i>.
*/
public static final String bufpolicy = "bufpolicy";
@@ -495,9 +493,9 @@ public final class Option implements Serializable {
* #VALUE_MANUAL manual}). Runtime option.
* <p>
* See the <a
- * href=http://docs.sun.com/app/docs/doc/817-6223/6mlkidlhu?a=view>
+ * href=http://dtrace.org/guide/chp-buf.html#chp-buf-5>
* <b>Buffer Resizing Policy</b></a> section of the <b>Buffers
- * and Buffering</b> chapter of the <i>Solaris Dynamic Tracing
+ * and Buffering</b> chapter of the <i>Dynamic Tracing
* Guide</i>.
*/
public static final String bufresize = "bufresize";
diff --git a/usr/src/lib/libdtrace_jni/java/src/org/opensolaris/os/dtrace/PrintaRecord.java b/usr/src/lib/libdtrace_jni/java/src/org/opensolaris/os/dtrace/PrintaRecord.java
index 616a955223..fd5fa7bc38 100644
--- a/usr/src/lib/libdtrace_jni/java/src/org/opensolaris/os/dtrace/PrintaRecord.java
+++ b/usr/src/lib/libdtrace_jni/java/src/org/opensolaris/os/dtrace/PrintaRecord.java
@@ -22,8 +22,6 @@
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
- *
- * ident "%Z%%M% %I% %E% SMI"
*/
package org.opensolaris.os.dtrace;
@@ -67,9 +65,9 @@ import java.util.*;
* no aggregation data. However, the formatted output generated by the
* DTrace library is available in all cases. For details about
* {@code printa()} format strings, see the <a
- * href=http://docs.sun.com/app/docs/doc/817-6223/6mlkidli3?a=view>
+ * href=http://dtrace.org/guide/chp-fmt.html#chp-fmt-printa>
* <b>{@code printa()}</b></a> section of the <b>Output
- * Formatting</b> chapter of the <i>Solaris Dynamic Tracing Guide</i>.
+ * Formatting</b> chapter of the <i>Dynamic Tracing Guide</i>.
* <p>
* Immutable. Supports persistence using {@link java.beans.XMLEncoder}.
*
@@ -523,7 +521,7 @@ public final class PrintaRecord implements Record, Serializable,
copy.addAll(tuples);
tuples = copy;
}
- // check constructor invariants only after defensize copy
+ // check constructor invariants only after defensive copy
try {
validate();
} catch (Exception e) {
diff --git a/usr/src/lib/libdtrace_jni/java/src/org/opensolaris/os/dtrace/PrintfRecord.java b/usr/src/lib/libdtrace_jni/java/src/org/opensolaris/os/dtrace/PrintfRecord.java
index e2aee1bce7..26cb8608e5 100644
--- a/usr/src/lib/libdtrace_jni/java/src/org/opensolaris/os/dtrace/PrintfRecord.java
+++ b/usr/src/lib/libdtrace_jni/java/src/org/opensolaris/os/dtrace/PrintfRecord.java
@@ -22,8 +22,6 @@
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
- *
- * ident "%Z%%M% %I% %E% SMI"
*/
package org.opensolaris.os.dtrace;
@@ -156,7 +154,7 @@ public final class PrintfRecord implements Record, Serializable,
}
/**
- * Gets the unfomatted elements passed to the DTrace {@code
+ * Gets the unformatted elements passed to the DTrace {@code
* printf()} action after the format string.
*
* @return non-null, unmodifiable list of unformatted elements
@@ -198,7 +196,7 @@ public final class PrintfRecord implements Record, Serializable,
* printf()} element at the given index (using the same order that
* they appear in the {@code printf()} argument list)
* @throws ArrayIndexOutOfBoundsException if the given index is
- * out of range (index < 0 || index >= getRecordCount())
+ * out of range (index &lt; 0 || index &gt;= getRecordCount())
*/
public ValueRecord
getRecord(int i)
diff --git a/usr/src/lib/libdtrace_jni/java/src/org/opensolaris/os/dtrace/ProbeData.java b/usr/src/lib/libdtrace_jni/java/src/org/opensolaris/os/dtrace/ProbeData.java
index a579ade0e1..e033fac799 100644
--- a/usr/src/lib/libdtrace_jni/java/src/org/opensolaris/os/dtrace/ProbeData.java
+++ b/usr/src/lib/libdtrace_jni/java/src/org/opensolaris/os/dtrace/ProbeData.java
@@ -22,8 +22,6 @@
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
- *
- * ident "%Z%%M% %I% %E% SMI"
*/
package org.opensolaris.os.dtrace;
@@ -61,9 +59,9 @@ import java.beans.*;
* Currently the {@code ProbeData} instance does not record a timestamp.
* If you need a timestamp, trace the built-in {@code timestamp}
* variable in your D program. (See the
- * <a href=http://docs.sun.com/app/docs/doc/817-6223/6mlkidlfv?a=view>
+ * <a href=http://dtrace.org/guide/chp-variables.html#chp-variables-5>
* <b>Built-in Variables</b></a> section of the <b>Variables</b> chapter of
- * the <i>Solaris Dynamic Tracing Guide</i>).
+ * the <i>Dynamic Tracing Guide</i>).
* <p>
* Immutable. Supports persistence using {@link java.beans.XMLEncoder}.
*
diff --git a/usr/src/lib/libdtrace_jni/java/src/org/opensolaris/os/dtrace/StackValueRecord.java b/usr/src/lib/libdtrace_jni/java/src/org/opensolaris/os/dtrace/StackValueRecord.java
index 682fe6b81c..7b1e89d8d4 100644
--- a/usr/src/lib/libdtrace_jni/java/src/org/opensolaris/os/dtrace/StackValueRecord.java
+++ b/usr/src/lib/libdtrace_jni/java/src/org/opensolaris/os/dtrace/StackValueRecord.java
@@ -22,8 +22,6 @@
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
- *
- * ident "%Z%%M% %I% %E% SMI"
*/
package org.opensolaris.os.dtrace;
@@ -46,9 +44,9 @@ public interface StackValueRecord extends ValueRecord {
* (The {@code stack()}, {@code ustack()}, and {@code jstack()}
* actions are all usable as members of an aggregation tuple.) See
* the <a
- * href=http://docs.sun.com/app/docs/doc/817-6223/6mlkidli3?a=view>
+ * href=http://dtrace.org/guide/chp-fmt.html#chp-fmt-printa>
* <b>{@code printa()}</b></a> section of the <b>Output
- * Formatting</b> chapter of the <i>Solaris Dynamic Tracing
+ * Formatting</b> chapter of the <i>Dynamic Tracing
* Guide</i> for details about {@code printa()} format strings.
* Human-readable stack frames are generated by default if {@code
* printa()} is called without specifying a format string, or when
diff --git a/usr/src/lib/libdtrace_jni/java/src/org/opensolaris/os/dtrace/package.html b/usr/src/lib/libdtrace_jni/java/src/org/opensolaris/os/dtrace/package.html
index 9ca357a440..7b8d77c17c 100644
--- a/usr/src/lib/libdtrace_jni/java/src/org/opensolaris/os/dtrace/package.html
+++ b/usr/src/lib/libdtrace_jni/java/src/org/opensolaris/os/dtrace/package.html
@@ -2,8 +2,6 @@
Copyright 2006 Sun Microsystems, Inc. All rights reserved.
Use is subject to license terms.
- ident "%Z%%M% %I% %E% SMI"
-
CDDL HEADER START
The contents of this file are subject to the terms of the
@@ -27,13 +25,13 @@
<html>
<head/>
<body bgcolor="white">
-
+
Interface to the native DTrace library.
-
+
<!-- commented out ...
<h2>Package Specification</h2>
-
+
##### FILL IN ANY SPECS NEEDED BY JAVA COMPATIBILITY KIT #####
<ul>
@@ -47,10 +45,8 @@ end commented-out block -->
For overviews, tutorials, examples, guides, and tool documentation, please see:
<br><br>
-<a href="http://docs.sun.com/app/docs/doc/817-6223">
- <i>Solaris Dynamic Tracing Guide</i></a><br>
-<a href="http://www.opensolaris.org/os/community/dtrace">
- OpenSolaris DTrace Website</a><br>
+<a href="http://dtrace.org/guide/">
+ <i>Dynamic Tracing Guide</i></a><br>
<a href="../../../../../html/JavaDTraceAPI.html" target="parent">
API Diagram</a><br>
<a href="../../../../../html/fast.html" target="parent">
diff --git a/usr/src/lib/libzfs/common/libzfs_pool.c b/usr/src/lib/libzfs/common/libzfs_pool.c
index a93e14d169..f539ef1f76 100644
--- a/usr/src/lib/libzfs/common/libzfs_pool.c
+++ b/usr/src/lib/libzfs/common/libzfs_pool.c
@@ -2798,10 +2798,9 @@ zpool_get_physpath(zpool_handle_t *zhp, char *physpath, size_t phypath_size)
* the disk to use the new unallocated space.
*/
static int
-zpool_relabel_disk(libzfs_handle_t *hdl, const char *name)
+zpool_relabel_disk(libzfs_handle_t *hdl, const char *name, const char *msg)
{
char path[MAXPATHLEN];
- char errbuf[1024];
int fd, error;
int (*_efi_use_whole_disk)(int);
@@ -2814,7 +2813,7 @@ zpool_relabel_disk(libzfs_handle_t *hdl, const char *name)
if ((fd = open(path, O_RDWR | O_NDELAY)) < 0) {
zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, "cannot "
"relabel '%s': unable to open device"), name);
- return (zfs_error(hdl, EZFS_OPENFAILED, errbuf));
+ return (zfs_error(hdl, EZFS_OPENFAILED, msg));
}
/*
@@ -2827,7 +2826,7 @@ zpool_relabel_disk(libzfs_handle_t *hdl, const char *name)
if (error && error != VT_ENOSPC) {
zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, "cannot "
"relabel '%s': unable to read disk capacity"), name);
- return (zfs_error(hdl, EZFS_NOCAP, errbuf));
+ return (zfs_error(hdl, EZFS_NOCAP, msg));
}
return (0);
}
@@ -2846,6 +2845,7 @@ zpool_vdev_online(zpool_handle_t *zhp, const char *path, int flags,
nvlist_t *tgt;
boolean_t avail_spare, l2cache, islog;
libzfs_handle_t *hdl = zhp->zpool_hdl;
+ int error;
if (flags & ZFS_ONLINE_EXPAND) {
(void) snprintf(msg, sizeof (msg),
@@ -2884,7 +2884,9 @@ zpool_vdev_online(zpool_handle_t *zhp, const char *path, int flags,
if (wholedisk) {
pathname += strlen(ZFS_DISK_ROOT) + 1;
- (void) zpool_relabel_disk(hdl, pathname);
+ error = zpool_relabel_disk(hdl, pathname, msg);
+ if (error != 0)
+ return (error);
}
}
diff --git a/usr/src/man/man1m/route.1m b/usr/src/man/man1m/route.1m
index 2f2bff558a..089e768157 100644
--- a/usr/src/man/man1m/route.1m
+++ b/usr/src/man/man1m/route.1m
@@ -1,5 +1,6 @@
'\" te
-.\" Copyright (C) 2009, Sun Microsystems, Inc. All Rights Reserved
+.\" Copyright (C) 2009, Sun Microsystems, Inc. All Rights Reserved.
+.\" Copyright (C) 2021 H. William Welliver
.\" 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]
@@ -7,7 +8,6 @@
.SH NAME
route \- manually manipulate the routing tables
.SH SYNOPSIS
-.LP
.nf
\fBroute\fR [\fB-fnvq\fR] [\fB-z\fR \fIzone\fR] \fIsub-command\fR [ [\fImodifiers\fR] \fIargs\fR]
.fi
@@ -40,7 +40,6 @@ route \- manually manipulate the routing tables
.fi
.SH DESCRIPTION
-.LP
\fBroute\fR manually manipulates the network routing tables. These tables are
normally maintained by the system routing daemon, such as \fBin.routed\fR(1M)
and \fBin.ripngd\fR(1M).
@@ -88,10 +87,12 @@ Make changes to the network route tables persistent across system restarts. The
operation is applied to the network routing tables first and, if successful, is
then applied to the list of saved routes used at system startup. In determining
whether an operation was successful, a failure to add a route that already
-exists or to delete a route that is not in the routing table is ignored.
-Particular care should be taken when using host or network names in persistent
-routes, as network-based name resolution services are not available at the time
-routes are added at startup.
+exists or to delete a route that is not in the routing table is ignored. At
+startup, any directly reachable routes (those specified with the
+\fB-interface\fR or \fB-iface\fR options) will be created first, followed by
+any remaining routes. Particular care should be taken when using host or network
+names in persistent routes, as network-based name resolution services are not
+available at the time routes are added at startup.
.RE
.sp
@@ -137,7 +138,6 @@ be a shared-\fBIP\fR zone.
.RE
.SS "Subcommands"
-.LP
The following subcommands are supported:
.sp
.ne 2
@@ -250,11 +250,9 @@ route monitor [ -inet | -inet6 ]
.sp
.SH OPERANDS
-.LP
\fBroute\fR executes its subcommands on routes to destinations by way of
gateways.
.SS "Destinations and Gateways"
-.LP
By default, destination and gateway addresses are interpreted as IPv4
addresses. All symbolic names are tried first as a host name, using
\fBgetipnodebyname\fR(3SOCKET). If this lookup fails in the AF_INET case,
@@ -451,7 +449,6 @@ multipathing) group, then requests to add a route will automatically be
translated to the corresponding IPMP IP interface, and requests to delete or
change a route on an underlying interface will fail.
.SS "Routing Flags"
-.LP
Routes have associated flags that influence operation of the protocols when
sending to destinations matched by the routes. These flags can be set (and in
some cases cleared, indicated by \fB~\fR) by including the following modifiers
@@ -605,7 +602,6 @@ sensitivity label.
.RE
.SS "Compatibility"
-.LP
The modifiers \fBhost\fR and \fBnet\fR are taken to be equivalent to
\fB-\fR\fBhost\fR and \fB-net\fR\fB\fR. To specify a symbolic address that
matches one of these names, use the \fBdst\fR or \fBgateway\fR keyword to
@@ -658,7 +654,6 @@ List of network names and addresses
.RE
.SH SEE ALSO
-.LP
\fBuname\fR(1), \fBin.ripngd\fR(1M), \fBin.routed\fR(1M), \fBnetstat\fR(1M),
\fBrouted\fR(1M), \fBioctl\fR(2), \fBgetipnodebyname\fR(3SOCKET),
\fBgetnetbyname\fR(3SOCKET), \fBinet_addr\fR(3C), \fBdefaultrouter\fR(4),
@@ -761,7 +756,6 @@ process does not have appropriate privileges.
.RE
.SH NOTES
-.LP
Specifying that destinations are local (with the \fB-interface\fR modifier)
assumes that the routers implement \fBproxy ARP\fR, meaning that they respond
to ARP queries for all reachable destinations. Normally, using either router
diff --git a/usr/src/pkg/manifests/diagnostic-cpu-counters.mf b/usr/src/pkg/manifests/diagnostic-cpu-counters.mf
index 0ac7a4fabf..5d221a91d3 100644
--- a/usr/src/pkg/manifests/diagnostic-cpu-counters.mf
+++ b/usr/src/pkg/manifests/diagnostic-cpu-counters.mf
@@ -125,6 +125,8 @@ legacy pkg=SUNWcpcu desc="CPU Performance Counter libraries and utilities" \
name="CPU Performance Counter libraries and utilities"
license cr_Sun license=cr_Sun
license lic_CDDL license=lic_CDDL
+$(i386_ONLY)license usr/src/data/perfmon/THIRDPARTYLICENSE \
+ license=usr/src/data/perfmon/THIRDPARTYLICENSE
$(i386_ONLY)license usr/src/uts/intel/pcbe/THIRDPARTYLICENSE \
license=usr/src/uts/intel/pcbe/THIRDPARTYLICENSE
$(sparc_ONLY)license usr/src/uts/sun4u/pcbe/THIRDPARTYLICENSE \
diff --git a/usr/src/pkg/manifests/system-boot-loader.mf b/usr/src/pkg/manifests/system-boot-loader.mf
index 2073af2013..1a2e826e2f 100644
--- a/usr/src/pkg/manifests/system-boot-loader.mf
+++ b/usr/src/pkg/manifests/system-boot-loader.mf
@@ -97,8 +97,10 @@ $(i386_ONLY)file path=usr/share/man/man5/menusets.4th.5
$(i386_ONLY)file path=usr/share/man/man5/pxeboot.5
$(i386_ONLY)file path=usr/share/man/man5/version.4th.5
license lic_CDDL license=lic_CDDL
-license usr/src/boot/COPYRIGHT license=usr/src/boot/COPYRIGHT
-license usr/src/boot/sys/boot/common/linenoise/LICENSE \
+$(i386_ONLY)license usr/src/boot/COPYRIGHT license=usr/src/boot/COPYRIGHT
+$(i386_ONLY)license usr/src/boot/sys/boot/common/linenoise/LICENSE \
license=usr/src/boot/sys/boot/common/linenoise/LICENSE
-license usr/src/common/pnglite/THIRDPARTYLICENSE \
+$(i386_ONLY)license usr/src/common/crypto/skein/THIRDPARTYLICENSE \
+ license=usr/src/common/crypto/skein/THIRDPARTYLICENSE
+$(i386_ONLY)license usr/src/common/pnglite/THIRDPARTYLICENSE \
license=usr/src/common/pnglite/THIRDPARTYLICENSE
diff --git a/usr/src/pkg/manifests/system-kernel.mf b/usr/src/pkg/manifests/system-kernel.mf
index 2af9b34303..7bcd72cb0d 100644
--- a/usr/src/pkg/manifests/system-kernel.mf
+++ b/usr/src/pkg/manifests/system-kernel.mf
@@ -679,8 +679,12 @@ license usr/src/common/crypto/ecc/THIRDPARTYLICENSE \
license=usr/src/common/crypto/ecc/THIRDPARTYLICENSE
$(i386_ONLY)license usr/src/common/crypto/md5/amd64/THIRDPARTYLICENSE \
license=usr/src/common/crypto/md5/amd64/THIRDPARTYLICENSE
+license usr/src/common/crypto/skein/THIRDPARTYLICENSE \
+ license=usr/src/common/crypto/skein/THIRDPARTYLICENSE
license usr/src/common/mpi/THIRDPARTYLICENSE \
license=usr/src/common/mpi/THIRDPARTYLICENSE
+license usr/src/uts/common/inet/cc/THIRDPARTYLICENSE \
+ license=usr/src/uts/common/inet/cc/THIRDPARTYLICENSE
license usr/src/uts/common/inet/ip/THIRDPARTYLICENSE.rts \
license=usr/src/uts/common/inet/ip/THIRDPARTYLICENSE.rts
license usr/src/uts/common/inet/tcp/THIRDPARTYLICENSE \
diff --git a/usr/src/pkg/manifests/system-library-platform.mf b/usr/src/pkg/manifests/system-library-platform.mf
index 92577df8a0..a5aad65836 100644
--- a/usr/src/pkg/manifests/system-library-platform.mf
+++ b/usr/src/pkg/manifests/system-library-platform.mf
@@ -192,6 +192,8 @@ $(sparc_ONLY)legacy pkg=SUNWkvmt200.v arch=$(ARCH).sun4v \
name="Core Architecture, sun4v-based platforms (Kvm)"
license cr_Sun license=cr_Sun
license lic_CDDL license=lic_CDDL
+$(sparc_ONLY)license usr/src/stand/lib/tcp/THIRDPARTYLICENSE \
+ license=usr/src/stand/lib/tcp/THIRDPARTYLICENSE
$(sparc_ONLY)link path=usr/platform/SUNW,A70/lib/cfgadm \
target=../../sun4u/lib/cfgadm
$(sparc_ONLY)link path=usr/platform/SUNW,A70/lib/fs target=../../sun4u/lib/fs
diff --git a/usr/src/pkg/manifests/system-library.mf b/usr/src/pkg/manifests/system-library.mf
index 5d84de5864..a1f7d93b35 100644
--- a/usr/src/pkg/manifests/system-library.mf
+++ b/usr/src/pkg/manifests/system-library.mf
@@ -574,6 +574,8 @@ license usr/src/common/crypto/sha1/amd64/THIRDPARTYLICENSE.sha1-ni \
license=usr/src/common/crypto/sha1/amd64/THIRDPARTYLICENSE.sha1-ni
license usr/src/common/crypto/sha2/amd64/THIRDPARTYLICENSE.sha256-ni \
license=usr/src/common/crypto/sha2/amd64/THIRDPARTYLICENSE.sha256-ni
+license usr/src/common/crypto/skein/THIRDPARTYLICENSE \
+ license=usr/src/common/crypto/skein/THIRDPARTYLICENSE
license usr/src/common/mpi/THIRDPARTYLICENSE \
license=usr/src/common/mpi/THIRDPARTYLICENSE
license usr/src/common/util/THIRDPARTYLICENSE.multi3 \
diff --git a/usr/src/tools/findunref/exception_list.open b/usr/src/tools/findunref/exception_list.open
index 22394e667d..e68626cf22 100644
--- a/usr/src/tools/findunref/exception_list.open
+++ b/usr/src/tools/findunref/exception_list.open
@@ -19,14 +19,13 @@
# CDDL HEADER END
#
-# Copyright 2014 Gary Mills
#
# Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright 2014 Gary Mills
# Copyright 2014 Garrett D'Amore <garrett@damore.org>
# Copyright 2020 Joyent, Inc.
# Copyright 2021 OmniOS Community Edition (OmniOSce) Association.
#
-#
# open-tree exception list
#
# See README.exception_lists for details
@@ -179,6 +178,29 @@
./usr/src/uts/common/xen/public/COPYING
#
+# These are in the source tree for reference, but another identical copy is
+# used by packaging.
+#
+./usr/src/cmd/bhyve/THIRDPARTYLICENSE
+./usr/src/cmd/bhyve/THIRDPARTYLICENSE.descrip
+./usr/src/cmd/bhyvectl/THIRDPARTYLICENSE
+./usr/src/cmd/bhyvectl/THIRDPARTYLICENSE.descrip
+./usr/src/contrib/bhyve/THIRDPARTYLICENSE
+./usr/src/contrib/bhyve/THIRDPARTYLICENSE.descrip
+./usr/src/uts/common/fs/smbclnt/netsmb/THIRDPARTYLICENSE.apple
+./usr/src/uts/common/fs/smbclnt/netsmb/THIRDPARTYLICENSE.apple.descrip
+./usr/src/uts/common/fs/smbclnt/netsmb/THIRDPARTYLICENSE.boris_popov
+./usr/src/uts/common/fs/smbclnt/netsmb/THIRDPARTYLICENSE.boris_popov.descrip
+./usr/src/uts/common/io/e1000api/THIRDPARTYLICENSE
+./usr/src/uts/common/io/e1000api/THIRDPARTYLICENSE.descrip
+./usr/src/uts/i86pc/io/viona/THIRDPARTYLICENSE
+./usr/src/uts/i86pc/io/viona/THIRDPARTYLICENSE.descrip
+
+# This is covered by license_in_headers in nfs4_prot.x
+./usr/src/head/rpcsvc/THIRDPARTYLICENSE.nfs4_prot
+./usr/src/head/rpcsvc/THIRDPARTYLICENSE.nfs4_prot.descrip
+
+#
# ld tests which are not currently delivered
#
./usr/src/cmd/sgs/test
diff --git a/usr/src/uts/common/io/lofi.c b/usr/src/uts/common/io/lofi.c
index b611b42034..ed3ee88e53 100644
--- a/usr/src/uts/common/io/lofi.c
+++ b/usr/src/uts/common/io/lofi.c
@@ -23,9 +23,9 @@
*
* Copyright 2013 Nexenta Systems, Inc. All rights reserved.
* Copyright (c) 2016 Andrey Sokolov
- * Copyright 2016 Toomas Soome <tsoome@me.com>
* Copyright 2019 Joyent, Inc.
* Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
+ * Copyright 2021 Toomas Soome <tsoome@me.com>
*/
/*
@@ -524,6 +524,23 @@ lofi_tg_getinfo(dev_info_t *dip, int cmd, void *arg, void *tg_cookie)
}
static void
+lofi_teardown_task(void *arg)
+{
+ struct lofi_state *lsp = arg;
+ int id = LOFI_MINOR2ID(getminor(lsp->ls_dev));
+
+ mutex_enter(&lofi_lock);
+ while (ndi_devi_offline(lsp->ls_dip, NDI_DEVI_REMOVE) != NDI_SUCCESS) {
+ mutex_exit(&lofi_lock);
+ /* do a sleeping wait for one second */;
+ delay(drv_usectohz(MICROSEC));
+ mutex_enter(&lofi_lock);
+ }
+ id_free(lofi_id, id);
+ mutex_exit(&lofi_lock);
+}
+
+static void
lofi_destroy(struct lofi_state *lsp, cred_t *credp)
{
int id = LOFI_MINOR2ID(getminor(lsp->ls_dev));
@@ -595,8 +612,23 @@ lofi_destroy(struct lofi_state *lsp, cred_t *credp)
lsp->ls_vp_closereq = B_FALSE;
ASSERT(ddi_get_soft_state(lofi_statep, id) == lsp);
- (void) ndi_devi_offline(lsp->ls_dip, NDI_DEVI_REMOVE);
- id_free(lofi_id, id);
+ /*
+ * Instance state is allocated in lofi_attach() and freed in
+ * lofi_detach(). New instance is created when we create new mapping.
+ * Instance removal is performed by unmap ioctl on lofi control
+ * instance (0).
+ *
+ * If the unmap is performed with instance which is still in use,
+ * we either cancel unmap with error or we can perform delayed unmap
+ * by blocking all IO, waiting the consumers to close access to this
+ * instance and once there are no more consumers, complete the unmap.
+ *
+ * Delayed unmap will trigger instance removal on last lofi_close(),
+ * but we can not remove device instance while the instance is still
+ * in use due to lofi_close() is running.
+ * Spawn task to complete device instance offlining in separate thread.
+ */
+ (void) taskq_dispatch(system_taskq, lofi_teardown_task, lsp, KM_SLEEP);
}
static void
diff --git a/usr/src/uts/i86pc/io/vmm/amd/amdvi_hw.c b/usr/src/uts/i86pc/io/vmm/amd/amdvi_hw.c
index 869b692100..c7b43b85ef 100644
--- a/usr/src/uts/i86pc/io/vmm/amd/amdvi_hw.c
+++ b/usr/src/uts/i86pc/io/vmm/amd/amdvi_hw.c
@@ -40,9 +40,6 @@ __FBSDID("$FreeBSD$");
#include <sys/smp.h>
#include <sys/sysctl.h>
-#include <vm/vm.h>
-#include <vm/pmap.h>
-
#include <dev/pci/pcivar.h>
#include <dev/pci/pcireg.h>
diff --git a/usr/src/uts/i86pc/io/vmm/amd/ivrs_drv.c b/usr/src/uts/i86pc/io/vmm/amd/ivrs_drv.c
index 3eb9fda2e3..4c26b61f5c 100644
--- a/usr/src/uts/i86pc/io/vmm/amd/ivrs_drv.c
+++ b/usr/src/uts/i86pc/io/vmm/amd/ivrs_drv.c
@@ -39,9 +39,6 @@ __FBSDID("$FreeBSD$");
#include <machine/vmparam.h>
-#include <vm/vm.h>
-#include <vm/pmap.h>
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <dev/acpica/acpivar.h>
diff --git a/usr/src/uts/i86pc/io/vmm/amd/npt.c b/usr/src/uts/i86pc/io/vmm/amd/npt.c
index d532b7b6ec..6fc6825242 100644
--- a/usr/src/uts/i86pc/io/vmm/amd/npt.c
+++ b/usr/src/uts/i86pc/io/vmm/amd/npt.c
@@ -34,9 +34,7 @@ __FBSDID("$FreeBSD$");
#include <sys/systm.h>
#include <sys/sysctl.h>
-#include <vm/vm.h>
-#include <vm/pmap.h>
-#include <vm/vm_extern.h>
+#include <sys/vmm_vm.h>
#include "npt.h"
diff --git a/usr/src/uts/i86pc/io/vmm/amd/svm.c b/usr/src/uts/i86pc/io/vmm/amd/svm.c
index 7071a5ad7f..5b1ad7dba3 100644
--- a/usr/src/uts/i86pc/io/vmm/amd/svm.c
+++ b/usr/src/uts/i86pc/io/vmm/amd/svm.c
@@ -55,9 +55,6 @@ __FBSDID("$FreeBSD$");
#include <sys/x86_archext.h>
#include <sys/trap.h>
-#include <vm/vm.h>
-#include <vm/pmap.h>
-
#include <machine/cpufunc.h>
#include <machine/psl.h>
#include <machine/md_var.h>
@@ -67,6 +64,7 @@ __FBSDID("$FreeBSD$");
#include <machine/vmm.h>
#include <machine/vmm_dev.h>
#include <sys/vmm_instruction_emul.h>
+#include <sys/vmm_vm.h>
#include "vmm_lapic.h"
#include "vmm_stat.h"
@@ -667,11 +665,11 @@ npf_fault_type(uint64_t exitinfo1)
{
if (exitinfo1 & VMCB_NPF_INFO1_W)
- return (VM_PROT_WRITE);
+ return (PROT_WRITE);
else if (exitinfo1 & VMCB_NPF_INFO1_ID)
- return (VM_PROT_EXECUTE);
+ return (PROT_EXEC);
else
- return (VM_PROT_READ);
+ return (PROT_READ);
}
static bool
diff --git a/usr/src/uts/i86pc/io/vmm/intel/ept.c b/usr/src/uts/i86pc/io/vmm/intel/ept.c
index 35e29bcfcc..49b01ebd36 100644
--- a/usr/src/uts/i86pc/io/vmm/intel/ept.c
+++ b/usr/src/uts/i86pc/io/vmm/intel/ept.c
@@ -51,11 +51,9 @@ __FBSDID("$FreeBSD$");
#include <sys/sysctl.h>
#include <sys/hma.h>
-#include <vm/vm.h>
-#include <vm/pmap.h>
-#include <vm/vm_extern.h>
-
+#include <machine/specialreg.h>
#include <machine/vmm.h>
+#include <sys/vmm_vm.h>
#include "ept.h"
diff --git a/usr/src/uts/i86pc/io/vmm/intel/offsets.in b/usr/src/uts/i86pc/io/vmm/intel/offsets.in
index ca7f967f3b..d456693573 100644
--- a/usr/src/uts/i86pc/io/vmm/intel/offsets.in
+++ b/usr/src/uts/i86pc/io/vmm/intel/offsets.in
@@ -21,9 +21,9 @@
#include <machine/pmap.h>
#include <machine/vmm.h>
+#include <sys/vmm_vm.h>
#include "intel/vmx.h"
-#include "vm/vm_glue.h"
vmxctx
guest_rdi VMXCTX_GUEST_RDI
diff --git a/usr/src/uts/i86pc/io/vmm/intel/vmcs.c b/usr/src/uts/i86pc/io/vmm/intel/vmcs.c
index 36318b1b49..7fabba79f7 100644
--- a/usr/src/uts/i86pc/io/vmm/intel/vmcs.c
+++ b/usr/src/uts/i86pc/io/vmm/intel/vmcs.c
@@ -48,8 +48,7 @@ __FBSDID("$FreeBSD$");
#include <sys/param.h>
#include <sys/systm.h>
-#include <vm/vm.h>
-
+#include <machine/specialreg.h>
#include <machine/vmm.h>
#include "vmx.h"
diff --git a/usr/src/uts/i86pc/io/vmm/intel/vmx.c b/usr/src/uts/i86pc/io/vmm/intel/vmx.c
index 4f4c32ac69..c716c02a34 100644
--- a/usr/src/uts/i86pc/io/vmm/intel/vmx.c
+++ b/usr/src/uts/i86pc/io/vmm/intel/vmx.c
@@ -61,9 +61,6 @@ __FBSDID("$FreeBSD$");
#include <sys/hma.h>
#include <sys/trap.h>
-#include <vm/vm.h>
-#include <vm/pmap.h>
-
#include <machine/psl.h>
#include <machine/cpufunc.h>
#include <machine/md_var.h>
@@ -72,6 +69,7 @@ __FBSDID("$FreeBSD$");
#include <machine/smp.h>
#include <machine/specialreg.h>
#include <machine/vmparam.h>
+#include <sys/vmm_vm.h>
#include <machine/vmm.h>
#include <machine/vmm_dev.h>
@@ -1806,11 +1804,11 @@ ept_fault_type(uint64_t ept_qual)
int fault_type;
if (ept_qual & EPT_VIOLATION_DATA_WRITE)
- fault_type = VM_PROT_WRITE;
+ fault_type = PROT_WRITE;
else if (ept_qual & EPT_VIOLATION_INST_FETCH)
- fault_type = VM_PROT_EXECUTE;
+ fault_type = PROT_EXEC;
else
- fault_type = VM_PROT_READ;
+ fault_type = PROT_READ;
return (fault_type);
}
diff --git a/usr/src/uts/i86pc/io/vmm/intel/vtd.c b/usr/src/uts/i86pc/io/vmm/intel/vtd.c
index e75764acf3..8784c94b48 100644
--- a/usr/src/uts/i86pc/io/vmm/intel/vtd.c
+++ b/usr/src/uts/i86pc/io/vmm/intel/vtd.c
@@ -36,12 +36,11 @@ __FBSDID("$FreeBSD$");
#include <sys/systm.h>
#include <sys/malloc.h>
-#include <vm/vm.h>
-#include <vm/pmap.h>
-
#include <dev/pci/pcireg.h>
#include <machine/vmparam.h>
+#include <sys/vmm_vm.h>
+
#include <contrib/dev/acpica/include/acpi.h>
#include <sys/sunndi.h>
diff --git a/usr/src/uts/i86pc/io/vmm/sys/vmm_impl.h b/usr/src/uts/i86pc/io/vmm/sys/vmm_impl.h
index 7240679efe..606be4bbae 100644
--- a/usr/src/uts/i86pc/io/vmm/sys/vmm_impl.h
+++ b/usr/src/uts/i86pc/io/vmm/sys/vmm_impl.h
@@ -35,7 +35,6 @@
* available by mmap(2)ing the vmm handle at a specific offset. These offsets
* begin just above the maximum allow guest physical address.
*/
-#include <vm/vm_param.h>
#define VM_DEVMEM_START (VM_MAXUSER_ADDRESS + 1)
struct vmm_devmem_entry {
diff --git a/usr/src/uts/i86pc/io/vmm/sys/vmm_vm.h b/usr/src/uts/i86pc/io/vmm/sys/vmm_vm.h
new file mode 100644
index 0000000000..e9ffbadcb2
--- /dev/null
+++ b/usr/src/uts/i86pc/io/vmm/sys/vmm_vm.h
@@ -0,0 +1,207 @@
+/*
+ * This file and its contents are supplied under the terms of the
+ * Common Development and Distribution License ("CDDL"), version 1.0.
+ * You may only use this file in accordance with the terms of version
+ * 1.0 of the CDDL.
+ *
+ * A full copy of the text of the CDDL should have accompanied this
+ * source. A copy of the CDDL is also available via the Internet at
+ * http://www.illumos.org/license/CDDL.
+ */
+/* This file is dual-licensed; see usr/src/contrib/bhyve/LICENSE */
+
+/*
+ * Copyright 2019 Joyent, Inc.
+ * Copyright 2021 Oxide Computer Company
+ */
+
+#ifndef _VMM_VM_H
+#define _VMM_VM_H
+
+#include <sys/list.h>
+#include <sys/types.h>
+#include <vm/hat_pte.h>
+#include <machine/pmap.h>
+
+/*
+ * vm_map_wire and vm_map_unwire option flags
+ */
+#define VM_MAP_WIRE_SYSTEM 0 /* wiring in a kernel map */
+#define VM_MAP_WIRE_USER 1 /* wiring in a user map */
+
+#define VM_MAP_WIRE_NOHOLES 0 /* region must not have holes */
+#define VM_MAP_WIRE_HOLESOK 2 /* region may have holes */
+
+#define VM_MAP_WIRE_WRITE 4 /* Validate writable. */
+
+/*
+ * The following "find_space" options are supported by vm_map_find().
+ *
+ * For VMFS_ALIGNED_SPACE, the desired alignment is specified to
+ * the macro argument as log base 2 of the desired alignment.
+ */
+#define VMFS_NO_SPACE 0 /* don't find; use the given range */
+#define VMFS_ANY_SPACE 1 /* find range with any alignment */
+#define VMFS_OPTIMAL_SPACE 2 /* find range with optimal alignment */
+#define VMFS_SUPER_SPACE 3 /* find superpage-aligned range */
+#define VMFS_ALIGNED_SPACE(x) ((x) << 8) /* find range with fixed alignment */
+
+/*
+ * vm_fault option flags
+ */
+#define VM_FAULT_NORMAL 0 /* Nothing special */
+#define VM_FAULT_WIRE 1 /* Wire the mapped page */
+#define VM_FAULT_DIRTY 2 /* Dirty the page; use w/PROT_COPY */
+
+/*
+ * The VM_MAXUSER_ADDRESS determines the upper size limit of a vmspace.
+ * This value is sized well below the host userlimit, halving the
+ * available space below the VA hole to avoid Intel EPT limits and
+ * leave room available in the usable VA range for other mmap tricks.
+ */
+#define VM_MAXUSER_ADDRESS 0x00003ffffffffffful
+
+/*
+ * Type definitions used in the hypervisor.
+ */
+typedef uchar_t vm_prot_t;
+
+/* New type declarations. */
+struct vm;
+struct vmspace;
+struct pmap;
+
+struct vm_object;
+typedef struct vm_object *vm_object_t;
+
+struct vmm_pt_ops;
+
+struct vm_page;
+typedef struct vm_page *vm_page_t;
+
+enum obj_type { OBJT_DEFAULT, OBJT_SWAP, OBJT_VNODE, OBJT_DEVICE, OBJT_PHYS,
+ OBJT_DEAD, OBJT_SG, OBJT_MGTDEVICE };
+typedef uchar_t objtype_t;
+
+union vm_map_object;
+typedef union vm_map_object vm_map_object_t;
+
+struct vm_map_entry;
+typedef struct vm_map_entry *vm_map_entry_t;
+
+struct vm_map;
+typedef struct vm_map *vm_map_t;
+
+pmap_t vmspace_pmap(struct vmspace *);
+
+int vm_map_find(vm_map_t, vm_object_t, vm_ooffset_t, vm_offset_t *, vm_size_t,
+ vm_offset_t, int, vm_prot_t, vm_prot_t, int);
+int vm_map_remove(vm_map_t, vm_offset_t, vm_offset_t);
+int vm_map_wire(vm_map_t map, vm_offset_t start, vm_offset_t end, int flags);
+
+long vmspace_resident_count(struct vmspace *vmspace);
+
+void pmap_invalidate_cache(void);
+void pmap_get_mapping(pmap_t pmap, vm_offset_t va, uint64_t *ptr, int *num);
+int pmap_emulate_accessed_dirty(pmap_t pmap, vm_offset_t va, int ftype);
+long pmap_wired_count(pmap_t pmap);
+
+struct vm_map {
+ struct vmspace *vmm_space;
+};
+
+struct pmap {
+ void *pm_pml4;
+ cpuset_t pm_active;
+ long pm_eptgen;
+
+ /* Implementation private */
+ enum pmap_type pm_type;
+ struct vmm_pt_ops *pm_ops;
+ void *pm_impl;
+};
+
+struct vmspace {
+ struct vm_map vm_map;
+
+ /* Implementation private */
+ kmutex_t vms_lock;
+ boolean_t vms_map_changing;
+ struct pmap vms_pmap;
+ uintptr_t vms_size; /* fixed after creation */
+
+ list_t vms_maplist;
+};
+
+typedef pfn_t (*vm_pager_fn_t)(vm_object_t, uintptr_t, pfn_t *, uint_t *);
+
+struct vm_object {
+ uint_t vmo_refcnt; /* manipulated with atomic ops */
+
+ /* This group of fields are fixed at creation time */
+ objtype_t vmo_type;
+ size_t vmo_size;
+ vm_pager_fn_t vmo_pager;
+ void *vmo_data;
+
+ kmutex_t vmo_lock; /* protects fields below */
+ vm_memattr_t vmo_attr;
+};
+
+struct vm_page {
+ kmutex_t vmp_lock;
+ pfn_t vmp_pfn;
+ struct vm_object *vmp_obj_held;
+};
+
+/* illumos-specific functions for setup and operation */
+int vm_segmap_obj(vm_object_t, off_t, size_t, struct as *, caddr_t *, uint_t,
+ uint_t, uint_t);
+int vm_segmap_space(struct vmspace *, off_t, struct as *, caddr_t *, off_t,
+ uint_t, uint_t, uint_t);
+void *vmspace_find_kva(struct vmspace *, uintptr_t, size_t);
+void vmm_arena_init(void);
+void vmm_arena_fini(void);
+
+struct vmm_pt_ops {
+ void * (*vpo_init)(uint64_t *);
+ void (*vpo_free)(void *);
+ uint64_t (*vpo_wired_cnt)(void *);
+ int (*vpo_is_wired)(void *, uint64_t, uint_t *);
+ int (*vpo_map)(void *, uint64_t, pfn_t, uint_t, uint_t, uint8_t);
+ uint64_t (*vpo_unmap)(void *, uint64_t, uint64_t);
+};
+
+extern struct vmm_pt_ops ept_ops;
+extern struct vmm_pt_ops rvi_ops;
+
+typedef int (*pmap_pinit_t)(struct pmap *pmap);
+
+struct vmspace *vmspace_alloc(vm_offset_t, vm_offset_t, pmap_pinit_t);
+void vmspace_free(struct vmspace *);
+
+int vm_fault(vm_map_t, vm_offset_t, vm_prot_t, int);
+int vm_fault_quick_hold_pages(vm_map_t map, vm_offset_t addr, vm_size_t len,
+ vm_prot_t prot, vm_page_t *ma, int max_count);
+void vmm_arena_fini(void);
+
+
+struct vm_object *vm_object_allocate(objtype_t, vm_pindex_t);
+void vm_object_deallocate(vm_object_t);
+void vm_object_reference(vm_object_t);
+int vm_object_set_memattr(vm_object_t, vm_memattr_t);
+void vm_object_clear(vm_object_t);
+
+#define VM_OBJECT_WLOCK(vmo) mutex_enter(&(vmo)->vmo_lock)
+#define VM_OBJECT_WUNLOCK(vmo) mutex_exit(&(vmo)->vmo_lock)
+
+#define PQ_ACTIVE 1
+
+void vm_page_unwire(vm_page_t, uint8_t);
+
+#define VM_PAGE_TO_PHYS(page) (mmu_ptob((uintptr_t)((page)->vmp_pfn)))
+
+vm_object_t vm_pager_allocate(objtype_t, void *, vm_ooffset_t, vm_prot_t,
+ vm_ooffset_t, void *);
+
+#endif /* _VMM_VM_H */
diff --git a/usr/src/uts/i86pc/io/vmm/vm/pmap.h b/usr/src/uts/i86pc/io/vmm/vm/pmap.h
deleted file mode 100644
index 680f24f171..0000000000
--- a/usr/src/uts/i86pc/io/vmm/vm/pmap.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * This file and its contents are supplied under the terms of the
- * Common Development and Distribution License ("CDDL"), version 1.0.
- * You may only use this file in accordance with the terms of version
- * 1.0 of the CDDL.
- *
- * A full copy of the text of the CDDL should have accompanied this
- * source. A copy of the CDDL is also available via the Internet at
- * http://www.illumos.org/license/CDDL.
- */
-/* This file is dual-licensed; see usr/src/contrib/bhyve/LICENSE */
-
-/*
- * Copyright 2017 Joyent, Inc.
- */
-
-#ifndef _PMAP_VM_
-#define _PMAP_VM_
-
-#include <machine/pmap.h>
-#include "vm_glue.h"
-
-void pmap_invalidate_cache(void);
-void pmap_get_mapping(pmap_t pmap, vm_offset_t va, uint64_t *ptr, int *num);
-int pmap_emulate_accessed_dirty(pmap_t pmap, vm_offset_t va, int ftype);
-long pmap_wired_count(pmap_t pmap);
-
-#endif /* _PMAP_VM_ */
diff --git a/usr/src/uts/i86pc/io/vmm/vm/vm_extern.h b/usr/src/uts/i86pc/io/vmm/vm/vm_extern.h
deleted file mode 100644
index fcd44ab1be..0000000000
--- a/usr/src/uts/i86pc/io/vmm/vm/vm_extern.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * This file and its contents are supplied under the terms of the
- * Common Development and Distribution License ("CDDL"), version 1.0.
- * You may only use this file in accordance with the terms of version
- * 1.0 of the CDDL.
- *
- * A full copy of the text of the CDDL should have accompanied this
- * source. A copy of the CDDL is also available via the Internet at
- * http://www.illumos.org/license/CDDL.
- */
-/* This file is dual-licensed; see usr/src/contrib/bhyve/LICENSE */
-
-/*
- * Copyright 2017 Joyent, Inc.
- */
-
-#ifndef _VM_EXTERN_H_
-#define _VM_EXTERN_H_
-
-#include <sys/types.h>
-#include <vm/vm.h>
-
-struct vmspace;
-struct pmap;
-
-typedef int (*pmap_pinit_t)(struct pmap *pmap);
-
-struct vmspace *vmspace_alloc(vm_offset_t, vm_offset_t, pmap_pinit_t);
-void vmspace_free(struct vmspace *);
-
-int vm_fault(vm_map_t, vm_offset_t, vm_prot_t, int);
-int vm_fault_quick_hold_pages(vm_map_t map, vm_offset_t addr, vm_size_t len,
- vm_prot_t prot, vm_page_t *ma, int max_count);
-
-
-#endif /* _VM_EXTERN_H_ */
diff --git a/usr/src/uts/i86pc/io/vmm/vm/vm_glue.h b/usr/src/uts/i86pc/io/vmm/vm/vm_glue.h
deleted file mode 100644
index 436b8e9691..0000000000
--- a/usr/src/uts/i86pc/io/vmm/vm/vm_glue.h
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * This file and its contents are supplied under the terms of the
- * Common Development and Distribution License ("CDDL"), version 1.0.
- * You may only use this file in accordance with the terms of version
- * 1.0 of the CDDL.
- *
- * A full copy of the text of the CDDL should have accompanied this
- * source. A copy of the CDDL is also available via the Internet at
- * http://www.illumos.org/license/CDDL.
- */
-/* This file is dual-licensed; see usr/src/contrib/bhyve/LICENSE */
-
-/*
- * Copyright 2019 Joyent, Inc.
- * Copyright 2020 Oxide Computer Company
- */
-
-#ifndef _VM_GLUE_
-#define _VM_GLUE_
-
-#include <vm/pmap.h>
-#include <vm/vm.h>
-#include <sys/cpuvar.h>
-
-struct vmspace;
-struct vm_map;
-struct pmap;
-struct vm_object;
-struct vmm_pt_ops;
-
-struct vm_map {
- struct vmspace *vmm_space;
-};
-
-struct pmap {
- void *pm_pml4;
- cpuset_t pm_active;
- long pm_eptgen;
-
- /* Implementation private */
- enum pmap_type pm_type;
- struct vmm_pt_ops *pm_ops;
- void *pm_impl;
-};
-
-struct vmspace {
- struct vm_map vm_map;
-
- /* Implementation private */
- kmutex_t vms_lock;
- boolean_t vms_map_changing;
- struct pmap vms_pmap;
- uintptr_t vms_size; /* fixed after creation */
-
- list_t vms_maplist;
-};
-
-typedef pfn_t (*vm_pager_fn_t)(vm_object_t, uintptr_t, pfn_t *, uint_t *);
-
-struct vm_object {
- uint_t vmo_refcnt; /* manipulated with atomic ops */
-
- /* This group of fields are fixed at creation time */
- objtype_t vmo_type;
- size_t vmo_size;
- vm_pager_fn_t vmo_pager;
- void *vmo_data;
-
- kmutex_t vmo_lock; /* protects fields below */
- vm_memattr_t vmo_attr;
-};
-
-struct vm_page {
- kmutex_t vmp_lock;
- pfn_t vmp_pfn;
- struct vm_object *vmp_obj_held;
-};
-
-/* Illumos-specific functions for setup and operation */
-int vm_segmap_obj(vm_object_t, off_t, size_t, struct as *, caddr_t *, uint_t,
- uint_t, uint_t);
-int vm_segmap_space(struct vmspace *, off_t, struct as *, caddr_t *, off_t,
- uint_t, uint_t, uint_t);
-void *vmspace_find_kva(struct vmspace *, uintptr_t, size_t);
-void vmm_arena_init(void);
-void vmm_arena_fini(void);
-
-struct vmm_pt_ops {
- void * (*vpo_init)(uint64_t *);
- void (*vpo_free)(void *);
- uint64_t (*vpo_wired_cnt)(void *);
- int (*vpo_is_wired)(void *, uint64_t, uint_t *);
- int (*vpo_map)(void *, uint64_t, pfn_t, uint_t, uint_t, uint8_t);
- uint64_t (*vpo_unmap)(void *, uint64_t, uint64_t);
-};
-
-extern struct vmm_pt_ops ept_ops;
-extern struct vmm_pt_ops rvi_ops;
-
-
-#endif /* _VM_GLUE_ */
diff --git a/usr/src/uts/i86pc/io/vmm/vm/vm_map.h b/usr/src/uts/i86pc/io/vmm/vm/vm_map.h
deleted file mode 100644
index b64d7c3f76..0000000000
--- a/usr/src/uts/i86pc/io/vmm/vm/vm_map.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * This file and its contents are supplied under the terms of the
- * Common Development and Distribution License ("CDDL"), version 1.0.
- * You may only use this file in accordance with the terms of version
- * 1.0 of the CDDL.
- *
- * A full copy of the text of the CDDL should have accompanied this
- * source. A copy of the CDDL is also available via the Internet at
- * http://www.illumos.org/license/CDDL.
- */
-/* This file is dual-licensed; see usr/src/contrib/bhyve/LICENSE */
-
-/*
- * Copyright 2017 Joyent, Inc.
- */
-
-#ifndef _VM_MAP_
-#define _VM_MAP_
-
-#include "vm_glue.h"
-
-/*
- * vm_map_wire and vm_map_unwire option flags
- */
-#define VM_MAP_WIRE_SYSTEM 0 /* wiring in a kernel map */
-#define VM_MAP_WIRE_USER 1 /* wiring in a user map */
-
-#define VM_MAP_WIRE_NOHOLES 0 /* region must not have holes */
-#define VM_MAP_WIRE_HOLESOK 2 /* region may have holes */
-
-#define VM_MAP_WIRE_WRITE 4 /* Validate writable. */
-
-/*
- * The following "find_space" options are supported by vm_map_find().
- *
- * For VMFS_ALIGNED_SPACE, the desired alignment is specified to
- * the macro argument as log base 2 of the desired alignment.
- */
-#define VMFS_NO_SPACE 0 /* don't find; use the given range */
-#define VMFS_ANY_SPACE 1 /* find range with any alignment */
-#define VMFS_OPTIMAL_SPACE 2 /* find range with optimal alignment */
-#define VMFS_SUPER_SPACE 3 /* find superpage-aligned range */
-#define VMFS_ALIGNED_SPACE(x) ((x) << 8) /* find range with fixed alignment */
-
-/*
- * vm_fault option flags
- */
-#define VM_FAULT_NORMAL 0 /* Nothing special */
-#define VM_FAULT_WIRE 1 /* Wire the mapped page */
-#define VM_FAULT_DIRTY 2 /* Dirty the page; use w/VM_PROT_COPY */
-
-
-
-pmap_t vmspace_pmap(struct vmspace *);
-
-int vm_map_find(vm_map_t, vm_object_t, vm_ooffset_t, vm_offset_t *, vm_size_t,
- vm_offset_t, int, vm_prot_t, vm_prot_t, int);
-int vm_map_remove(vm_map_t, vm_offset_t, vm_offset_t);
-int vm_map_wire(vm_map_t map, vm_offset_t start, vm_offset_t end, int flags);
-
-long vmspace_resident_count(struct vmspace *vmspace);
-
-
-#endif /* _VM_MAP_ */
diff --git a/usr/src/uts/i86pc/io/vmm/vm/vm_object.h b/usr/src/uts/i86pc/io/vmm/vm/vm_object.h
deleted file mode 100644
index c2f6391cd1..0000000000
--- a/usr/src/uts/i86pc/io/vmm/vm/vm_object.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * This file and its contents are supplied under the terms of the
- * Common Development and Distribution License ("CDDL"), version 1.0.
- * You may only use this file in accordance with the terms of version
- * 1.0 of the CDDL.
- *
- * A full copy of the text of the CDDL should have accompanied this
- * source. A copy of the CDDL is also available via the Internet at
- * http://www.illumos.org/license/CDDL.
- */
-/* This file is dual-licensed; see usr/src/contrib/bhyve/LICENSE */
-
-/*
- * Copyright 2017 Joyent, Inc.
- */
-
-#ifndef _VM_OBJECT_
-#define _VM_OBJECT_
-
-#include "vm_glue.h"
-
-vm_object_t vm_object_allocate(objtype_t, vm_pindex_t);
-void vm_object_deallocate(vm_object_t);
-void vm_object_reference(vm_object_t);
-int vm_object_set_memattr(vm_object_t, vm_memattr_t);
-void vm_object_clear(vm_object_t);
-
-
-#define VM_OBJECT_WLOCK(vmo) mutex_enter(&(vmo)->vmo_lock)
-#define VM_OBJECT_WUNLOCK(vmo) mutex_exit(&(vmo)->vmo_lock)
-
-#endif /* _VM_OBJECT_ */
diff --git a/usr/src/uts/i86pc/io/vmm/vm/vm_page.h b/usr/src/uts/i86pc/io/vmm/vm/vm_page.h
deleted file mode 100644
index d344c8f188..0000000000
--- a/usr/src/uts/i86pc/io/vmm/vm/vm_page.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * This file and its contents are supplied under the terms of the
- * Common Development and Distribution License ("CDDL"), version 1.0.
- * You may only use this file in accordance with the terms of version
- * 1.0 of the CDDL.
- *
- * A full copy of the text of the CDDL should have accompanied this
- * source. A copy of the CDDL is also available via the Internet at
- * http://www.illumos.org/license/CDDL.
- */
-/* This file is dual-licensed; see usr/src/contrib/bhyve/LICENSE */
-
-/*
- * Copyright 2017 Joyent, Inc.
- */
-
-
-#ifndef _VM_PAGE_
-#define _VM_PAGE_
-
-#include "vm_glue.h"
-
-#define PQ_ACTIVE 1
-
-void vm_page_unwire(vm_page_t, uint8_t);
-
-#define VM_PAGE_TO_PHYS(page) (mmu_ptob((uintptr_t)((page)->vmp_pfn)))
-
-#endif /* _VM_PAGE_ */
diff --git a/usr/src/uts/i86pc/io/vmm/vm/vm_pager.h b/usr/src/uts/i86pc/io/vmm/vm/vm_pager.h
deleted file mode 100644
index b4c84a9411..0000000000
--- a/usr/src/uts/i86pc/io/vmm/vm/vm_pager.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * This file and its contents are supplied under the terms of the
- * Common Development and Distribution License ("CDDL"), version 1.0.
- * You may only use this file in accordance with the terms of version
- * 1.0 of the CDDL.
- *
- * A full copy of the text of the CDDL should have accompanied this
- * source. A copy of the CDDL is also available via the Internet at
- * http://www.illumos.org/license/CDDL.
- */
-/* This file is dual-licensed; see usr/src/contrib/bhyve/LICENSE */
-
-/*
- * Copyright 2017 Joyent, Inc.
- */
-
-#ifndef _VM_PAGER_
-#define _VM_PAGER_
-
-vm_object_t vm_pager_allocate(objtype_t, void *, vm_ooffset_t, vm_prot_t,
- vm_ooffset_t, void *);
-
-
-#endif /* _VM_PAGER_ */
diff --git a/usr/src/uts/i86pc/io/vmm/vmm.c b/usr/src/uts/i86pc/io/vmm/vmm.c
index febc8bb4fe..3984fee38a 100644
--- a/usr/src/uts/i86pc/io/vmm/vmm.c
+++ b/usr/src/uts/i86pc/io/vmm/vmm.c
@@ -61,23 +61,18 @@ __FBSDID("$FreeBSD$");
#include <sys/smp.h>
#include <sys/systm.h>
-#include <vm/vm.h>
-#include <vm/vm_object.h>
-#include <vm/vm_map.h>
-#include <vm/vm_page.h>
-#include <vm/pmap.h>
-#include <vm/vm_extern.h>
-#include <vm/vm_param.h>
-
#include <machine/pcb.h>
#include <machine/smp.h>
#include <machine/md_var.h>
#include <x86/psl.h>
#include <x86/apicreg.h>
+#include <machine/specialreg.h>
#include <machine/vmm.h>
#include <machine/vmm_dev.h>
+#include <machine/vmparam.h>
#include <sys/vmm_instruction_emul.h>
+#include <sys/vmm_vm.h>
#include "vmm_ioport.h"
#include "vmm_ktr.h"
@@ -818,7 +813,7 @@ vm_mmap_memseg(struct vm *vm, vm_paddr_t gpa, int segid, vm_ooffset_t first,
vm_ooffset_t last;
int i, error;
- if (prot == 0 || (prot & ~(VM_PROT_ALL)) != 0)
+ if (prot == 0 || (prot & ~(PROT_ALL)) != 0)
return (EINVAL);
if (flags & ~VM_MEMMAP_F_WIRED)
@@ -852,7 +847,7 @@ vm_mmap_memseg(struct vm *vm, vm_paddr_t gpa, int segid, vm_ooffset_t first,
error = vm_map_find(&vm->vmspace->vm_map, seg->object, first, &gpa,
len, 0, VMFS_NO_SPACE, prot, prot, 0);
- if (error != KERN_SUCCESS)
+ if (error != 0)
return (EFAULT);
vm_object_reference(seg->object);
@@ -860,10 +855,9 @@ vm_mmap_memseg(struct vm *vm, vm_paddr_t gpa, int segid, vm_ooffset_t first,
if ((flags & VM_MEMMAP_F_WIRED) != 0) {
error = vm_map_wire(&vm->vmspace->vm_map, gpa, gpa + len,
VM_MAP_WIRE_USER | VM_MAP_WIRE_NOHOLES);
- if (error != KERN_SUCCESS) {
+ if (error != 0) {
vm_map_remove(&vm->vmspace->vm_map, gpa, gpa + len);
- return (error == KERN_RESOURCE_SHORTAGE ? ENOMEM :
- EFAULT);
+ return (EFAULT);
}
}
@@ -938,7 +932,7 @@ vm_free_memmap(struct vm *vm, int ident)
if (mm->len) {
error = vm_map_remove(&vm->vmspace->vm_map, mm->gpa,
mm->gpa + mm->len);
- KASSERT(error == KERN_SUCCESS, ("%s: vm_map_remove error %d",
+ KASSERT(error == 0, ("%s: vm_map_remove error %d",
__func__, error));
bzero(mm, sizeof (struct mem_map));
}
@@ -1010,7 +1004,7 @@ vm_iommu_modify(struct vm *vm, bool map)
gpa = mm->gpa;
while (gpa < mm->gpa + mm->len) {
- vp = vm_gpa_hold(vm, -1, gpa, PAGE_SIZE, VM_PROT_WRITE,
+ vp = vm_gpa_hold(vm, -1, gpa, PAGE_SIZE, PROT_WRITE,
&cookie);
KASSERT(vp != NULL, ("vm(%s) could not map gpa %lx",
vm_name(vm), gpa));
@@ -1509,16 +1503,16 @@ vm_handle_paging(struct vm *vm, int vcpuid)
__func__, vme->inst_length));
ftype = vme->u.paging.fault_type;
- KASSERT(ftype == VM_PROT_READ ||
- ftype == VM_PROT_WRITE || ftype == VM_PROT_EXECUTE,
+ KASSERT(ftype == PROT_READ ||
+ ftype == PROT_WRITE || ftype == PROT_EXEC,
("vm_handle_paging: invalid fault_type %d", ftype));
- if (ftype == VM_PROT_READ || ftype == VM_PROT_WRITE) {
+ if (ftype == PROT_READ || ftype == PROT_WRITE) {
rv = pmap_emulate_accessed_dirty(vmspace_pmap(vm->vmspace),
vme->u.paging.gpa, ftype);
if (rv == 0) {
VCPU_CTR2(vm, vcpuid, "%s bit emulation for gpa %lx",
- ftype == VM_PROT_READ ? "accessed" : "dirty",
+ ftype == PROT_READ ? "accessed" : "dirty",
vme->u.paging.gpa);
goto done;
}
@@ -1530,7 +1524,7 @@ vm_handle_paging(struct vm *vm, int vcpuid)
VCPU_CTR3(vm, vcpuid, "vm_handle_paging rv = %d, gpa = %lx, "
"ftype = %d", rv, vme->u.paging.gpa, ftype);
- if (rv != KERN_SUCCESS)
+ if (rv != 0)
return (EFAULT);
done:
return (0);
diff --git a/usr/src/uts/i86pc/io/vmm/vmm_instruction_emul.c b/usr/src/uts/i86pc/io/vmm/vmm_instruction_emul.c
index b0501a60ad..ea0b0ae379 100644
--- a/usr/src/uts/i86pc/io/vmm/vmm_instruction_emul.c
+++ b/usr/src/uts/i86pc/io/vmm/vmm_instruction_emul.c
@@ -51,12 +51,10 @@ __FBSDID("$FreeBSD$");
#include <sys/systm.h>
#include <sys/proc.h>
-#include <vm/vm.h>
-#include <vm/pmap.h>
-
#include <machine/vmparam.h>
#include <machine/vmm.h>
#include <sys/vmm_kernel.h>
+#include <sys/vmm_vm.h>
#include <sys/vmm_instruction_emul.h>
#include <x86/psl.h>
@@ -2724,13 +2722,13 @@ pf_error_code(int usermode, int prot, int rsvd, uint64_t pte)
if (pte & PG_V)
error_code |= PGEX_P;
- if (prot & VM_PROT_WRITE)
+ if (prot & PROT_WRITE)
error_code |= PGEX_W;
if (usermode)
error_code |= PGEX_U;
if (rsvd)
error_code |= PGEX_RSV;
- if (prot & VM_PROT_EXECUTE)
+ if (prot & PROT_EXEC)
error_code |= PGEX_I;
return (error_code);
@@ -2751,7 +2749,9 @@ ptp_hold(struct vm *vm, int vcpu, vm_paddr_t ptpphys, size_t len, void **cookie)
void *ptr;
ptp_release(cookie);
- ptr = vm_gpa_hold(vm, vcpu, ptpphys, len, VM_PROT_RW, cookie);
+ ptr = vm_gpa_hold(vm, vcpu, ptpphys, len, PROT_READ | PROT_WRITE,
+ cookie);
+
return (ptr);
}
@@ -2769,7 +2769,7 @@ _vm_gla2gpa(struct vm *vm, int vcpuid, struct vm_guest_paging *paging,
*guest_fault = 0;
usermode = (paging->cpl == 3 ? 1 : 0);
- writable = prot & VM_PROT_WRITE;
+ writable = prot & PROT_WRITE;
cookie = NULL;
retval = 0;
restart:
diff --git a/usr/src/uts/i86pc/io/vmm/vmm_mem.c b/usr/src/uts/i86pc/io/vmm/vmm_mem.c
index 26862397a1..4ffe5bf509 100644
--- a/usr/src/uts/i86pc/io/vmm/vmm_mem.c
+++ b/usr/src/uts/i86pc/io/vmm/vmm_mem.c
@@ -34,19 +34,14 @@ __FBSDID("$FreeBSD$");
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/malloc.h>
+#include <sys/mman.h>
#include <sys/sglist.h>
#include <sys/lock.h>
#include <sys/rwlock.h>
-#include <vm/vm.h>
-#include <vm/vm_param.h>
-#include <vm/pmap.h>
-#include <vm/vm_map.h>
-#include <vm/vm_object.h>
-#include <vm/vm_page.h>
-#include <vm/vm_pager.h>
-
#include <machine/md_var.h>
+#include <machine/vm.h>
+#include <sys/vmm_vm.h>
#include "vmm_mem.h"
@@ -69,7 +64,8 @@ vmm_mmio_alloc(struct vmspace *vmspace, vm_paddr_t gpa, size_t len,
error = sglist_append_phys(sg, hpa, len);
KASSERT(error == 0, ("error %d appending physaddr to sglist", error));
- obj = vm_pager_allocate(OBJT_SG, sg, len, VM_PROT_RW, 0, NULL);
+ const int prot = PROT_READ | PROT_WRITE;
+ obj = vm_pager_allocate(OBJT_SG, sg, len, prot, 0, NULL);
if (obj != NULL) {
/*
* VT-x ignores the MTRR settings when figuring out the
@@ -81,13 +77,13 @@ vmm_mmio_alloc(struct vmspace *vmspace, vm_paddr_t gpa, size_t len,
VM_OBJECT_WLOCK(obj);
error = vm_object_set_memattr(obj, VM_MEMATTR_UNCACHEABLE);
VM_OBJECT_WUNLOCK(obj);
- if (error != KERN_SUCCESS) {
+ if (error != 0) {
panic("vmm_mmio_alloc: vm_object_set_memattr error %d",
error);
}
error = vm_map_find(&vmspace->vm_map, obj, 0, &gpa, len, 0,
- VMFS_NO_SPACE, VM_PROT_RW, VM_PROT_RW, 0);
- if (error != KERN_SUCCESS) {
+ VMFS_NO_SPACE, prot, prot, 0);
+ if (error != 0) {
vm_object_deallocate(obj);
obj = NULL;
}
diff --git a/usr/src/uts/i86pc/io/vmm/vmm_sol_dev.c b/usr/src/uts/i86pc/io/vmm/vmm_sol_dev.c
index 67380cdf72..f5c1fa8d82 100644
--- a/usr/src/uts/i86pc/io/vmm/vmm_sol_dev.c
+++ b/usr/src/uts/i86pc/io/vmm/vmm_sol_dev.c
@@ -44,8 +44,8 @@
#include <sys/vmm_dev.h>
#include <sys/vmm_impl.h>
#include <sys/vmm_drv.h>
+#include <sys/vmm_vm.h>
-#include <vm/vm.h>
#include <vm/seg_dev.h>
#include "io/ppt.h"
@@ -57,7 +57,6 @@
#include "vmm_lapic.h"
#include "vmm_stat.h"
#include "vmm_util.h"
-#include "vm/vm_glue.h"
/*
* Locking details:
@@ -1185,10 +1184,6 @@ vmmdev_do_ioctl(vmm_softc_t *sc, int cmd, intptr_t arg, int md,
case VM_GLA2GPA: {
struct vm_gla2gpa gg;
- CTASSERT(PROT_READ == VM_PROT_READ);
- CTASSERT(PROT_WRITE == VM_PROT_WRITE);
- CTASSERT(PROT_EXEC == VM_PROT_EXECUTE);
-
if (ddi_copyin(datap, &gg, sizeof (gg), md)) {
error = EFAULT;
break;
@@ -1205,10 +1200,6 @@ vmmdev_do_ioctl(vmm_softc_t *sc, int cmd, intptr_t arg, int md,
case VM_GLA2GPA_NOFAULT: {
struct vm_gla2gpa gg;
- CTASSERT(PROT_READ == VM_PROT_READ);
- CTASSERT(PROT_WRITE == VM_PROT_WRITE);
- CTASSERT(PROT_EXEC == VM_PROT_EXECUTE);
-
if (ddi_copyin(datap, &gg, sizeof (gg), md)) {
error = EFAULT;
break;
diff --git a/usr/src/uts/i86pc/io/vmm/vmm_sol_ept.c b/usr/src/uts/i86pc/io/vmm/vmm_sol_ept.c
index 01403642b4..b43a6cac1d 100644
--- a/usr/src/uts/i86pc/io/vmm/vmm_sol_ept.c
+++ b/usr/src/uts/i86pc/io/vmm/vmm_sol_ept.c
@@ -12,15 +12,17 @@
/*
* Copyright 2019 Joyent, Inc.
+ * Copyright 2021 Oxide Computer Company
*/
#include <sys/types.h>
#include <sys/param.h>
#include <sys/kmem.h>
#include <sys/machsystm.h>
+#include <sys/mman.h>
#include <sys/gipt.h>
-#include <vm/vm_glue.h>
+#include <sys/vmm_vm.h>
struct ept_map {
diff --git a/usr/src/uts/i86pc/io/vmm/vmm_sol_glue.c b/usr/src/uts/i86pc/io/vmm/vmm_sol_glue.c
index 7968f461f7..afd686f197 100644
--- a/usr/src/uts/i86pc/io/vmm/vmm_sol_glue.c
+++ b/usr/src/uts/i86pc/io/vmm/vmm_sol_glue.c
@@ -63,6 +63,7 @@
#include <machine/pmap.h>
#include <machine/specialreg.h>
#include <machine/vmm.h>
+#include <machine/vmparam.h>
#include <sys/vmm_impl.h>
#include <sys/kernel.h>
diff --git a/usr/src/uts/i86pc/io/vmm/vmm_sol_rvi.c b/usr/src/uts/i86pc/io/vmm/vmm_sol_rvi.c
index 4a2ce5b3f7..f82ea64994 100644
--- a/usr/src/uts/i86pc/io/vmm/vmm_sol_rvi.c
+++ b/usr/src/uts/i86pc/io/vmm/vmm_sol_rvi.c
@@ -12,17 +12,19 @@
/*
* Copyright 2019 Joyent, Inc.
+ * Copyright 2021 Oxide Computer Company
*/
#include <sys/types.h>
#include <sys/param.h>
#include <sys/kmem.h>
#include <sys/machsystm.h>
+#include <sys/mach_mmu.h>
+#include <sys/mman.h>
#include <sys/x86_archext.h>
#include <sys/gipt.h>
-#include <vm/vm_glue.h>
-
+#include <sys/vmm_vm.h>
struct rvi_map {
gipt_map_t rm_gipt;
diff --git a/usr/src/uts/i86pc/io/vmm/vmm_sol_vm.c b/usr/src/uts/i86pc/io/vmm/vmm_sol_vm.c
index a280c1d255..04fbb94c83 100644
--- a/usr/src/uts/i86pc/io/vmm/vmm_sol_vm.c
+++ b/usr/src/uts/i86pc/io/vmm/vmm_sol_vm.c
@@ -12,7 +12,7 @@
/*
* Copyright 2019 Joyent, Inc.
- * Copyright 2020 Oxide Computer Company
+ * Copyright 2021 Oxide Computer Company
* Copyright 2021 OmniOS Community Edition (OmniOSce) Association.
*/
@@ -29,13 +29,13 @@
#include <sys/malloc.h>
#include <sys/x86_archext.h>
#include <vm/as.h>
+#include <vm/hat_i86.h>
#include <vm/seg_vn.h>
#include <vm/seg_kmem.h>
#include <vm/seg_vmm.h>
-#include <vm/vm_extern.h>
-#include <vm/vm_map.h>
-#include "vm/vm_glue.h"
+#include <machine/vm.h>
+#include <sys/vmm_vm.h>
#define PMAP_TO_VMMAP(pm) ((vm_map_t) \
((caddr_t)(pm) - offsetof(struct vmspace, vms_pmap)))