svn commit: r327902 - in user/jeff/numa: . cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/env cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety cddl/contrib/opensolaris/lib/libdtrace/...
Jeff Roberson
jeff at FreeBSD.org
Fri Jan 12 23:38:21 UTC 2018
Author: jeff
Date: Fri Jan 12 23:38:15 2018
New Revision: 327902
URL: https://svnweb.freebsd.org/changeset/base/327902
Log:
Merge from head
Added:
user/jeff/numa/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/env/tst.setenv3.ksh
- copied unchanged from r327901, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/env/tst.setenv3.ksh
user/jeff/numa/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/env/tst.setenv3.ksh.out
- copied unchanged from r327901, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/env/tst.setenv3.ksh.out
user/jeff/numa/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.jailname.d
- copied unchanged from r327901, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.jailname.d
user/jeff/numa/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.jid.d
- copied unchanged from r327901, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.jid.d
user/jeff/numa/sys/arm/arm/gic_acpi.c
- copied unchanged from r327901, head/sys/arm/arm/gic_acpi.c
user/jeff/numa/sys/arm64/arm64/gic_v3_acpi.c
- copied unchanged from r327901, head/sys/arm64/arm64/gic_v3_acpi.c
user/jeff/numa/sys/contrib/zstd/lib/freebsd/zstd_kfreebsd.c
- copied unchanged from r327901, head/sys/contrib/zstd/lib/freebsd/zstd_kfreebsd.c
user/jeff/numa/sys/dev/acpica/acpi_bus_if.m
- copied unchanged from r327901, head/sys/dev/acpica/acpi_bus_if.m
user/jeff/numa/sys/i386/i386/prof_machdep.c
- copied unchanged from r327901, head/sys/i386/i386/prof_machdep.c
user/jeff/numa/sys/powerpc/powernv/
- copied from r327901, head/sys/powerpc/powernv/
user/jeff/numa/tests/sys/geom/class/mirror/sync_error.sh
- copied unchanged from r327901, head/tests/sys/geom/class/mirror/sync_error.sh
user/jeff/numa/usr.bin/awk/tests/
- copied from r327901, head/usr.bin/awk/tests/
user/jeff/numa/usr.bin/clang/lld/ld.lld.1
- copied unchanged from r327901, head/usr.bin/clang/lld/ld.lld.1
user/jeff/numa/usr.bin/vmstat/tests/
- copied from r327901, head/usr.bin/vmstat/tests/
Deleted:
user/jeff/numa/sys/i386/isa/
user/jeff/numa/sys/sys/_vm_domain.h
user/jeff/numa/sys/sys/digiio.h
user/jeff/numa/sys/vm/vm_domain.c
user/jeff/numa/sys/vm/vm_domain.h
user/jeff/numa/usr.sbin/digictl/
Modified:
user/jeff/numa/Makefile.inc1
user/jeff/numa/Makefile.libcompat
user/jeff/numa/ObsoleteFiles.inc
user/jeff/numa/UPDATING
user/jeff/numa/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c
user/jeff/numa/cddl/contrib/opensolaris/lib/libdtrace/common/dt_options.c
user/jeff/numa/cddl/usr.sbin/dtrace/tests/common/env/Makefile
user/jeff/numa/cddl/usr.sbin/dtrace/tests/common/safety/Makefile
user/jeff/numa/contrib/gcc/unwind-dw2.c
user/jeff/numa/contrib/llvm/lib/Support/Unix/Memory.inc
user/jeff/numa/etc/mtree/BSD.tests.dist
user/jeff/numa/include/stdlib.h
user/jeff/numa/lib/libcasper/services/cap_dns/cap_dns.3
user/jeff/numa/sbin/camcontrol/camcontrol.c
user/jeff/numa/sbin/dhclient/parse.c
user/jeff/numa/share/man/man5/src.conf.5
user/jeff/numa/share/man/man9/Makefile
user/jeff/numa/share/man/man9/malloc.9
user/jeff/numa/share/mk/src.opts.mk
user/jeff/numa/share/mk/src.sys.obj.mk
user/jeff/numa/stand/common/reloc_elf.c
user/jeff/numa/stand/efi/boot1/Makefile
user/jeff/numa/stand/efi/boot1/boot1.c
user/jeff/numa/stand/efi/include/efi.h
user/jeff/numa/stand/libsa/net.h
user/jeff/numa/stand/libsa/stand.h
user/jeff/numa/sys/amd64/amd64/cpu_switch.S
user/jeff/numa/sys/amd64/amd64/exception.S
user/jeff/numa/sys/amd64/amd64/genassym.c
user/jeff/numa/sys/amd64/amd64/machdep.c
user/jeff/numa/sys/amd64/amd64/mp_machdep.c
user/jeff/numa/sys/amd64/amd64/support.S
user/jeff/numa/sys/amd64/include/md_var.h
user/jeff/numa/sys/arm/allwinner/a83t/a83t_padconf.c
user/jeff/numa/sys/arm/allwinner/if_awg.c
user/jeff/numa/sys/arm/arm/generic_timer.c
user/jeff/numa/sys/arm/arm/gic.c
user/jeff/numa/sys/arm64/arm64/cpu_errata.c
user/jeff/numa/sys/arm64/arm64/gic_v3.c
user/jeff/numa/sys/arm64/arm64/gic_v3_var.h
user/jeff/numa/sys/arm64/arm64/gicv3_its.c
user/jeff/numa/sys/arm64/arm64/locore.S
user/jeff/numa/sys/arm64/arm64/nexus.c
user/jeff/numa/sys/arm64/arm64/pmap.c
user/jeff/numa/sys/arm64/arm64/trap.c
user/jeff/numa/sys/arm64/include/pcpu.h
user/jeff/numa/sys/cam/cam_periph.c
user/jeff/numa/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c
user/jeff/numa/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h
user/jeff/numa/sys/compat/linuxkpi/common/include/linux/slab.h
user/jeff/numa/sys/conf/files.arm64
user/jeff/numa/sys/conf/files.i386
user/jeff/numa/sys/conf/files.mips
user/jeff/numa/sys/conf/files.powerpc
user/jeff/numa/sys/conf/files.riscv
user/jeff/numa/sys/conf/options.powerpc
user/jeff/numa/sys/crypto/aesni/aesni.c
user/jeff/numa/sys/dev/acpica/acpi.c
user/jeff/numa/sys/dev/acpica/acpi_resource.c
user/jeff/numa/sys/dev/acpica/acpivar.h
user/jeff/numa/sys/dev/amdsbwd/amdsbwd.c
user/jeff/numa/sys/dev/bhnd/bcma/bcma_erom.c
user/jeff/numa/sys/dev/bhnd/nvram/bhnd_nvram_private.h
user/jeff/numa/sys/dev/bhnd/siba/siba_erom.c
user/jeff/numa/sys/dev/bxe/bxe.c
user/jeff/numa/sys/dev/bxe/ecore_sp.h
user/jeff/numa/sys/dev/cxgbe/t4_sge.c
user/jeff/numa/sys/dev/e1000/e1000_82575.h
user/jeff/numa/sys/dev/e1000/e1000_ich8lan.c
user/jeff/numa/sys/dev/e1000/e1000_regs.h
user/jeff/numa/sys/dev/e1000/if_em.c
user/jeff/numa/sys/dev/iicbus/ds13rtc.c
user/jeff/numa/sys/dev/ixl/if_ixlv.c
user/jeff/numa/sys/dev/ixl/ixl_pf_iov.c
user/jeff/numa/sys/dev/ixl/ixl_pf_main.c
user/jeff/numa/sys/dev/md/md.c
user/jeff/numa/sys/dev/mlx4/cq.h
user/jeff/numa/sys/dev/mlx4/mlx4_core/mlx4_fw.c
user/jeff/numa/sys/dev/mlx4/mlx4_core/mlx4_mcg.c
user/jeff/numa/sys/dev/mlx4/mlx4_en/mlx4_en_tx.c
user/jeff/numa/sys/dev/mlx4/mlx4_ib/mlx4_ib.h
user/jeff/numa/sys/dev/mlx4/mlx4_ib/mlx4_ib_qp.c
user/jeff/numa/sys/dev/mlx4/qp.h
user/jeff/numa/sys/dev/mlx5/device.h
user/jeff/numa/sys/dev/mlx5/qp.h
user/jeff/numa/sys/fs/nullfs/null_vfsops.c
user/jeff/numa/sys/geom/mirror/g_mirror.c
user/jeff/numa/sys/geom/mirror/g_mirror.h
user/jeff/numa/sys/i386/bios/apm.c
user/jeff/numa/sys/i386/conf/GENERIC
user/jeff/numa/sys/i386/conf/NOTES
user/jeff/numa/sys/i386/i386/support.s
user/jeff/numa/sys/kern/kern_malloc.c
user/jeff/numa/sys/kern/kern_mutex.c
user/jeff/numa/sys/kern/sys_socket.c
user/jeff/numa/sys/kern/vfs_aio.c
user/jeff/numa/sys/kern/vfs_subr.c
user/jeff/numa/sys/mips/mips/exception.S
user/jeff/numa/sys/mips/mips/locore.S
user/jeff/numa/sys/mips/mips/swtch.S
user/jeff/numa/sys/mips/mips/trap.c
user/jeff/numa/sys/modules/bhnd/Makefile
user/jeff/numa/sys/modules/dtrace/Makefile
user/jeff/numa/sys/modules/sdhci_acpi/Makefile
user/jeff/numa/sys/modules/sdhci_pci/Makefile
user/jeff/numa/sys/modules/sgx/Makefile
user/jeff/numa/sys/netinet/libalias/alias_mod.h
user/jeff/numa/sys/netinet/libalias/alias_sctp.c
user/jeff/numa/sys/netpfil/ipfw/dn_heap.c
user/jeff/numa/sys/netpfil/ipfw/dn_sched_fq_codel.c
user/jeff/numa/sys/netpfil/ipfw/dn_sched_fq_pie.c
user/jeff/numa/sys/opencrypto/cryptodev.c
user/jeff/numa/sys/opencrypto/cryptodev.h
user/jeff/numa/sys/powerpc/conf/GENERIC64
user/jeff/numa/sys/powerpc/include/spr.h
user/jeff/numa/sys/powerpc/powermac/uninorthpci.c
user/jeff/numa/sys/powerpc/powermac/uninorthvar.h
user/jeff/numa/sys/sys/malloc.h
user/jeff/numa/sys/ufs/ffs/ffs_softdep.c
user/jeff/numa/sys/ufs/ufs/ufs_dirhash.c
user/jeff/numa/sys/vm/vm_glue.c
user/jeff/numa/sys/vm/vm_unix.c
user/jeff/numa/tests/sys/geom/class/mirror/Makefile
user/jeff/numa/tools/tools/crypto/cryptotest.c
user/jeff/numa/usr.bin/awk/Makefile
user/jeff/numa/usr.bin/clang/lld/Makefile
user/jeff/numa/usr.bin/patch/inp.c
user/jeff/numa/usr.bin/vmstat/Makefile
user/jeff/numa/usr.sbin/Makefile
user/jeff/numa/usr.sbin/bsdinstall/partedit/gpart_ops.c
user/jeff/numa/usr.sbin/efibootmgr/efibootmgr.c
Directory Properties:
user/jeff/numa/ (props changed)
user/jeff/numa/cddl/ (props changed)
user/jeff/numa/cddl/contrib/opensolaris/ (props changed)
user/jeff/numa/contrib/gcc/ (props changed)
user/jeff/numa/contrib/llvm/ (props changed)
user/jeff/numa/sys/cddl/contrib/opensolaris/ (props changed)
user/jeff/numa/sys/contrib/zstd/ (props changed)
user/jeff/numa/tests/sys/geom/class/eli/attach_test.sh (props changed)
user/jeff/numa/tests/sys/geom/class/eli/configure_test.sh (props changed)
user/jeff/numa/tests/sys/geom/class/eli/detach_test.sh (props changed)
user/jeff/numa/tests/sys/geom/class/eli/integrity_test.sh (props changed)
user/jeff/numa/tests/sys/geom/class/mirror/10_test.sh (props changed)
user/jeff/numa/tests/sys/geom/class/mirror/11_test.sh (props changed)
user/jeff/numa/tests/sys/geom/class/mirror/12_test.sh (props changed)
user/jeff/numa/tests/sys/geom/class/mirror/13_test.sh (props changed)
Modified: user/jeff/numa/Makefile.inc1
==============================================================================
--- user/jeff/numa/Makefile.inc1 Fri Jan 12 23:34:16 2018 (r327901)
+++ user/jeff/numa/Makefile.inc1 Fri Jan 12 23:38:15 2018 (r327902)
@@ -144,7 +144,7 @@ TEST_SYSTEM_COMPILER_VARS= \
WANT_COMPILER_FREEBSD_VERSION WANT_COMPILER_FREEBSD_VERSION_FILE \
CC COMPILER_TYPE COMPILER_FEATURES COMPILER_VERSION \
COMPILER_FREEBSD_VERSION \
- LINKER_TYPE LINKER_VERSION
+ LINKER_TYPE LINKER_FEATURES LINKER_VERSION
test-system-compiler: .PHONY
.for v in ${TEST_SYSTEM_COMPILER_VARS}
${_+_}@printf "%-35s= %s\n" "${v}" "${${v}}"
@@ -178,6 +178,7 @@ _COMPILER_METADATA_VARS= COMPILER_VERSION \
COMPILER_FEATURES \
COMPILER_FREEBSD_VERSION \
LINKER_VERSION \
+ LINKER_FEATURES \
LINKER_TYPE
compiler-metadata.mk: .PHONY .META
@: > ${.TARGET}
@@ -536,6 +537,7 @@ BSARGS= DESTDIR= \
-DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no \
MK_CLANG_EXTRAS=no MK_CLANG_FULL=no \
MK_LLDB=no MK_TESTS=no \
+ MK_LLD=${MK_LLD_BOOTSTRAP} \
MK_INCLUDES=yes
BMAKE= \
Modified: user/jeff/numa/Makefile.libcompat
==============================================================================
--- user/jeff/numa/Makefile.libcompat Fri Jan 12 23:34:16 2018 (r327901)
+++ user/jeff/numa/Makefile.libcompat Fri Jan 12 23:38:15 2018 (r327902)
@@ -35,10 +35,19 @@ LIB32WMAKEFLAGS= \
OBJCOPY="${XOBJCOPY}"
.elif ${TARGET_ARCH:Mmips64*} != ""
+.if ${WANT_COMPILER_TYPE} == clang || \
+ (defined(X_COMPILER_TYPE) && ${X_COMPILER_TYPE} == clang)
+.if ${TARGET_ARCH:Mmips64el*} != ""
+LIB32CPUFLAGS= -target mipsel-unknown-freebsd12.0
+.else
+LIB32CPUFLAGS= -target mips-unknown-freebsd12.0
+.endif
+.else
.if empty(TARGET_CPUTYPE)
LIB32CPUFLAGS= -march=mips3
.else
LIB32CPUFLAGS= -march=${TARGET_CPUTYPE}
+.endif
.endif
LIB32CPUFLAGS+= -mabi=32
LIB32WMAKEENV= MACHINE=mips MACHINE_ARCH=mips
Modified: user/jeff/numa/ObsoleteFiles.inc
==============================================================================
--- user/jeff/numa/ObsoleteFiles.inc Fri Jan 12 23:34:16 2018 (r327901)
+++ user/jeff/numa/ObsoleteFiles.inc Fri Jan 12 23:38:15 2018 (r327902)
@@ -38,6 +38,10 @@
# xargs -n1 | sort | uniq -d;
# done
+# 20180109: Remove vestiges of digi(4) driver
+OLD_FILES+=usr/include/sys/digiio.h
+OLD_FILES+=usr/sbin/digictl
+OLD_FILES+=usr/share/man/man8/digictl.8.gz
# 20180107: Convert remaining geli(8) tests to ATF
OLD_FILES+=tests/sys/geom/class/eli/nokey_test.sh
OLD_FILES+=tests/sys/geom/class/eli/readonly_test.sh
Modified: user/jeff/numa/UPDATING
==============================================================================
--- user/jeff/numa/UPDATING Fri Jan 12 23:34:16 2018 (r327901)
+++ user/jeff/numa/UPDATING Fri Jan 12 23:38:15 2018 (r327902)
@@ -51,6 +51,20 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW:
****************************** SPECIAL WARNING: ******************************
+20180110:
+ LLVM's lld linker is now used as the FreeBSD/amd64 bootstrap linker.
+ This means it is used to link the kernel and userland libraries and
+ executables, but is not yet installed as /usr/bin/ld by default.
+
+ To revert to ld.bfd as the bootstrap linker, in /etc/src.conf set
+ WITHOUT_LLD_BOOTSTRAP=yes
+
+20180110:
+ On i386, pmtimer has been removed. Its functionality has been folded
+ into apm. It was a no-op on ACPI in current for a while now (but was still
+ needed on i386 in FreeBSD 11 and earlier). Users may need to remove it
+ from kernel config files.
+
20180104:
The use of RSS hash from the network card aka flowid has been
disabled by default for lagg(4) as it's currently incompatible with
@@ -195,7 +209,7 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW:
will create the recovery information. If you have a filesystem
created prior to this change and wish to have a recovery block
created for your filesystem, you can do so by running fsck in
- forground mode (i.e., do not use the -p or -y options). As it
+ foreground mode (i.e., do not use the -p or -y options). As it
starts, fsck will ask ``SAVE DATA TO FIND ALTERNATE SUPERBLOCKS''
to which you should answer yes.
@@ -1855,7 +1869,7 @@ COMMON ITEMS:
do an upgrade to the new branch. This is the best-tested upgrade path,
and has the highest probability of being successful. Please try this
approach if you encounter problems with a major version upgrade. Since
- the stable 4.x branch point, one has generally been able to upgade from
+ the stable 4.x branch point, one has generally been able to upgrade from
anywhere in the most recent stable branch to head / current (or even the
last couple of stable branches). See the top of this file when there's
an exception.
@@ -1993,7 +2007,7 @@ COMMON ITEMS:
for potential gotchas. The -U option is also useful to consider.
See mergemaster(8) for more information.
- [5] Usually this step is a noop. However, from time to time
+ [5] Usually this step is a no-op. However, from time to time
you may need to do this if you get unknown user in the following
step. It never hurts to do it all the time. You may need to
install a new mergemaster (cd src/usr.sbin/mergemaster && make
Copied: user/jeff/numa/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/env/tst.setenv3.ksh (from r327901, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/env/tst.setenv3.ksh)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ user/jeff/numa/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/env/tst.setenv3.ksh Fri Jan 12 23:38:15 2018 (r327902, copy of r327901, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/env/tst.setenv3.ksh)
@@ -0,0 +1,34 @@
+#
+# CDDL HEADER START
+#
+# 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.
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2012 by Delphix. All rights reserved.
+#
+
+#
+# Reset an environment variable we already know to be set.
+# Regression test for FreeBSD r327794.
+#
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+
+$dtrace -q -Z -n doogle -xsetenv=PATH=/foo -c '/usr/bin/printenv PATH'
+
+exit $?
Copied: user/jeff/numa/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/env/tst.setenv3.ksh.out (from r327901, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/env/tst.setenv3.ksh.out)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ user/jeff/numa/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/env/tst.setenv3.ksh.out Fri Jan 12 23:38:15 2018 (r327902, copy of r327901, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/env/tst.setenv3.ksh.out)
@@ -0,0 +1,2 @@
+/foo
+
Copied: user/jeff/numa/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.jailname.d (from r327901, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.jailname.d)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ user/jeff/numa/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.jailname.d Fri Jan 12 23:38:15 2018 (r327902, copy of r327901, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.jailname.d)
@@ -0,0 +1,44 @@
+/*
+ * 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 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 2018 Domagoj Stolfa <domagoj.stolfa at cl.cam.ac.uk>.
+ *
+ * This software was developed by BAE Systems, the University of Cambridge
+ * Computer Laboratory, and Memorial University under DARPA/AFRL contract
+ * FA8650-15-C-7558 ("CADETS"), as part of the DARPA Transparent Computing
+ * (TC) research program.
+ *
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * collect jailname at every fbt probe and at every firing of a
+ * high-frequency profile probe
+ */
+
+fbt:::
+{
+ @a[jailname] = count();
+}
+
+profile-4999hz
+{
+ @a[jailname] = count();
+}
+
+tick-1sec
+/n++ == 10/
+{
+ exit(0);
+}
Copied: user/jeff/numa/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.jid.d (from r327901, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.jid.d)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ user/jeff/numa/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.jid.d Fri Jan 12 23:38:15 2018 (r327902, copy of r327901, head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.jid.d)
@@ -0,0 +1,44 @@
+/*
+ * 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 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 2018 Domagoj Stolfa <domagoj.stolfa at cl.cam.ac.uk>.
+ *
+ * This software was developed by BAE Systems, the University of Cambridge
+ * Computer Laboratory, and Memorial University under DARPA/AFRL contract
+ * FA8650-15-C-7558 ("CADETS"), as part of the DARPA Transparent Computing
+ * (TC) research program.
+ *
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * collect jid at every fbt probe and at every firing of a
+ * high-frequency profile probe
+ */
+
+fbt:::
+{
+ @a[jid] = count();
+}
+
+profile-4999hz
+{
+ @a[jid] = count();
+}
+
+tick-1sec
+/n++ == 10/
+{
+ exit(0);
+}
Modified: user/jeff/numa/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c
==============================================================================
--- user/jeff/numa/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c Fri Jan 12 23:34:16 2018 (r327901)
+++ user/jeff/numa/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c Fri Jan 12 23:38:15 2018 (r327902)
@@ -313,6 +313,12 @@ static const dt_ident_t _dtrace_globals[] = {
DT_VERS_1_5, &dt_idops_func, "string(int, void *)" },
{ "ipl", DT_IDENT_SCALAR, 0, DIF_VAR_IPL, DT_ATTR_STABCMN, DT_VERS_1_0,
&dt_idops_type, "uint_t" },
+#ifdef __FreeBSD__
+{ "jailname", DT_IDENT_SCALAR, 0, DIF_VAR_JAILNAME,
+ DT_ATTR_STABCMN, DT_VERS_1_13, &dt_idops_type, "string" },
+{ "jid", DT_IDENT_SCALAR, 0, DIF_VAR_JID, DT_ATTR_STABCMN, DT_VERS_1_13,
+ &dt_idops_type, "int" },
+#endif
{ "json", DT_IDENT_FUNC, 0, DIF_SUBR_JSON, DT_ATTR_STABCMN, DT_VERS_1_11,
&dt_idops_func, "string(const char *, const char *)" },
{ "jstack", DT_IDENT_ACTFUNC, 0, DT_ACT_JSTACK, DT_ATTR_STABCMN, DT_VERS_1_0,
@@ -528,10 +534,8 @@ static const dt_ident_t _dtrace_globals[] = {
{ "walltimestamp", DT_IDENT_SCALAR, 0, DIF_VAR_WALLTIMESTAMP,
DT_ATTR_STABCMN, DT_VERS_1_0,
&dt_idops_type, "int64_t" },
-#ifdef illumos
{ "zonename", DT_IDENT_SCALAR, 0, DIF_VAR_ZONENAME,
DT_ATTR_STABCMN, DT_VERS_1_0, &dt_idops_type, "string" },
-#endif
#ifndef illumos
{ "cpu", DT_IDENT_SCALAR, 0, DIF_VAR_CPU,
Modified: user/jeff/numa/cddl/contrib/opensolaris/lib/libdtrace/common/dt_options.c
==============================================================================
--- user/jeff/numa/cddl/contrib/opensolaris/lib/libdtrace/common/dt_options.c Fri Jan 12 23:34:16 2018 (r327901)
+++ user/jeff/numa/cddl/contrib/opensolaris/lib/libdtrace/common/dt_options.c Fri Jan 12 23:38:15 2018 (r327902)
@@ -415,7 +415,7 @@ dt_opt_setenv(dtrace_hdl_t *dtp, const char *arg, uint
{
char **p;
char *var;
- int i;
+ int nvars;
/*
* We can't effectively set environment variables from #pragma lines
@@ -430,7 +430,7 @@ dt_opt_setenv(dtrace_hdl_t *dtp, const char *arg, uint
if (!option && strchr(arg, '=') != NULL)
return (dt_set_errno(dtp, EDT_BADOPTVAL));
- for (i = 1, p = dtp->dt_proc_env; *p != NULL; i++, p++)
+ for (nvars = 0, p = dtp->dt_proc_env; *p != NULL; nvars++, p++)
continue;
for (p = dtp->dt_proc_env; *p != NULL; p++) {
@@ -439,9 +439,9 @@ dt_opt_setenv(dtrace_hdl_t *dtp, const char *arg, uint
var = *p + strlen(*p);
if (strncmp(*p, arg, var - *p) == 0) {
dt_free(dtp, *p);
- *p = dtp->dt_proc_env[i - 1];
- dtp->dt_proc_env[i - 1] = NULL;
- i--;
+ *p = dtp->dt_proc_env[nvars - 1];
+ dtp->dt_proc_env[nvars - 1] = NULL;
+ nvars--;
}
}
@@ -449,17 +449,18 @@ dt_opt_setenv(dtrace_hdl_t *dtp, const char *arg, uint
if ((var = strdup(arg)) == NULL)
return (dt_set_errno(dtp, EDT_NOMEM));
- if ((p = dt_alloc(dtp, sizeof (char *) * (i + 1))) == NULL) {
+ nvars++;
+ if ((p = dt_alloc(dtp, sizeof(char *) * (nvars + 1))) == NULL) {
dt_free(dtp, var);
return (dt_set_errno(dtp, EDT_NOMEM));
}
- bcopy(dtp->dt_proc_env, p, sizeof (char *) * i);
+ bcopy(dtp->dt_proc_env, p, sizeof(char *) * nvars);
dt_free(dtp, dtp->dt_proc_env);
dtp->dt_proc_env = p;
- dtp->dt_proc_env[i - 1] = var;
- dtp->dt_proc_env[i] = NULL;
+ dtp->dt_proc_env[nvars - 1] = var;
+ dtp->dt_proc_env[nvars] = NULL;
}
return (0);
Modified: user/jeff/numa/cddl/usr.sbin/dtrace/tests/common/env/Makefile
==============================================================================
--- user/jeff/numa/cddl/usr.sbin/dtrace/tests/common/env/Makefile Fri Jan 12 23:34:16 2018 (r327901)
+++ user/jeff/numa/cddl/usr.sbin/dtrace/tests/common/env/Makefile Fri Jan 12 23:38:15 2018 (r327902)
@@ -15,6 +15,8 @@ ${PACKAGE}FILES= \
tst.setenv1.ksh.out \
tst.setenv2.ksh \
tst.setenv2.ksh.out \
+ tst.setenv3.ksh \
+ tst.setenv3.ksh.out \
tst.unsetenv1.ksh \
tst.unsetenv1.ksh.out \
tst.unsetenv2.ksh \
Modified: user/jeff/numa/cddl/usr.sbin/dtrace/tests/common/safety/Makefile
==============================================================================
--- user/jeff/numa/cddl/usr.sbin/dtrace/tests/common/safety/Makefile Fri Jan 12 23:34:16 2018 (r327901)
+++ user/jeff/numa/cddl/usr.sbin/dtrace/tests/common/safety/Makefile Fri Jan 12 23:38:15 2018 (r327902)
@@ -19,6 +19,8 @@ ${PACKAGE}FILES= \
tst.gid.d \
tst.hton.d \
tst.index.d \
+ tst.jailname.d \
+ tst.jid.d \
tst.msgdsize.d \
tst.msgsize.d \
tst.null.d \
Modified: user/jeff/numa/contrib/gcc/unwind-dw2.c
==============================================================================
--- user/jeff/numa/contrib/gcc/unwind-dw2.c Fri Jan 12 23:34:16 2018 (r327901)
+++ user/jeff/numa/contrib/gcc/unwind-dw2.c Fri Jan 12 23:38:15 2018 (r327902)
@@ -1393,16 +1393,7 @@ uw_advance_context (struct _Unwind_Context *context, _
static inline void
init_dwarf_reg_size_table (void)
{
-/*
- * ARM64TODO: http://llvm.org/pr22997
- * llvm 3.6 doesn't support __builtin_init_dwarf_reg_size_table on AArch64.
- */
-#ifdef __aarch64__
- printf("Unimplemented: init_dwarf_reg_size_table\n");
- abort();
-#else
__builtin_init_dwarf_reg_size_table (dwarf_reg_size_table);
-#endif
}
static void
Modified: user/jeff/numa/contrib/llvm/lib/Support/Unix/Memory.inc
==============================================================================
--- user/jeff/numa/contrib/llvm/lib/Support/Unix/Memory.inc Fri Jan 12 23:34:16 2018 (r327901)
+++ user/jeff/numa/contrib/llvm/lib/Support/Unix/Memory.inc Fri Jan 12 23:38:15 2018 (r327902)
@@ -27,7 +27,7 @@
#if defined(__mips__)
# if defined(__OpenBSD__)
# include <mips64/sysarch.h>
-# else
+# elif !defined(__FreeBSD__)
# include <sys/cachectl.h>
# endif
#endif
Modified: user/jeff/numa/etc/mtree/BSD.tests.dist
==============================================================================
--- user/jeff/numa/etc/mtree/BSD.tests.dist Fri Jan 12 23:34:16 2018 (r327901)
+++ user/jeff/numa/etc/mtree/BSD.tests.dist Fri Jan 12 23:38:15 2018 (r327902)
@@ -536,6 +536,8 @@
usr.bin
apply
..
+ awk
+ ..
basename
..
bmake
@@ -733,6 +735,8 @@
uuencode
..
uniq
+ ..
+ vmstat
..
xargs
..
Modified: user/jeff/numa/include/stdlib.h
==============================================================================
--- user/jeff/numa/include/stdlib.h Fri Jan 12 23:34:16 2018 (r327901)
+++ user/jeff/numa/include/stdlib.h Fri Jan 12 23:38:15 2018 (r327902)
@@ -304,7 +304,7 @@ int radixsort(const unsigned char **, int, const unsi
unsigned);
void *reallocarray(void *, size_t, size_t) __result_use_check __alloc_size(2)
__alloc_size(3);
-void *reallocf(void *, size_t) __alloc_size(2);
+void *reallocf(void *, size_t) __result_use_check __alloc_size(2);
int rpmatch(const char *);
void setprogname(const char *);
int sradixsort(const unsigned char **, int, const unsigned char *,
Modified: user/jeff/numa/lib/libcasper/services/cap_dns/cap_dns.3
==============================================================================
--- user/jeff/numa/lib/libcasper/services/cap_dns/cap_dns.3 Fri Jan 12 23:34:16 2018 (r327901)
+++ user/jeff/numa/lib/libcasper/services/cap_dns/cap_dns.3 Fri Jan 12 23:38:15 2018 (r327902)
@@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd January 8, 2018
+.Dd January 10, 2018
.Dt CAP_DNS 3
.Os
.Sh NAME
@@ -59,7 +59,7 @@ The functions
.Fn cap_gethostbyname2 ,
.Fn cep_gethostbyaddr
and
-.Xr cap_getnameinfo
+.Fn cap_getnameinfo
are respectively equivalent to
.Xr gethostbyname 2 ,
.Xr gethostbyname2 2 ,
Modified: user/jeff/numa/sbin/camcontrol/camcontrol.c
==============================================================================
--- user/jeff/numa/sbin/camcontrol/camcontrol.c Fri Jan 12 23:34:16 2018 (r327901)
+++ user/jeff/numa/sbin/camcontrol/camcontrol.c Fri Jan 12 23:38:15 2018 (r327902)
@@ -275,6 +275,12 @@ camcontrol_optret getoption(struct camcontrol_opts *ta
static int getdevlist(struct cam_device *device);
#endif /* MINIMALISTIC */
static int getdevtree(int argc, char **argv, char *combinedopt);
+static int print_dev_scsi(struct device_match_result *dev_result, char *tmpstr);
+static int print_dev_ata(struct device_match_result *dev_result, char *tmpstr);
+static int print_dev_semb(struct device_match_result *dev_result, char *tmpstr);
+static int print_dev_mmcsd(struct device_match_result *dev_result,
+ char *tmpstr);
+static int print_dev_nvme(struct device_match_result *dev_result, char *tmpstr);
#ifndef MINIMALISTIC
static int testunitready(struct cam_device *device, int task_attr,
int retry_count, int timeout, int quiet);
@@ -554,8 +560,7 @@ getdevtree(int argc, char **argv, char *combinedopt)
}
case DEV_MATCH_DEVICE: {
struct device_match_result *dev_result;
- char vendor[16], product[48], revision[16];
- char fw[5], tmpstr[256];
+ char tmpstr[256];
if (busonly == 1)
break;
@@ -572,57 +577,36 @@ getdevtree(int argc, char **argv, char *combinedopt)
skip_device = 0;
if (dev_result->protocol == PROTO_SCSI) {
- cam_strvis(vendor, dev_result->inq_data.vendor,
- sizeof(dev_result->inq_data.vendor),
- sizeof(vendor));
- cam_strvis(product,
- dev_result->inq_data.product,
- sizeof(dev_result->inq_data.product),
- sizeof(product));
- cam_strvis(revision,
- dev_result->inq_data.revision,
- sizeof(dev_result->inq_data.revision),
- sizeof(revision));
- sprintf(tmpstr, "<%s %s %s>", vendor, product,
- revision);
+ if (print_dev_scsi(dev_result,
+ &tmpstr[0]) != 0) {
+ skip_device = 1;
+ break;
+ }
} else if (dev_result->protocol == PROTO_ATA ||
dev_result->protocol == PROTO_SATAPM) {
- cam_strvis(product,
- dev_result->ident_data.model,
- sizeof(dev_result->ident_data.model),
- sizeof(product));
- cam_strvis(revision,
- dev_result->ident_data.revision,
- sizeof(dev_result->ident_data.revision),
- sizeof(revision));
- sprintf(tmpstr, "<%s %s>", product,
- revision);
- } else if (dev_result->protocol == PROTO_MMCSD) {
- if (strlen(dev_result->mmc_ident_data.model) > 0) {
- sprintf(tmpstr, "<%s>", dev_result->mmc_ident_data.model);
- } else {
- sprintf(tmpstr, "<%s card>",
- dev_result->mmc_ident_data.card_features & CARD_FEATURE_SDIO ? "SDIO" : "unknown");
+ if (print_dev_ata(dev_result,
+ &tmpstr[0]) != 0) {
+ skip_device = 1;
+ break;
}
+ } else if (dev_result->protocol == PROTO_MMCSD){
+ if (print_dev_mmcsd(dev_result,
+ &tmpstr[0]) != 0) {
+ skip_device = 1;
+ break;
+ }
} else if (dev_result->protocol == PROTO_SEMB) {
- struct sep_identify_data *sid;
-
- sid = (struct sep_identify_data *)
- &dev_result->ident_data;
- cam_strvis(vendor, sid->vendor_id,
- sizeof(sid->vendor_id),
- sizeof(vendor));
- cam_strvis(product, sid->product_id,
- sizeof(sid->product_id),
- sizeof(product));
- cam_strvis(revision, sid->product_rev,
- sizeof(sid->product_rev),
- sizeof(revision));
- cam_strvis(fw, sid->firmware_rev,
- sizeof(sid->firmware_rev),
- sizeof(fw));
- sprintf(tmpstr, "<%s %s %s %s>",
- vendor, product, revision, fw);
+ if (print_dev_semb(dev_result,
+ &tmpstr[0]) != 0) {
+ skip_device = 1;
+ break;
+ }
+ } else if (dev_result->protocol == PROTO_NVME) {
+ if (print_dev_nvme(dev_result,
+ &tmpstr[0]) != 0) {
+ skip_device = 1;
+ break;
+ }
} else {
sprintf(tmpstr, "<>");
}
@@ -676,6 +660,122 @@ getdevtree(int argc, char **argv, char *combinedopt)
close(fd);
return (error);
+}
+
+static int
+print_dev_scsi(struct device_match_result *dev_result, char *tmpstr)
+{
+ char vendor[16], product[48], revision[16];
+
+ cam_strvis(vendor, dev_result->inq_data.vendor,
+ sizeof(dev_result->inq_data.vendor), sizeof(vendor));
+ cam_strvis(product, dev_result->inq_data.product,
+ sizeof(dev_result->inq_data.product), sizeof(product));
+ cam_strvis(revision, dev_result->inq_data.revision,
+ sizeof(dev_result->inq_data.revision), sizeof(revision));
+ sprintf(tmpstr, "<%s %s %s>", vendor, product, revision);
+
+ return (0);
+}
+
+static int
+print_dev_ata(struct device_match_result *dev_result, char *tmpstr)
+{
+ char product[48], revision[16];
+
+ cam_strvis(product, dev_result->ident_data.model,
+ sizeof(dev_result->ident_data.model), sizeof(product));
+ cam_strvis(revision, dev_result->ident_data.revision,
+ sizeof(dev_result->ident_data.revision), sizeof(revision));
+ sprintf(tmpstr, "<%s %s>", product, revision);
+
+ return (0);
+}
+
+static int
+print_dev_semb(struct device_match_result *dev_result, char *tmpstr)
+{
+ struct sep_identify_data *sid;
+ char vendor[16], product[48], revision[16], fw[5];
+
+ sid = (struct sep_identify_data *)&dev_result->ident_data;
+ cam_strvis(vendor, sid->vendor_id,
+ sizeof(sid->vendor_id), sizeof(vendor));
+ cam_strvis(product, sid->product_id,
+ sizeof(sid->product_id), sizeof(product));
+ cam_strvis(revision, sid->product_rev,
+ sizeof(sid->product_rev), sizeof(revision));
+ cam_strvis(fw, sid->firmware_rev,
+ sizeof(sid->firmware_rev), sizeof(fw));
+ sprintf(tmpstr, "<%s %s %s %s>", vendor, product, revision, fw);
+
+ return (0);
+}
+
+static int
+print_dev_mmcsd(struct device_match_result *dev_result, char *tmpstr)
+{
+
+ if (strlen(dev_result->mmc_ident_data.model) > 0) {
+ sprintf(tmpstr, "<%s>", dev_result->mmc_ident_data.model);
+ } else {
+ sprintf(tmpstr, "<%s card>",
+ dev_result->mmc_ident_data.card_features &
+ CARD_FEATURE_SDIO ? "SDIO" : "unknown");
+ }
+ return (0);
+}
+
+static int
+print_dev_nvme(struct device_match_result *dev_result, char *tmpstr)
+{
+ union ccb *ccb;
+ struct ccb_dev_advinfo *advi;
+ struct cam_device *dev;
+ struct nvme_controller_data cdata;
+ char vendor[64], product[64];
+
+ dev = cam_open_btl(dev_result->path_id, dev_result->target_id,
+ dev_result->target_lun, O_RDWR, NULL);
+ if (dev == NULL) {
+ warnx("%s", cam_errbuf);
+ return (1);
+ }
+
+ ccb = cam_getccb(dev);
+ if (ccb == NULL) {
+ warnx("couldn't allocate CCB");
+ cam_close_device(dev);
+ return (1);
+ }
+
+ advi = &ccb->cdai;
+ advi->ccb_h.flags = CAM_DIR_IN;
+ advi->ccb_h.func_code = XPT_DEV_ADVINFO;
+ advi->flags = CDAI_FLAG_NONE;
+ advi->buftype = CDAI_TYPE_NVME_CNTRL;
+ advi->bufsiz = sizeof(struct nvme_controller_data);
+ advi->buf = (uint8_t *)&cdata;
+
+ if (cam_send_ccb(dev, ccb) < 0) {
+ warn("error sending CAMIOCOMMAND ioctl");
+ cam_freeccb(ccb);
+ cam_close_device(dev);
+ return(1);
+ }
+ if (advi->ccb_h.status != CAM_REQ_CMP) {
+ warnx("got CAM error %#x", advi->ccb_h.status);
+ cam_freeccb(ccb);
+ cam_close_device(dev);
+ return(1);
+ }
+ cam_strvis(vendor, cdata.mn, sizeof(cdata.mn), sizeof(vendor));
+ cam_strvis(product, cdata.fr, sizeof(cdata.fr), sizeof(product));
+ sprintf(tmpstr, "<%s %s>", vendor, product);
+
+ cam_freeccb(ccb);
+ cam_close_device(dev);
+ return (0);
}
#ifndef MINIMALISTIC
Modified: user/jeff/numa/sbin/dhclient/parse.c
==============================================================================
--- user/jeff/numa/sbin/dhclient/parse.c Fri Jan 12 23:34:16 2018 (r327901)
+++ user/jeff/numa/sbin/dhclient/parse.c Fri Jan 12 23:38:15 2018 (r327902)
@@ -45,6 +45,8 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
+#include <stdbool.h>
+
#include "dhcpd.h"
#include "dhctoken.h"
Modified: user/jeff/numa/share/man/man5/src.conf.5
==============================================================================
--- user/jeff/numa/share/man/man5/src.conf.5 Fri Jan 12 23:34:16 2018 (r327901)
+++ user/jeff/numa/share/man/man5/src.conf.5 Fri Jan 12 23:38:15 2018 (r327902)
@@ -1,6 +1,6 @@
.\" DO NOT EDIT-- this file is generated by tools/build/options/makeman.
.\" $FreeBSD$
-.Dd November 2, 2017
+.Dd January 11, 2018
.Dt SRC.CONF 5
.Os
.Sh NAME
@@ -970,12 +970,12 @@ To be able to build the system, either Binutils or LLD
enabled unless an alternate linker is provided via XLD.
.Pp
This is a default setting on
-amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm/armv7, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64.
+arm/arm, arm/armeb, arm/armv6, arm/armv7, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64.
.It Va WITH_LLD_BOOTSTRAP
Set to build the LLD linker during the bootstrap phase of the build.
.Pp
This is a default setting on
-arm64/aarch64.
+amd64/amd64, arm64/aarch64 and i386/i386.
.It Va WITHOUT_LLD_IS_LD
Set to use GNU binutils ld as the system linker, instead of LLVM's LLD.
.Pp
@@ -996,6 +996,11 @@ Set to use LLVM's libunwind stack unwinder (instead of
.Pp
This is a default setting on
amd64/amd64, arm64/aarch64, i386/i386, riscv/riscv64 and riscv/riscv64sf.
+.It Va WITH_LOADER_FIREWIRE
+Enable firewire support in /boot/loader and /boot/zfsloader on x86.
+This option is a nop on all other platforms.
+.It Va WITHOUT_LOADER_GELI
+Disable inclusion of GELI crypto support in the boot chain binaries.
.It Va WITHOUT_LOCALES
Set to not build localization files; see
.Xr locale 1 .
Modified: user/jeff/numa/share/man/man9/Makefile
==============================================================================
--- user/jeff/numa/share/man/man9/Makefile Fri Jan 12 23:34:16 2018 (r327901)
+++ user/jeff/numa/share/man/man9/Makefile Fri Jan 12 23:38:15 2018 (r327902)
@@ -1262,6 +1262,7 @@ MLINKS+=make_dev.9 destroy_dev.9 \
make_dev.9 make_dev_p.9 \
make_dev.9 make_dev_s.9
MLINKS+=malloc.9 free.9 \
+ malloc.9 mallocarray.9 \
malloc.9 MALLOC_DECLARE.9 \
malloc.9 MALLOC_DEFINE.9 \
malloc.9 realloc.9 \
Modified: user/jeff/numa/share/man/man9/malloc.9
==============================================================================
--- user/jeff/numa/share/man/man9/malloc.9 Fri Jan 12 23:34:16 2018 (r327901)
+++ user/jeff/numa/share/man/man9/malloc.9 Fri Jan 12 23:38:15 2018 (r327902)
@@ -29,7 +29,7 @@
.\" $NetBSD: malloc.9,v 1.3 1996/11/11 00:05:11 lukem Exp $
.\" $FreeBSD$
.\"
-.Dd November 19, 2015
+.Dd January 10, 2018
.Dt MALLOC 9
.Os
.Sh NAME
@@ -154,6 +154,7 @@ If the request cannot be immediately fulfilled, the cu
to sleep to wait for resources to be released by other processes.
The
.Fn malloc ,
+.Fn mallocarray ,
.Fn realloc ,
and
.Fn reallocf
@@ -162,15 +163,13 @@ functions cannot return
if
.Dv M_WAITOK
is specified.
-The
-.Fn mallocarray
-function can return
-.Dv NULL
-if the multiplication of
+If the multiplication of
.Fa nmemb
and
.Fa size
-would cause an integer overflow.
+would cause an integer overflow, the
+.Fn mallocarray
+function induces a panic.
.It Dv M_USE_RESERVE
Indicates that the system can use its reserve of memory to satisfy the
request.
Modified: user/jeff/numa/share/mk/src.opts.mk
==============================================================================
--- user/jeff/numa/share/mk/src.opts.mk Fri Jan 12 23:34:16 2018 (r327901)
+++ user/jeff/numa/share/mk/src.opts.mk Fri Jan 12 23:38:15 2018 (r327902)
@@ -253,6 +253,9 @@ __DEFAULT_NO_OPTIONS+=LLVM_LIBUNWIND
.endif
.if ${__T} == "aarch64"
__DEFAULT_YES_OPTIONS+=LLD_BOOTSTRAP LLD_IS_LD
+.elif ${__T} == "amd64" || ${__T} == "i386"
+__DEFAULT_YES_OPTIONS+=LLD_BOOTSTRAP
+__DEFAULT_NO_OPTIONS+=LLD_IS_LD
.else
__DEFAULT_NO_OPTIONS+=LLD_BOOTSTRAP LLD_IS_LD
.endif
Modified: user/jeff/numa/share/mk/src.sys.obj.mk
==============================================================================
--- user/jeff/numa/share/mk/src.sys.obj.mk Fri Jan 12 23:34:16 2018 (r327901)
+++ user/jeff/numa/share/mk/src.sys.obj.mk Fri Jan 12 23:38:15 2018 (r327902)
@@ -132,7 +132,8 @@ __objdir:= ${MAKEOBJDIR}
.if ${.MAKE.LEVEL} == 0 && \
${MK_AUTO_OBJ} == "no" && empty(.MAKEOVERRIDES:MMK_AUTO_OBJ) && \
!defined(WITHOUT_AUTO_OBJ) && !make(showconfig) && !make(print-dir) && \
- !defined(NO_OBJ)
+ !defined(NO_OBJ) && \
+ empty(RELDIR:Msys/*/compile/*)
# Find the last existing directory component and check if we can write to it.
# If the last component is a symlink then recurse on the new path.
CheckAutoObj= \
Modified: user/jeff/numa/stand/common/reloc_elf.c
==============================================================================
--- user/jeff/numa/stand/common/reloc_elf.c Fri Jan 12 23:34:16 2018 (r327901)
+++ user/jeff/numa/stand/common/reloc_elf.c Fri Jan 12 23:38:15 2018 (r327902)
@@ -115,6 +115,7 @@ __elfN(reloc)(struct elf_file *ef, symaddr_fn *symaddr
/* XXX, definitions not available on i386. */
#define R_X86_64_64 1
#define R_X86_64_RELATIVE 8
+#define R_X86_64_IRELATIVE 37
switch (rtype) {
case R_X86_64_64: /* S + A */
@@ -129,6 +130,9 @@ __elfN(reloc)(struct elf_file *ef, symaddr_fn *symaddr
val = addr;
*where = val;
break;
+ case R_X86_64_IRELATIVE:
+ /* leave it to kernel */
+ break;
default:
printf("\nunhandled relocation type %u\n", (u_int)rtype);
return (EFTYPE);
@@ -173,6 +177,7 @@ __elfN(reloc)(struct elf_file *ef, symaddr_fn *symaddr
#define R_386_32 1 /* Add symbol value. */
#define R_386_GLOB_DAT 6 /* Set GOT entry to data address. */
#define R_386_RELATIVE 8 /* Add load address of shared object. */
+#define R_386_IRELATIVE 42
switch (rtype) {
case R_386_RELATIVE:
@@ -185,6 +190,9 @@ __elfN(reloc)(struct elf_file *ef, symaddr_fn *symaddr
return (ESRCH);
val = addr + addend;
*where = val;
+ break;
+ case R_386_IRELATIVE:
+ /* leave it to kernel */
break;
default:
printf("\nunhandled relocation type %u\n", (u_int)rtype);
Modified: user/jeff/numa/stand/efi/boot1/Makefile
==============================================================================
--- user/jeff/numa/stand/efi/boot1/Makefile Fri Jan 12 23:34:16 2018 (r327901)
+++ user/jeff/numa/stand/efi/boot1/Makefile Fri Jan 12 23:38:15 2018 (r327902)
@@ -110,7 +110,7 @@ boot1.efi: ${PROG}
# The following inserts our objects into a template FAT file system
# created by generate-fat.sh
-.include "${.CURDIR}/Makefile.fat"
+.include "Makefile.fat"
boot1.efifat: boot1.efi
@set -- `ls -l ${.ALLSRC}`; \
@@ -120,7 +120,7 @@ boot1.efifat: boot1.efi
exit 1; \
fi
echo ${.OBJDIR}
- xz -d -c ${.CURDIR}/fat-${MACHINE}.tmpl.xz > ${.TARGET}
+ xz -d -c ${BOOTSRC}/efi/boot1/fat-${MACHINE}.tmpl.xz > ${.TARGET}
${DD} if=${.ALLSRC} of=${.TARGET} seek=${BOOT1_OFFSET} conv=notrunc
CLEANFILES+= boot1.efi boot1.efifat
Modified: user/jeff/numa/stand/efi/boot1/boot1.c
==============================================================================
--- user/jeff/numa/stand/efi/boot1/boot1.c Fri Jan 12 23:34:16 2018 (r327901)
+++ user/jeff/numa/stand/efi/boot1/boot1.c Fri Jan 12 23:38:15 2018 (r327902)
@@ -55,6 +55,7 @@ static EFI_GUID DevicePathGUID = DEVICE_PATH_PROTOCOL;
static EFI_GUID LoadedImageGUID = LOADED_IMAGE_PROTOCOL;
static EFI_GUID ConsoleControlGUID = EFI_CONSOLE_CONTROL_PROTOCOL_GUID;
static EFI_GUID FreeBSDBootVarGUID = FREEBSD_BOOT_VAR_GUID;
+static EFI_GUID GlobalBootVarGUID = UEFI_BOOT_VAR_GUID;
/*
* Provide Malloc / Free backed by EFIs AllocatePool / FreePool which ensures
@@ -80,6 +81,25 @@ Free(void *buf, const char *file __unused, int line __
}
static EFI_STATUS
+efi_getenv(EFI_GUID *g, const char *v, void *data, size_t *len)
+{
+ size_t ul;
+ CHAR16 *uv;
+ UINT32 attr;
+ UINTN dl;
+ EFI_STATUS rv;
+
+ utf8_to_ucs2(v, &uv, &ul);
+ if (uv == NULL)
+ return (EFI_OUT_OF_RESOURCES);
+ dl = *len;
+ rv = RS->GetVariable(uv, g, &attr, &dl, data);
+ if (rv == EFI_SUCCESS)
+ *len = dl;
+ return (rv);
+}
+
+static EFI_STATUS
efi_setenv_freebsd_wcs(const char *varname, CHAR16 *valstr)
{
CHAR16 *var = NULL;
@@ -411,6 +431,9 @@ efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE *Xsystab)
SIMPLE_TEXT_OUTPUT_INTERFACE *conout = NULL;
UINTN i, max_dim, best_mode, cols, rows, hsize, nhandles;
CHAR16 *text;
+ UINT16 boot_current;
+ size_t sz;
+ UINT16 boot_order[100];
/* Basic initialization*/
ST = Xsystab;
@@ -480,12 +503,32 @@ efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE *Xsystab)
}
}
+ boot_current = 0;
+ sz = sizeof(boot_current);
+ efi_getenv(&GlobalBootVarGUID, "BootCurrent", &boot_current, &sz);
+ printf(" BootCurrent: %04x\n", boot_current);
+
+ sz = sizeof(boot_order);
+ efi_getenv(&GlobalBootVarGUID, "BootOrder", &boot_order, &sz);
+ printf(" BootOrder:");
+ for (i = 0; i < sz / sizeof(boot_order[0]); i++)
+ printf(" %04x", boot_order[i]);
+ printf("\n");
+
+#ifdef TEST_FAILURE
+ /*
+ * For testing failover scenarios, it's nice to be able to fail fast.
+ * Define TEST_FAILURE to create a boot1.efi that always fails after
+ * reporting the boot manager protocol details.
+ */
+ BS->Exit(IH, EFI_OUT_OF_RESOURCES, 0, NULL);
+#endif
+
/* Get all the device handles */
hsize = (UINTN)NUM_HANDLES_INIT * sizeof(EFI_HANDLE);
handles = malloc(hsize);
- if (handles == NULL) {
+ if (handles == NULL)
printf("Failed to allocate %d handles\n", NUM_HANDLES_INIT);
- }
status = BS->LocateHandle(ByProtocol, &BlockIoProtocolGUID, NULL,
&hsize, handles);
Modified: user/jeff/numa/stand/efi/include/efi.h
==============================================================================
--- user/jeff/numa/stand/efi/include/efi.h Fri Jan 12 23:34:16 2018 (r327901)
+++ user/jeff/numa/stand/efi/include/efi.h Fri Jan 12 23:38:15 2018 (r327902)
@@ -59,5 +59,7 @@ Revision History
*/
#define FREEBSD_BOOT_VAR_GUID \
{ 0xCFEE69AD, 0xA0DE, 0x47A9, {0x93, 0xA8, 0xF6, 0x31, 0x06, 0xF8, 0xAE, 0x99} }
+#define UEFI_BOOT_VAR_GUID \
+ { 0x8be4df61, 0x93ca, 0x11d2, {0xaa, 0x0d, 0x00, 0xe0, 0x98, 0x03, 0x2b, 0x8c} }
#endif
Modified: user/jeff/numa/stand/libsa/net.h
==============================================================================
--- user/jeff/numa/stand/libsa/net.h Fri Jan 12 23:34:16 2018 (r327901)
+++ user/jeff/numa/stand/libsa/net.h Fri Jan 12 23:38:15 2018 (r327902)
@@ -128,6 +128,4 @@ char *inet_ntoa(struct in_addr);
char *intoa(n_long); /* similar to inet_ntoa */
n_long inet_addr(char *);
-/* Machine-dependent functions: */
-time_t getsecs(void);
#endif /* ! _STAND_NET_H */
Modified: user/jeff/numa/stand/libsa/stand.h
==============================================================================
--- user/jeff/numa/stand/libsa/stand.h Fri Jan 12 23:34:16 2018 (r327901)
+++ user/jeff/numa/stand/libsa/stand.h Fri Jan 12 23:38:15 2018 (r327902)
@@ -394,6 +394,7 @@ extern void putchar(int);
extern int devopen(struct open_file *, const char *, const char **);
extern int devclose(struct open_file *f);
extern void panic(const char *, ...) __dead2 __printflike(1, 2);
+extern time_t getsecs(void);
extern struct fs_ops *file_system[];
extern struct fs_ops *exclusive_file_system;
extern struct devsw *devsw[];
Modified: user/jeff/numa/sys/amd64/amd64/cpu_switch.S
==============================================================================
--- user/jeff/numa/sys/amd64/amd64/cpu_switch.S Fri Jan 12 23:34:16 2018 (r327901)
+++ user/jeff/numa/sys/amd64/amd64/cpu_switch.S Fri Jan 12 23:38:15 2018 (r327902)
@@ -215,7 +215,7 @@ done_tss:
movq %r8,PCPU(RSP0)
movq %r8,PCPU(CURPCB)
/* Update the TSS_RSP0 pointer for the next interrupt */
- movq %r8,COMMON_TSS_RSP0(%rdx)
+ movq %r8,TSS_RSP0(%rdx)
movq %r12,PCPU(CURTHREAD) /* into next thread */
/* Test if debug registers should be restored. */
Modified: user/jeff/numa/sys/amd64/amd64/exception.S
==============================================================================
--- user/jeff/numa/sys/amd64/amd64/exception.S Fri Jan 12 23:34:16 2018 (r327901)
+++ user/jeff/numa/sys/amd64/amd64/exception.S Fri Jan 12 23:38:15 2018 (r327902)
@@ -410,7 +410,6 @@ IDTVEC(fast_syscall)
movq %r14,TF_R14(%rsp) /* C preserved */
movq %r15,TF_R15(%rsp) /* C preserved */
movl $TF_HASSEGS,TF_FLAGS(%rsp)
- cld
FAKE_MCOUNT(TF_RIP(%rsp))
movq PCPU(CURTHREAD),%rdi
movq %rsp,TD_FRAME(%rdi)
Modified: user/jeff/numa/sys/amd64/amd64/genassym.c
==============================================================================
--- user/jeff/numa/sys/amd64/amd64/genassym.c Fri Jan 12 23:34:16 2018 (r327901)
+++ user/jeff/numa/sys/amd64/amd64/genassym.c Fri Jan 12 23:38:15 2018 (r327902)
@@ -153,7 +153,7 @@ ASSYM(PCB_FULL_IRET, PCB_FULL_IRET);
ASSYM(PCB_DBREGS, PCB_DBREGS);
ASSYM(PCB_32BIT, PCB_32BIT);
-ASSYM(COMMON_TSS_RSP0, offsetof(struct amd64tss, tss_rsp0));
+ASSYM(TSS_RSP0, offsetof(struct amd64tss, tss_rsp0));
ASSYM(TF_R15, offsetof(struct trapframe, tf_r15));
ASSYM(TF_R14, offsetof(struct trapframe, tf_r14));
Modified: user/jeff/numa/sys/amd64/amd64/machdep.c
==============================================================================
--- user/jeff/numa/sys/amd64/amd64/machdep.c Fri Jan 12 23:34:16 2018 (r327901)
+++ user/jeff/numa/sys/amd64/amd64/machdep.c Fri Jan 12 23:38:15 2018 (r327902)
@@ -1512,6 +1512,22 @@ amd64_kdb_init(void)
#endif
}
+/* Set up the fast syscall stuff */
+void
+amd64_conf_fast_syscall(void)
+{
+ uint64_t msr;
+
+ msr = rdmsr(MSR_EFER) | EFER_SCE;
+ wrmsr(MSR_EFER, msr);
*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
More information about the svn-src-user
mailing list