Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'stable/10' of github.com:pcbsd/freebsd into stable/10

  • Loading branch information...
commit dbff34bea47c6fc0362836208a898436e57b806e 2 parents d13262e + e3393d7
@kmoore134 kmoore134 authored
Showing with 3,190 additions and 1,554 deletions.
  1. +27 −1 ObsoleteFiles.inc
  2. +1 −16 UPDATING
  3. +1 −1  bin/freebsd-version/freebsd-version.sh.in
  4. +2 −0  contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h
  5. +0 −3  etc/Makefile
  6. +0 −12 etc/atf/FreeBSD.conf
  7. +0 −39 etc/atf/Makefile
  8. +0 −12 etc/atf/common.conf
  9. +2 −1  etc/defaults/rc.conf
  10. +0 −1  etc/ftpusers
  11. +0 −1  etc/group
  12. +0 −1  etc/master.passwd
  13. +0 −2  etc/mtree/BSD.root.dist
  14. +0 −10 etc/mtree/BSD.usr.dist
  15. +6 −34 etc/rc.d/initrandom
  16. +2 −3 etc/rc.d/jail
  17. +1 −1  lib/clang/clang.build.mk
  18. +1 −1  lib/libcrypt/tests/crypt_tests.c
  19. +2 −2 sbin/camcontrol/modeedit.c
  20. +1 −8 share/Makefile
  21. +0 −37 share/atf/Makefile
  22. +0 −3  share/examples/Makefile
  23. +0 −39 share/examples/atf/Makefile
  24. +24 −17 share/examples/kld/random_adaptor/random_adaptor_example.c
  25. +55 −66 share/man/man4/random.4
  26. +0 −7 share/man/man5/Makefile
  27. +5 −4 share/man/man5/rc.conf.5
  28. +0 −13 share/man/man7/Makefile
  29. +1 −1  share/misc/bsd-family-tree
  30. +0 −94 share/mk/atf.test.mk
  31. +1 −1  share/syscons/keymaps/INDEX.keymaps
  32. +0 −36 share/xml/Makefile
  33. +0 −39 share/xml/atf/Makefile
  34. +0 −36 share/xsl/Makefile
  35. +0 −30 share/xsl/Makefile.inc
  36. +0 −39 share/xsl/atf/Makefile
  37. +4 −3 sys/amd64/conf/GENERIC
  38. +3 −0  sys/arm/versatile/versatile_pci.c
  39. +11 −0 sys/boot/forth/loader.conf
  40. +5 −0 sys/conf/NOTES
  41. +5 −3 sys/conf/files
  42. +2 −2 sys/conf/files.amd64
  43. +2 −2 sys/conf/files.i386
  44. +2 −2 sys/conf/newvers.sh
  45. +6 −0 sys/conf/options
  46. +1 −1  sys/dev/ata/ata-all.c
  47. +1 −1  sys/dev/ata/ata-card.c
  48. +25 −13 sys/dev/bxe/bxe.c
  49. +11 −0 sys/dev/bxe/bxe_stats.c
  50. +7 −2 sys/dev/bxe/ecore_sp.h
  51. +1 −0  sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb.c
  52. +1 −1  sys/dev/glxsb/glxsb.c
  53. +1 −1  sys/dev/hifn/hifn7751.c
  54. +3 −0  sys/dev/hyperv/include/hyperv.h
  55. +4 −0 sys/dev/hyperv/netvsc/hv_net_vsc.h
  56. +82 −19 sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
  57. +8 −22 sys/dev/hyperv/stordisengage/hv_ata_pci_disengage.c
  58. +8 −8 sys/dev/hyperv/vmbus/hv_channel.c
  59. +45 −46 sys/dev/random/{pseudo_rng.c → dummy_rng.c}
  60. +5 −7 sys/dev/random/harvest.c
  61. +5 −0 sys/dev/random/hash.h
  62. +43 −44 sys/dev/random/ivy.c
  63. +195 −0 sys/dev/random/live_entropy_sources.c
  64. +60 −0 sys/dev/random/live_entropy_sources.h
  65. +57 −134 sys/dev/random/nehemiah.c
  66. +45 −73 sys/dev/random/random_adaptors.c
  67. +5 −3 sys/dev/random/random_adaptors.h
  68. +138 −67 sys/dev/random/random_harvestq.c
  69. +5 −4 sys/dev/random/random_harvestq.h
  70. +30 −46 sys/dev/random/randomdev.c
  71. +12 −5 sys/dev/random/randomdev.h
  72. +41 −49 sys/dev/random/randomdev_soft.c
  73. +10 −9 sys/dev/random/randomdev_soft.h
  74. +96 −0 sys/dev/random/rwfile.c
  75. +39 −0 sys/dev/random/rwfile.h
  76. +44 −16 sys/dev/random/yarrow.c
  77. +5 −0 sys/dev/random/yarrow.h
  78. +1 −1  sys/dev/rndtest/rndtest.c
  79. +1 −1  sys/dev/safe/safe.c
  80. +1 −1  sys/dev/syscons/scmouse.c
  81. +1 −1  sys/dev/syscons/syscons.c
  82. +1 −1  sys/dev/ubsec/ubsec.c
  83. +1 −1  sys/dev/vmware/vmxnet3/if_vmx.c
  84. +0 −11 sys/dev/vmware/vmxnet3/if_vmxvar.h
  85. +4 −12 sys/i386/conf/GENERIC
  86. +0 −9 sys/ia64/conf/GENERIC
  87. +3 −3 sys/kern/kern_intr.c
  88. +16 −0 sys/kern/subr_bus.c
  89. +1 −6 sys/mips/cavium/octeon_rnd.c
  90. +1 −1  sys/modules/random/Makefile
  91. +1 −1  sys/net/if_ethersubr.c
  92. +1 −1  sys/net/if_tun.c
  93. +1 −1  sys/netgraph/ng_iface.c
  94. +0 −8 sys/powerpc/conf/GENERIC
  95. +0 −8 sys/powerpc/conf/GENERIC64
  96. +0 −9 sys/sparc64/conf/GENERIC
  97. +1 −1  sys/sys/param.h
  98. +11 −3 sys/sys/random.h
  99. +0 −22 tools/build/mk/OptionalObsoleteFiles.inc
  100. +1 −5 usr.bin/atf/Makefile
  101. +0 −2  usr.bin/atf/Makefile.inc
  102. +0 −42 usr.bin/atf/atf-config/Makefile
  103. +0 −42 usr.bin/atf/atf-report/Makefile
  104. +0 −44 usr.bin/atf/atf-run/Makefile
  105. +0 −52 usr.bin/atf/atf-version/Makefile
  106. +47 −5 usr.sbin/bhyve/pci_virtio_block.c
  107. +1 −0  usr.sbin/bsdconfig/include/messages.subr
  108. +3 −2 usr.sbin/bsdconfig/share/Makefile
  109. +104 −17 usr.sbin/bsdconfig/share/device.subr
  110. +8 −7 usr.sbin/bsdconfig/share/dialog.subr
  111. +262 −0 usr.sbin/bsdconfig/share/keymap.subr
  112. +121 −0 usr.sbin/bsdconfig/share/strings.subr
  113. +17 −0 usr.sbin/bsdconfig/share/variable.subr
  114. +2 −0  usr.sbin/bsdinstall/bsdinstall
  115. +5 −1 usr.sbin/bsdinstall/bsdinstall.8
  116. +3 −3 usr.sbin/bsdinstall/scripts/Makefile
  117. +32 −7 usr.sbin/bsdinstall/scripts/auto
  118. +5 −0 usr.sbin/bsdinstall/scripts/config
  119. +3 −4 share/xml/Makefile.inc → usr.sbin/bsdinstall/scripts/entropy
  120. +2 −0  usr.sbin/bsdinstall/scripts/jail
  121. +208 −6 usr.sbin/bsdinstall/scripts/keymap
  122. +9 −3 usr.sbin/bsdinstall/scripts/netconfig
  123. +1 −0  usr.sbin/bsdinstall/scripts/script
  124. +11 −10 usr.sbin/bsdinstall/scripts/services
  125. +1,043 −0 usr.sbin/bsdinstall/scripts/zfsboot
  126. +32 −1 usr.sbin/jail/command.c
  127. +1 −0  usr.sbin/jail/config.c
  128. +15 −5 usr.sbin/jail/jail.8
  129. +2 −0  usr.sbin/jail/jail.c
  130. +1 −0  usr.sbin/jail/jailp.h
View
28 ObsoleteFiles.inc
@@ -38,8 +38,27 @@
# xargs -n1 | sort | uniq -d;
# done
+# 20131013: Removal of the ATF tools
+OLD_FILES+=etc/atf/FreeBSD.conf
+OLD_FILES+=etc/atf/atf-run.hooks
+OLD_FILES+=etc/atf/common.conf
+OLD_FILES+=usr/bin/atf-config
+OLD_FILES+=usr/bin/atf-report
+OLD_FILES+=usr/bin/atf-run
+OLD_FILES+=usr/bin/atf-version
+OLD_FILES+=usr/share/atf/atf-run.hooks
+OLD_FILES+=usr/share/examples/atf/atf-run.hooks
+OLD_FILES+=usr/share/examples/atf/tests-results.css
+OLD_FILES+=usr/share/man/man1/atf-config.1.gz
+OLD_FILES+=usr/share/man/man1/atf-report.1.gz
+OLD_FILES+=usr/share/man/man1/atf-run.1.gz
+OLD_FILES+=usr/share/man/man1/atf-version.1.gz
+OLD_FILES+=usr/share/man/man5/atf-formats.5.gz
+OLD_FILES+=usr/share/man/man7/atf.7.gz
+OLD_FILES+=usr/share/xml/atf/tests-results.dtd
+OLD_FILES+=usr/share/xsl/atf/tests-results.xsl
# 20131009: freebsd-version moved from /libexec to /bin
-OLD_FILES+=/libexec/freebsd-version
+OLD_FILES+=libexec/freebsd-version
# 20131001: ar and ranlib from binutils not used
OLD_FILES+=usr/bin/gnu-ar
OLD_FILES+=usr/bin/gnu-ranlib
@@ -6093,6 +6112,13 @@ OLD_LIBS+=usr/lib/libkse.so.1
OLD_LIBS+=usr/lib/liblwres.so.3
OLD_LIBS+=usr/lib/pam_ftp.so.2
+# 20131013: Removal of the ATF tools
+OLD_DIRS+=etc/atf
+OLD_DIRS+=usr/share/examples/atf
+OLD_DIRS+=usr/share/xml/atf
+OLD_DIRS+=usr/share/xml
+OLD_DIRS+=usr/share/xsl/atf
+OLD_DIRS+=usr/share/xsl
# 20040925: bind9 import
OLD_DIRS+=usr/share/doc/bind/html
OLD_DIRS+=usr/share/doc/bind/misc
View
17 UPDATING
@@ -13,24 +13,9 @@ Items affecting the ports and packages system can be found in
NOTE: FreeBSD has switched from gcc to clang. If you have trouble bootstrapping
from older versions of FreeBSD, try WITHOUT_CLANG to bootstrap to the tip of
-head, and then rebuild without this option. The bootstrap process from
+stable/10, and then rebuild without this option. The bootstrap process from
older version of current is a bit fragile.
-NOTE TO PEOPLE WHO THINK THAT FreeBSD 11.x IS SLOW:
- FreeBSD 11.x has many debugging features turned on, in both the kernel
- and userland. These features attempt to detect incorrect use of
- system primitives, and encourage loud failure through extra sanity
- checking and fail stop semantics. They also substantially impact
- system performance. If you want to do performance measurement,
- benchmarking, and optimization, you'll want to turn them off. This
- includes various WITNESS- related kernel options, INVARIANTS, malloc
- debugging flags in userland, and various verbose features in the
- kernel. Many developers choose to disable these features on build
- machines to maximize performance. (To completely disable malloc
- debugging, define MALLOC_PRODUCTION in /etc/make.conf, or to merely
- disable the most expensive debugging functionality run
- "ln -s 'abort:false,junk:false' /etc/malloc.conf".)
-
20131010:
The rc.d/jail script has been updated to support jail(8)
configuration file. The "jail_<jname>_*" rc.conf(5) variables
View
2  bin/freebsd-version/freebsd-version.sh.in
@@ -81,7 +81,7 @@ userland_version() {
# Print a usage string and exit.
#
usage() {
- echo "usage: $progname [-ku]\n" >&2
+ echo "usage: $progname [-ku]" >&2
exit 1
}
View
2  contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h
@@ -4,6 +4,8 @@
#undef JEMALLOC_OVERRIDE_VALLOC
+#define MALLOC_PRODUCTION
+
#ifndef MALLOC_PRODUCTION
#define JEMALLOC_DEBUG
#endif
View
3  etc/Makefile
@@ -218,9 +218,6 @@ distribution:
echo "./etc/spwd.db type=file mode=0600 uname=root gname=wheel"; \
) | ${METALOG.add}
.endif
-.if ${MK_ATF} != "no"
- ${_+_}cd ${.CURDIR}/atf; ${MAKE} install
-.endif
.if ${MK_BLUETOOTH} != "no"
${_+_}cd ${.CURDIR}/bluetooth; ${MAKE} install
.endif
View
12 etc/atf/FreeBSD.conf
@@ -1,12 +0,0 @@
-Content-Type: application/X-atf-config; version="1"
-
-# $FreeBSD$
-#
-# Configuration file for the FreeBSD test suite.
-#
-# See atf-formats(5) for details on the syntax of this file and tests(7) for
-# details on the FreeBSD test suite.
-#
-
-#variable1 = value1
-#variable2 = value2
View
39 etc/atf/Makefile
@@ -1,39 +0,0 @@
-#-
-# Copyright (c) 2011 Google, Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
-#
-# $FreeBSD$
-
-ATF= ${.CURDIR}/../../contrib/atf
-
-.PATH: ${ATF}/atf-run/sample
-
-NO_OBJ=
-
-FILESGROUPS= ETC
-
-ETCDIR= /etc/atf
-ETC= FreeBSD.conf atf-run.hooks common.conf
-
-.include <bsd.prog.mk>
View
12 etc/atf/common.conf
@@ -1,12 +0,0 @@
-Content-Type: application/X-atf-config; version="1"
-
-# $FreeBSD$
-#
-# Sample configuration file for properties affecting all test suites.
-#
-
-# When running the test suite as root, some tests require to switch to
-# an unprivileged user to perform extra checks. Set this variable to
-# the user you want to use in those cases. If not set, those tests will
-# be skipped.
-unprivileged-user = "_atf"
View
3  etc/defaults/rc.conf
@@ -604,7 +604,7 @@ lpd_flags="" # Flags to lpd (if enabled).
nscd_enable="NO" # Run the nsswitch caching daemon.
chkprintcap_enable="NO" # Run chkprintcap(8) before running lpd.
chkprintcap_flags="-d" # Create missing directories by default.
-dumpdev="AUTO" # Device to crashdump to (device name, AUTO, or NO).
+dumpdev="NO" # Device to crashdump to (device name, AUTO, or NO).
dumpdir="/var/crash" # Directory where crash dumps are to be stored
savecore_flags="-m 10" # Used if dumpdev is enabled above, and present.
# By default, only the 10 most recent kernel dumps
@@ -651,6 +651,7 @@ entropy_save_num="8" # Number of entropy cache files to save.
harvest_interrupt="YES" # Entropy device harvests interrupt randomness
harvest_ethernet="YES" # Entropy device harvests ethernet randomness
harvest_p_to_p="YES" # Entropy device harvests point-to-point randomness
+harvest_swi="YES" # Entropy device harvests internal SWI randomness
dmesg_enable="YES" # Save dmesg(8) to /var/run/dmesg.boot
watchdogd_enable="NO" # Start the software watchdog daemon
watchdogd_flags="" # Flags to watchdogd (if enabled)
View
1  etc/ftpusers
@@ -15,7 +15,6 @@ man
sshd
smmsp
mailnull
-_atf
bind
unbound
proxy
View
1  etc/group
@@ -16,7 +16,6 @@ staff:*:20:
sshd:*:22:
smmsp:*:25:
mailnull:*:26:
-_atf:*:27:
guest:*:31:
bind:*:53:
unbound:*:59:
View
1  etc/master.passwd
@@ -13,7 +13,6 @@ man:*:9:9::0:0:Mister Man Pages:/usr/share/man:/usr/sbin/nologin
sshd:*:22:22::0:0:Secure Shell Daemon:/var/empty:/usr/sbin/nologin
smmsp:*:25:25::0:0:Sendmail Submission User:/var/spool/clientmqueue:/usr/sbin/nologin
mailnull:*:26:26::0:0:Sendmail Default User:/var/spool/mqueue:/usr/sbin/nologin
-_atf:*:27:27::0:0:& pseudo-user:/nonexistent:/usr/sbin/nologin
bind:*:53:53::0:0:Bind Sandbox:/:/usr/sbin/nologin
unbound:*:59:59::0:0:Unbound DNS Resolver:/var/unbound:/usr/sbin/nologin
proxy:*:62:62::0:0:Packet Filter pseudo-user:/nonexistent:/usr/sbin/nologin
View
2  etc/mtree/BSD.root.dist
@@ -24,8 +24,6 @@
etc
X11
..
- atf
- ..
bluetooth
..
defaults
View
10 etc/mtree/BSD.usr.dist
@@ -299,8 +299,6 @@
..
IPv6
..
- atf
- ..
bhyve
..
bootforth
@@ -1410,14 +1408,6 @@
catalog
..
..
- xml
- atf
- ..
- ..
- xsl
- atf
- ..
- ..
zoneinfo
Africa
..
View
40 etc/rc.d/initrandom
@@ -14,26 +14,6 @@ name="initrandom"
start_cmd="initrandom_start"
stop_cmd=":"
-feed_dev_random()
-{
- if [ -f "${1}" -a -r "${1}" -a -s "${1}" ]; then
- cat "${1}" | dd of=/dev/random bs=8k 2>/dev/null
- fi
-}
-
-better_than_nothing()
-{
- # XXX temporary until we can improve the entropy
- # harvesting rate.
- # Entropy below is not great, but better than nothing.
- # This unblocks the generator at startup
- # Note: commands are ordered to cause the most variance across reboots.
- ( kenv; dmesg; df -ib; ps -fauxww; date; sysctl -a ) \
- | dd of=/dev/random bs=8k 2>/dev/null
- /sbin/sha256 -q `sysctl -n kern.bootfile` \
- | dd of=/dev/random bs=8k 2>/dev/null
-}
-
initrandom_start()
{
soft_random_generator=`sysctl kern.random 2>/dev/null`
@@ -63,23 +43,15 @@ initrandom_start()
else
${SYSCTL} kern.random.sys.harvest.point_to_point=0 >/dev/null
fi
- fi
- # First pass at reseeding /dev/random.
- #
- case ${entropy_file} in
- [Nn][Oo] | '')
- ;;
- *)
- if [ -w /dev/random ]; then
- feed_dev_random "${entropy_file}"
+ if checkyesno harvest_swi; then
+ ${SYSCTL} kern.random.sys.harvest.swi=1 >/dev/null
+ echo -n ' swi'
+ else
+ ${SYSCTL} kern.random.sys.harvest.swi=0 >/dev/null
fi
- ;;
- esac
-
- better_than_nothing
+ fi
- echo -n ' kickstart'
fi
echo '.'
View
5 etc/rc.d/jail
@@ -226,8 +226,7 @@ parse_options()
eval : \${jail_${_j}_fdescfs_enable:=${jail_fdescfs_enable:-NO}}
if checkyesno jail_${_j}_fdescfs_enable; then
- echo " mount += " \
- "\"fdescfs ${_rootdir%/}/dev/fd fdescfs rw 0 0\";"
+ echo " mount.fdescfs;"
fi
eval : \${jail_${_j}_procfs_enable:=${jail_procfs_enable:-NO}}
if checkyesno jail_${_j}_procfs_enable; then
@@ -438,7 +437,7 @@ jail_start()
echo -n " ${_hostname:-${_jail}}"
else
echo " cannot start jail \"${_hostname:-${jail}}\": "
- tail +2 $_tmp
+ cat $_tmp
fi
rm -f $_tmp
done
View
2  lib/clang/clang.build.mk
@@ -6,7 +6,7 @@ CFLAGS+= -I${LLVM_SRCS}/include -I${CLANG_SRCS}/include \
-I${LLVM_SRCS}/${SRCDIR} ${INCDIR:C/^/-I${LLVM_SRCS}\//} -I. \
-I${LLVM_SRCS}/../../lib/clang/include \
-DLLVM_ON_UNIX -DLLVM_ON_FREEBSD \
- -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS #-DNDEBUG
+ -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -DNDEBUG
.if !defined(EARLY_BUILD) && defined(MK_CLANG_FULL) && ${MK_CLANG_FULL} != "no"
CFLAGS+= -DCLANG_ENABLE_ARCMT \
View
2  lib/libcrypt/tests/crypt_tests.c
@@ -43,7 +43,7 @@ ATF_TC_BODY(invalid, tc)
/*
* This function must not do anything except enumerate
- * the test cases, else atf-run is likely to be upset.
+ * the test cases, per atf-c-api(3).
*/
ATF_TP_ADD_TCS(tp)
{
View
4 sbin/camcontrol/modeedit.c
@@ -886,12 +886,12 @@ mode_list(struct cam_device *device, int page_control, int dbd,
timeout, data, sizeof(data));
mh = (struct scsi_mode_header_6 *)data;
- len = mh->blk_desc_len; /* Skip block descriptors. */
+ len = sizeof(*mh) + mh->blk_desc_len; /* Skip block descriptors. */
/* Iterate through the pages in the reply. */
while (len < mh->data_length) {
/* Locate the next mode page header. */
mph = (struct scsi_mode_page_header *)
- ((intptr_t)mh + sizeof(*mh) + len);
+ ((intptr_t)mh + len);
mph->page_code &= SMS_PAGE_CODE;
nameentry = nameentry_lookup(mph->page_code);
View
9 share/Makefile
@@ -5,8 +5,7 @@
# Do not include `info' in the SUBDIR list, it is handled separately.
-SUBDIR= ${_atf} \
- ${_colldef} \
+SUBDIR= ${_colldef} \
${_dict} \
${_doc} \
dtrace \
@@ -27,16 +26,10 @@ SUBDIR= ${_atf} \
tabset \
termcap \
${_timedef} \
- xml \
- xsl \
${_zoneinfo}
# NB: keep these sorted by MK_* knobs
-.if ${MK_ATF} != "no"
-_atf= atf
-.endif
-
.if ${MK_BSNMP} != "no"
_snmp= snmp
.endif
View
37 share/atf/Makefile
@@ -1,37 +0,0 @@
-#-
-# Copyright (c) 2012 EMC Corporation.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
-#
-# $FreeBSD$
-
-ATF= ${.CURDIR}/../../contrib/atf
-
-.PATH: ${ATF}/atf-run/sample
-
-NO_OBJ=
-
-FILESDIR= ${SHAREDIR}/atf
-FILES= atf-run.hooks
-
-.include <bsd.prog.mk>
View
3  share/examples/Makefile
@@ -241,9 +241,6 @@ etc-examples:
.if ${SHARED} != "symlinks"
SUBDIR= smbfs
-.if ${MK_ATF} != "no"
-SUBDIR+=atf
-.endif
.if ${MK_IPFILTER} != "no"
SUBDIR+=ipfilter
.endif
View
39 share/examples/atf/Makefile
@@ -1,39 +0,0 @@
-#-
-# Copyright (c) 2011 Google, Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
-#
-# $FreeBSD$
-
-ATF= ${.CURDIR}/../../../contrib/atf
-
-.PATH: ${ATF}/atf-report
-.PATH: ${ATF}/atf-run/sample
-
-NO_OBJ=
-
-FILESDIR= ${SHAREDIR}/examples/atf
-FILES= atf-run.hooks \
- tests-results.css
-
-.include <bsd.prog.mk>
View
41 share/examples/kld/random_adaptor/random_adaptor_example.c
@@ -30,32 +30,29 @@ __FBSDID("$FreeBSD$");
#include <sys/param.h>
#include <sys/kernel.h>
+#include <sys/lock.h>
#include <sys/module.h>
-#include <sys/selinfo.h>
+#include <sys/random.h>
#include <sys/systm.h>
+#include <dev/random/live_entropy_sources.h>
#include <dev/random/random_adaptors.h>
#include <dev/random/randomdev.h>
-#define RNG_NAME "example"
-
static int random_example_read(void *, int);
struct random_adaptor random_example = {
.ident = "Example RNG",
- .init = (random_init_func_t *)random_null_func,
- .deinit = (random_deinit_func_t *)random_null_func,
+ .source = RANDOM_PURE_BOGUS, /* Make sure this is in
+ * sys/random.h and is unique */
.read = random_example_read,
- .write = (random_write_func_t *)random_null_func,
- .reseed = (random_reseed_func_t *)random_null_func,
- .seeded = 1,
};
/*
* Used under the license provided @ http://xkcd.com/221/
* http://creativecommons.org/licenses/by-nc/2.5/
*/
-static u_char
+static uint8_t
getRandomNumber(void)
{
return 4; /* chosen by fair dice roll, guaranteed to be random */
@@ -64,14 +61,13 @@ getRandomNumber(void)
static int
random_example_read(void *buf, int c)
{
- u_char *b;
+ uint8_t *b;
int count;
b = buf;
- for (count = 0; count < c; count++) {
+ for (count = 0; count < c; count++)
b[count] = getRandomNumber();
- }
printf("returning %d bytes of pure randomness\n", c);
return (c);
@@ -80,15 +76,26 @@ random_example_read(void *buf, int c)
static int
random_example_modevent(module_t mod, int type, void *unused)
{
+ int error = 0;
switch (type) {
case MOD_LOAD:
- random_adaptor_register(RNG_NAME, &random_example);
- EVENTHANDLER_INVOKE(random_adaptor_attach, &random_example);
- return (0);
+ live_entropy_source_register(&random_example);
+ break;
+
+ case MOD_UNLOAD:
+ live_entropy_source_deregister(&random_example);
+ break;
+
+ case MOD_SHUTDOWN:
+ break;
+
+ default:
+ error = EOPNOTSUPP;
+ break;
}
- return (EINVAL);
+ return (error);
}
-RANDOM_ADAPTOR_MODULE(random_example, random_example_modevent, 1);
+LIVE_ENTROPY_SRC_MODULE(live_entropy_source_example, random_example_modevent, 1);
View
121 share/man/man4/random.4
@@ -1,4 +1,4 @@
-.\" Copyright (c) 2001 Mark R V Murray. All rights reserved.
+.\" Copyright (c) 2001-2013 Mark R V Murray. All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
@@ -23,7 +23,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd August 7, 2013
+.Dd October 12, 2013
.Dt RANDOM 4
.Os
.Sh NAME
@@ -43,35 +43,48 @@ The device will probe for
certain hardware entropy sources,
and use these in preference to the fallback,
which is a generator implemented in software.
-If the kernel environment MIB's
-.Va hw.nehemiah_rng_enable
-or
-.Va hw.ivy_rng_enable
-are set to
-.Dq Li 0 ,
-the associated hardware entropy source will be ignored.
.Pp
-If the device is using
-the software generator,
-writing data to
-.Nm
-would perturb the internal state.
-This perturbation of the internal state
-is the only userland method of introducing
-extra entropy into the device.
-If the writer has superuser privilege,
-then closing the device after writing
-will make the software generator reseed itself.
-This can be used for extra security,
-as it immediately introduces any/all new entropy
-into the PRNG.
-The hardware generators will generate
-sufficient quantities of entropy,
-and will therefore ignore user-supplied input.
-The software
+The software generator will start in an
+.Em unseeded
+state, and will block reads until
+it is (re)seeded.
+This may cause trouble at system boot
+when keys and the like
+are generated from
+/dev/random
+so steps should be taken to ensure a
+reseed as soon as possible.
+The
+.Xr sysctl 8
+controlling the
+.Em seeded
+status (see below) may be used
+if security is not an issue
+or for convenience
+during setup or development.
+.Pp
+This initial seeding
+of random number generators
+is a bootstrapping problem
+that needs very careful attention.
+In some cases,
+it may be difficult
+to find enough randomness
+to seed a random number generator
+until a system is fully operational,
+but the system requires random numbers
+to become fully operational.
+It is (or more accurately should be)
+critically important that the
.Nm
-device may be controlled with
-.Xr sysctl 8 .
+device is seeded
+before the first time it is used.
+In the case where a dummy or "blocking-only"
+device is used,
+it is the responsibility
+of the system architect
+to ensure that no blocking reads
+hold up critical processes.
.Pp
To see the current settings of the software
.Nm
@@ -81,22 +94,20 @@ device, use the command line:
.Pp
which results in something like:
.Bd -literal -offset indent
-kern.random.adaptors: yarrow
+kern.random.adaptors: yarrow,dummy
+kern.random.active_adaptor: yarrow
+kern.random.yarrow.gengateinterval: 10
+kern.random.yarrow.bins: 10
+kern.random.yarrow.fastthresh: 96
+kern.random.yarrow.slowthresh: 128
+kern.random.yarrow.slowoverthresh: 2
kern.random.sys.seeded: 1
kern.random.sys.harvest.ethernet: 1
kern.random.sys.harvest.point_to_point: 1
kern.random.sys.harvest.interrupt: 1
-kern.random.sys.harvest.swi: 0
-kern.random.yarrow.gengateinterval: 10
-kern.random.yarrow.bins: 10
-kern.random.yarrow.fastthresh: 192
-kern.random.yarrow.slowthresh: 256
-kern.random.yarrow.slowoverthresh: 2
+kern.random.sys.harvest.swi: 1
.Ed
.Pp
-(These would not be seen if a
-hardware generator is present.)
-.Pp
Other than
.Dl kern.random.adaptors
all settings are read/write.
@@ -107,9 +118,10 @@ variable indicates whether or not the
.Nm
device is in an acceptably secure state
as a result of reseeding.
-If set to 0, the device will block (on read) until the next reseed
-(which can be from an explicit write,
-or as a result of entropy harvesting).
+If set to 0,
+the device will block (on read)
+until the next reseed
+as a result of entropy harvesting.
A reseed will set the value to 1 (non-blocking).
.Pp
The
@@ -276,19 +288,6 @@ the generator produce independent sequences.
However, the guessability or reproducibility of the sequence is unimportant,
unlike the previous cases.
.Pp
-One final consideration for the seeding of random number generators
-is a bootstrapping problem.
-In some cases, it may be difficult to find enough randomness to
-seed a random number generator until a system is fully operational,
-but the system requires random numbers to become fully operational.
-There is no substitute for careful thought here,
-but the
-.Fx
-.Nm
-device,
-which is based on the Yarrow system,
-should be of some help in this area.
-.Pp
.Fx
does also provide the traditional
.Xr rand 3
@@ -325,17 +324,7 @@ and is an implementation of the
.Em Yarrow
algorithm by Bruce Schneier,
.Em et al .
-The only hardware implementations
-currently are for the
-.Tn VIA C3 Nehemiah
-(stepping 3 or greater)
-CPU
-and the
-.Tn Intel
-.Dq Bull Mountain
-.Em RdRand
-instruction and underlying random number generator (RNG).
-More will be added in the future.
+Significant infrastructure work was done by Arthur Mesh.
.Pp
The author gratefully acknowledges
significant assistance from VIA Technologies, Inc.
View
7 share/man/man5/Makefile
@@ -6,7 +6,6 @@
#MISSING: dump.5 plot.5
MAN= acct.5 \
ar.5 \
- ${_atf_formats.5} \
a.out.5 \
bluetooth.device.conf.5 \
bluetooth.hosts.5 \
@@ -80,12 +79,6 @@ MLINKS+=quota.user.5 quota.group.5
MLINKS+=rc.conf.5 rc.conf.local.5
MLINKS+=resolver.5 resolv.conf.5
-.if ${MK_ATF} != "no"
-ATF= ${.CURDIR}/../../../contrib/atf
-.PATH: ${ATF}/doc
-_atf_formats.5= atf-formats.5
-.endif
-
.if ${MK_FREEBSD_UPDATE} != "no"
MAN+= freebsd-update.conf.5
.endif
View
9 share/man/man5/rc.conf.5
@@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd October 10, 2013
+.Dd October 12, 2013
.Dt RC.CONF 5
.Os
.Sh NAME
@@ -3992,9 +3992,7 @@ set from
.Va jail_ Ns Ao Ar jname Ac Ns Va _fstab
.It Li mount
set from
-.Va jail_ Ns Ao Ar jname Ac Ns Va _fdescfs_enable
-or
-.Va jail_ Ns Ao Ar jname Ac Ns Va _procfs_enable.
+.Va jail_ Ns Ao Ar jname Ac Ns Va _procfs_enable .
.It Li exec.fib
set from
.Va jail_ Ns Ao Ar jname Ac Ns Va _fib
@@ -4042,6 +4040,9 @@ set from
.Va jail_ Ns Ao Ar jname Ac Ns Va _devfs_ruleset .
This must be an integer,
not a string.
+.It Li mount.fdescfs
+set from
+.Va jail_ Ns Ao Ar jname Ac Ns Va _fdescfs_enable
.It Li allow.set_hostname
set from
.Va jail_ Ns Ao Ar jname Ac Ns Va _set_hostname_allow
View
13 share/man/man7/Makefile
@@ -36,17 +36,4 @@ MLINKS+= c99.7 c78.7
MLINKS+= c99.7 c89.7
MLINKS+= c99.7 c90.7
-.if ${MK_ATF} != "no"
-ATF= ${.CURDIR}/../../../contrib/atf
-.PATH: ${ATF}/doc
-MAN+= atf.7
-
-CLEANFILES+= atf.7 atf.7.tmp
-atf.7: atf.7.in
- sed -e 's,__DOCDIR__,${DOCDIR}/atf,g' \
- -e 's,__TESTSDIR__,${TESTSBASE},g' \
- < ${.ALLSRC} > ${.TARGET}.tmp
- mv ${.TARGET}.tmp ${.TARGET}
-.endif
-
.include <bsd.prog.mk>
View
2  share/misc/bsd-family-tree
@@ -275,7 +275,7 @@ FreeBSD 5.2 | | | |
| | | | | | 6.0.2 | |
| | | | | | | OpenBSD 5.3 DragonFly 3.4.1
| | | | | | NetBSD | |
- | | | | | | 6.0.2 | |
+ | | | | | | 6.0.3 | |
| | | | | | | |
| | | | | |`-NetBSD 6.1 | |
| | FreeBSD | | | | |
View
94 share/mk/atf.test.mk
@@ -51,98 +51,4 @@ ${_T}: ${TESTS_SH_SRC_${_T}}
.endfor
.endif
-ATFFILE?= auto
-
-.if ${ATFFILE:tl} != "no"
-FILES+= Atffile
-FILESDIR_Atffile= ${TESTSDIR}
-
-.if ${ATFFILE:tl} == "auto"
-CLEANFILES+= Atffile Atffile.tmp
-
-Atffile: Makefile
- @{ echo 'Content-Type: application/X-atf-atffile; version="1"'; \
- echo; \
- echo '# Automatically generated by atf-test.mk.'; \
- echo; \
- echo 'prop: test-suite = "'`uname -o`'"'; \
- echo; \
- for tp in ${ATF_TESTS}; do \
- echo "tp: $${tp}"; \
- done; } >Atffile.tmp
- @mv Atffile.tmp Atffile
-.endif
-.endif
-
-# Generate support variables for atf-test.
-#
-# atf-test can only work for native builds, i.e. a build host of a particular
-# OS building a release for the same OS version and architecture. The target
-# runs ATF, which is on the build host, and the tests execute code built for
-# the target host.
-#
-# Due to the dependencies of the binaries built by the source tree and how they
-# are used by tests, it is highly possible for a execution of "make test" to
-# report bogus results unless the new binaries are put in place.
-
-# XXX (gcooper): Executing ATF from outside the source tree is improper; it
-# should be built as part of the OS toolchain build for the host OS and
-# executed from there.
-ATF_PATH+= ${DESTDIR}/bin ${DESTDIR}/sbin ${DESTDIR}/usr/bin ${DESTDIR}/usr/sbin
-TESTS_ENV+= PATH=${ATF_PATH:ts:}:${PATH}
-
-ATF_BUILD_CC?= ${DESTDIR}/usr/bin/cc
-ATF_BUILD_CPP?= ${DESTDIR}/usr/bin/cpp
-ATF_BUILD_CXX?= ${DESTDIR}/usr/bin/c++
-ATF_CONFDIR?= ${DESTDIR}/etc
-ATF_INCLUDEDIR?= ${DESTDIR}/usr/include
-ATF_LIBDIR?= ${DESTDIR}/usr/lib
-ATF_LIBEXECDIR?= ${DESTDIR}/usr/libexec
-ATF_PKGDATADIR?= ${DESTDIR}/usr/share/atf
-ATF_SHELL?= ${DESTDIR}/bin/sh
-LD_LIBRARY_PATH?= ${TESTS_LD_LIBRARY_PATH:tW:S/ /:/g}
-
-ATF_ENV_VARS= \
- ATF_BUILD_CC \
- ATF_BUILD_CPP \
- ATF_BUILD_CXX \
- ATF_CONFDIR \
- ATF_INCLUDEDIR \
- ATF_LIBDIR \
- ATF_LIBEXECDIR \
- ATF_PKGDATADIR \
- ATF_SHELL \
-
-.for v in ${ATF_ENV_VARS}
-.if !empty($v)
-TESTS_ENV+= $v=${$v}
-.endif
-.endfor
-
-_TESTS_FIFO= ${.OBJDIR}/atf-run.fifo
-_TESTS_LOG= ${.OBJDIR}/atf-run.log
-CLEANFILES+= ${_TESTS_FIFO} ${_TESTS_LOG}
-
-ATF_BIN?= ${DESTDIR}/usr/bin
-ATF_REPORT?= ${ATF_BIN}/atf-report
-ATF_RUN?= ${ATF_BIN}/atf-run
-
-.PHONY: realtest
-realtest:
-.if defined(TESTSDIR)
- @set -e; \
- cd ${DESTDIR}${TESTSDIR}; \
- rm -f ${_TESTS_FIFO}; \
- mkfifo ${_TESTS_FIFO}; \
- tee ${_TESTS_LOG} < ${_TESTS_FIFO} | ${TESTS_ENV} ${ATF_REPORT} & \
- set +e; \
- ${TESTS_ENV} ${ATF_RUN} >> ${_TESTS_FIFO}; \
- result=$${?}; \
- wait; \
- rm -f ${_TESTS_FIFO}; \
- echo; \
- echo "*** The verbatim output of atf-run has been saved to ${_TESTS_LOG}"; \
- exit $${result}
-.endif
-
.include <bsd.test.mk>
View
2  share/syscons/keymaps/INDEX.keymaps
@@ -117,7 +117,7 @@ danish.cp865.kbd:fr:Danois Code page 865
danish.cp865.kbd:pt:Dinamarqu�s Codepage 865
danish.cp865.kbd:es:Dan�s Codepage 865
-danish.iso.macbook.kbd:Danish ISO-8859-1 (macbook)
+danish.iso.macbook.kbd:da:Danish ISO-8859-1 (macbook)
dutch.iso.acc.kbd:en:Dutch ISO keymap (accent keys)
View
36 share/xml/Makefile
@@ -1,36 +0,0 @@
-#-
-# Copyright (c) 2012 EMC Corporation.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
-#
-# $FreeBSD$
-
-.include <bsd.own.mk>
-
-SUBDIR+= ${_atf}
-
-.if ${MK_ATF} != "no"
-_atf= atf
-.endif
-
-.include <bsd.subdir.mk>
View
39 share/xml/atf/Makefile
@@ -1,39 +0,0 @@
-#-
-# Copyright (c) 2011 Google, Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
-#
-# $FreeBSD$
-
-ATF= ${.CURDIR}/../../../contrib/atf
-
-.PATH: ${ATF}/atf-report
-
-NO_OBJ=
-
-FILESGROUPS= XML
-
-XMLDIR= ${SHAREDIR}/xml/atf
-XML= tests-results.dtd
-
-.include <bsd.prog.mk>
View
36 share/xsl/Makefile
@@ -1,36 +0,0 @@
-#-
-# Copyright (c) 2012 EMC Corporation.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
-#
-# $FreeBSD$
-
-.include <bsd.own.mk>
-
-SUBDIR+= ${_atf}
-
-.if ${MK_ATF} != "no"
-_atf= atf
-.endif
-
-.include <bsd.subdir.mk>
View
30 share/xsl/Makefile.inc
@@ -1,30 +0,0 @@
-#-
-# Copyright (c) 2012 EMC Corporation.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
-#
-# $FreeBSD$
-
-BINDIR?= ${SHAREDIR}/xsl
-
-# vim: syntax=make
View
39 share/xsl/atf/Makefile
@@ -1,39 +0,0 @@
-#-
-# Copyright (c) 2011 Google, Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
-#
-# $FreeBSD$
-
-ATF= ${.CURDIR}/../../../contrib/atf
-
-.PATH: ${ATF}/atf-report
-
-NO_OBJ=
-
-FILESGROUPS= XSL
-
-XSLDIR= ${SHAREDIR}/xsl/atf
-XSL= tests-results.xsl
-
-.include <bsd.prog.mk>
View
7 sys/amd64/conf/GENERIC
@@ -73,7 +73,6 @@ options KDTRACE_HOOKS # Kernel DTrace hooks
options DDB_CTF # Kernel ELF linker loads CTF data
options DDB # Support DDB.
options INCLUDE_CONFIG_FILE # Include this file in kernel
-options XENHVM # Include Xen support
# Debugging support. Always need this:
options KDB # Enable kernel debugger support.
@@ -337,8 +336,10 @@ device virtio_balloon # VirtIO Memory Balloon device
# HyperV drivers
device hyperv # HyperV drivers
-# Xen support
-device xenpci # Generic Xen bus
+# Xen HVM Guest Optimizations
+# NOTE: XENHVM depends on xenpci. They must be added or removed together.
+options XENHVM # Xen HVM kernel infrastructure
+device xenpci # Xen HVM Hypervisor services driver
# VMware support
device vmx # VMware VMXNET3 Ethernet
View
3  sys/arm/versatile/versatile_pci.c
@@ -360,6 +360,9 @@ versatile_pci_activate_resource(device_t bus, device_t child, int type, int rid,
res = (BUS_ACTIVATE_RESOURCE(device_get_parent(bus),
child, type, rid, r));
break;
+ default:
+ res = ENXIO;
+ break;
}
return (res);
View
11 sys/boot/forth/loader.conf
@@ -39,6 +39,17 @@ bitmap_type="splash_image_data" # and place it on the module_path
##############################################################
+### Random number generator configuration ###################
+##############################################################
+
+entropy_cache_load="NO" # Set this to YES to load entropy at boot time
+entropy_cache_name="/boot/entropy" # Set this to the name of the file
+entropy_cache_type="/boot/entropy"
+#kern.random.sys.seeded="0" # Set this to 1 to start /dev/random
+ # without waiting for a (re)seed.
+
+
+##############################################################
### Loader settings ########################################
##############################################################
View
5 sys/conf/NOTES
@@ -2962,3 +2962,8 @@ options RCTL
options BROOKTREE_ALLOC_PAGES=(217*4+1)
options MAXFILES=999
+# Random number generator
+options RANDOM_YARROW # Yarrow RNG
+##options RANDOM_FORTUNA # Fortuna RNG - not yet implemented
+options RANDOM_DEBUG # Debugging messages
+options RANDOM_RWFILE # Read and write entropy cache
View
8 sys/conf/files
@@ -2043,13 +2043,15 @@ rt2860.fw optional rt2860fw | ralfw \
no-obj no-implicit-rule \
clean "rt2860.fw"
dev/random/harvest.c standard
-dev/random/hash.c optional random
-dev/random/pseudo_rng.c standard
+dev/random/dummy_rng.c standard
dev/random/random_adaptors.c standard
-dev/random/random_harvestq.c standard
+dev/random/live_entropy_sources.c optional random
+dev/random/random_harvestq.c optional random
dev/random/randomdev.c optional random
dev/random/randomdev_soft.c optional random
dev/random/yarrow.c optional random
+dev/random/hash.c optional random
+dev/random/rwfile.c optional random
dev/rc/rc.c optional rc
dev/re/if_re.c optional re
dev/rndtest/rndtest.c optional rndtest
View
4 sys/conf/files.amd64
@@ -259,8 +259,8 @@ dev/nvme/nvme_sysctl.c optional nvme
dev/nvme/nvme_test.c optional nvme
dev/nvme/nvme_util.c optional nvme
dev/nvram/nvram.c optional nvram isa
-dev/random/ivy.c optional random rdrand_rng
-dev/random/nehemiah.c optional random padlock_rng
+dev/random/ivy.c optional rdrand_rng
+dev/random/nehemiah.c optional padlock_rng
dev/qlxge/qls_dbg.c optional qlxge pci
dev/qlxge/qls_dump.c optional qlxge pci
dev/qlxge/qls_hw.c optional qlxge pci
View
4 sys/conf/files.i386
@@ -257,8 +257,8 @@ dev/nvme/nvme_test.c optional nvme
dev/nvme/nvme_util.c optional nvme
dev/nvram/nvram.c optional nvram isa
dev/pcf/pcf_isa.c optional pcf
-dev/random/ivy.c optional random rdrand_rng
-dev/random/nehemiah.c optional random padlock_rng
+dev/random/ivy.c optional rdrand_rng
+dev/random/nehemiah.c optional padlock_rng
dev/sbni/if_sbni.c optional sbni
dev/sbni/if_sbni_isa.c optional sbni isa
dev/sbni/if_sbni_pci.c optional sbni pci
View
4 sys/conf/newvers.sh
@@ -31,8 +31,8 @@
# $FreeBSD$
TYPE="FreeBSD"
-REVISION="11.0"
-BRANCH="CURRENT"
+REVISION="10"
+BRANCH="STABLE"
if [ "X${BRANCH_OVERRIDE}" != "X" ]; then
BRANCH=${BRANCH_OVERRIDE}
fi
View
6 sys/conf/options
@@ -904,3 +904,9 @@ RACCT opt_global.h
# Resource Limits
RCTL opt_global.h
+
+# Random number generator(s)
+RANDOM_YARROW opt_random.h
+RANDOM_FORTUNA opt_random.h
+RANDOM_DEBUG opt_random.h
+RANDOM_RWFILE opt_random.h
View
2  sys/dev/ata/ata-all.c
@@ -92,7 +92,7 @@ FEATURE(ata_cam, "ATA devices are accessed through the cam(4) driver");
int
ata_probe(device_t dev)
{
- return 0;
+ return (BUS_PROBE_DEFAULT);
}
int
View
2  sys/dev/ata/ata-card.c
@@ -140,7 +140,7 @@ ata_pccard_attach(device_t dev)
ch-> flags |= ATA_NO_SLAVE;
ata_generic_hw(dev);
err = ata_probe(dev);
- if (err)
+ if (err > 0)
return (err);
return (ata_attach(dev));
}
View
38 sys/dev/bxe/bxe.c
@@ -34,7 +34,7 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#define BXE_DRIVER_VERSION "1.78.17"
+#define BXE_DRIVER_VERSION "1.78.18"
#include "bxe.h"
#include "ecore_sp.h"
@@ -936,8 +936,8 @@ bxe_dma_alloc(struct bxe_softc *sc,
int rc;
if (dma->size > 0) {
- BLOGE(sc, "dma block '%s' already has size %lu\n", msg,
- (unsigned long) dma->size);
+ BLOGE(sc, "dma block '%s' already has size %lu\n", msg,
+ (unsigned long)dma->size);
return (1);
}
@@ -2532,9 +2532,9 @@ bxe_sp_post(struct bxe_softc *sc,
atomic_subtract_acq_long(&sc->cq_spq_left, 1);
}
- BLOGD(sc, DBG_SP, "SPQE -> %p\n", (void *)sc->spq_dma.paddr);
- BLOGD(sc, DBG_SP, "FUNC_RDATA -> %p / %p\n",
- BXE_SP(sc, func_rdata), (void *)BXE_SP_MAPPING(sc, func_rdata));
+ BLOGD(sc, DBG_SP, "SPQE -> %#jx\n", (uintmax_t)sc->spq_dma.paddr);
+ BLOGD(sc, DBG_SP, "FUNC_RDATA -> %p / %#jx\n",
+ BXE_SP(sc, func_rdata), (uintmax_t)BXE_SP_MAPPING(sc, func_rdata));
BLOGD(sc, DBG_SP,
"SPQE[%x] (%x:%x) (cmd, common?) (%d,%d) hw_cid %x data (%x:%x) type(0x%x) left (CQ, EQ) (%lx,%lx)\n",
sc->spq_prod_idx,
@@ -6923,11 +6923,11 @@ bxe_alloc_fw_stats_mem(struct bxe_softc *sc)
sc->fw_stats_data_mapping = (sc->fw_stats_dma.paddr +
sc->fw_stats_req_size);
- BLOGD(sc, DBG_LOAD, "statistics request base address set to %p\n",
- (void *)sc->fw_stats_req_mapping);
+ BLOGD(sc, DBG_LOAD, "statistics request base address set to %#jx\n",
+ (uintmax_t)sc->fw_stats_req_mapping);
- BLOGD(sc, DBG_LOAD, "statistics data base address set to %p\n",
- (void *)sc->fw_stats_data_mapping);
+ BLOGD(sc, DBG_LOAD, "statistics data base address set to %#jx\n",
+ (uintmax_t)sc->fw_stats_data_mapping);
return (0);
}
@@ -14201,8 +14201,14 @@ bxe_media_detect(struct bxe_softc *sc)
uint32_t phy_idx = bxe_get_cur_phy_idx(sc);
switch (sc->link_params.phy[phy_idx].media_type) {
case ELINK_ETH_PHY_SFPP_10G_FIBER:
- case ELINK_ETH_PHY_SFP_1G_FIBER:
case ELINK_ETH_PHY_XFP_FIBER:
+ BLOGI(sc, "Found 10Gb Fiber media.\n");
+ sc->media = IFM_10G_SR;
+ break;
+ case ELINK_ETH_PHY_SFP_1G_FIBER:
+ BLOGI(sc, "Found 1Gb Fiber media.\n");
+ sc->media = IFM_1000_SX;
+ break;
case ELINK_ETH_PHY_KR:
case ELINK_ETH_PHY_CX4:
BLOGI(sc, "Found 10GBase-CX4 media.\n");
@@ -14213,8 +14219,14 @@ bxe_media_detect(struct bxe_softc *sc)
sc->media = IFM_10G_TWINAX;
break;
case ELINK_ETH_PHY_BASE_T:
- BLOGI(sc, "Found 10GBase-T media.\n");
- sc->media = IFM_10G_T;
+ if (sc->link_params.speed_cap_mask[0] &
+ PORT_HW_CFG_SPEED_CAPABILITY_D0_10G) {
+ BLOGI(sc, "Found 10GBase-T media.\n");
+ sc->media = IFM_10G_T;
+ } else {
+ BLOGI(sc, "Found 1000Base-T media.\n");
+ sc->media = IFM_1000_T;
+ }
break;
case ELINK_ETH_PHY_NOT_PRESENT:
BLOGI(sc, "Media not present.\n");
View
11 sys/dev/bxe/bxe_stats.c
@@ -263,6 +263,17 @@ bxe_stats_pmf_update(struct bxe_softc *sc)
int loader_idx = PMF_DMAE_C(sc);
uint32_t *stats_comp = BXE_SP(sc, stats_comp);
+ if (sc->devinfo.bc_ver <= 0x06001400) {
+ /*
+ * Bootcode v6.0.21 fixed a GRC timeout that occurs when accessing
+ * BRB registers while the BRB block is in reset. The DMA transfer
+ * below triggers this issue resulting in the DMAE to stop
+ * functioning. Skip this initial stats transfer for old bootcode
+ * versions <= 6.0.20.
+ */
+ return;
+ }
+
/* sanity */
if (!sc->port.pmf || !sc->port.port_stx) {
BLOGE(sc, "BUG!\n");
View
9 sys/dev/bxe/ecore_sp.h
@@ -77,9 +77,14 @@ struct bxe_softc;
typedef bus_addr_t ecore_dma_addr_t; /* expected to be 64 bit wide */
typedef volatile int ecore_atomic_t;
-#if __FreeBSD_version < 1000002
-typedef int bool;
+#ifndef __bool_true_false_are_defined
+#ifndef __cplusplus
+#define bool _Bool
+#if __STDC_VERSION__ < 199901L && __GNUC__ < 3 && !defined(__INTEL_COMPILER)
+typedef _Bool bool;
#endif
+#endif /* !__cplusplus */
+#endif /* !__bool_true_false_are_defined$ */
#define ETH_ALEN ETHER_ADDR_LEN /* 6 */
View
1  sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb.c
@@ -298,3 +298,4 @@ DECLARE_MODULE(iw_cxgb, iwch_mod_data, SI_SUB_EXEC, SI_ORDER_ANY);
MODULE_DEPEND(t3_tom, cxgbc, 1, 1, 1);
MODULE_DEPEND(iw_cxgb, toecore, 1, 1, 1);
MODULE_DEPEND(iw_cxgb, t3_tom, 1, 1, 1);
+MODULE_DEPEND(iw_cxgb, ibcore, 1, 1, 1);
View
2  sys/dev/glxsb/glxsb.c
@@ -476,7 +476,7 @@ glxsb_rnd(void *v)
if (status & SB_RNS_TRNG_VALID) {
value = bus_read_4(sc->sc_sr, SB_RANDOM_NUM);
/* feed with one uint32 */
- random_harvest(&value, 4, 32/2, 0, RANDOM_PURE);
+ random_harvest(&value, 4, 32/2, RANDOM_PURE_GLXSB);
}
callout_reset(&sc->sc_rngco, sc->sc_rnghz, glxsb_rnd, sc);
View
2  sys/dev/hifn/hifn7751.c
@@ -258,7 +258,7 @@ hifn_partname(struct hifn_softc *sc)
static void
default_harvest(struct rndtest_state *rsp, void *buf, u_int count)
{
- random_harvest(buf, count, count*NBBY/2, 0, RANDOM_PURE);
+ random_harvest(buf, count, count*NBBY/2, RANDOM_PURE_HIFN);
}
static u_int
View
3  sys/dev/hyperv/include/hyperv.h
@@ -24,6 +24,8 @@
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * $FreeBSD$
*/
/**
@@ -669,6 +671,7 @@ typedef struct hv_vmbus_channel {
* Allocated memory for ring buffer
*/
void* ring_buffer_pages;
+ unsigned long ring_buffer_size;
uint32_t ring_buffer_page_count;
/*
* send to parent
View
4 sys/dev/hyperv/netvsc/hv_net_vsc.h
@@ -24,6 +24,8 @@
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * $FreeBSD$
*/
/*
@@ -970,6 +972,8 @@ typedef struct hn_softc {
int hn_if_flags;
struct mtx hn_lock;
int hn_initdone;
+ /* See hv_netvsc_drv_freebsd.c for rules on how to use */
+ int temp_unusable;
struct hv_device *hn_dev_obj;
netvsc_dev *net_dev;
} hn_softc_t;
View
101 sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
@@ -52,6 +52,9 @@
* SUCH DAMAGE.
*/
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/sockio.h>
@@ -702,6 +705,17 @@ netvsc_recv(struct hv_device *device_ctx, netvsc_packet *packet)
}
/*
+ * Rules for using sc->temp_unusable:
+ * 1. sc->temp_unusable can only be read or written while holding NV_LOCK()
+ * 2. code reading sc->temp_unusable under NV_LOCK(), and finding
+ * sc->temp_unusable set, must release NV_LOCK() and exit
+ * 3. to retain exclusive control of the interface,
+ * sc->temp_unusable must be set by code before releasing NV_LOCK()
+ * 4. only code setting sc->temp_unusable can clear sc->temp_unusable
+ * 5. code setting sc->temp_unusable must eventually clear sc->temp_unusable
+ */
+
+/*
* Standard ioctl entry point. Called when the user wants to configure
* the interface.
*/
@@ -713,7 +727,8 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
netvsc_device_info device_info;
struct hv_device *hn_dev;
int mask, error = 0;
-
+ int retry_cnt = 500;
+
switch(cmd) {
case SIOCSIFADDR:
@@ -723,38 +738,80 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
case SIOCSIFMTU:
hn_dev = vmbus_get_devctx(sc->hn_dev);
- NV_LOCK(sc);
+ /* Check MTU value change */
+ if (ifp->if_mtu == ifr->ifr_mtu)
+ break;
if (ifr->ifr_mtu > NETVSC_MAX_CONFIGURABLE_MTU) {
error = EINVAL;
- NV_UNLOCK(sc);
break;
}
+
/* Obtain and record requested MTU */
ifp->if_mtu = ifr->ifr_mtu;
+
+ do {
+ NV_LOCK(sc);
+ if (!sc->temp_unusable) {
+ sc->temp_unusable = TRUE;
+ retry_cnt = -1;
+ }
+ NV_UNLOCK(sc);
+ if (retry_cnt > 0) {
+ retry_cnt--;
+ DELAY(5 * 1000);
+ }
+ } while (retry_cnt > 0);
- /*
- * We must remove and add back the device to cause the new
+ if (retry_cnt == 0) {
+ error = EINVAL;
+ break;
+ }
+
+ /* We must remove and add back the device to cause the new
* MTU to take effect. This includes tearing down, but not
* deleting the channel, then bringing it back up.
*/
error = hv_rf_on_device_remove(hn_dev, HV_RF_NV_RETAIN_CHANNEL);
if (error) {
+ NV_LOCK(sc);
+ sc->temp_unusable = FALSE;
NV_UNLOCK(sc);
break;
}
error = hv_rf_on_device_add(hn_dev, &device_info);
if (error) {
+ NV_LOCK(sc);
+ sc->temp_unusable = FALSE;
NV_UNLOCK(sc);
break;
}
hn_ifinit_locked(sc);
+ NV_LOCK(sc);
+ sc->temp_unusable = FALSE;
NV_UNLOCK(sc);
break;
case SIOCSIFFLAGS:
- NV_LOCK(sc);
+ do {
+ NV_LOCK(sc);
+ if (!sc->temp_unusable) {
+ sc->temp_unusable = TRUE;
+ retry_cnt = -1;
+ }
+ NV_UNLOCK(sc);
+ if (retry_cnt > 0) {
+ retry_cnt--;
+ DELAY(5 * 1000);
+ }
+ } while (retry_cnt > 0);
+
+ if (retry_cnt == 0) {
+ error = EINVAL;
+ break;
+ }
+
if (ifp->if_flags & IFF_UP) {
/*
* If only the state of the PROMISC flag changed,
@@ -766,21 +823,14 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
*/
#ifdef notyet
/* Fixme: Promiscuous mode? */
- /* No promiscuous mode with Xen */
if (ifp->if_drv_flags & IFF_DRV_RUNNING &&
ifp->if_flags & IFF_PROMISC &&
!(sc->hn_if_flags & IFF_PROMISC)) {
/* do something here for Hyper-V */
- ;
-/* XN_SETBIT(sc, XN_RX_MODE, */
-/* XN_RXMODE_RX_PROMISC); */
} else if (ifp->if_drv_flags & IFF_DRV_RUNNING &&
- !(ifp->if_flags & IFF_PROMISC) &&
- sc->hn_if_flags & IFF_PROMISC) {
+ !(ifp->if_flags & IFF_PROMISC) &&
+ sc->hn_if_flags & IFF_PROMISC) {
/* do something here for Hyper-V */
- ;
-/* XN_CLRBIT(sc, XN_RX_MODE, */
-/* XN_RXMODE_RX_PROMISC); */
} else
#endif
hn_ifinit_locked(sc);
@@ -789,8 +839,10 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
hn_stop(sc);
}
}
- sc->hn_if_flags = ifp->if_flags;
+ NV_LOCK(sc);
+ sc->temp_unusable = FALSE;
NV_UNLOCK(sc);
+ sc->hn_if_flags = ifp->if_flags;
error = 0;
break;
case SIOCSIFCAP:
@@ -838,7 +890,6 @@ hn_stop(hn_softc_t *sc)
int ret;
struct hv_device *device_ctx = vmbus_get_devctx(sc->hn_dev);
- NV_LOCK_ASSERT(sc);
ifp = sc->hn_ifp;
printf(" Closing Device ...\n");
@@ -859,6 +910,10 @@ hn_start(struct ifnet *ifp)
sc = ifp->if_softc;
NV_LOCK(sc);
+ if (sc->temp_unusable) {
+ NV_UNLOCK(sc);
+ return;
+ }
hn_start_locked(ifp);
NV_UNLOCK(sc);
}
@@ -873,8 +928,6 @@ hn_ifinit_locked(hn_softc_t *sc)
struct hv_device *device_ctx = vmbus_get_devctx(sc->hn_dev);
int ret;
- NV_LOCK_ASSERT(sc);
-
ifp = sc->hn_ifp;
if (ifp->if_drv_flags & IFF_DRV_RUNNING) {
@@ -902,7 +955,17 @@ hn_ifinit(void *xsc)
hn_softc_t *sc = xsc;
NV_LOCK(sc);
+ if (sc->temp_unusable) {
+ NV_UNLOCK(sc);
+ return;
+ }
+ sc->temp_unusable = TRUE;
+ NV_UNLOCK(sc);
+
hn_ifinit_locked(sc);
+
+ NV_LOCK(sc);
+ sc->temp_unusable = FALSE;
NV_UNLOCK(sc);
}
View
30 sys/dev/hyperv/stordisengage/hv_ata_pci_disengage.c
@@ -92,6 +92,7 @@ static int hv_check_for_hyper_v(void);
static int
hv_ata_pci_probe(device_t dev)
{
+ device_t parent = device_get_parent(dev);
int ata_disk_enable;
ata_disk_enable = 0;
@@ -102,23 +103,9 @@ hv_ata_pci_probe(device_t dev)
if (!hv_check_for_hyper_v())
return (ENXIO);
- if (bootverbose)
- device_printf(dev,
- "hv_ata_pci_probe dev_class/subslcass = %d, %d\n",
- pci_get_class(dev), pci_get_subclass(dev));
-
- /* is this a storage class device ? */
- if (pci_get_class(dev) != PCIC_STORAGE)
+ if (device_get_unit(parent) != 0 || device_get_ivars(dev) != 0)
return (ENXIO);
- /* is this an IDE/ATA type device ? */
- if (pci_get_subclass(dev) != PCIS_STORAGE_IDE)
- return (ENXIO);
-
- if(bootverbose)
- device_printf(dev,
- "Hyper-V probe for disabling ATA-PCI, emulated driver\n");
-
/*
* On Hyper-V the default is to use the enlightened driver for
* IDE disks. However, if the user wishes to use the native
@@ -126,15 +113,14 @@ hv_ata_pci_probe(device_t dev)
* hw_ata.disk_enable must be explicitly set to 1.
*/
if (getenv_int("hw.ata.disk_enable", &ata_disk_enable)) {
- if(bootverbose)
+ if (bootverbose)
device_printf(dev,
"hw.ata.disk_enable flag is disabling Hyper-V"
" ATA driver support\n");
return (ENXIO);
}
- if (bootverbose)
- device_printf(dev, "Hyper-V ATA storage driver enabled.\n");
+ device_set_desc(dev, "Hyper-V ATA storage disengage driver");
return (BUS_PROBE_VENDOR);
}
@@ -193,12 +179,12 @@ static device_method_t hv_ata_pci_methods[] = {
devclass_t hv_ata_pci_devclass;
static driver_t hv_ata_pci_disengage_driver = {
- "pciata-disable",
+ "ata",
hv_ata_pci_methods,
- sizeof(struct ata_pci_controller),
+ 0,
};
-DRIVER_MODULE(atapci_dis, pci, hv_ata_pci_disengage_driver,
- hv_ata_pci_devclass, NULL, NULL);
+DRIVER_MODULE(atapci_dis, atapci, hv_ata_pci_disengage_driver,
+ hv_ata_pci_devclass, NULL, NULL);
MODULE_VERSION(atapci_dis, 1);
MODULE_DEPEND(atapci_dis, ata, 1, 1, 1);
View
16 sys/dev/hyperv/vmbus/hv_channel.c
@@ -104,17 +104,19 @@ hv_vmbus_channel_open(
/* Allocate the ring buffer */
out = contigmalloc((send_ring_buffer_size + recv_ring_buffer_size),
- M_DEVBUF, M_ZERO, 0UL, BUS_SPACE_MAXADDR, PAGE_SIZE, 0);
+ M_DEVBUF, M_ZERO, 0UL, BUS_SPACE_MAXADDR, PAGE_SIZE, 0);
KASSERT(out != NULL,
("Error VMBUS: contigmalloc failed to allocate Ring Buffer!"));
if (out == NULL)
- return (ENOMEM);
+ return (ENOMEM);
in = ((uint8_t *) out + send_ring_buffer_size);
new_channel->ring_buffer_pages = out;
- new_channel->ring_buffer_page_count = (send_ring_buffer_size
- + recv_ring_buffer_size) >> PAGE_SHIFT;
+ new_channel->ring_buffer_page_count = (send_ring_buffer_size +
+ recv_ring_buffer_size) >> PAGE_SHIFT;
+ new_channel->ring_buffer_size = send_ring_buffer_size +
+ recv_ring_buffer_size;
hv_vmbus_ring_buffer_init(
&new_channel->outbound,
@@ -539,10 +541,8 @@ hv_vmbus_channel_close(hv_vmbus_channel *channel)
hv_ring_buffer_cleanup(&channel->outbound);
hv_ring_buffer_cleanup(&channel->inbound);
- contigfree(
- channel->ring_buffer_pages,
- channel->ring_buffer_page_count,
- M_DEVBUF);
+ contigfree(channel->ring_buffer_pages, channel->ring_buffer_size,
+ M_DEVBUF);
free(info, M_DEVBUF);
View
91 sys/dev/random/pseudo_rng.c → sys/dev/random/dummy_rng.c
@@ -28,93 +28,92 @@
__FBSDID("$FreeBSD$");
#include <sys/param.h>
-#include <sys/time.h>
+#include <sys/fcntl.h>
#include <sys/kernel.h>
+#include <sys/malloc.h>
#include <sys/module.h>
+#include <sys/random.h>
#include <sys/selinfo.h>
#include <sys/systm.h>
+#include <sys/time.h>
#include <dev/random/random_adaptors.h>
#include <dev/random/randomdev.h>
-static struct mtx pseudo_random_block_mtx;
+static struct mtx dummy_random_mtx;
/* Used to fake out unused random calls in random_adaptor */
-void
+static void
random_null_func(void)
{
}
static int
-pseudo_random_block_read(void *buf __unused, int c __unused)
+dummy_random_poll(int events __unused, struct thread *td __unused)
{
- mtx_lock(&pseudo_random_block_mtx);
-
- printf("random(4) device is blocking.\n");
- msleep(pseudo_random_block_read, &pseudo_random_block_mtx, 0,
- "block", 0);
-
- mtx_unlock(&pseudo_random_block_mtx);
-
return (0);
}
-static void
-pseudo_random_block_init(void)
+static int
+dummy_random_block(int flag)
{
+ int error = 0;
+
+ mtx_lock(&dummy_random_mtx);
+
+ /* Blocking logic */
+ while (!error) {
+ if (flag & O_NONBLOCK)
+ error = EWOULDBLOCK;
+ else {
+ printf("random: dummy device blocking on read.\n");
+ error = msleep(&dummy_random_block,
+ &dummy_random_mtx,
+ PUSER | PCATCH, "block", 0);
+ }
+ }
+ mtx_unlock(&dummy_random_mtx);
- mtx_init(&pseudo_random_block_mtx, "sleep mtx for random_block",
- NULL, MTX_DEF);
+ return (error);
}
static void
-pseudo_random_block_deinit(void)
+dummy_random_init(void)
{
- mtx_destroy(&pseudo_random_block_mtx);
+ mtx_init(&dummy_random_mtx, "sleep mtx for dummy_random",
+ NULL, MTX_DEF);
}
-struct random_adaptor pseudo_random_block = {
- .ident = "pseudo-RNG that always blocks",
- .init = pseudo_random_block_init,
- .deinit = pseudo_random_block_deinit,
- .read = pseudo_random_block_read,
- .write = (random_write_func_t *)random_null_func,
- .reseed = (random_reseed_func_t *)random_null_func,
- .seeded = 1,
-};
-
-static int
-pseudo_random_panic_read(void *buf, int c)
+static void
+dummy_random_deinit(void)
{
- panic("Insert a witty panic msg in here.");
-
- return (0);
+ mtx_destroy(&dummy_random_mtx);
}
-struct random_adaptor pseudo_random_panic = {
- .ident = "pseudo-RNG that always panics on first read(2)",
- .init = (random_init_func_t *)random_null_func,
- .deinit = (random_deinit_func_t *)random_null_func,
- .read = pseudo_random_panic_read,
- .write = (random_write_func_t *)random_null_func,
+struct random_adaptor dummy_random = {
+ .ident = "Dummy entropy device that always blocks",
+ .init = dummy_random_init,
+ .deinit = dummy_random_deinit,
+ .block = dummy_random_block,
+ .poll = dummy_random_poll,
+ .read = (random_read_func_t *)random_null_func,
.reseed = (random_reseed_func_t *)random_null_func,
- .seeded = 1,
+ .seeded = 0, /* This device can never be seeded */
+ .priority = 1, /* Bottom priority, so goes to last position */
};
static int
-pseudo_random_modevent(module_t mod, int type, void *unused)
+dummy_random_modevent(module_t mod __unused, int type, void *unused __unused)
{
switch (type) {
case MOD_LOAD:
- random_adaptor_register("block", &pseudo_random_block);
+ random_adaptor_register("dummy", &dummy_random);
EVENTHANDLER_INVOKE(random_adaptor_attach,
- &pseudo_random_block);
-
- random_adaptor_register("panic", &pseudo_random_panic);
+ &dummy_random);
return (0);
}
@@ -122,4 +121,4 @@ pseudo_random_modevent(module_t mod, int type, void *unused)
return (EINVAL);
}
-RANDOM_ADAPTOR_MODULE(