History log of /freebsd-9.3-release/sys/amd64/include/xen/
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
267655 20-Jun-2014 gjb

Remove svn:mergeinfo carried over from stable/9.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


/freebsd-9.3-release/COPYRIGHT
/freebsd-9.3-release/MAINTAINERS
/freebsd-9.3-release/Makefile
/freebsd-9.3-release/Makefile.inc1
/freebsd-9.3-release/ObsoleteFiles.inc
/freebsd-9.3-release/UPDATING
/freebsd-9.3-release/bin
/freebsd-9.3-release/bin/cat
/freebsd-9.3-release/bin/cp
/freebsd-9.3-release/bin/csh
/freebsd-9.3-release/bin/date
/freebsd-9.3-release/bin/dd
/freebsd-9.3-release/bin/df
/freebsd-9.3-release/bin/ed
/freebsd-9.3-release/bin/expr
/freebsd-9.3-release/bin/getfacl
/freebsd-9.3-release/bin/kenv
/freebsd-9.3-release/bin/ln
/freebsd-9.3-release/bin/mkdir
/freebsd-9.3-release/bin/mv
/freebsd-9.3-release/bin/pkill
/freebsd-9.3-release/bin/ps
/freebsd-9.3-release/bin/pwait
/freebsd-9.3-release/bin/rcp
/freebsd-9.3-release/bin/rm
/freebsd-9.3-release/bin/setfacl
/freebsd-9.3-release/bin/sh
/freebsd-9.3-release/bin/sleep
/freebsd-9.3-release/bin/test
/freebsd-9.3-release/bin/uuidgen
/freebsd-9.3-release/cddl
/freebsd-9.3-release/cddl/contrib
/freebsd-9.3-release/cddl/contrib/dtracetoolkit
/freebsd-9.3-release/cddl/contrib/opensolaris
/freebsd-9.3-release/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize
/freebsd-9.3-release/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print
/freebsd-9.3-release/cddl/contrib/opensolaris/cmd/zfs
/freebsd-9.3-release/cddl/contrib/opensolaris/cmd/zpool
/freebsd-9.3-release/cddl/contrib/opensolaris/lib/libdtrace/common
/freebsd-9.3-release/cddl/contrib/opensolaris/lib/libzfs
/freebsd-9.3-release/cddl/lib
/freebsd-9.3-release/cddl/lib/drti
/freebsd-9.3-release/cddl/lib/libdtrace
/freebsd-9.3-release/cddl/usr.bin/zinject
/freebsd-9.3-release/contrib
/freebsd-9.3-release/contrib/bind9
/freebsd-9.3-release/contrib/binutils
/freebsd-9.3-release/contrib/bmake
/freebsd-9.3-release/contrib/bsnmp
/freebsd-9.3-release/contrib/bsnmp/snmp_mibII
/freebsd-9.3-release/contrib/bzip2
/freebsd-9.3-release/contrib/compiler-rt
/freebsd-9.3-release/contrib/dialog
/freebsd-9.3-release/contrib/diff
/freebsd-9.3-release/contrib/ee
/freebsd-9.3-release/contrib/expat
/freebsd-9.3-release/contrib/file
/freebsd-9.3-release/contrib/gcc
/freebsd-9.3-release/contrib/gcclibs
/freebsd-9.3-release/contrib/gdb
/freebsd-9.3-release/contrib/gdtoa
/freebsd-9.3-release/contrib/gnu-sort
/freebsd-9.3-release/contrib/gperf
/freebsd-9.3-release/contrib/groff
/freebsd-9.3-release/contrib/less
/freebsd-9.3-release/contrib/libarchive
/freebsd-9.3-release/contrib/libarchive/cpio
/freebsd-9.3-release/contrib/libarchive/libarchive
/freebsd-9.3-release/contrib/libarchive/libarchive_fe
/freebsd-9.3-release/contrib/libarchive/tar
/freebsd-9.3-release/contrib/libc++
/freebsd-9.3-release/contrib/libc-pwcache
/freebsd-9.3-release/contrib/libc-vis
/freebsd-9.3-release/contrib/libcxxrt
/freebsd-9.3-release/contrib/libpcap
/freebsd-9.3-release/contrib/libstdc++
/freebsd-9.3-release/contrib/libucl
/freebsd-9.3-release/contrib/llvm
/freebsd-9.3-release/contrib/llvm/tools/clang
/freebsd-9.3-release/contrib/mknod
/freebsd-9.3-release/contrib/mtree
/freebsd-9.3-release/contrib/ncurses
/freebsd-9.3-release/contrib/netcat
/freebsd-9.3-release/contrib/ntp
/freebsd-9.3-release/contrib/nvi
/freebsd-9.3-release/contrib/one-true-awk
/freebsd-9.3-release/contrib/openbsm
/freebsd-9.3-release/contrib/openpam
/freebsd-9.3-release/contrib/openresolv
/freebsd-9.3-release/contrib/opie
/freebsd-9.3-release/contrib/pf
/freebsd-9.3-release/contrib/pnpinfo
/freebsd-9.3-release/contrib/sendmail
/freebsd-9.3-release/contrib/tcpdump
/freebsd-9.3-release/contrib/tcsh
/freebsd-9.3-release/contrib/telnet
/freebsd-9.3-release/contrib/tnftp
/freebsd-9.3-release/contrib/top
/freebsd-9.3-release/contrib/top/install-sh
/freebsd-9.3-release/contrib/traceroute
/freebsd-9.3-release/contrib/tzcode
/freebsd-9.3-release/contrib/tzcode/stdtime
/freebsd-9.3-release/contrib/tzcode/zic
/freebsd-9.3-release/contrib/tzdata
/freebsd-9.3-release/contrib/unvis
/freebsd-9.3-release/contrib/vis
/freebsd-9.3-release/contrib/wpa
/freebsd-9.3-release/contrib/xz
/freebsd-9.3-release/crypto/heimdal
/freebsd-9.3-release/crypto/openssh
/freebsd-9.3-release/crypto/openssl
/freebsd-9.3-release/etc
/freebsd-9.3-release/etc/mtree
/freebsd-9.3-release/etc/rc.d
/freebsd-9.3-release/games/bcd
/freebsd-9.3-release/games/caesar
/freebsd-9.3-release/games/factor
/freebsd-9.3-release/games/fortune
/freebsd-9.3-release/games/fortune/fortune
/freebsd-9.3-release/games/grdc
/freebsd-9.3-release/games/morse
/freebsd-9.3-release/games/number
/freebsd-9.3-release/games/pom
/freebsd-9.3-release/games/random
/freebsd-9.3-release/gnu/lib
/freebsd-9.3-release/gnu/lib/csu
/freebsd-9.3-release/gnu/lib/libgcc
/freebsd-9.3-release/gnu/lib/libgomp
/freebsd-9.3-release/gnu/lib/libstdc++
/freebsd-9.3-release/gnu/lib/libsupc++
/freebsd-9.3-release/gnu/usr.bin/binutils
/freebsd-9.3-release/gnu/usr.bin/binutils/libbinutils
/freebsd-9.3-release/gnu/usr.bin/cc/c++
/freebsd-9.3-release/gnu/usr.bin/cc/cc_tools
/freebsd-9.3-release/gnu/usr.bin/cc/include
/freebsd-9.3-release/gnu/usr.bin/gdb
/freebsd-9.3-release/gnu/usr.bin/gdb/kgdb
/freebsd-9.3-release/gnu/usr.bin/gperf
/freebsd-9.3-release/gnu/usr.bin/groff
/freebsd-9.3-release/gnu/usr.bin/send-pr
/freebsd-9.3-release/include
/freebsd-9.3-release/include/arpa
/freebsd-9.3-release/kerberos5
/freebsd-9.3-release/kerberos5/lib/libgssapi_krb5
/freebsd-9.3-release/lib
/freebsd-9.3-release/lib/Makefile
/freebsd-9.3-release/lib/bind
/freebsd-9.3-release/lib/clang
/freebsd-9.3-release/lib/clang/include
/freebsd-9.3-release/lib/csu
/freebsd-9.3-release/lib/libarchive
/freebsd-9.3-release/lib/libbluetooth
/freebsd-9.3-release/lib/libc
/freebsd-9.3-release/lib/libc++
/freebsd-9.3-release/lib/libc/stdtime
/freebsd-9.3-release/lib/libc/sys
/freebsd-9.3-release/lib/libc/uuid
/freebsd-9.3-release/lib/libcam
/freebsd-9.3-release/lib/libcompiler_rt
/freebsd-9.3-release/lib/libcrypt
/freebsd-9.3-release/lib/libcxxrt
/freebsd-9.3-release/lib/libdwarf
/freebsd-9.3-release/lib/libedit
/freebsd-9.3-release/lib/libelf
/freebsd-9.3-release/lib/libexpat
/freebsd-9.3-release/lib/libfetch
/freebsd-9.3-release/lib/libgeom
/freebsd-9.3-release/lib/libgpib
/freebsd-9.3-release/lib/libgssapi
/freebsd-9.3-release/lib/libiconv_modules
/freebsd-9.3-release/lib/libipsec
/freebsd-9.3-release/lib/libjail
/freebsd-9.3-release/lib/libkiconv
/freebsd-9.3-release/lib/libkvm
/freebsd-9.3-release/lib/libmagic
/freebsd-9.3-release/lib/libmemstat
/freebsd-9.3-release/lib/libncp
/freebsd-9.3-release/lib/libnetbsd
/freebsd-9.3-release/lib/libnetgraph
/freebsd-9.3-release/lib/libopie
/freebsd-9.3-release/lib/libpam
/freebsd-9.3-release/lib/libpcap
/freebsd-9.3-release/lib/libpmc
/freebsd-9.3-release/lib/libproc
/freebsd-9.3-release/lib/libprocstat
/freebsd-9.3-release/lib/libradius
/freebsd-9.3-release/lib/librpcsec_gss
/freebsd-9.3-release/lib/librpcsvc
/freebsd-9.3-release/lib/librt
/freebsd-9.3-release/lib/libsbuf
/freebsd-9.3-release/lib/libsm
/freebsd-9.3-release/lib/libstand
/freebsd-9.3-release/lib/libstdbuf
/freebsd-9.3-release/lib/libtacplus
/freebsd-9.3-release/lib/libthr
/freebsd-9.3-release/lib/libthr/thread/thr_setprio.c
/freebsd-9.3-release/lib/libthr/thread/thr_setschedparam.c
/freebsd-9.3-release/lib/libthread_db
/freebsd-9.3-release/lib/libucl
/freebsd-9.3-release/lib/libulog
/freebsd-9.3-release/lib/libusb
/freebsd-9.3-release/lib/libusbhid
/freebsd-9.3-release/lib/libutil
/freebsd-9.3-release/lib/libvgl
/freebsd-9.3-release/lib/libypclnt
/freebsd-9.3-release/lib/libz
/freebsd-9.3-release/lib/msun
/freebsd-9.3-release/lib/ncurses/form
/freebsd-9.3-release/lib/ncurses/menu
/freebsd-9.3-release/lib/ncurses/ncurses
/freebsd-9.3-release/lib/ncurses/panel
/freebsd-9.3-release/libexec/atrun
/freebsd-9.3-release/libexec/bootpd
/freebsd-9.3-release/libexec/comsat
/freebsd-9.3-release/libexec/ftpd
/freebsd-9.3-release/libexec/getty
/freebsd-9.3-release/libexec/mail.local
/freebsd-9.3-release/libexec/pppoed
/freebsd-9.3-release/libexec/rbootd
/freebsd-9.3-release/libexec/rshd
/freebsd-9.3-release/libexec/rtld-elf
/freebsd-9.3-release/libexec/save-entropy
/freebsd-9.3-release/libexec/smrsh
/freebsd-9.3-release/libexec/tftpd
/freebsd-9.3-release/libexec/ypxfr
/freebsd-9.3-release/release
/freebsd-9.3-release/release/doc
/freebsd-9.3-release/release/doc/en_US.ISO8859-1/hardware
/freebsd-9.3-release/release/ia64
/freebsd-9.3-release/release/picobsd/tinyware/passwd
/freebsd-9.3-release/rescue
/freebsd-9.3-release/rescue/rescue
/freebsd-9.3-release/sbin
/freebsd-9.3-release/sbin/atacontrol
/freebsd-9.3-release/sbin/atm/atmconfig
/freebsd-9.3-release/sbin/bsdlabel
/freebsd-9.3-release/sbin/camcontrol
/freebsd-9.3-release/sbin/ccdconfig
/freebsd-9.3-release/sbin/ddb
/freebsd-9.3-release/sbin/devd
/freebsd-9.3-release/sbin/devfs
/freebsd-9.3-release/sbin/dhclient
/freebsd-9.3-release/sbin/dump
/freebsd-9.3-release/sbin/dumpfs
/freebsd-9.3-release/sbin/fdisk
/freebsd-9.3-release/sbin/fdisk_pc98
/freebsd-9.3-release/sbin/fsck_ffs
/freebsd-9.3-release/sbin/fsck_msdosfs
/freebsd-9.3-release/sbin/fsdb
/freebsd-9.3-release/sbin/fsirand
/freebsd-9.3-release/sbin/gbde
/freebsd-9.3-release/sbin/geom
/freebsd-9.3-release/sbin/geom/class/mirror
/freebsd-9.3-release/sbin/geom/class/multipath
/freebsd-9.3-release/sbin/geom/class/part
/freebsd-9.3-release/sbin/geom/class/raid
/freebsd-9.3-release/sbin/geom/class/raid3
/freebsd-9.3-release/sbin/geom/class/sched
/freebsd-9.3-release/sbin/geom/class/virstor
/freebsd-9.3-release/sbin/ggate
/freebsd-9.3-release/sbin/growfs
/freebsd-9.3-release/sbin/gvinum
/freebsd-9.3-release/sbin/hastctl
/freebsd-9.3-release/sbin/hastd
/freebsd-9.3-release/sbin/ifconfig
/freebsd-9.3-release/sbin/init
/freebsd-9.3-release/sbin/ipf
/freebsd-9.3-release/sbin/ipfw
/freebsd-9.3-release/sbin/iscontrol
/freebsd-9.3-release/sbin/kldload
/freebsd-9.3-release/sbin/mca
/freebsd-9.3-release/sbin/md5
/freebsd-9.3-release/sbin/mdconfig
/freebsd-9.3-release/sbin/mdmfs
/freebsd-9.3-release/sbin/mount
/freebsd-9.3-release/sbin/mount_cd9660
/freebsd-9.3-release/sbin/mount_msdosfs
/freebsd-9.3-release/sbin/mount_nfs
/freebsd-9.3-release/sbin/mount_ntfs
/freebsd-9.3-release/sbin/mount_nullfs
/freebsd-9.3-release/sbin/mount_unionfs
/freebsd-9.3-release/sbin/natd
/freebsd-9.3-release/sbin/newfs
/freebsd-9.3-release/sbin/newfs_msdos
/freebsd-9.3-release/sbin/nvmecontrol
/freebsd-9.3-release/sbin/ping6
/freebsd-9.3-release/sbin/quotacheck
/freebsd-9.3-release/sbin/rcorder
/freebsd-9.3-release/sbin/reboot
/freebsd-9.3-release/sbin/recoverdisk
/freebsd-9.3-release/sbin/restore
/freebsd-9.3-release/sbin/route
/freebsd-9.3-release/sbin/routed/rtquery
/freebsd-9.3-release/sbin/savecore
/freebsd-9.3-release/sbin/setkey
/freebsd-9.3-release/sbin/shutdown
/freebsd-9.3-release/sbin/swapon
/freebsd-9.3-release/sbin/sysctl
/freebsd-9.3-release/sbin/tunefs
/freebsd-9.3-release/sbin/umount
/freebsd-9.3-release/secure/lib/libcrypt
/freebsd-9.3-release/secure/lib/libcrypto
/freebsd-9.3-release/secure/lib/libssh
/freebsd-9.3-release/secure/lib/libssl
/freebsd-9.3-release/secure/libexec/ssh-keysign
/freebsd-9.3-release/secure/usr.bin/openssl
/freebsd-9.3-release/secure/usr.bin/ssh
/freebsd-9.3-release/secure/usr.sbin/sshd
/freebsd-9.3-release/share
/freebsd-9.3-release/share/doc
/freebsd-9.3-release/share/doc/bind9
/freebsd-9.3-release/share/doc/smm
/freebsd-9.3-release/share/dtrace
/freebsd-9.3-release/share/examples
/freebsd-9.3-release/share/examples/csh
/freebsd-9.3-release/share/examples/cvsup
/freebsd-9.3-release/share/examples/diskless
/freebsd-9.3-release/share/examples/etc
/freebsd-9.3-release/share/examples/kld/dyn_sysctl
/freebsd-9.3-release/share/examples/ppp
/freebsd-9.3-release/share/examples/printing
/freebsd-9.3-release/share/examples/scsi_target
/freebsd-9.3-release/share/examples/ses
/freebsd-9.3-release/share/i18n/csmapper
/freebsd-9.3-release/share/info
/freebsd-9.3-release/share/man
/freebsd-9.3-release/share/man/man3
/freebsd-9.3-release/share/man/man4
/freebsd-9.3-release/share/man/man4/run.4
/freebsd-9.3-release/share/man/man4/runfw.4
/freebsd-9.3-release/share/man/man5
/freebsd-9.3-release/share/man/man7
/freebsd-9.3-release/share/man/man8
/freebsd-9.3-release/share/man/man9
/freebsd-9.3-release/share/misc
/freebsd-9.3-release/share/mk
/freebsd-9.3-release/share/mk/bsd.arch.inc.mk
/freebsd-9.3-release/share/mk/bsd.sys.mk
/freebsd-9.3-release/share/skel
/freebsd-9.3-release/share/syscons
/freebsd-9.3-release/share/syscons/keymaps
/freebsd-9.3-release/share/termcap
/freebsd-9.3-release/share/zoneinfo
/freebsd-9.3-release/sys
/freebsd-9.3-release/sys/amd64/include/xen
/freebsd-9.3-release/sys/boot
/freebsd-9.3-release/sys/boot/forth
/freebsd-9.3-release/sys/boot/i386/efi
/freebsd-9.3-release/sys/boot/i386/gptboot
/freebsd-9.3-release/sys/boot/ia64/efi
/freebsd-9.3-release/sys/boot/ia64/ski
/freebsd-9.3-release/sys/boot/powerpc/boot1.chrp
/freebsd-9.3-release/sys/boot/powerpc/ofw
/freebsd-9.3-release/sys/cddl/contrib/opensolaris
/freebsd-9.3-release/sys/conf
/freebsd-9.3-release/sys/contrib/dev/acpica
/freebsd-9.3-release/sys/contrib/dev/run
/freebsd-9.3-release/sys/contrib/octeon-sdk
/freebsd-9.3-release/sys/contrib/pf
/freebsd-9.3-release/sys/contrib/x86emu
/freebsd-9.3-release/sys/dev
/freebsd-9.3-release/sys/dev/e1000
/freebsd-9.3-release/sys/dev/isp
/freebsd-9.3-release/sys/dev/ixgbe
/freebsd-9.3-release/sys/dev/puc
/freebsd-9.3-release/sys/dev/usb/wlan/if_run.c
/freebsd-9.3-release/sys/dev/usb/wlan/if_runreg.h
/freebsd-9.3-release/sys/fs
/freebsd-9.3-release/sys/fs/ntfs
/freebsd-9.3-release/sys/modules
/freebsd-9.3-release/sys/modules/ixgbe
/freebsd-9.3-release/sys/net
/freebsd-9.3-release/sys/netpfil
/freebsd-9.3-release/sys/sys
/freebsd-9.3-release/tools
/freebsd-9.3-release/tools/build
/freebsd-9.3-release/tools/build/options
/freebsd-9.3-release/tools/diag
/freebsd-9.3-release/tools/kerneldoc
/freebsd-9.3-release/tools/regression
/freebsd-9.3-release/tools/regression/aio/aiotest
/freebsd-9.3-release/tools/regression/bin/sh
/freebsd-9.3-release/tools/regression/bin/test
/freebsd-9.3-release/tools/regression/doat
/freebsd-9.3-release/tools/regression/fifo
/freebsd-9.3-release/tools/regression/fsx
/freebsd-9.3-release/tools/regression/lib/libc
/freebsd-9.3-release/tools/regression/netinet
/freebsd-9.3-release/tools/regression/pipe
/freebsd-9.3-release/tools/regression/security/cap_test
/freebsd-9.3-release/tools/regression/sockets
/freebsd-9.3-release/tools/regression/usr.sbin
/freebsd-9.3-release/tools/regression/usr.sbin/etcupdate
/freebsd-9.3-release/tools/test
/freebsd-9.3-release/tools/test/auxinfo
/freebsd-9.3-release/tools/test/pthread_vfork
/freebsd-9.3-release/tools/tools
/freebsd-9.3-release/tools/tools/ath
/freebsd-9.3-release/tools/tools/bootparttest
/freebsd-9.3-release/tools/tools/cxgbetool
/freebsd-9.3-release/tools/tools/ether_reflect
/freebsd-9.3-release/tools/tools/mcgrab
/freebsd-9.3-release/tools/tools/nanobsd
/freebsd-9.3-release/tools/tools/netmap
/freebsd-9.3-release/tools/tools/syscall_timing
/freebsd-9.3-release/tools/tools/sysdoc
/freebsd-9.3-release/tools/tools/umastat
/freebsd-9.3-release/tools/tools/vimage
/freebsd-9.3-release/tools/tools/zfsboottest
/freebsd-9.3-release/usr.bin
/freebsd-9.3-release/usr.bin/apply
/freebsd-9.3-release/usr.bin/ar
/freebsd-9.3-release/usr.bin/at
/freebsd-9.3-release/usr.bin/bc
/freebsd-9.3-release/usr.bin/bmake
/freebsd-9.3-release/usr.bin/brandelf
/freebsd-9.3-release/usr.bin/bsdiff
/freebsd-9.3-release/usr.bin/c89
/freebsd-9.3-release/usr.bin/c99
/freebsd-9.3-release/usr.bin/calendar
/freebsd-9.3-release/usr.bin/calendar/calendars
/freebsd-9.3-release/usr.bin/chpass
/freebsd-9.3-release/usr.bin/clang
/freebsd-9.3-release/usr.bin/comm
/freebsd-9.3-release/usr.bin/compress
/freebsd-9.3-release/usr.bin/cpio
/freebsd-9.3-release/usr.bin/csup
/freebsd-9.3-release/usr.bin/ctlstat
/freebsd-9.3-release/usr.bin/cut
/freebsd-9.3-release/usr.bin/dc
/freebsd-9.3-release/usr.bin/dig
/freebsd-9.3-release/usr.bin/du
/freebsd-9.3-release/usr.bin/ee
/freebsd-9.3-release/usr.bin/fetch
/freebsd-9.3-release/usr.bin/find
/freebsd-9.3-release/usr.bin/finger
/freebsd-9.3-release/usr.bin/fstat
/freebsd-9.3-release/usr.bin/gcore
/freebsd-9.3-release/usr.bin/gprof
/freebsd-9.3-release/usr.bin/grep
/freebsd-9.3-release/usr.bin/gzip
/freebsd-9.3-release/usr.bin/hexdump
/freebsd-9.3-release/usr.bin/host
/freebsd-9.3-release/usr.bin/indent
/freebsd-9.3-release/usr.bin/ipcrm
/freebsd-9.3-release/usr.bin/join
/freebsd-9.3-release/usr.bin/kdump
/freebsd-9.3-release/usr.bin/killall
/freebsd-9.3-release/usr.bin/ktrace
/freebsd-9.3-release/usr.bin/ktrdump
/freebsd-9.3-release/usr.bin/last
/freebsd-9.3-release/usr.bin/lastcomm
/freebsd-9.3-release/usr.bin/ldd
/freebsd-9.3-release/usr.bin/less
/freebsd-9.3-release/usr.bin/lex
/freebsd-9.3-release/usr.bin/limits
/freebsd-9.3-release/usr.bin/locale
/freebsd-9.3-release/usr.bin/lock
/freebsd-9.3-release/usr.bin/lockf
/freebsd-9.3-release/usr.bin/login
/freebsd-9.3-release/usr.bin/lsvfs
/freebsd-9.3-release/usr.bin/m4
/freebsd-9.3-release/usr.bin/mail
/freebsd-9.3-release/usr.bin/make
/freebsd-9.3-release/usr.bin/makewhatis
/freebsd-9.3-release/usr.bin/man
/freebsd-9.3-release/usr.bin/minigzip
/freebsd-9.3-release/usr.bin/ministat
/freebsd-9.3-release/usr.bin/mkcsmapper
/freebsd-9.3-release/usr.bin/mkesdb
/freebsd-9.3-release/usr.bin/mklocale
/freebsd-9.3-release/usr.bin/mktemp
/freebsd-9.3-release/usr.bin/msgs
/freebsd-9.3-release/usr.bin/mt
/freebsd-9.3-release/usr.bin/ncal
/freebsd-9.3-release/usr.bin/ncplist
/freebsd-9.3-release/usr.bin/ncplogin
/freebsd-9.3-release/usr.bin/netstat
/freebsd-9.3-release/usr.bin/newgrp
/freebsd-9.3-release/usr.bin/nfsstat
/freebsd-9.3-release/usr.bin/nslookup
/freebsd-9.3-release/usr.bin/passwd
/freebsd-9.3-release/usr.bin/pr
/freebsd-9.3-release/usr.bin/printf
/freebsd-9.3-release/usr.bin/procstat
/freebsd-9.3-release/usr.bin/protect
/freebsd-9.3-release/usr.bin/rctl
/freebsd-9.3-release/usr.bin/rlogin
/freebsd-9.3-release/usr.bin/rpcgen
/freebsd-9.3-release/usr.bin/rsh
/freebsd-9.3-release/usr.bin/rwho
/freebsd-9.3-release/usr.bin/script
/freebsd-9.3-release/usr.bin/sed
/freebsd-9.3-release/usr.bin/seq
/freebsd-9.3-release/usr.bin/sockstat
/freebsd-9.3-release/usr.bin/split
/freebsd-9.3-release/usr.bin/stat
/freebsd-9.3-release/usr.bin/stdbuf
/freebsd-9.3-release/usr.bin/su
/freebsd-9.3-release/usr.bin/systat
/freebsd-9.3-release/usr.bin/tail
/freebsd-9.3-release/usr.bin/talk
/freebsd-9.3-release/usr.bin/tar
/freebsd-9.3-release/usr.bin/tftp
/freebsd-9.3-release/usr.bin/top
/freebsd-9.3-release/usr.bin/touch
/freebsd-9.3-release/usr.bin/truss
/freebsd-9.3-release/usr.bin/unvis
/freebsd-9.3-release/usr.bin/unzip
/freebsd-9.3-release/usr.bin/usbhidaction
/freebsd-9.3-release/usr.bin/usbhidctl
/freebsd-9.3-release/usr.bin/users
/freebsd-9.3-release/usr.bin/uuencode
/freebsd-9.3-release/usr.bin/vacation
/freebsd-9.3-release/usr.bin/vis
/freebsd-9.3-release/usr.bin/vmstat
/freebsd-9.3-release/usr.bin/w
/freebsd-9.3-release/usr.bin/wall
/freebsd-9.3-release/usr.bin/who
/freebsd-9.3-release/usr.bin/whois
/freebsd-9.3-release/usr.bin/write
/freebsd-9.3-release/usr.bin/xinstall
/freebsd-9.3-release/usr.bin/xlint
/freebsd-9.3-release/usr.bin/yes
/freebsd-9.3-release/usr.sbin
/freebsd-9.3-release/usr.sbin/Makefile
/freebsd-9.3-release/usr.sbin/ac
/freebsd-9.3-release/usr.sbin/acpi/acpidump
/freebsd-9.3-release/usr.sbin/adduser
/freebsd-9.3-release/usr.sbin/amd
/freebsd-9.3-release/usr.sbin/ancontrol
/freebsd-9.3-release/usr.sbin/apmd
/freebsd-9.3-release/usr.sbin/arp
/freebsd-9.3-release/usr.sbin/authpf
/freebsd-9.3-release/usr.sbin/bluetooth/ath3kfw
/freebsd-9.3-release/usr.sbin/bluetooth/bthidd
/freebsd-9.3-release/usr.sbin/bluetooth/hccontrol
/freebsd-9.3-release/usr.sbin/bluetooth/sdpd
/freebsd-9.3-release/usr.sbin/boot0cfg
/freebsd-9.3-release/usr.sbin/bootparamd
/freebsd-9.3-release/usr.sbin/bsdconfig
/freebsd-9.3-release/usr.sbin/bsdinstall
/freebsd-9.3-release/usr.sbin/bsdinstall/scripts
/freebsd-9.3-release/usr.sbin/bsnmpd
/freebsd-9.3-release/usr.sbin/bsnmpd/modules/snmp_hostres
/freebsd-9.3-release/usr.sbin/bsnmpd/modules/snmp_wlan
/freebsd-9.3-release/usr.sbin/bsnmpd/tools/bsnmptools
/freebsd-9.3-release/usr.sbin/btxld
/freebsd-9.3-release/usr.sbin/burncd
/freebsd-9.3-release/usr.sbin/cdcontrol
/freebsd-9.3-release/usr.sbin/chkgrp
/freebsd-9.3-release/usr.sbin/config
/freebsd-9.3-release/usr.sbin/cpucontrol
/freebsd-9.3-release/usr.sbin/crashinfo
/freebsd-9.3-release/usr.sbin/cron
/freebsd-9.3-release/usr.sbin/cron/crontab
/freebsd-9.3-release/usr.sbin/crunch
/freebsd-9.3-release/usr.sbin/ctladm
/freebsd-9.3-release/usr.sbin/ctm/ctm_dequeue
/freebsd-9.3-release/usr.sbin/daemon
/freebsd-9.3-release/usr.sbin/diskinfo
/freebsd-9.3-release/usr.sbin/edquota
/freebsd-9.3-release/usr.sbin/etcupdate
/freebsd-9.3-release/usr.sbin/flowctl
/freebsd-9.3-release/usr.sbin/freebsd-update
/freebsd-9.3-release/usr.sbin/fwcontrol
/freebsd-9.3-release/usr.sbin/gpioctl
/freebsd-9.3-release/usr.sbin/gssd
/freebsd-9.3-release/usr.sbin/i2c
/freebsd-9.3-release/usr.sbin/ifmcstat
/freebsd-9.3-release/usr.sbin/inetd
/freebsd-9.3-release/usr.sbin/iostat
/freebsd-9.3-release/usr.sbin/ip6addrctl
/freebsd-9.3-release/usr.sbin/jail
/freebsd-9.3-release/usr.sbin/jls
/freebsd-9.3-release/usr.sbin/kbdcontrol
/freebsd-9.3-release/usr.sbin/kbdmap
/freebsd-9.3-release/usr.sbin/keyserv
/freebsd-9.3-release/usr.sbin/kgmon
/freebsd-9.3-release/usr.sbin/kldxref
/freebsd-9.3-release/usr.sbin/lpr
/freebsd-9.3-release/usr.sbin/lpr/filters
/freebsd-9.3-release/usr.sbin/lpr/lpd
/freebsd-9.3-release/usr.sbin/makefs
/freebsd-9.3-release/usr.sbin/memcontrol
/freebsd-9.3-release/usr.sbin/mergemaster
/freebsd-9.3-release/usr.sbin/mfiutil
/freebsd-9.3-release/usr.sbin/mixer
/freebsd-9.3-release/usr.sbin/mountd
/freebsd-9.3-release/usr.sbin/moused
/freebsd-9.3-release/usr.sbin/mptutil
/freebsd-9.3-release/usr.sbin/mtest
/freebsd-9.3-release/usr.sbin/mtree
/freebsd-9.3-release/usr.sbin/named
/freebsd-9.3-release/usr.sbin/ndiscvt
/freebsd-9.3-release/usr.sbin/ndp
/freebsd-9.3-release/usr.sbin/newsyslog
/freebsd-9.3-release/usr.sbin/nfscbd
/freebsd-9.3-release/usr.sbin/nfsd
/freebsd-9.3-release/usr.sbin/nmtree
/freebsd-9.3-release/usr.sbin/ntp
/freebsd-9.3-release/usr.sbin/pc-sysinstall
/freebsd-9.3-release/usr.sbin/pciconf
/freebsd-9.3-release/usr.sbin/pkg
/freebsd-9.3-release/usr.sbin/pkg_install
/freebsd-9.3-release/usr.sbin/pkg_install/add
/freebsd-9.3-release/usr.sbin/pkg_install/info
/freebsd-9.3-release/usr.sbin/pkg_install/updating
/freebsd-9.3-release/usr.sbin/pmcannotate
/freebsd-9.3-release/usr.sbin/pmccontrol
/freebsd-9.3-release/usr.sbin/pmcstat
/freebsd-9.3-release/usr.sbin/portsnap
/freebsd-9.3-release/usr.sbin/portsnap/portsnap
/freebsd-9.3-release/usr.sbin/powerd
/freebsd-9.3-release/usr.sbin/ppp
/freebsd-9.3-release/usr.sbin/pw
/freebsd-9.3-release/usr.sbin/pwd_mkdb
/freebsd-9.3-release/usr.sbin/rarpd
/freebsd-9.3-release/usr.sbin/route6d
/freebsd-9.3-release/usr.sbin/rpc.lockd
/freebsd-9.3-release/usr.sbin/rpc.statd
/freebsd-9.3-release/usr.sbin/rpc.yppasswdd
/freebsd-9.3-release/usr.sbin/rpc.ypupdated
/freebsd-9.3-release/usr.sbin/rpc.ypxfrd
/freebsd-9.3-release/usr.sbin/rrenumd
/freebsd-9.3-release/usr.sbin/rtadvctl
/freebsd-9.3-release/usr.sbin/rtadvd
/freebsd-9.3-release/usr.sbin/rtprio
/freebsd-9.3-release/usr.sbin/rtsold
/freebsd-9.3-release/usr.sbin/rwhod
/freebsd-9.3-release/usr.sbin/sa
/freebsd-9.3-release/usr.sbin/sade
/freebsd-9.3-release/usr.sbin/sendmail
/freebsd-9.3-release/usr.sbin/service
/freebsd-9.3-release/usr.sbin/services_mkdb
/freebsd-9.3-release/usr.sbin/setfib
/freebsd-9.3-release/usr.sbin/smbmsg
/freebsd-9.3-release/usr.sbin/syslogd
/freebsd-9.3-release/usr.sbin/sysrc
/freebsd-9.3-release/usr.sbin/tcpdrop
/freebsd-9.3-release/usr.sbin/tcpdump
/freebsd-9.3-release/usr.sbin/timed
/freebsd-9.3-release/usr.sbin/timed/timed
/freebsd-9.3-release/usr.sbin/traceroute6
/freebsd-9.3-release/usr.sbin/tzsetup
/freebsd-9.3-release/usr.sbin/uhsoctl
/freebsd-9.3-release/usr.sbin/usbdump
/freebsd-9.3-release/usr.sbin/utxrm
/freebsd-9.3-release/usr.sbin/vidcontrol
/freebsd-9.3-release/usr.sbin/vipw
/freebsd-9.3-release/usr.sbin/wake
/freebsd-9.3-release/usr.sbin/watch
/freebsd-9.3-release/usr.sbin/watchdogd
/freebsd-9.3-release/usr.sbin/wlandebug
/freebsd-9.3-release/usr.sbin/wpa
/freebsd-9.3-release/usr.sbin/wpa/hostapd
/freebsd-9.3-release/usr.sbin/wpa/wpa_supplicant
/freebsd-9.3-release/usr.sbin/yp_mkdb
/freebsd-9.3-release/usr.sbin/ypbind
/freebsd-9.3-release/usr.sbin/yppush
/freebsd-9.3-release/usr.sbin/ypserv
/freebsd-9.3-release/usr.sbin/zic
267654 20-Jun-2014 gjb

Copy stable/9 to releng/9.3 as part of the 9.3-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


259485 16-Dec-2013 andreast

Fix the outstanding mergeinfo part of r249374.


252778 05-Jul-2013 achim

MFC r250963, r251013, r251056: Driver 'aacraid' added to support Adaptec by PMC RAID controller families Series 6, 7, 8 and upcoming products.

Approved by: emaste (co-mentor)


250248 04-May-2013 mdf

MFC r248933:

Use a shared lock for VOP_GETEXTATTR, as it is a read-like operation.


250111 30-Apr-2013 gnn

Improve error handling when unwrapping received data.

Submitted by: Rick Macklem


248665 23-Mar-2013 mckusick

MFC of 246876 and 246877

MFC: 246876:

Add barrier write capability to the VFS buffer interface. A barrier
write is a disk write request that tells the disk that the buffer
being written must be committed to the media along with any writes
that preceeded it before any future blocks may be written to the drive.

Barrier writes are provided by adding the functions bbarrierwrite
(bwrite with barrier) and babarrierwrite (bawrite with barrier).

Following a bbarrierwrite the client knows that the requested buffer
is on the media. It does not ensure that buffers written before that
buffer are on the media. It only ensure that buffers written before
that buffer will get to the media before any buffers written after
that buffer. A flush command must be sent to the disk to ensure that
all earlier written buffers are on the media.

Reviewed by: kib
Tested by: Peter Holm

MFC 246877:

The UFS2 filesystem allocates new blocks of inodes as they are needed.
When a cylinder group runs short of inodes, a new block for inodes is
allocated, zero'ed, and written to the disk. The zero'ed inodes must
be on the disk before the cylinder group can be updated to claim them.
If the cylinder group claiming the new inodes were written before the
zero'ed block of inodes, the system could crash with the filesystem in
an unrecoverable state.

Rather than adding a soft updates dependency to ensure that the new
inode block is written before it is claimed by the cylinder group
map, we just do a barrier write of the zero'ed inode block to ensure
that it will get written before the updated cylinder group map can
be written. This change should only slow down bulk loading of newly
created filesystems since that is the primary time that new inode
blocks need to be created.

Reported by: Robert Watson
Reviewed by: kib
Tested by: Peter Holm


248626 22-Mar-2013 mckusick

MFS of 246289:

For UFS2 i_blocks is unsigned. The current "sanity" check that it
has gone below zero after the blocks in its inode are freed is a
no-op which the compiler fails to warn about because of the use of
the DIP macro. Change the sanity check to compare the number of
blocks being freed against the value i_blocks. If the number of
blocks being freed exceeds i_blocks, just set i_blocks to zero.

Reported by: Pedro Giffuni (pfg@)


247111 21-Feb-2013 mav

MFC r230590 (by ken) except parts changing ABI:
Add CAM infrastructure to allow reporting when a drive's long read capacity
data changes.


245258 10-Jan-2013 ae

MFC r244750:
Add net.link.stf.permit_rfc1918 sysctl variable. It can be used to allow
the use of private IPv4 addresses with stf(4).

MFC r244752:
Add an ability to set net.link.stf.permit_rfc1918 from the loader.


244999 03-Jan-2013 gnn

MFC: 234930

Fix so that ,usr and ,os work correctly with fixed function (IAF)
counters.


243989 07-Dec-2012 gnn

MFC: 238366, 240924

Initial commit of an I/O provider for DTrace on FreeBSD.

These probes are most useful when looking into the structures
they provide, which are listed in io.d. For example:

dtrace -n 'io:kernel::start { printf("%d\n", args[0]->bio_bcount); }'

Note that the I/O systems in FreeBSD and Solaris/Illumos are sufficiently
different that there is not a 1:1 mapping from scripts that work
with one to the other.

This commit includes the fix so that our probes use "kernel"
instead of the Solaris specific "genunix"


241681 18-Oct-2012 marius

MFC: r239864

- Unlike cache invalidation and TLB demapping IPIs, reading registers from
other CPUs doesn't require locking so get rid of it. As the latter is used
for the timecounter on certain machine models, using a spin lock in this
case can lead to a deadlock with the upcoming callout(9) rework.
- Merge r134227/r167250 from x86:
Avoid cross-IPI SMP deadlock by using the smp_ipi_mtx spin lock not only
for smp_rendezvous_cpus() but also for the MD cache invalidation and TLB
demapping IPIs.
- Mark some unused function arguments as such.


241222 05-Oct-2012 jh

MFC r239257:

Reserve room for the terminating NUL when setting or getting kernel
environment variables. KENV_MNAMELEN and KENV_MVALLEN doesn't include
space for the terminating NUL.


241194 04-Oct-2012 rmacklem

MFC: r240720
Modify the NFSv4 client so that it can handle owner
and owner_group strings that consist entirely of
digits, interpreting them as the uid/gid number.
This change was needed since new (>= 3.3) Linux
servers reply with these strings by default.
This change is mandated by the rfc3530bis draft.
Reported on freebsd-stable@ under the Subject
heading "Problem with Linux >= 3.3 as NFSv4 server"
by Norbert Aschendorff on Aug. 20, 2012.


241112 01-Oct-2012 jhb

MFC 239779:
Shorten the name of the fast SWI taskqueue to "fast taskq" so that
it fits.


241110 01-Oct-2012 jhb

MFC 239008,239020:
Improve the handling of static DMA buffers that use non-default memory
attributes (currently just BUS_DMA_NOCACHE):
- Don't call pmap_change_attr() on the returned address, instead use
kmem_alloc_contig() to ask the VM system for memory with the requested
attribute.
- As a result, always use kmem_alloc_contig() for non-default memory
attributes, even for sub-page allocations. This requires adjusting
bus_dmamem_free()'s logic for determining which free routine to use.
- For x86, add a new dummy bus_dmamap that is used for static DMA
buffers allocated via kmem_alloc_contig(). bus_dmamem_free() can then
use the map pointer to determine which free routine to use.
- For powerpc, add a new flag to the allocated map (bus_dmamem_alloc()
always creates a real map on powerpc) to indicate which free routine
should be used.

Note that the BUS_DMA_NOCACHE handling in powerpc is currently #ifdef'd out.
I have left it disabled but updated it to match x86.


241109 01-Oct-2012 jhb

MFC 239771: Fix misspelled "Infiniband".


240977 26-Sep-2012 rmacklem

MFC: r240289
Add a simple printf() based debug facility to the new nfs client.
Use it for a printf() that can be harmlessly generated for mmap()'d
files. It will be used extensively for the NFSv4.1 client.
Debugging printf()s are enabled by setting vfs.nfs.debuglevel to
a non-zero value. The higher the value, the more debugging printf()s.


240217 07-Sep-2012 thomas

Merge rev. 239673 from head to stable/9:
(g_multipath_rotate): Fix algorithm so that it does rotate over all good
providers, not just the last two.


240159 06-Sep-2012 thomas

MFC: merge rev. 239012 from head to stable/9
New command "gmultipath prefer" to force selection of a specified
provider in an Active/Passive configuration.


239920 30-Aug-2012 jhb

MFC 239128:
Don't try to stop the IPMI watchdog timer if it is not running.
Starting or stopping the IPMI watchdog is rather expensive with the
current implementation as all IPMI requests are bounced via thread.
This is not viable during shutdown or dumps, and this avoids headache
in the common case that the watchdog is not enabled. The IPMI watchdog
should probably be reworked to not use a separate thread to fix this
in the case when the watchdog timer is enabled.


239917 30-Aug-2012 jhb

MFC 239103:
Explicitly enable busmastering on PCI-PCI bridges. Transactions initiated
on the secondary side of a bridge will not be propagated to the primary
bus unless this is enabled. Busmastering is not enabled by default (we
have relied on firmware to set this bit to date). The OS needs to set it
for any bridges not configured by system firmware.


239915 30-Aug-2012 jhb

MFC 238424:
Make the interval timings for EVFILT_TIMER more accurate. tvtohz() always
adds an extra tick to account for the current partial clock tick. However,
that is not appropriate for a repeating timer when the exact tvtohz() value
should be used for subsequent intervals. Fix repeating callouts for
EVFILT_TIMER by subtracting 1 tick from the tvtohz() result similar to the
fix used in realitexpire() for interval timers.

While here, update a few comments to note that if the EVFILT_TIMER code
were to move out of kern_event.c, it should move to kern_time.c (where the
interval timer code it mimics lives) rather than kern_timeout.c.


239914 30-Aug-2012 jhb

MFC 238311:
Add a clts() wrapper around the 'clts' instruction to <machine/cpufunc.h>
on x86 and use that to implement stop_emulating() in the fpu/npx code.
Reimplement start_emulating() in the non-XEN case by using load_cr0() and
rcr0() instead of the 'lmsw' and 'smsw' instructions. Intel explicitly
discourages the use of 'lmsw' and 'smsw' on 80386 and later processors in
the description of these instructions in Volume 2 of the ADM.


239882 29-Aug-2012 jhb

MFC 238142,238179:
Now that our assembler supports the xsave family of instructions, use them
natively rather than hand-assembled versions. For xgetbv/xsetbv, add a
wrapper API to deal with xcr* registers: rxcr() and load_xcr().


239880 29-Aug-2012 jhb

MFC 238310:
Partially revert r217515 so that the mem_range_softc variable is always
present on x86 kernels. This fixes the build of kernels that include
'device acpi' but do not include 'device mem'.


239879 29-Aug-2012 jhb

MFC 238109,238166:
Several fixes to the amd64 disassembler:
- Decode the 'xsave', 'xrstor', 'xsaveopt', 'xgetbv', 'xsetbv', and
'rdtscp' instructions.
- Add generic support for opcodes that are escape bytes used for
multi-byte opcodes (such as the 0x0f prefix). Use this to replace
the hard-coded 0x0f special case and add support for three-byte
opcodes that use the 0x0f38 prefix.
- Decode all Intel VMX instructions. invept and invvpid in particular are
three-byte opcodes that use the 0x0f38 escape prefix.
- Rework how the special 'SDEP' size flag works such that the default
instruction name (i_name) is the instruction when the data size
prefix (0x66) is not specified, and the alternate name in i_extra is
used when the prefix is included.
- Add a new 'ADEP' size flag similar to 'SDEP' except that it chooses
between i_name and i_extra based on the address size prefix (0x67).
Use this to fix the decoding for jrcxz vs jecxz which is determined
by the address size prefix, not the operand size prefix. Also, jcxz
is not possible in 64-bit mode, but jrcxz is the default instruction
for that opcode.
- Add support for handling instructions that have a mandatory 'rep'
prefix (this means not outputting the 'repe ' prefix until determining
if it is used as part of an opcode). Make 'pause' less of a special
case this way.
- Decode 'cmpxchg16b' and 'cdqe' which are variants of other instructions
but with a REX.W prefix.


239874 29-Aug-2012 jhb

MFC 238000,239584:
Honor db_pager_quit in 'show malloc', 'show uma', and 'show witness'.


239866 29-Aug-2012 jhb

MFC 238077:
Fix panics triggered by older mfiutil binaries run on the new mfi(4) driver.
The new driver changed the size of the mfi_dcmd_frame structure in such a
way that a MFI_IOC_PASSTHRU ioctl from an old amd64 binary is treated as an
MFI_IOC_PASSTHRU32 ioctl in the new driver. As a result, the user pointer
is treated as the buffer length. mfi_user_command() doesn't have a bounds
check on the buffer length, so it passes a really big value to malloc()
which panics when it tries to exhaust the kmem_map. Fix this two ways:
- Only honor MFI_IOC_PASSTHRU32 if the binary has the SV_ILP32 flag set,
otherwise treat it as an unknown ioctl.
- Add a bounds check on the buffer length passed by the user. For now
it fails any user attempts to use a buffer larger than 1MB.

While here, fix a few other nits:
- Remove an unnecessary check for a NULL return from malloc(M_WAITOK).
- Use the ENOTTY errno for invalid ioctl commands instead of ENOENT.


239821 29-Aug-2012 jhb

MFC 237338:
Don't return an error if a kld does not contain any modules (e.g. a
kld that only contained a sysctl). The kernel linker allows such
modules, so the boot loader should not reject them.


239787 28-Aug-2012 jhb

MFC 230782,237274:
Refine the implementation of POSIX_FADV_NOREUSE to perform
POSIX_FADV_DONTNEED requests on the currently accessed portion of the
file on each read(2) or write(2) rather than using direct I/O. This
gives much better performance including read-ahead and write clustering
similar to normal read(2) and write(2) calls.

If subsequent read(2) and write(2) calls are sequential, then the
POSIX_FADV_DONTNEED requests will cover the entire sequentially-accessed
range.


239748 27-Aug-2012 jhb

MFC 233040,233198,233870,234183:
Add OFED and the associated options and drivers to x86 LINT builds:
- Fix build with INET6 disabled.
- Fix build of OFED bits with debugging options enabled.
- Fix build on i386.
- Mark 'sdp' as requiring 'inet'.
- Always include "opt_inet.h" and "opt_inet6.h" and modify the IB
driver Makefiles to honor WITH/WITHOUT_INET/INET6/_SUPPORT options
to determine what should be enabled during a module build.
- Fix the mlxen(4) driver and the core IB code to compile without
if INET is disabled (including when both INET and INET6 are disabled).


239662 24-Aug-2012 jhb

MFC 233872:
Add descriptions after the 'device' line for several NICs to match the
existing style.


239565 22-Aug-2012 mdf

MFC r238502:

Fix a bug with memguard(9) on 32-bit architectures without a
VM_KMEM_MAX_SIZE.

The code was not taking into account the size of the kernel_map, which
the kmem_map is allocated from, so it could produce a sub-map size too
large to fit. The simplest solution is to ignore VM_KMEM_MAX entirely
and base the memguard map's size off the kernel_map's size, since this
is always relevant and always smaller.

Found by: Justin Hibbits


239483 21-Aug-2012 marius

MFC: r239079

Merge r236494 from x86:

Isolate the global TTE list lock from data and other locks to prevent false
sharing within the cache.


238916 30-Jul-2012 jhb

MFC 238164:
Add another PS/2 keyboard PNP ID. This ID is listed as
"Reserved by Microsoft" in the standard PNP ID table, but has been seen
in the wild on at least one laptop.

Approved by: re (kib)


238904 30-Jul-2012 marius

Pull the tier-2 card and change the sparc64 ZFS loader to no longer probe
all diskN aliases for providers (which more or less corresponds to how the
x86 version behaves) but instead probe only those listed in the boot-device
OFW environment variable. This has the following advantages:
- avoids otherwise unavoidable OFW warnings about failures to open disks
for which aliases exist but no actual hardware is connected
- avoids issues due to different diskN naming schemes
- aligns us with Solaris

Approved by: re (kib)


238689 22-Jul-2012 marius

MFC: r238621

Revert the use of BUS_DMA_ALLOCNOW when creating the DMA tag for user
data introduced in r236061 (MFC'ed to stable/9 in r237186). Using that
flag doesn't make that much sense on this case as the DMA maps using
it are also created during sym_pci_attach(). Moreover, due to the
maxsegsz parameter used, doing so may exhaust the bounce pages pool
on architectures requiring bounce pages. [1]
While at it, use a slightly more appropriate maxsegsz parameter.

PR: 169526
Submitted by: Mike Watters [1]
Approved by: re (kib)


238047 03-Jul-2012 thompsa

MFC r237852

Add the same check as vlan(4) where we ignore the ifnet departure event if the
interface is just being renamed.

PR: kern/169557


238017 02-Jul-2012 marius

MFC: r237547

Fix size of the bcopy when extracting ethernet address

Obtained from: DragonFly


238013 02-Jul-2012 marius

MFC: r237546

Correct sizeof usage

Obtained from: DragonFly


238012 02-Jul-2012 marius

MFC: r237842

Switch back to the 4BSD scheduler for now. There is some more or less
recent regression with ULE, causing processes to get stuck in getblk
as well as interrupt handler execution delays to rise above the command
timeout of mpt(4).


237995 02-Jul-2012 bms

Merge r237736 from HEAD:
Kick the current-state report timer when a V1 group report would
be triggered.

Submitted by: rpaulo@


237992 02-Jul-2012 bms

Merge r237735 from HEAD:
Fix a typo in MLD query exponent processing.

Submitted by: rpaulo@


237990 02-Jul-2012 bms

Merge r237734 from HEAD:
In MLDv2 general query processing, do not enforce the strict check
on query origins.

Submitted by: Gu Yong


237839 30-Jun-2012 avg

MFC r236503: free wdog_kern_pat calls in post-panic paths from under
SW_WATCHDOG


237822 29-Jun-2012 jhb

MFC 235024,235029,235556,235834,235845:
Use MADT to match ACPI Processor objects to CPUs. MADT and DSDT/SSDTs may
list CPUs in different orders, especially for disabled logical cores. Now
we match ACPI IDs from the MADT with Processor objects, strictly order CPUs
accordingly, and ignore disabled cores. This prevents us from executing
methods for other CPUs, e. g., _PSS for disabled logical core, which may not
exist. Unfortunately, it is known that there are a few systems with buggy
BIOSes that do not have unique ACPI IDs for MADT and Processor objects. To
work around these problems, 'debug.acpi.cpu_unordered' tunable is added.
Set this to a non-zero value to restore the old behavior.


237815 29-Jun-2012 marius

MFC: r236581

The loaddev environment variable is not modifiable once set, so it is not
update for ZFS. It seems that this does not really affect anything except
the help command. Nevertheless, rearrange things so loaddev is set only
once in all cases in order to get it right.
Pointed out by: avg


237805 29-Jun-2012 jhb

MFC 233191:
Fix madvise(MADV_WILLNEED) to properly handle individual mappings larger
than 4GB. Specifically, the inlined version of 'ptoa' of the the 'int'
count of pages overflowed on 64-bit platforms. While here, change
vm_object_madvise() to accept two vm_pindex_t parameters (start and end)
rather than a (start, count) tuple to match other VM APIs as suggested
by alc@.


237803 29-Jun-2012 jhb

MFC 237334:
Move the per-thread deferred user map entries list into a private list
in vm_map_process_deferred() which is then iterated to release map entries.
This avoids having a nested vm map unlock operation called from the loop
body attempt to recuse into vm_map_process_deferred(). This can happen if
the vm_map_remove() triggers the OOM killer.


237797 29-Jun-2012 jhb

MFC 237008,237271,237272,237673:
- Fix a couple of bugs that prevented windows in PCI-PCI bridges from
growing "downward" (moving the start address down). First, an off by
one error caused the end address to be moved down an extra alignment
chunk unnecessarily. Second, when aligning the new candidate starting
address, the wrong bits were masked off.
- Add a 'wmask' variable to hold the expression '(1ul << w->step) - 1' in
pcib_grow_window().
- For subtractively decoding bridges, don't try to grow windows but pass
the request up the tree in order to be on the safe side. Growing windows
in this case would mean to switch resources to positive decoding and
it's unclear how to correctly handle this. At least with ALi/ULi M5249
PCI-PCI bridges, this also just doesn't work out of the box.


237771 29-Jun-2012 avg

MFC r235390: zfs boot code: mark spa_t arguments as const where they are
used as such


237770 29-Jun-2012 avg

MFC r235392,235394,235395: fixes and cleanups for zfs boot MFC


237767 29-Jun-2012 avg

MFC r235330: zfs boot: try to set vfs.root.mountfrom from currdev as a
fallback


237766 29-Jun-2012 avg

MFC r235329,235343,235361,235364: zfsboot/zfsloader: support accessing
filesystems within a pool


237763 29-Jun-2012 avg

MFC r235264: MFi386: improve argument passing via btxldr


237761 29-Jun-2012 avg

MFC r235219: cdboot, pxeldr: make use of bootargs.h instead of
redefining flag constants


237760 29-Jun-2012 avg

MFC r235156: i386 zfsloader: rename LIBZFS to LIBZFSBOOT


237758 29-Jun-2012 avg

MFC r235155: i386 boot: consolidate MAXBDDEV definition


237752 29-Jun-2012 avg

MFC r235153: sys/boot: add common CTASSERT definition


237731 28-Jun-2012 jhb

MFC 228161,230774,230822,236415:
Add a new -e flag to pciconf(8)'s list mode to display PCI error details.
Currently this dumps the status of any error bits in the PCI status register
and PCI-express device status register. It also lists any errors indicated
by version 1 of PCI-express Advanced Error Reporting (AER).


237727 28-Jun-2012 jhb

MFC 236405:
Remove unnecessary initializations. The BSS of boot2 is in fact
zero'd when boot2 begins execution by the _start() routine in btxcsu.S.


237725 28-Jun-2012 jhb

MFC 236404:
Extend VERBOSE_SYSINIT to also print out the name of variables passed
to SYSINIT routines if they can be resolved via symbol look up in DDB.
To avoid false positives, only honor a name if the symbol resolves
exactly to the pointer value (no offset).


237719 28-Jun-2012 jhb

MFC 234494:
Include the associated wait channel message for context switch ktrace
records. kdump supports both the old and new messages.


237670 27-Jun-2012 thompsa

MFC r236178

if_lagg: allow to invoke SIOCSLAGGPORT multiple times in a row


237669 27-Jun-2012 thompsa

MFC r236062

Turn LACP debugging from a compile time option to a sysctl, it is very handy to
be able to turn it on when negotiation to a switch misbehaves.


237663 27-Jun-2012 jhb

MFC 233925,236357:
Add new ktrace records for the start and end of VM faults. This gives
a pair of records similar to syscall entry and return that a user can
use to determine how long page faults take. The new ktrace records are
enabled via the 'p' trace type, but are not enabled in the default set of
trace points.


237543 25-Jun-2012 rmacklem

MFC: r237244
Fix the NFSv4 client for the case where mmap'd files are
written, but not msync'd by a process. A VOP_PUTPAGES()
called when VOP_RECLAIM() happens will usually fail, since
the NFSv4 Open has already been closed by VOP_INACTIVE().
Add a vm_object_page_clean() call to the NFSv4 client's
VOP_INACTIVE(), so that the write happens before the NFSv4
Open is closed. kib@ suggested using vgone() instead and
I will explore this, but this patch fixes things in the
meantime. For some reason, the VOP_PUTPAGES() is still
attaempted in VOP_RECLAIM(), but having this fail doesn't
cause any problems except a "stateid0 in write" being logged.


237534 24-Jun-2012 rmacklem

MFC: r237200
Move the nfsrpc_close() call in ncl_reclaim() for the NFSv4 client
to below the vnode_destroy_vobject() call, since that is where
writes are flushed.


237491 23-Jun-2012 marius

MFC: r231616, r232497, r234337

Add __aeabi_read_tp function required for thread-local storage.


237444 22-Jun-2012 gnn

MFC 230063
Clean up a switch statement for uncore events on Westmere processors.

Submitted by: Davide Italiano
Reviewed by: gnn


237388 21-Jun-2012 marius

MFC: r231617

Add ARM relocations types used for thread-local storage

Reviewed by: cognet


237386 21-Jun-2012 marius

MFC: r235348, r236191, r236497

Add glue/support for the SAM9XE512-based Ethernut 5 boards. Currently,
all integrated and on-board peripherals except NAND Flash (missing NAND
framework/integration) are working.


237384 21-Jun-2012 marius

MFC: r236496

- Loop up to 3 seconds when waiting for a device to get ready. [1]
- Make the device description match the driver name.
- Identify the chip variant based on the JEDEC and use that information
to use the proper values for page count, offset and size instead of
hardcoding a AT45DB642x with 2^N byte page support disabled.
- Take advantage of bioq_takefirst().
- Given that CONTINUOUS_ARRAY_READ_HF (0x0b) command isn't even mentioned
in Atmel's DataFlash Application Note, as suggested by the previous
comment may not work on all all devices and actually doesn't properly
on at least AT45DB321D (JEDEC 0x1f2701), rewrite at45d_task() to use
CONTINUOUS_ARRAY_READ (0xe8) for reading instead. This rewrite is laid
out in a way allowing to easily add support for BIO_DELETE later on.
- Add support for reads and writes not starting on a page boundary.
- Verify the flash content after writing.
- Let at45d_task() gracefully handle errors on SPI transfers and the
device not becoming ready afterwards again. [1]
- Use DEVMETHOD_END. [1]
- Use NULL instead of 0 for pointers. [1]

Additional testing by: Ian Lepore

Submitted by: Ian Lepore [1]


237382 21-Jun-2012 marius

MFC: r237239

Revert the part of r236495 (MFC'ed to stable/9 in r237095) that
introduced checking of SPI_SR_TXEMPTY for TX transfer completion as
for reasons unknown this occasionally causes SPI_SR_RXBUFF and
SPI_SR_ENDRX to not rise.
In any case, once the RX part of the transfer is done it's obvious
that the preceding TX part had finished and checking of SPI_SR_TXEMPTY
was introduced to rule out a possible cause for the data corruption
mentioned in r236495 but which didn't turn out to be the problem
anyway.


237380 21-Jun-2012 marius

MFC: r230242, r237102, r237236

- Add support for the FT2232 based egnite Turtelizer 2 JTAG/RS232 Adapter.
This includes adding support for skipping FTDI interfaces used for JTAG
leaving them for userland and just attaching to the RS232 half, similarly
to how the corresponding Linux drivers handles these kind of adapters.
While at it, sort uftdi_devs and return BUS_PROBE_SPECIFIC (because
uftdi_probe() alters the instance variables for better or worse as do
other probe routines of USB drivers) instead of 0.
- Remove duplicated entries for BeagleBone.
- Use DEVMETHOD_END.
- Use NULL instead of 0 for pointers.
- Remove some stray lines.


237352 21-Jun-2012 mckusick

MFC of 236937

In softdep_setup_inomapdep() we may have to allocate both inodedep
and bmsafemap dependency structures in inodedep_lookup() and
bmsafemap_lookup() respectively. The setup of these structures must
be done while holding the soft-dependency mutex. If the inodedep is
allocated first, it may be freed in the I/O completion callback when
the mutex is released to allocate the bmsafemap. If the bmsafemap is
allocated first, it may be freed in the I/O completion callback when
the mutex is released to allocate the inodedep.

To resolve this problem, bmsafemap_lookup has had a parameter added
that allows a pre-malloc'ed bmsafemap to be passed in so that it does
not need to release the mutex to create a new bmsafemap. The
softdep_setup_inomapdep() routine pre-malloc's a bmsafemap dependency
before acquiring the mutex and starting to build the inodedep with a
call to inodedep_lookup(). The subsequent call to bmsafemap_lookup()
is passed this pre-allocated bmsafemap entry so that it need not
release the mutex if it needs to create a new one.

Reported by: Peter Holm
Tested by: Peter Holm


237351 21-Jun-2012 mckusick

MFC of 236825

When synchronously syncing a device (MNT_WAIT), wait for buffers
to become available. Otherwise we may excessively spin and fail
with ``fsync: giving up on dirty''.

Reviewed by: kib
Tested by: Peter Holm


237343 20-Jun-2012 rnoland

MFC r236246

Add device ids for the Winbond 83627DHG-P chip and set the registers to
trigger the keyboard reset line on timeout.


237342 20-Jun-2012 rnoland

MFC r236245

Fix a typo in wbwd so that CRF5 is actually written to the data register
rather than the index register.


237191 17-Jun-2012 marius

MFC: r237107

- As a baind-aid, disable ATAPI DMA when using ATA_CAM for these controllers
as well as it causes the kernel to hang during boot.
Reported and tested by: Kevin Oberman
- Use NULL instead of 0 for a pointer.


237188 17-Jun-2012 marius

MFC: r230179

BeagleBone uses an FTDI chip with
an altered Product ID.


237186 17-Jun-2012 marius

MFC: r237101

Fix a braino in r236469 (MFC'ed to stable/9 in r236468); the number of
DMA tags required for handling MAXPHYS should be based on PAGE_SIZE rather
than SYM_CONF_DMA_BOUNDARY.
While at it, reuse the SYM_CONF_MAX_SG macro for specifying the maximum
number of DMA tags so sym(4) itself doesn't size memory beyond what's
required for handling MAXPHYS.

PR: 168928


237103 14-Jun-2012 thompsa

MFC r236916

Fix a panic I introduced in r234487, the bridge softc pointer is set to null
early in the detach so rearrange things not to explode.

Reported by: David Roffiaen, Gustau Perez Querol


237095 14-Jun-2012 marius

MFC: r236495

- Prepend the device description with "AT91" to reflect its nature. [1]
- Move DMA tag and map creature to at91_spi_activate() where the other
resource allocation also lives. [1]
- Flesh out at91_spi_deactivate(). [1]
- Work around the "Software Reset must be Written Twice" erratum.
- For now, run the bus at the slowest speed possible in order to work
around data corruption on transit even seen with 9 MHz on ETHERNUT5
(15 MHz maximum) and AT45DB321D (20 MHz maximum). This also serves as
a poor man's work-around for the "NPCSx rises if no data data is to be
transmitted" erratum of RM9200. Being able to use the appropriate bus
speed would require:
1) Adding a proper work-around for the RM9200 bug consisting of taking
the chip select control away from the SPI peripheral and managing it
directly as a GPIO line.
2) Taking the maximum frequencies supported by the actual board and the
slave devices into account and basing the whole thing on the master
clock instead of hardcoding a divisor as previously done.
3) Fixing the above mentioned data corruption.
- KASSERT that TX/RX command and data sizes match on transfers.
- Introduce a mutex ensuring that only one child device is running a SPI
transfer at a time. [1]
- Add preliminary, #ifdef'ed out support for setting the chip select. [1]
- Use the RX instead of the TX commando size when setting up the RX side
of a transfer.
- For controllers having SPI_SR_TXEMPTY, i.e. !RM9200, also wait for the
completion of the TX part of transfers before stopping the whole thing
again.
- Use DEVMETHOD_END. [1]
- Use NULL instead of 0 for pointers. [1, partially]

Additional testing by: Ian Lepore

Submitted by: Ian Lepore [1]


237093 14-Jun-2012 marius

MFC: r225882

Remove pointless semicolons after label


237091 14-Jun-2012 marius

MFC: r236579

The workaround added in r151650 for handling firmwares that don't allow
a single device to be opened multiple times concurrently unfortunately
isn't sufficient with ZFS. This is due to the fact, that ZFS may open
different partitions of a single device simultaneously. So the best we
can do in this case is to cache the lastly used device path and close
and open devices in ofwd_strategy() as needed.

PR: 165025
Submitted by: Gavin Mu


236887 11-Jun-2012 rmacklem

MFC: r235381
Fix two cases in the new NFS server where a tsleep() is
used, when the code should actually protect the tested
variable with a mutex. Since the tsleep()s had a 10sec
timeout, the race would have only delayed the allocation
of a new clientid for a client. The sleeps will also
rarely occur, since having a callback in progress when
a client acquires a new clientid, is unlikely.
in practice, since having a callback in progress when
a fresh clientid is being acquired by a client is unlikely.


236702 07-Jun-2012 yongari

MFC r236371:
Remove unnecessary device_printfs.


236698 06-Jun-2012 jhb

MFC 233760:
Export some more useful info about shared memory objects to userland
via procstat(1) and fstat(1):
- Change shm file descriptors to track the pathname they are associated
with and add a shm_path() method to copy the path out to a caller-supplied
buffer.
- Use the fo_stat() method of shared memory objects and shm_path() to
export the path, mode, and size of a shared memory object via
struct kinfo_file.
- Add a struct shmstat to the libprocstat(3) interface along with a
procstat_get_shm_info() to export the mode and size of a shared memory
object.
- Change procstat to always print out the path for a given object if it
is valid.
- Teach fstat about shared memory objects and to display their path,
mode, and size.


236683 06-Jun-2012 jhb

MFC 228509,228620,228533:
Add a helper API to allow in-kernel code to map portions of shared memory
objects created by shm_open(2) into the kernel's address space. This
provides a convenient way for creating shared memory buffers between
userland and the kernel without requiring custom character devices.


236642 05-Jun-2012 marius

MFC: r236491

Add missing prototypes. While at it, sort them alphabetically.


236641 05-Jun-2012 marius

MFC: r236488

Take advantage of nitems().


236631 05-Jun-2012 marius

MFC: r236486

Add nitems(), a macro for determining the number of elements in a
statically-allocated array.

Obtained from: OpenBSD (in principle)

MFC: r236489


236518 03-Jun-2012 marius

MFC: r233666

Fix build after changes to trap headers.


236511 03-Jun-2012 marius

MFC: r233635

Allow multiple inclusion of trap.h. This has always been broken, but
until recently never caused problems.


236484 02-Jun-2012 marius

MFC: r236328

Try to finally get the point in time at which bge_add_sysctls() is called
right; it needs to be called before bge_can_use_msi() but in turn requires
bge_flags to be properly set.

Submitted by: yongari


236481 02-Jun-2012 avg

MFC r235829: vm_pager_object_lookup: small performance optimization


236479 02-Jun-2012 marius

MFC: r236156

- Fix some typos in mmc_acquire_bus() and mmc_send_csd().
- Fix some math errors in mmc_decode_csd_sd().
- Fix incorrect arguments to mmc_send_app_op_cond() in mmc_go_discovery().
- Add reporting of CSD for debug purposes.
- Add detection (and skipping) of password-locked cards.
- Add setting of block length on card if necessary.

Submitted by: Patrick Kelsey


236477 02-Jun-2012 marius

MFC: r236070

Consistently use USB_PAGE_SIZE. Currently, this is cosmetic.


236475 02-Jun-2012 marius

MFC: r236069, r236073

Make the VIA workaround actually do its intended job.


236473 02-Jun-2012 marius

MFC: r236063

Remove extraneous empty lines.


236472 02-Jun-2012 marius

Revert changes accidentally committed as part of r236468.


236468 02-Jun-2012 marius

MFC: r236061

- When creating the DMA tag for user data, don't ask for more segments
than required for handling MAXPHYS and report the resulting maximum
I/O size to CAM instead of implicitly limiting it to DFLTPHYS.
- Move the variables of sym_action2() out of nested scope as required
by style(9) and remove extraneous curly braces.
- Replace a magic value for PCIR_COMMAND with the appropriate macro.
- Use DEVMETHOD_END.
- Use NULL instead of 0 for pointers.

Tested with a HBA donated by wilko.


236464 02-Jun-2012 avg

MFC r235391: i386 bootinfo: re-arrange EFI fields for natural alignment
and packing


236413 01-Jun-2012 gallatin

MFC 236212:

Update mxge(4) firmware to the latest version available from
Myricom (1.4.55).

Sponored by: Myricom, Inc.


236320 30-May-2012 jhb

MFC 235833:
Only check to see if a memory resource is a PCI ROM BAR when activating
and deactivating PCI resources. Previously, if a device had more than
48 MSI interrupts, then activating message 48 (which has a rid == PCIR_BIOS)
would incorrectly try to enable the PCI ROM BAR.


236318 30-May-2012 jhb

MFC 234501:
The amr(4) firmware contains a rather dubious "feature" where it
assumes for small buffers (< 64k) that the OS driver is actually using
a buffer rounded up to the next power of 2. It also assumes that the
buffer is at least 4k in size. Furthermore, there is at least one
known instance of megarc sending a request with a 12k buffer where the
firmware writes out a 24k-ish reply.

To workaround the data corruption triggered by this "feature", ensure
that buffers for user commands use a minimum size of 32k, and that
buffers between 32k and 64k use a 64k buffer.


236316 30-May-2012 jhb

MFC 234099:
Properly parse 40G media types from newer Mellanox adapters that are
40G capable. For now, map all 40G links to 40GBase-CR4.


236218 29-May-2012 yongari

MFC r235821:
Don't force max payload size to 128. Root complex and Endpoint will
negotiate with each other on the TLP payload size so blindly
forcing the size to 128 can cause a completion error which in turn
will stop device.

Reported by: Geans Pin < geanspin <> broadcom dot com >


236216 29-May-2012 yongari

MFC r235816:
Make IPMI work in the bce driver even when the interface is
configured down. Formerly, IPMI communication was lost whenever the
interface was not up. The reason was that the BCE_EMAC_MODE
register was not configured with the correct media settings. There
are two parts to the fix.

First, resetting the chip in bce_reset() causes the BCE_EMAC_MODE
register to be initialized to a default value that does not
necessarily correspond to the actual media settings. The fix
implemented here is a bit of a hack. Ideally, at the end of
bce_reset() we would poll the PHY to determine the negotiated media,
and then we would set the BCE_EMAC_MODE register accordingly. That
is difficult, since the PHY is abstracted behind the MII layer and is
not supposed to be queried directly from the MAC driver. Instead,
we read the BCE_EMAC_MODE register at the beginning of bce_reset()
and then restore its media bits to their original values before
returning. If IPMI is up and running, then the link is already
established and the BCE_EMAC_MODE register is already set appropriately
when bce_reset() is called. If IPMI is not running, no harm is
done by preserving the BCE_EMAC_MODE settings. The driver will set
the register properly once the interface is configured up and link
is established.

Second, bce_miibus_statchg() is sometimes called when the link is
down. In that case, the reported media settings are invalid.
Formerly, the driver used them anyway to setup the BCE_EMAC_MODE
register. We now avoid changing any MAC registers unless link is
active and the reported media settings are valid.

Submitted by: jdp
Tested by: jdp


236164 27-May-2012 mckusick

MFC of 235610

Add missing `continue' statement at end of case.

Found by: Kevin Lo (kevlo@)


236134 27-May-2012 rmacklem

MFC: r234740
Fix a leak of namei lookup path buffers that occurs when a
ZFS volume is exported via the new NFS server. The leak occurred
because the new NFS server code didn't handle the case where
a file system sets the SAVENAME flag in its VOP_LOOKUP() and
ZFS does this for the DELETE case.


236096 26-May-2012 rmacklem

MFC: r235332
PR# 165923 reported intermittent write failures for dirty
memory mapped pages being written back on an NFS mount.
Since any thread can call VOP_PUTPAGES() to write back a
dirty page, the credentials of that thread may not have
write access to the file on an NFS server. (Often the uid
is 0, which may be mapped to "nobody" in the NFS server.)
Although there is no completely correct fix for this
(NFS servers check access on every write RPC instead of at
open/mmap time), this patch avoids the common cases by
holding onto a credential that recently opened the file
for writing and uses that credential for the write RPCs
being done by VOP_PUTPAGES() for both NFS clients.


236089 26-May-2012 marius

MFC: r234524

o Fixes:
- When switching to 4-bit operation, send a SET_CLR_CARD_DETECT command
to disconnect the card-detect pull-up resistor from the DAT3 line before
sending the SET_BUS_WIDTH command.
- Add the missing "reserved" zero entry to the mantissa table used to
decode various CSD fields. This was causing SD cards to report that they
could run at 30 MHz instead of the maximum 25 MHz mandated in the spec.
o Enhancements:
- At the MMC layer, format various info from the CID into a string that
uniquely identifies the card instance (manufacturer number, serial
number, product name and revision, etc). Export it as an instance
variable.
- At the MMCSD layer, display the formatted card ID string, and also
report the clock speed of the hardware (not the card's max speed), and
the number of bits and number of blocks per transfer. It comes out like
this now:
mmcsd0: 968MB <SD SD01G 8.0 SN 276886905 MFG 08/2008 by 3 SD> at mmc0
22.5MHz/4bit/128-block
o Use DEVMETHOD_END.
o Use NULL instead of 0 for pointers.

PR: 156496
Submitted by: Ian Lepore


236088 26-May-2012 marius

MFC: r234901

- Add missing locking in at91_usart_getc().
- Align the RX buffers on the cache line size, otherwise the requirement
of partial cache line flushes on every are pretty much guaranteed. [1]
- Make the code setting the RX timeout match its comment (apparently,
start and stop bits were missed in the previous calculation). [1]
- Cover the busdma operations in at91_usart_bus_{ipend,transmit}() with
the hardware mutex, too, so these don't race against each other.
- In at91_usart_bus_ipend(), reduce duplication in the code dealing with
TX interrupts.
- In at91_usart_bus_ipend(), turn the code dealing with RX interrupts
into an else-if cascade in order reduce its complexity and to improve
its run-time behavior.
- In at91_usart_bus_ipend(), add missing BUS_DMASYNC_PREREAD calls on
the RX buffer map before handing things over to the hardware again. [1]
- In at91_usart_bus_getsig(), used a variable of sufficient width for
storing the contents of USART_CSR.
- Use KOBJMETHOD_END.
- Remove an unused header.

Submitted by: Ian Lepore [1]
Reviewed by: Ian Lepore


236085 26-May-2012 marius

MFC: r234561

Interrupts must be disabled while handling a partial cache line flush,
as otherwise the interrupt handling code may modify data in the non-DMA
part of the cache line while we have it stashed away in the temporary
stack buffer, then we end up restoring a stale value.

PR: 160431
Submitted by: Ian Lepore


236084 26-May-2012 marius

MFC: r234560

- Add support for MCI1 revision 2xx controllers and a work-around for their
"Data Write Operation and number of bytes" erratum.
- Use DEVMETHOD_END.
- Use NULL instead of 0 for pointers.


236082 26-May-2012 marius

MFC: r234293

Generate an obviously missing STOP when having finished transmitting data.
This fixes communication with PCF8563.


236081 26-May-2012 marius

MFC: r234291, r234292

Add support for the Atmel SAM9XE family of microcontrollers, which
consist of a ARM926EJ-S processor core with up to 512 Kbytes of on-chip
flash. Tested with SAM9XE512.


236080 26-May-2012 marius

MFC: r234281

- Try to bring these files closer to style(9).
- Use DEVMETHOD_END.
- Use NULL instead of 0 for pointers.


236078 26-May-2012 marius

MFC: r234248

Add a driver for the NXP (Philips) PCF8563 RTC.

Obtained from: NetBSD (pcf8563reg.h)


236076 26-May-2012 marius

MFC: r234898, r235207

Add initial support for booting from ZFS on sparc64. At least on Sun Fire
V100, the firmware is known to be broken and not allowing to simultaneously
open disk devices, causing attempts to boot from a mirror or RAIDZ to cause
a crash. This will be worked around later. The firmwares of newer sun4u models
don't seem to exhibit this problem though.

PR: 165025
Submitted by: Gavin Mu


236074 26-May-2012 thompsa

MFC r234936 (emaste)

Relax restriction on direct tx to child ports

Lagg(4) restricts the type of packet that may be sent directly to a child
port, to avoid undesired output from accidental misconfiguration.
Previously only ETHERTYPE_PAE was permitted.

BPF writes to a lagg(4) child port are presumably intentional, so just
allow them, while still blocking other packets that should take the
aggregation path.

PR: kern/138620


236071 26-May-2012 thompsa

MFC r231130 (pjd)

Allow to set if_bridge(4) sysctls from /boot/loader.conf.


236054 26-May-2012 thompsa

MFC r235147

Do not reinitialise the interface if it is already running, this prevents the
bootp+nfs code from working as it calls init on each dhcp send and rx fails to
start in time.


236053 26-May-2012 thompsa

MFC r235144

The DEVICE_POLLING dereference of sc->tsec_ifp needs to be checked for null
first or this will panic. Condense three blocks that check sc->tsec_ifp into
one while I am here.


236052 26-May-2012 thompsa

MFC r234488

Move the interface media check to a taskqueue, some interfaces (usb) sleep
during SIOCGIFMEDIA and we were holding locks.


236051 26-May-2012 thompsa

MFC r234487

Add linkstate to bridge(4), set the link to up when at least one underlying
interface is up, otherwise the link is down.

This, among other things, allows carp to work on a bridge.


236050 26-May-2012 thompsa

MFC r234163

Set the proto to LAGG_PROTO_NONE before calling the detach routine so packets
are discarded, this is an issue because lacp drops the lock which may allow
network threads to access freed memory. Expand the lock coverage so the
detach/attach happen atomically.

Submitted by: Andrew Boyer (earlier version)


236049 26-May-2012 thompsa

MFC r232629,r232640

Add the ability to set which packet layers are used for the load balance hash
calculation.


236048 26-May-2012 thompsa

MFC r232118

Only look for a usable MAC address for the bridge ID from ports within our
bridge, this allows us to have more than one independent bridge in the same
STP domain.

PR: kern/164369
Submitted by: Nikos Vassiliadis (earlier version)


236047 26-May-2012 thompsa

MFC r232014,r232030,r232070

- bstp_input() always consumes the packet so remove the mbuf handling dance
around it.
- Now that network interfaces advertise if they support linkstate notifications
we do not need to perform a media ioctl every 15 seconds.
- Indicate this function decrements the timer as well as testing for expiry.


236021 25-May-2012 marius

MFC: r235681

Rewrite nd6_sysctl_{d,p}rlist() to avoid misaligned accesses to char arrays
casted to structs by getting rid of these buffers entirely. In r169832, it
was tried to paper over this issue by 32-bit aligning the buffers. Depending
on compiler optimizations that still was insufficient for 64-bit architectures
with strong alignment requirements though.
While at it, add comments regarding the total lack of locking in this area.

Tested by: bz
Reviewed by: bz (slightly earlier version), yongari (earlier version)


235997 25-May-2012 marius

MFC: r234897

Add a command for showing the heap usage.

PR: 165025
Submitted by: Gavin Mu


235995 25-May-2012 marius

MFC: r234789

Add multiple inclusion protection.

PR: 165025
Submitted by: Gavin Mu


235992 25-May-2012 marius

MFC: r234348

Turn on PREEMPTION by default. After fixing several bugs over time, the
last show-stopper keeping PREEMPTION from being usable on sparc64 should
have been dealt with in r230662 (MFC'ed to stable/9 in r230662).
At least on 2-way systems, PREEMPTION causes a little bit of a degradation
in worldstone performance. However, FreeBSD seems to have started building
up regressions in !PREEMPTION cases so sparc64 better should not be an
oddball in this regard.


235906 24-May-2012 rmacklem

MFC: r235568
A problem with the NFSv4 server was reported by Andrew Leonard
to freebsd-fs@, where the setfacl of an NFSv4 acl would fail.
This was caused by the VOP_ACLCHECK() call for ZFS replying
EOPNOTSUPP. After discussion with rwatson@, it was determined
that a call to VOP_ACLCHECK() before doing VOP_SETACL() is not
required. This patch fixes the problem by deleting the
VOP_ACLCHECK() call.


235818 23-May-2012 yongari

MFC r235151:
Implement basic remote PHY support. Remote PHY allows the
controller to perform MDIO type accesses to a remote transceiver
using message pages defined through MRBE(multirate backplane
ethernet). It's used in blade systems(e.g Dell Blade m610) which
are connected to pass-through blades rather than traditional
switches.
This change directly manipulates firmware's mailboxes to control
remote PHY such that it does not use mii(4). Alternatively, as
David said, it could be implemented in brgphy(4) by creating a fake
PHY and let brgphy(4) do necessary mii accesses and bce(4) can
implement mailbox accesses based on the type of brgphy(4)'s mii
accesses. Personally, I think it would make brgphy(4) hard to
maintain since it would have to access many bce(4) registers in
brgphy(4). Given that there are users who are suffering from lack
of remote PHY support, it would be better to get working system
rather than waiting for complete/perfect implementation.


235764 22-May-2012 jhb

MFC 234098:
Add media types for 40G media that might be used with FreeBSD.


235763 22-May-2012 jhb

Repair mergeinfo from merges done into a sparse checkout.


235741 21-May-2012 jhb

MFC 234190,234196,234280:
- Extend the KDB interface to add a per-debugger callback to print a
backtrace for an arbitrary thread (rather than the calling thread).
A kdb_backtrace_thread() wrapper function uses the configured debugger
if possible, otherwise it falls back to using stack(9) if that is
available.
- Replace a direct call to db_trace_thread() in propagate_priority()
with a call to kdb_backtrace_thread() instead.


235627 18-May-2012 jhb

Move mergeinfo from sys/kern/subr_witness.c up to sys/.


235626 18-May-2012 mckusick

MFC of 234386, 234400, 234441, 234443, 234482, 234483, 235052, 235241,
235246, and 235619

MFC: 234386

Replace the MNT_VNODE_FOREACH interface with MNT_VNODE_FOREACH_ALL.
The primary changes are that the user of the interface no longer
needs to manage the mount-mutex locking and that the vnode that
is returned has its mutex locked (thus avoiding the need to check
to see if its is DOOMED or other possible end of life senarios).

To minimize compatibility issues for third-party developers, the
old MNT_VNODE_FOREACH interface will remain available so that this
change can be MFC'ed to 9. Following the MFC to 9, MNT_VNODE_FOREACH
will be removed in head.

The reason for this update is to prepare for the addition of the
MNT_VNODE_FOREACH_ACTIVE interface that will loop over just the
active vnodes associated with a mount point (typically less than
1% of the vnodes associated with the mount point).

Reviewed by: kib
Tested by: Peter Holm
MFC after: 2 weeks

MFC: 234400

Drop export of vdestroy() function from kern/vfs_subr.c as it is
used only as a helper function in that file. Replace sole call to
vbusy() with inline code in vholdl(). Replace sole calls to vfree()
and vdestroy() with inline code in vdropl().

The Clang compiler already inlines these functions, so they do not
show up in a kernel backtrace which is confusing. Also you cannot
set their frame in kgdb which means that it is impossible to view
their local variables. So, while the produced code is unchanged,
the debugging should be easier.

Discussed with: kib
MFC after: 2 weeks

MFC: 234441

Fix a memory leak of M_VNODE_MARKER introduced in 234386.

Found by: Peter Holm

MFC: 234443

Delete a no longer useful VNASSERT missed during changes in 234400.

Suggested by: kib

MFC: 234482

This change creates a new list of active vnodes associated with
a mount point. Active vnodes are those with a non-zero use or hold
count, e.g., those vnodes that are not on the free list. Note that
this list is in addition to the list of all the vnodes associated
with a mount point.

To avoid adding another set of linkage pointers to the vnode
structure, the active list uses the existing linkage pointers
used by the free list (previously named v_freelist, now renamed
v_actfreelist).

This update adds the MNT_VNODE_FOREACH_ACTIVE interface that loops
over just the active vnodes associated with a mount point (typically
less than 1% of the vnodes associated with the mount point).

Reviewed by: kib
Tested by: Peter Holm
MFC after: 2 weeks

MFC: 234483

This update uses the MNT_VNODE_FOREACH_ACTIVE interface that loops
over just the active vnodes associated with a mount point to replace
MNT_VNODE_FOREACH_ALL in the vfs_msync, ffs_sync_lazy, and qsync
routines.

The vfs_msync routine is run every 30 seconds for every writably
mounted filesystem. It ensures that any files mmap'ed from the
filesystem with modified pages have those pages queued to be
written back to the file from which they are mapped.

The ffs_lazy_sync and qsync routines are run every 30 seconds for
every writably mounted UFS/FFS filesystem. The ffs_lazy_sync routine
ensures that any files that have been accessed in the previous
30 seconds have had their access times queued for updating in the
filesystem. The qsync routine ensures that any files with modified
quotas have those quotas queued to be written back to their
associated quota file.

In a system configured with 250,000 vnodes, less than 1000 are
typically active at any point in time. Prior to this change all
250,000 vnodes would be locked and inspected twice every minute
by the syncer. For UFS/FFS filesystems they would be locked and
inspected six times every minute (twice by each of these three
routines since each of these routines does its own pass over the
vnodes associated with a mount point). With this change the syncer
now locks and inspects only the tiny set of vnodes that are active.

Reviewed by: kib
Tested by: Peter Holm
MFC after: 2 weeks

MFC: 235052 (by pluknet)

Fix mount mutex handling missed in r234386.

MFC: 235241 (by pluknet)

Fix mount interlock oversights from the previous change in r234386.

Reported by: dougb
Submitted by: Mateusz Guzik <mjguzik at gmail com>
Reviewed by: Kirk McKusick
Tested by: pho

MFC: 235246

Fix mount mutex handling missed in r234386.

MFC: 235619

Update comment to document that the vnode free-list mutex needs to be
held when updating mnt_activevnodelist and mnt_activevnodelistsize.


235620 18-May-2012 jhb

MFC 234186
If a linker file contains at least one module, but all of the modules
fail to load (the MOD_LOAD event fails) during a kldload(2), unload the
linker file and fail the kldload(2) with ENOEXEC.


235612 18-May-2012 jhb

MFC 234182:
Don't update if_obytes when transmitting packets. That is already done
in IFQ_HANDOFF() when the packet is passed to the start routine, so doing
it here resulted in double counting.


235564 17-May-2012 jhb

MFC 235563:
Don't expose i386-only ptrace constants on amd64. This broke gdb with
libthread_db on amd64.


235522 16-May-2012 jhb

MFC 234152:
Allow device_busy() and device_unbusy() to be invoked while a device is
being attached. This is implemented by adding a new DS_ATTACHING state
while a device's DEVICE_ATTACH() method is being invoked. A driver is
required to not fail an attach of a busy device. The device's state will
be promoted to DS_BUSY rather than DS_ACTIVE() if the device was marked
busy during DEVICE_ATTACH()


235515 16-May-2012 jhb

MFC 233709,233781,233793:
- Don't malloc() new MCA records for machine checks logged due to a
CMCI or MC# exception. Instead, use a pre-allocated pool of records.
When a CMCI or MC# exception fires, schedule a task to refill the pool.
The pool is sized to hold at least one record per available machine
bank, and one record per CPU. This should handle the case of all CPUs
triggering a single bank at once as well as the case a single CPU
triggering all of its banks. The periodic scans still use malloc()
since they are run from a safe context.
- Make machine check exception logging more readable. On newer Intel systems,
an uncorrected ECC error tends to fire on all CPUs in a package
simultaneously and the current printf hacks are not sufficient to make
the messages legible. Instead, use the existing mca_lock spinlock to
serialize calls to mca_log() and change the machine check code to panic
directly when an unrecoverable error is encoutered rather than falling
back to a trap_fatal() call in trap() (which adds nearly a screen-full of
logging messages that aren't useful for machine checks).


235480 15-May-2012 avg

MFC r230643: stop_scheduler -> td_stopsched


235449 14-May-2012 jh

MFC r234489:

The value of flags matching VNOVAL can't be supported. Return EOPNOTSUPP
from setfflags() in this case. This fixes the return value of
chflags(path, -1).


235423 14-May-2012 yongari

MFC r235119:
Restore jumbo frame configuration which was broken in r218423.

Submitted by: Andrey Zonov <andrey <> zonov dot org > (initial version)
Tested by: Andrey Zonov <andrey <> zonov dot org >


235422 14-May-2012 marius

MFC: r235255

- Change the module order of these MAC drivers to be last so they are
deterministically handled after the corresponding PHY drivers when
loaded as modules. Otherwise, when these MAC/PHY driver pairs are
compiled into a single module probing the PHY driver may fail. This
makes r151438 and r226154 actually work. [1]
Reported and tested by: yongari (fxp(4))
- Use DEVMETHOD_END.
- Use NULL instead of 0 for pointers.

Submitted by: jhb [1]


235413 13-May-2012 avg

MFC r229854: enable stop_scheduler_on_panic by default


235411 13-May-2012 avg

MFC r228765: ukbd: adjust for SCHEDULER_STOPPED() and overhaul locking code


235410 13-May-2012 avg

MFC r228760: adapt usb transfer code for SCHEDULER_STOPPED


235409 13-May-2012 avg

MFC r228767: sc_cngrab: switch to console vty when possible


235408 13-May-2012 avg

MFC r228644: syscons: provide a first iteration of cngrab/cnungrab
implementation


235407 13-May-2012 avg

MFC r228633,228634,228638,228642,228643: introduce cngets,
a method for kernel to read a string from console


235406 13-May-2012 avg

MFC r228632: introduce cngrab/cnungrab stub calls in some places where they
make sense


235405 13-May-2012 avg

MFC r228631: kern cons: introduce infrastructure for console grabbing by
kernel


235404 13-May-2012 avg

MFC r228424,228448: panic: add a switch and infrastructure for stopping
other CPUs in SMP case


235397 13-May-2012 rmacklem

MFC: r234742
It was reported via email that some non-FreeBSD NFS servers
do not include file attributes in the reply to an NFS create RPC
under certain circumstances.
This resulted in a vnode of type VNON that was not usable.
This patch adds an NFS getattr RPC to nfs_create() for this case,
to fix the problem. It was tested by the person that reported
the problem and confirmed to fix this case for their server.


235260 11-May-2012 attilio

MFC r233961,234074,234105,234564,234723,234989,235231-235232:
- Fix a bug in x86 and sparc64 where the intr cpu mask does only
enables the BSP.
- Remove the SMP constraints for intr_add_cpu


235131 07-May-2012 jh

MFC r234104:

Apply changes from r233787 to ext2fs:

- Use more natural ip->i_flags instead of vap->va_flags in the final
flags check.
- Style improvements.

No functional change intended.

MFC r234139:

Restore the blank line incorrectly removed in r234104.


235010 04-May-2012 jh

MFC r233875: Add a check for unsupported file flags to ufs_setattr().


234929 02-May-2012 jh

MFC r233787:

- Use more natural ip->i_flags instead of vap->va_flags in the final
flags check.
- Add a comment for the immutable/append check done after handling of
the flags.
- Style improvements.

No functional change intended.

MFC r234421:

The part about exec atime no longer applies in the comment.


234771 28-Apr-2012 alc

MFC r234038
If a page belonging a reservation is cached, then mark the reservation so
that it will be freed to the cache pool rather than the default pool.
Otherwise, the cached pages within the reservation may be recycled sooner
than necessary.


234766 28-Apr-2012 alc

MFC r234039
Fix mincore(2) so that it reports PG_CACHED pages as resident.


234765 28-Apr-2012 alc

MFC r233097
With the changes over the past year to how accesses to the page's dirty
field are synchronized, there is no need for pmap_protect() to acquire
the page queues lock unless it is going to access the pv lists.


234764 28-Apr-2012 alc

MFC r234554
Updates to the vm_page's flags no longer require the page queues lock.


234763 28-Apr-2012 alc

MFC r232166
Simplify vm_mmap()'s control flow.

Add a comment describing what vm_mmap_to_errno() does.


234679 25-Apr-2012 avg

MFC r234339: zfsboot: honor -q if it's present in boot.config


234677 25-Apr-2012 avg

MFC r234338: intpm: add ATI IXP400 pci id

PR: kern/136762


234673 25-Apr-2012 avg

MFC r234208: add actual interrupt counters to back ipi_invlcache_counts


234671 25-Apr-2012 avg

MFC r234207: bump INTRCNT_COUNT values to reflect actual numbers of IPI counters


234593 23-Apr-2012 yongari

MFC r234121:
Back out r228476.
r228476 fixed superfluous link UP/DOWN messages but broke IPMI
access during boot. It's not clear why r228476 breaks IPMI and
should be revisited.

Reported by: Paul Guyot <paulguyot <> ieee dot org >


234559 21-Apr-2012 raj

MFC r227730:

Initial version of cesa(4) driver for Marvell crypto engine and security
accelerator.

The following algorithms and schemes are supported:
- 3DES, AES, DES
- MD5, SHA1

Obtained from: Semihalf
Written by: Piotr Ziecik


234558 21-Apr-2012 raj

MFC r233230, r233323:

Improve device tree blob (DTB) handling in loader(8).

Enable using the statically embedded blob from the kernel, if present. The
KLD loaded DTB takes precedence, but they are both recognized and handled in
the same way.

Improve FDT handling in loader(8) and make it more robust.

o Fix buffer overflows when using a long property body in node paths.
o Fix loop end condition when iterating through the symbol table.
o Better error handling during node modification, better problem reporting.
o Eliminate build time warnings.

Submitted by: Lukasz Wojcik
Obtained from: Semihalf


234511 20-Apr-2012 rmh

MFC of r227310:

Don astbestos garment and remove the warning about TMPFS being experimental
-- highly experimental even. So far the closest to a bug in TMPFS that people
have gotten to relates to how ZFS can take away from the memory that TMPFS
needs. One can argue that such is not a bug in TMPFS. Irrespective, even if
there is a bug here and there in TMPFS, it's not in our own advantage to
scare people away from using TMPFS. I for one have been using it, even with
ZFS, very successfully.

Reviewed by: marcel


234490 20-Apr-2012 marius

MFC: r234247

Merge from x86:

r233961:

Fix interrupt load balancing regression, introduced in revision
222813, that left all un-pinned interrupts assigned to CPU 0.
In intr_shuffle_irqs(), remove CPU_SETOF() call that initialized
the "intr_cpus" cpuset to only contain CPU0.

This initialization is too late and nullifies the results of calls
to the intr_add_cpu() that occur much earlier in the boot process.

r234074 (partial):

The BSP is not added to the mask of valid target CPUs for interrupts.
Fix this by adding the BSP as an interrupt target directly in

r234105:

Fix !SMP build after r234074.


234473 19-Apr-2012 mckusick

MFC of 234158:

Export vinactive() from kern/vfs_subr.c (e.g., make it no longer
static and declare its prototype in sys/vnode.h) so that it can be
called from process_deferred_inactive() (in ufs/ffs/ffs_snapshot.c)
instead of the body of vinactive() being cut and pasted into
process_deferred_inactive().

Reviewed by: kib
MFC after: 2 weeks


234471 19-Apr-2012 mckusick

MFC of 234157:

Whitespace cleanup.


234470 19-Apr-2012 mckusick

MFC of 233817:

A file cannot be deallocated until its last name has been removed
and it is no longer referenced by a user process. The inode for a
file whose name has been removed, but is still referenced at the
time of a crash will still be allocated in the filesystem, but will
have no references (e.g., they will have no names referencing them
from any directory).

With traditional soft updates these unreferenced inodes will be
found and reclaimed when the background fsck is run. When using
journaled soft updates, the kernel must keep track of these inodes
so that it can find and reclaim them during the cleanup process.
Their existence cannot be stored in the journal as the journal only
handles short-term events, and they may persist for days. So, they
are tracked by keeping them in a linked list whose head pointer is
stored in the superblock. The journal tracks them only until their
linked list pointers have been commited to disk. Part of the cleanup
process involves traversing the list of unreferenced inodes and
reclaiming them.

This bug was triggered when confusion arose in the commit steps
of keeping the unreferenced-inode linked list coherent on disk.
Notably, a race between the link() system call adding a link-count
to a file and the unlink() system call removing a link-count to
the file. Here if the unlink() ran after link() had looked up
the file but before link() had incremented the link-count of the
file, the file's link-count would drop to zero before the link()
incremented it back up to one. If the file was referenced by a
user process, the first transition through zero made it appear
that it should be added to the unreferenced-inode list when in
fact it should not have been added. If the new name created by
link() was deleted within a few seconds (with the file still
referenced by a user process) it would legitimately be a candidate
for addition to the unreferenced-inode list. The result was that
there were two attempts to add the same inode to the unreferenced-inode
list which scrambled the unreferenced-inode list's pointers leading
to a panic. The fix is to detect and avoid the false attempt at
adding it to the unreferenced-inode list by having the link()
system call check to see if the link count is zero before it
increments it. If it is, the link() fails with ENOENT (showing that
it has failed the link()/unlink() race).

While tracking down this bug, we have added additional assertions
to detect the problem sooner and also simplified some of the code.

Reported by: Kirk Russell
Fix submitted by: Jeff Roberson
Tested by: Peter Holm
PR: kern/159971


234466 19-Apr-2012 mckusick

MFC of 233627, 234024, 234025, and 234026

Restore per mount-point counts of synchronous and asynchronous
reads and writes associated with UFS and MSDOS filesystems.

MFS 233627:
Keep track of the mount point associated with a special device
to enable the collection of counts of synchronous and asynchronous
reads and writes for its associated filesystem. The counts are
displayed using `mount -v'.

Ensure that buffers used for paging indicate the vnode from
which they are operating so that counts of paging I/O operations
from the filesystem are collected.

This checkin only adds the setting of the mount point for the
UFS/FFS filesystem, but it would be trivial to add the setting
and clearing of the mount point at filesystem mount/unmount
time for other filesystems too.

Reviewed by: kib

MFC 234024:
Drop an unnecessary setting of si_mountpt when updating a UFS mount point.
Clearly it must have been set when the mount was done.

Reviewed by: kib

MFC 234025:
Add I/O accounting to msdos filesystem.

Suggested and reviewed by: kib

MFC 234026:
Expand locking around identification of filesystem mount point when
accounting for I/O counts at completion of I/O operation. Also switch
from using global devmtx to vnode mutex to reduce contention.

Suggested and reviewed by: kib


234391 17-Apr-2012 jhb

MFC 234059:
Recognize the RDRAND instruction feature.


234316 15-Apr-2012 netchild

MFC r232799:
- add comments to syscalls.master and linux(32)_dummy about which linux
kernel version introduced the sysctl (based upon a linux man-page)
- add comments to syscalls.master regarding some names of sysctls which are
different than the linux-names (based upon the linux unistd.h)
- add some dummy sysctls
- name an unimplemented sysctl


234240 13-Apr-2012 marius

MFC: r233888

- Const'ify the device lookup-table.
- Use DEVMETHOD_END.
- Use NULL instead of 0 for pointers.
- Enable support for flow control.
Tested by: yongari


234215 13-Apr-2012 avg

MFC r234043: intpm: return only SMB bus error codes from SMB methods


234213 13-Apr-2012 avg

MFC r234040: intpm: reflect the fact that SB800 and later AMD chipsets
are not supported


234211 13-Apr-2012 avg

MFC r233918: zfs_ioctl: no need for ddi_copyin/out here because
sys_ioctl handles that


234209 13-Apr-2012 avg

MFC r231558: newvers.sh: unbreak git/git-svn support


234181 12-Apr-2012 jhb

MFC 233547:
Use VM_MEMATTR_UNCACHEABLE instead of VM_MEMATTR_UNCACHED for UC mappings.
VM_MEMATTR_UNCACHED is actually the x86-specific UC- mode (where a WC
MTRR can override the PAT setting).


234179 12-Apr-2012 jhb

MFC 233670,233671:
- Use VM_MEMATTR_UNCACHEABLE for the constant for UC memory rather than
VM_MEMATTR_UNCACHED on mips.
- Rename VM_MEMATTR_UNCACHED to VM_MEMATTR_WEAK_UNCACHEABLE on x86 to
be less ambiguous and more clearly identify what it means. An alias
from VM_MEMATTR_WEAK_UNCACHEABLE to VM_MEMATTR_WEAK_UNCACHED remains
on x86 to preserve the KPI.
- Remove the VM_MEMATTR_UNCACHED alias from powerpc.


234150 11-Apr-2012 jhb

MFC 233676:
Use a more proper fix for enabling HT MSI mapping windows on Host-PCI
bridges. Rather than blindly enabling the windows on all of them, only
enable the window when an MSI interrupt is enabled for a device behind
the bridge, similar to what already happens for HT PCI-PCI bridges.


234148 11-Apr-2012 jhb

MFC 233893:
Disable INET6 support in modules when building the LINT-NOINET6 kernel.


234147 11-Apr-2012 jhb

MFC 233305,233623:
- Mark the 'lapics' and 'ioapics' arrays here static since they are
private to this file. The 'lapics' array was actually shadowing a
completely different 'lapics' array that is private to local_apic.c.
- Allocate the ioapics[] array dynamically since it is only needed for the
duration of madt_setup_io(). This avoids having the array take up
permanent space in the BSS.


234145 11-Apr-2012 jhb

MFC 232228,233613:
Move the DTrace return IDT vector back up from 0x20 to 0x92. The 0x20
vector is currently dedicated to servicing IRQ 0 from the 8259A's, so
it shouldn't be overloaded for DTrace.


234144 11-Apr-2012 jhb

MFC 232744,232747,233031:
- Allow a native i386 kernel to be built with 'nodevice atpic'. Just as on
amd64, if 'device isa' is present quiesce the 8259A's during boot and
resume from suspend.
- Move i386's intr_machdep.c to the x86 tree and share it with amd64.
- Merge r232744 changes to pc98.
(Allow a kernel to be built with 'nodevice atpic'.)
- Move ICU related defines from x86/isa/atpic.c to x86/isa/icu.h and
use them in x86/x86/intr_machdep.c.

Note, I normally would have merged 232747 separately, but 233031 assumed
232747 was already merged and 232744 needs to be merged with 233031.


234141 11-Apr-2012 jhb

MFC 232742:
MFamd64:
- Return failure for a suspend attempt if we have no wake address.
- Use intr_disable()/intr_restore() instead of ACPI_DISABLE_IRQS().
- Invoke intr_suspend() earlier and call intr_resume() if suspend
fails.
- Use pause in the loop waiting for CPU to suspend.
- Restore PAT MSR, switchtime, switchticks, and MTRRs on resume.


234126 11-Apr-2012 yongari

MFC r233688-233689:
r233688:
Remove task queue based link state change handler. Driver no longer
needs to defer link state handling.
While I'm here, mark IFF_DRV_RUNNING before changing media. If
link is established without any delay, that link state change
handling could be lost.

r233689:
Do not report current link status if driver is not running.
This change also workarounds dhclient's link state handling bug by
not giving current link status.

Unlike other controllers, ale(4)'s PHY hibernation perfectly works
such that driver does not see a valid link if the controller is not
brought up. If dhclient(8) runs on ale(4) it will blindly waits
until link UP and then gives up after 10 seconds. Because
dhclient(8) still thinks interface got a valid link when IFM_AVALID
is not set for selected media, this change makes dhclient initiate
DHCP without waiting for link UP.


234123 11-Apr-2012 yongari

MFC r233585-233587:
r233585:
Partially revert r223608 and selectively allow microcode loading
for 82550C. For 82550 controllers this change restores CPUSaver
microcode loading. Due to silicon bug on 82550 and 82550C with
server extension, these controllers seem to require CPUSaver
microcode to receive fragmented UDP datagrams. However the
microcode shouldn't be used on client featured 82550C as it locks
up the controller. In addition, client featured 82550C does not
have the silicon bug. Also clear temporary memory used for
microcode loading since the same memory area is used for other
commands.
While I'm here use 82550C in probe message instead of generic
82550.

Reported by: Andreas Longwitz <longwitz <> incore de>
Tested by: Andreas Longwitz <longwitz <> incore de>

r233586:
Load entire EEPROM contents in device attach time and verify
whether the checksum of EEPROM is valid or not. Because driver
heavily relies on EEPROM information when it selectively enables
features/workarounds, it would be helpful to know whether driver
sees valid EEPROM.
While I'm here remove all other EEPROM accesses since the entire
EEPROM is loaded at device attach time.

r233587:
Remove unnecessary #if as the software workaround for PCI protocol
violation should be activated unless the system is cold-booted
after updating EEPROM.
The PCI protocol violation happens only when established link is
10Mbps so the workaround should be updated whenever link state
change is detected. Previously the workaround was activated only
when user checks current media status with ifconfig(8).


233995 07-Apr-2012 marius

MFC: r233827

Fix probing of SAS1068E with a device ID of 0x0059 after r232411 (MFC'ed
to stable/9 in r232562).
Reported by: infofarmer

MFC: r233886

Refine r233827; as it turns out, controllers with a device ID of 0x0059
can be upgraded to MegaRAID mode, in which case mfi(4) should attach to
these based on the sub-vendor and -device ID instead (not currently done).
Therefore, let mpt_pci_probe() return BUS_PROBE_LOW_PRIORITY.
While it, let mpt_pci_probe() return BUS_PROBE_DEFAULT instead of 0 in
the default case.


233924 05-Apr-2012 jhb

MFC 233675:
Restore proper use of bounce buffers for ISA DMA. When locking was
added, the call to pmap_kextract() was moved up, and as a result the
code never updated the physical address to use for DMA if a bounce
buffer was used. Restore the earlier location of pmap_kextract() so
it takes bounce buffers into account.


233889 04-Apr-2012 marius

MFC: r233747, r233748

- Fix panic on kernel traps having a mapping in trap_sig b0rked in r206086.
Reported by: David E. Cross
- Remove checks that are redundant due to tf_type being unsigned.


233816 02-Apr-2012 jhb

MFC 233236: Add sys/ofed to the 'make cscope' target.


233814 02-Apr-2012 jhb

MFC 232700:
Add a new sched_clear_name() method to the scheduler interface to clear
the cached name used for KTR_SCHED traces when a thread's name changes.
This way KTR_SCHED traces (and thus schedgraph) will notice when a thread's
name changes, most commonly via execve().


233811 02-Apr-2012 marius

MFC: r233701

- Remove erroneous trailing semicolon. [1]
- Correctly determine the maximum payload size for setting the TX link
frequent NACK latency and replay timer thresholds.

Submitted by: stefanf [1]


233810 02-Apr-2012 gnn

MFC: 232612

Properly mask off bits that are not supported in the IAP counters.
This fixes a bug where users would see massively large counts, near
to 2**64 -1, due to the bits not being cleared.


233750 31-Mar-2012 alc

MFC r233256
Eliminate vm.pmap.shpgperproc and vm.pmap.pv_entry_max because they no
longer serve any purpose.


233743 31-Mar-2012 marius

MFC: r233427

Add cas(4), gem(4) and hme(4) to x86 GENERICs as suggested by netchild@ in
<20120222095239.Horde.0hpYHJjmRSRPRKzXsoFRbYk@webmail.leidinger.net>.
According to some private emails received, it apparently is not unpopular
to use at least Quad GigaSwift cards driven by cas(4) in x86 machines.


233740 31-Mar-2012 marius

MFC: r233425

Consistently update to the MPI header set version 01.05.20 after r224761.
Requested by: mjacob


233725 31-Mar-2012 marius

MFC: r233423

Initialize the mutexes used for the NVM and the swflag as MTX_DUPOK in
order to avoid otherwise harmless witness warnings when these are acquired
at the same time and due to both using MTX_NETWORK_LOCK as their type.
The right fix actually would be to use different, descriptive types for
these. However, the latter would require undesirable changes to the shared
code base. Another approach would be to just supply NULL as the type, which
was deemed as less desirable though as it would cause the unique but cryptic
name also to be used for the type and to diverge from the type used by other
network device drivers.


233723 31-Mar-2012 marius

MFC: r233421

Given that this is a host-PCI-Express bridge driver, create the parent
DMA tag with a 4 GB boundary as required by PCI-Express. With r232403
(MFC'ed to stable/9 in r233393) in place this actually is redundant.
However, the host-PCI-Express bridge driver is the more appropriate
place for implementing this restriction.


233721 31-Mar-2012 marius

MFC: r233403, r233404

- Use the PCI ID macros from mpi_cnfg.h rather than duplicating them here.
Note that this driver additionally probes some device IDs for the most
part not know to other MPT drivers, if at all. So rename the macros not
present in mpi_cnfg.h to match the naming scheme in the latter and but
suffix them with a _FB in order to not cause conflicts.
- Like mpt_set_config_regs(), comment out mpt_read_config_regs() as the
content of the registers read isn't actually used and both functions
aren't exactly up to date regarding the possible layouts of the BARs
(these function might be helpful for debugging though, so don't remove
them completely).
- Use DEVMETHOD_END.
- Use NULL rather than 0 for pointers.
- Remove an unusual check for the softc being NULL.
- Remove redundant zeroing of the softc.
- Remove an overly banal and actually partly incorrect as well as partly
outdated comment regarding the allocation of the memory resource.


233719 31-Mar-2012 marius

MFC: r233287

Use the common/shared CRC-32 implementation instead of duplicating it.


233717 31-Mar-2012 marius

MFC: r233282

- First pass at const'ifying ata(4) as appropriate.
- Use DEVMETHOD_END.
- Use NULL instead of 0 for pointers.


233715 30-Mar-2012 marius

MFC: r233274

Remove remnants of ATA_LOCKING uses in the ATA_CAM case and wrap it
along with functions, SYSCTLs and tunables that are not used with
ATA_CAM in #ifndef ATA_CAM, similar to the existing #ifdef'ed ATA_CAM
code for the other way around. This makes it easier to understand
which parts of ata(4) actually are used in the new world order and
to later on remove the !ATA_CAM bits. It also makes it obvious that
there is something fishy with the C-bus front-end as well as in the
ATP850 support, as these used ATA_LOCKING which is defunct in the
ATA_CAM case. When fixing the former, ATA_LOCKING probably needs to
be brought back in some form or other.

Reviewed by: mav


233712 30-Mar-2012 marius

MFC: r233273

Exclude devices which are mutually exclusive with ATA_CAM. For better
or worse, the former are still built as modules as part of the LINT
builds.

Reviewed by: mav


233705 30-Mar-2012 jhb

MFC 232669:
Use bus_get_dma_tag() to inherit the 4G boundary restriction from the
parent PCI bus and remove the home-grown version in this driver.


233659 29-Mar-2012 rmh

MFC r233096:

Hide a few declarations from userland (including `struct inpcbgroup'). This
removes the dependency on <machine/param.h> which was introduced with SVN
rev 222748 (due to CACHE_LINE_SIZE).

Reviewed by: bde
MFC after: 10 days


233647 29-Mar-2012 alc

MFC r233291
Handle spurious page faults that may occur in no-fault sections of the
kernel.


233630 28-Mar-2012 mckusick

MFC of 232351, 233438, and 233629

MFC reviewed by: kib

MFC 232351:

This change avoids a kernel deadlock on "snaplk" when using
snapshots on UFS filesystems running with journaled soft updates.
This is the first of several bugs that need to be fixed before
removing the restriction added in -r230250 to prevent the use
of snapshots on filesystems running with journaled soft updates.

The deadlock occurs when holding the snapshot lock (snaplk)
and then trying to flush an inode via ffs_update(). We become
blocked by another process trying to flush a different inode
contained in the same inode block that we need. It holds the
inode block for which we are waiting locked. When it tries to
write the inode block, it gets blocked waiting for the our
snaplk when it calls ffs_copyonwrite() to see if the inode
block needs to be copied in our snapshot.

The most obvious place that this deadlock arises is in the
ffs_copyonwrite() routine when it updates critical metadata
in a snapshot and tries to write it out before proceeding.
The fix here is to write the data and indirect block pointer
for the snapshot, but to skip the call to ffs_update() to
write the snapshot inode. To ensure that we will never have
to update a pointer in the inode itself, the ffs_snapshot()
routine that creates the snapshot has to ensure that all the
direct blocks are allocated as part of the creation of the
snapshot.

A less obvious place that this deadlock occurs is when we hold
the snaplk because we are deleting a snapshot. In the course of
doing the deletion, we need to allocate various soft update
dependency structures and allocate some journal space. If we
hit a resource limit while doing this we decrease the resources
in use by flushing out an existing dirty file to get it to give
up the soft dependency resources that it holds. The flush can
cause an ffs_update() to be done on the inode for the file that
we have selected to flush resulting in the same deadlock as
described above when the inode that we have chosen to flush
resides in the same inode block as the snapshot inode that we hold.
The fix is to defer cleaning up any time that the inode on which
we are operating is a snapshot.

Help and review by: Jeff Roberson
Tested by: Peter Holm

MFC 233438:

Add a third flags argument to ffs_syncvnode to avoid a possible conflict
with MNT_WAIT flags that passed in its second argument.

Discussed with: kib

MFC 233629:

A refinement of change 232351 to avoid a race with a forcible unmount.
While we have a snapshot vnode unlocked to avoid a deadlock with another
inode in the same inode block being updated, the filesystem containing
it may be forcibly unmounted. When that happens the snapshot vnode is
revoked. We need to check for that condition and fail appropriately.

Spotted by: kib
Reviewed by: kib


233604 28-Mar-2012 zec

MFC r232517:
Change SYSINIT priorities so that ip_mroute_modevent() is executed
before vnet_mroute_init(), since vnet_mroute_init() depends on mfchashsize
tunable to be set, and that is done in in ip_mroute_modevent().
Apparently I broke that ordering with r208744 almost 2 years ago...

PR: kern/162201
Submitted by: Stevan Markovic (mcafee.com)
MFC after: 3 days


233602 28-Mar-2012 zec

MFC: 232487
Properly restore curvnet context when returning early from
ether_input_internal().

This change only affects options VIMAGE kernel builds.

PR: kern/165643
Submitted by: Vijay Singh
MFC after: 3 days


233543 27-Mar-2012 jh

MFC r233126:

Cast wallclock.tv_sec to uint64_t to avoid overflow in the calculation.

PR: kern/161552


233501 26-Mar-2012 yongari

MFC r232951,232953,233158:
r232951:
fxp(4) does not handle deferred dma map loading. Tell
bus_dmamap_load(9) that it should return immediately with error
when there are insufficient mapping resources.

r232953:
Fix white space nits.

r233158:
Do not change current media when driver is already running. If
driver is running driver would have already completed flow control
configuration. This change removes unnecessary media changes in
controller reconfiguration cases such that it does not trigger link
reestablishment for configuration change requests like promiscuous
mode change.

Reported by: Many
Tested by: Mike Tancsa <mike <> sentex dot net>


233498 26-Mar-2012 yongari

MFC r232849-232850:
r232849:
Show PCI bus speed and width as well as running mode of PCI-X
device in device attach. This would help to narrow down issue to a
specific controller and operating mode of the controller.
While I'm here rename BGE_MISCCFG_BOARD_ID with
BGE_MISCCFG_BOARD_ID_MASK.

r232850:
Make if_ierrors updated whenever any of the following counters are
updated.
o Number of times NIC ran out of RX buffer descriptors
o Number of inbound packet errors
o Number of inbound packets that were chosen to be discarded
Previously only the discarded packet counter was used to update
if_ierrors. This change fixes wrong if_ierrors counter on
BCM570[0-4] controllers. For BCM5705 and later controllers bge(4)
already correctly counted it.

Reported by: Eugene Grosbein <egrosbein <> rdtc dot ru>


233495 26-Mar-2012 yongari

MFC r232848:
Add workaround for PCI-X BCM5704 controller that live behind
AMD-8131 PCI-X bridge. The bridge seems to reorder write access to
mailbox registers such that it caused watchdog timeouts by
out-of-order TX completions.

Tested by: Michael L. Squires <mikes <> siralan dot org >


233492 26-Mar-2012 yongari

MFC r232246:
Prefer RL_GMEDIASTAT register to RGEPHY_MII_SSR register to
extract a link status of PHY when parent driver is re(4).
RGEPHY_MII_SSR register does not seem to report correct PHY status
on some integrated PHYs used with re(4).
Unfortunately, RealTek PHYs have no additional information to
differentiate integrated PHYs from external ones so relying on PHY
model number is not enough to know that. However, it seems
RGEPHY_MII_SSR register exists for external RealTek PHYs so
checking parent driver would be good indication to know which PHY
was used. In other words, for non-re(4) controllers, the PHY is
external one and its revision number is greater than or equal to 2.
This change fixes intermittent link UP/DOWN messages reported on
RTL8169 controller.

Also, mii_attach(9) is tried after setting interface name since
rgephy(4) have to know parent driver name.

PR: kern/165509


233489 26-Mar-2012 yongari

MFC r232145:
Use correct Config registers for RTL8139 family. Unlike RTL8168 and
RTL810x family , RTL8139 has different register map for Config
registers.

While here, follow the lead of re(4) in WOL configuration.
- Disable WOL_UCAST and WOL_MCAST capabilities by default.
- Config5 register write does not need to unlock EEPROM access
on RTL8139 family but unlocking EEPROM access does not affect
its operation and make it consistent with re(4).

Reported by: Matt Renzelmann mjr <> cs dot wisc dot edu


233486 26-Mar-2012 yongari

MFC r232019,232021,232025,232027,232029,232031,232040:
r232019:
Give hardware chance to drain active DMA cycles.

r232021:
If there are not enough RX buffers, release partially allocated RX
buffers.

r232025:
Introduce sf_ifmedia_upd_locked() and have driver reset PHY before
switching to selected media. While here, set if_drv_flags before
switching to selected media.

r232027:
No need to reprogram hardware RX filter when driver is not running.

r232029:
Remove taskqueue based MII stat change handler.
Driver does not need deferred link state change processing.
While I'm here, do not report current link status if interface is
not UP.

r232031:
With r232015, sf(4) gets correct speed/duplex of established link.
Add more strict speed check in sf_miibus_statchg() and do not touch
MAC config registers when driver lost a link.

r232040:
Add check for IFF_DRV_RUNNING flag after serving an interrupt and
don't give RX path more priority than TX path.
Also remove infinite loop in interrupt handler and limit number of
iteration to 32. This change addresses system load fluctuations
under high network load.


233485 26-Mar-2012 yongari

MFC r232015-232016:
r232015:
Add Seeq Technology 80220 PHY support to smcphy(4). This PHY is
found on Adaptec AIC-6915 Starfire ethernet controller.
While here, use status register to know resolved speed/duplex.
With this change, sf(4) correctly reports speed/duplex of
established link.

r232016:
Connect smcphy(4) to mii module build.


233468 25-Mar-2012 marius

MFC: r233105

Declare some variables static in order to reduce the object size and
redo r232822 (MFC'ed to stable/9 in r232962) in a less hackish way.
The latter now no longer breaks compiling the x86 boot2 with clang.


233398 23-Mar-2012 jhb

MFC 232470:
Use pci_find_cap() instead of pci_find_extcap() to locate PCI
find capabilities as the latter API is deprecated for this purpose.


233393 23-Mar-2012 jhb

MFC 232403,232667:
- Add a bus_dma tag to each PCI bus that is a child of a Host-PCI bridge.
The tag enforces a single restriction that all DMA transactions must not
cross a 4GB boundary. Note that while this restriction technically only
applies to PCI-express, this change applies it to all PCI devices as it
is simpler to implement that way and errs on the side of caution.
- Add a softc structure for PCI bus devices to hold the bus_dma tag and
a new pci_attach_common() routine that performs actions common to the
attach phase of all PCI bus drivers. Right now this only consists of
a bootverbose printf and the allocate of a bus_dma tag if necessary.
- Adjust all PCI bus drivers to allocate a PCI bus softc and to call
pci_attach_common() from their attach routines.


233385 23-Mar-2012 jhb

MFC 232401:
Similar to the fixes in 226967 and 226987, purge any name cache entries
associated with the previous vnode (if any) associated with the target of
a rename(). Otherwise, a lookup of the target pathname concurrent with a
rename() could re-add a name cache entry after the namei(RENAME) lookup
in kern_renameat() had purged the target pathname.


233383 23-Mar-2012 jhb

MFC 232367:
Properly handle failures in igb_setup_msix() by returning 0 if MSI or MSI-X
allocation fails.


233379 23-Mar-2012 jhb

MFC 232360:
Add pci_save_state() and pci_restore_state() wrappers around
pci_cfg_save() and pci_cfg_restore() for device drivers to use when
saving and restoring state (e.g. to handle device-specific resets).


233376 23-Mar-2012 jhb

Record mergeinfo for 233374.


233358 23-Mar-2012 jhb

MFC 232218:
Clear the a device's description string anytime it's driver changes.
Descriptions are specific to drivers and we don't change drivers on attached
devices. This fixes a few places where we were not clearing the description
when detaching a driver (e.g. if device_attach() failed). While here, fix
a few other nits:
- Remove spurious call to remove a device's driver from
devclass_driver_deleted(). device_detach() removes it already.
- Fix a typo.


233355 23-Mar-2012 jhb

MFC 232265:
Properly clear a device's devclass if DEVICE_ATTACH() fails if the device
does not have a fixed devclass.


233353 23-Mar-2012 kib

MFC r231949:
Fix found places where uio_resid is truncated to int.

Add the sysctl debug.iosize_max_clamp, enabled by default. Setting the
sysctl to zero allows to perform the SSIZE_MAX-sized i/o requests from
the usermode.

MFC r232493:
Remove unneeded cast to u_int. The values as small enough to fit into
int, beside the use of MIN macro which performs type promotions.

MFC r232494:
Instead of incomplete handling of read(2)/write(2) return values that
does not fit into registers, declare that we do not support this case
using CTASSERT(), and remove endianess-unsafe code to split return value
into td_retval.

While there, change the style of the sysctl debug.iosize_max_clamp
definition.

MFC r232495:
pipe_read(): change the type of size to int, and remove signed clamp.
pipe_write(): change the type of desiredsize back to int, its value fits.


233326 22-Mar-2012 jhb

MFC 230547:
Add a timeout on positive name cache entries in the NFS client. That is,
we will only trust a positive name cache entry for a specified amount of
time before falling back to a LOOKUP RPC, even if the ctime for the file
handle matches the cached copy in the name cache entry. The timeout is
configured via a new 'nametimeo' mount option and defaults to 60 seconds.
It may be set to zero to disable positive name caching entirely.


233324 22-Mar-2012 jhb

MFC 232116:
Adjust the nfs_skip_wcc_data_onerr setting so that it does not block
post-op attributes for ENOENT errors now that the name caching logic
depends on working post-op attributes.


233285 21-Mar-2012 jhb

MFC 230394,230441,230489,230552,232420:
Close a race in NFS lookup processing that could result in stale name cache
entries on one client when a directory was renamed on another client. The
root cause for the stale entry being trusted is that each per-vnode nfsnode
structure has a single 'n_ctime' timestamp used to validate positive name
cache entries. However, if there are multiple entries for a single vnode,
they all share a single timestamp. To fix this, extend the name cache
to allow filesystems to optionally store a timestamp value in each name
cache entry. The NFS clients now fetch the timestamp associated with
each name cache entry and use that to validate cache hits instead of the
timestamps previously stored in the nfsnode. Another part of the fix is
that the NFS clients now use timestamps from the post-op attributes of
RPCs when adding name cache entries rather than pulling the timestamps out
of the file's attribute cache. The latter is subject to races with other
lookups updating the attribute cache concurrently.


233281 21-Mar-2012 jh

MFC r232975: Add an assert for proctree_lock to proc_to_reap().


233275 21-Mar-2012 glebius

Merge 232685 from head:
Merge from OpenBSD:

revision 1.146
date: 2010/05/12 08:11:11; author: claudio; state: Exp; lines: +2 -3
bzero() the full compressed update struct before setting the values.
This is needed because pf_state_peer_hton() skips some fields in certain
situations which could result in garbage beeing sent to the other peer.
This seems to fix the pfsync storms seen by stephan@ and so dlg owes me
a whiskey.

I didn't see any storms, but this definitely fixes a useless memory
allocation on the receiving side, due to non zero scrub_flags field
in a pfsync_state_peer structure.


233266 21-Mar-2012 glebius

Merge 228321 from head:
Fix double free.

PR: kern/163089
Submitted by: Herbie Robinson <Herbie.Robinson stratus.com>


233265 21-Mar-2012 glebius

Merge from head:
r227785:
- Reduce severity for all ARP events, that can be triggered from remote
machine to LOG_NOTICE. Exception left to "using my IP address".
- Fix multicast ARP warning: add newline and also log the bad MAC address.

Tested by: Alexander Wittig <wittigal msu.edu>

r227790:
Be more informative for "unknown hardware address format" message.

Submitted by: Andrzej Tobola <ato iem.pw.edu.pl>


233261 21-Mar-2012 glebius

Merge 227308 from head/:
In icmp6_redirect_input:

- Assert that we got a valid mbuf with rcvif pointer. [1]
- Use __func__ in logging.

Submitted by: prabhakar lakhera <prabhakar.lakhera gmail.com> [1]
Submitted by: Kristof Provost <kristof sigsegv.be> [1]


233200 19-Mar-2012 jhb

MFC 229621:
Convert all users of IF_ADDR_LOCK to use new locking macros that specify
either a read lock or write lock.


233084 17-Mar-2012 brueffer

MFC: r232315

Use a more appropriate default for the maximum number of addresses in the
bridge forwarding table.


233076 17-Mar-2012 marcel

MFC r227430:
On i386, fbt probes are implemented by writing an invalid opcode over
certain instructions in a function prologue or epilogue. DTrace has a
hook into the invalid opcode fault handler that checks whether the fault
was due to an probe and if so, runs the DTrace magic.

Upon returning from an invalid opcode fault caused by a probe, DTrace must
emulate the instruction that was replaced with the invalid opcode and then
return control to the instruction following the invalid opcode.

There were a pair of related bugs in the emulation for the leave
instruction. The leave instruction is used to pop off a stack frame prior
to returning from a function. The emulation for this instruction must
move the trap frame for the invalid opcode fault down the stack to the
bottom of the stack frame that is being removed, and then execute an iret.

At two points in this process, the emulation code was storing values above
the current value of the stack pointer. This opened up a window in which
if we were two take an interrupt, the trap frame for the interrupt would
overwrite the values stored on the stack, causing the system to panic
later.

The first bug was that at one point the emulation code saves the new value
for $esp above the current stack pointer value. The fix is to save this
value instead inside of the original trap frame. At this point we do
not need the original trap frame so this is safe.

The second bug is that when the emulate code loads $esp from the stack, it
points part-way through the new trap frame instead of at its beginning.
The emulation code adjusts the stack pointer to the correct value
immediately afterwards, but this still leaves a one instruction window in
which an interrupt would corrupt this trap frame. Fix this by adjusting
the stack frame value before loading it into $esp.

This fixes panics in invop_leave on i386 when using fbt return probes.

Ok'd by: rstone


233046 16-Mar-2012 jhb

MFC 226340,226340:
Use queue(3) macros instead of home-rolled versions in several places in
the INET6 code. This includes retiring the 'ndpr_next' and 'pfr_next'
macros.


233015 15-Mar-2012 raj

MFC r232518:

Respect phy-handle property in Ethernet nodes of the device tree.

This lets specify whereabouts of the parent PHY for a given MAC node
(and get rid of ugly kludges in mge(4) and tsec(4)).

Obtained from: Semihalf


233014 15-Mar-2012 raj

MFC r232512:

Remove unused #defines. All this is now retrieved from the device tree.


232962 14-Mar-2012 marius

MFC: r232822

Fix a bug introduced in r223938; on big-endian machines coping a 32-bit
quantum bytewise to the address of a 64-bit variable results in writing
to the "wrong" 32-bit half so adjust the address accordingly. This fix
is implemented in a hackish way for two reasons:
o in order to be able to get it into 8.3 with zero impact on the little-
endian architectures where this bug has no effect and
o to avoid blowing the x86 boot2 out of the water again when compiling
it with clang, which all sane versions of this fix tested do.
This change fixes booting from UFS1 file systems on big-endian machines.


232945 13-Mar-2012 glebius

Merge 231025 from head:
Add new socket options: TCP_KEEPINIT, TCP_KEEPIDLE, TCP_KEEPINTVL and
TCP_KEEPCNT, that allow to control initial timeout, idle time, idle
re-send interval and idle send count on a per-socket basis.

Reviewed by: andre, bz, lstewart


232683 08-Mar-2012 rmacklem

MFC: r2323467
The name caching changes of r230394 exposed an intermittent bug
in the new NFS server for NFSv4, where it would report ENOENT
when the file actually existed on the server. This turned out
to be caused by not initializing ni_topdir before calling lookup()
and there was a rare case where the value on the stack location
assigned to ni_topdir happened to be a pointer to a ".." entry,
such that "dp == ndp->ni_topdir" succeeded in lookup().
This patch initializes ni_topdir to fix the problem.


232682 08-Mar-2012 rmacklem

MFC: r232327
Fix the NFS clients so that they use copyin() instead of bcopy(),
when doing direct I/O. This direct I/O code is not enabled by default.


232511 04-Mar-2012 raj

MFC r230865:

Adjust mvs(4) to handle interrupt cause reg depending on the actual number of
channels available

- current code treats bits 4:7 in 'SATAHC interrupt mask' and 'SATAHC
interrupt cause' as flags for SATA channels 2 and 3

- for embedded SATA controllers (SoC) these bits have been marked as reserved
in datasheets so far, but for some new and upcoming chips they are used for
purposes other than SATA

Submitted by: Lukasz Plachno
Reviewed by: mav
Obtained from: Semihalf


232508 04-Mar-2012 raj

MFC r228504, r228530.

r228504:
Make *intr{cnt,names} on ARM reside in data section, similar to other arches.

sintrnames and sintrcnt are initialized with non-zero values, which were
discarded by the .bss directive, so consumers like "vmstat -i" were not
getting correct data.

Submitted by: Lukasz Plachno
Obtained from: Semihalf

r228530:
ARM pmap fixes:

- Write Buffers have to be drained after write to Page Table even if caches
are in write-through mode.

- Make sure to sync PTE in pmap_zero_page_generic().

Submitted by: Michal Mazur
Reviewed by: cognet
Obtained from: Semihalf


232292 29-Feb-2012 bz

MFC r231852,232127:

Merge multi-FIB IPv6 support.

Extend the so far IPv4-only support for multiple routing tables (FIBs)
introduced in r178888 to IPv6 providing feature parity.

This includes an extended rtalloc(9) KPI for IPv6, the necessary
adjustments to the network stack, and user land support as in netstat.

Sponsored by: Cisco Systems, Inc.


232290 29-Feb-2012 davidxu

MFC 230857:

If multiple threads call kevent() to get AIO events on same kqueue fd,
it is possible that a single AIO event will be reported to multiple
threads, it is not threading friendly, and the existing API can not
control this behavior.
Allocate a kevent flags field sigev_notify_kevent_flags for AIO event
notification in sigevent, and allow user to pass EV_CLEAR, EV_DISPATCH
or EV_ONESHOT to AIO kernel code, user can control whether the event
should be cleared once it is retrieved by a thread. This change should
be comptaible with existing application, because the field should have
already been zero-filled, and no additional action will be taken by
kernel.

PR: kern/156567

MFC 231006:

Add 32-bit compat code for AIO kevent flags introduced in revision 230857.

MFC 231724:

Add notes about sigev_notify_kevent_flags introduced in revision 230857
which enables thread-friendly polling on same fd for AIO events.

Reviewed by: delphij

MFC 231777:

Bump .Dd date for previous revision.


232279 29-Feb-2012 thompsa

MFC r232008,232010,232080,232089

Using the flowid in the mbuf assumes the network card is giving a good hash for
the traffic flow, this may not be the case giving poor traffic distribution.
Add a sysctl which allows us to fall back to our own flow hash code.

PR: kern/164901


232259 28-Feb-2012 rmacklem

MFC: r232050
hrs@ reported a panic to freebsd-stable@ under the subject line
"panic in 8.3-PRERELEASE" on Feb. 22, 2012. This panic was caused
by use of a mix of tsleep() and msleep() calls on the same event
in the new NFS server DRC code. It did "mtx_unlock(); tsleep();"
in two places, which kib@ noted introduced a slight risk that the
wakeup() would occur before the tsleep(), resulting in a 10sec
delay before waking up. This patch fixes the problem by replacing
"mtx_unlock(); tsleep();" with mtx_sleep(..PDROP..). It also
changes a nfsmsleep() call to mtx_sleep() so that the code uses
mtx_sleep() consistently within the file.


232140 25-Feb-2012 marius

MFC: r231985

Fix memset sizeof


232137 25-Feb-2012 marius

MFC: r231914

Probe the National DP83849, which is a dual-port version of the PHYTER.

Obtained from: NetBSD


232134 25-Feb-2012 marius

MFC: r231913

- Probe BCM57780.
- In case the parent is bge(4), don't set the Jumbo frame settings unless
the MAC actually is Jumbo capable as otherwise the PHY might not have the
corresponding registers implemented. This is also in line with what the
Linux tg3 driver does.

PR: 165032
Submitted by: Alexander Milanov
Obtained from: OpenBSD


232117 24-Feb-2012 alc

MFC r231904
Close a race due to dropping of the map lock between creating a map entry
for a shared mapping and marking the entry for inheritance.


232092 24-Feb-2012 marius

MFC: r231621

- As it turns out, MSI-X is broken for at least LSI SAS1068E when passed
through by VMware so blacklist their PCI-PCI bridge for MSI/MSI-X here.
Note that besides currently there not being a quirk type that disables
MSI-X only and there's no evidence that MSI doesn't work with the VMware
pass-through, it's really questionable whether MSI generally works in
that setup as VMware only mention three know working devices [1, p. 4].
Also not that this quirk entry currently doesn't affect the devices
emulated by VMware in any way as these don't claim support MSI/MSI-X to
begin with. [2]
While at it, make the PCI quirk table const and static.
- Remove some duplicated empty lines.
- Use DEVMETHOD_END.

PR: 163812, http://forums.freebsd.org/showthread.php?t=27899 [2]
Reviewed by: jhb

[1]: http://www.vmware.com/pdf/vsp_4_vmdirectpath_host.pdf


232068 23-Feb-2012 cperciva

MFC 230183: Make XENHVM work on i386 by fixing the definition of __ffs.


232067 23-Feb-2012 cperciva

MFC 230184, 230185: Add XENHVM config file to i386.


232045 23-Feb-2012 yongari

MFC r231622:
For RTL8168/8111D controller, make sure to wake PHY from power down
mode. Otherwise, PHY access times out under certain conditions.


232018 23-Feb-2012 rmacklem

MFC: r231805
Delete a couple of out of date comments that are no longer true in
the new NFS client.


231905 19-Feb-2012 rmh

MFC r230972,r230980,r231559,r231565: Add MK_SOURCELESS build option, and
associated fixes.

Approved by: kib (mentor)


231775 15-Feb-2012 alc

MFC r229363
Don't pass VM_ALLOC_ZERO to vm_page_grab() in tmpfs_mappedwrite() and
tmpfs_nocacheread(). It is both unnecessary and a pessimization. It
results in either the page being zeroed twice or zeroed first and then
overwritten by an I/O operation.


231734 15-Feb-2012 yongari

MFC r230286,230337-230338,231159:
r230286:
Introduce a tunable that disables use of MSI.
Non-zero value will use INTx.

r230337-230338:
Rename dev.bge.%d.msi_disable to dev.bge.%d.msi which matches
enable/disable and default it to on.

r231159:
Call bge_add_sysctls() early and especially before bge_can_use_msi() so
r230337 actually has a chance of working and doesn't always unconditionally
disable the use of MSIs.


231731 15-Feb-2012 yongari

MFC r230336:
Fix a logic error which resulted in putting PHY into sleep when WOL
is active. If WOL is active driver should not put PHY into sleep.
This change makes WOL work on RTL8168E.


231728 15-Feb-2012 yongari

MFC r230575-230576:
r230275:
Use a RX DMA tag to free loaded RX DMA maps.
Previously it used a TX DMA tag.

r230276:
Free allocated jumbo buffers when controller is stopped.


231725 15-Feb-2012 yongari

MFC r229940:
style. No functional changes.


231636 14-Feb-2012 rmacklem

MFC: r230803
When a "mount -u" switches an NFS mount point from TCP to UDP,
any thread doing an I/O RPC with a transfer size greater than
NFS_UDPMAXDATA will be hung indefinitely, retrying the RPC.
After a discussion on freebsd-fs@, I decided to add a warning
message for this case, as suggested by Jeremy Chadwick.


231633 14-Feb-2012 rmacklem

MFC: r230801
jwd@ reported a problem via email to freebsd-fs@ on Aug 25, 2011
under the subject "F_RDLCK lock to FreeBSD NFS fails to R/O target file".
This occurred because the server side NLM always checked for VWRITE
access, irrespective of the type of lock request. This patch
replaces VOP_ACCESS(..VWRITE..) with one appropriate to
the lock operation. It allows unlock and lock cancellation
to be done without a check of VOP_ACCESS(), so that files
can't be left locked indefinitely after the file permissions
have been changed.


231629 14-Feb-2012 marius

MFC: r231228

Remove extra newlines from panic messages.


231623 14-Feb-2012 marius

MFC: r231518

Remove extra newlines from panic messages.


231610 13-Feb-2012 jhb

MFC 230340:
Properly return success once a matching VPD entry is found in
pci_get_vpd_readonly_method(). Previously the loop was always running
to completion and falling through to failing with ENXIO.


231545 12-Feb-2012 rmacklem

MFC: r231133
r228827 fixed a problem where copying of NFSv4 open credentials into
a credential structure would corrupt it. This happened when the
p argument was != NULL. However, I now realize that the copying of
open credentials should only happen for p == NULL, since that indicates
that it is a read-ahead or write-behind. This patch fixes this.
After this commit, r228827 could be reverted, but I think the code is
clearer and safer with the patch, so I am going to leave it in.
Without this patch, it was possible that a NFSv4 VOP_SETATTR() could have
changed the credentials of the caller. This would have happened if
the process doing the VOP_SETATTR() did not have the file open, but
some other process running as a different uid had the file open for writing
at the same time.


231522 11-Feb-2012 avg

MFC r230157: dadump: don't leak the periph lock on i/o error


231330 10-Feb-2012 rmacklem

MFC: r230605
A problem with respect to data read through the buffer cache for both
NFS clients was reported to freebsd-fs@ under the subject "NFS
corruption in recent HEAD" on Nov. 26, 2011. This problem occurred when
a TCP mounted root fs was changed to using UDP. I believe that this
problem was caused by the change in mnt_stat.f_iosize that occurred
because rsize was decreased to the maximum supported by UDP. This
patch fixes the problem by using v_bufobj.bo_bsize instead of f_iosize,
since the latter is set to f_iosize when the vnode is allocated, but
does not change for a given vnode when f_iosize changes.


231178 08-Feb-2012 marcel

MFC r231177:
Rev. 228360 moved the call to cpu_set_upcall() to happen before
td_proc gets initialized in td (=newtd). Use td0 instead.


231165 07-Feb-2012 jhb

MFC 229465: Use correct locking when traversing interface address list.


231157 07-Feb-2012 jhb

MFC 229614:
Add new variants of the IF_ADDR_*LOCK*() macros used for protecting
interface address lists that distinguish read locks from write locks.
To preserve the KPI, the previous operations are mapped to the write
lock macros. The lock is still kept as a mutex for now.


231156 07-Feb-2012 jhb

MFC 229613:
Update recently added drivers to use the if_*addr_r*lock() wrapper
functions instead of using the IF_ADDR_LOCK directly. The wrapper
functions are the supported interface for device drivers.


231153 07-Feb-2012 jhb

MFC 229598:
Remove use of explicit bus space tags and handles and use methods that
operate on resource objects instead.


231152 07-Feb-2012 jhb

Hoist mergeinfo for modules/sound/driver/* up to sys/.


231150 07-Feb-2012 jhb

MFC 228962:
Use curthread rather than PCPU_GET(curthread). 'curthread' uses
special-case optimizations on several platforms and is preferred.


231145 07-Feb-2012 jhb

MFC 228957:
Implement linux_fadvise64() and linux_fadvise64_64() using
kern_posix_fadvise().


231023 05-Feb-2012 nwhitehorn

MFC r230247:

Revert r212360 now that PowerPC can handle large sparse arguments to
pmap_remove() (changed in r228412).


231022 05-Feb-2012 nwhitehorn

Pick a constant high IRQ value for the PS3 IPI, which lets PS3 devices be
usefully loaded and unloaded as modules.

Submitted by: geoffrey dot levand at mail dot ru


231021 05-Feb-2012 nwhitehorn

MFC r230398:

Prevent an error resulting from signed/unsigned comparison on systems
that do not comply with the OF spec.

Submitted by: Anders Gavare


230928 03-Feb-2012 rmacklem

MFC: r230345
Martin Cracauer reported a problem to freebsd-current@ under the
subject "Data corruption over NFS in -current". During investigation
of this, I came across an ugly bogusity in the new NFS client where
it replaced the cr_uid with the one used for the mount. This was
done so that "system operations" like the NFSv4 Renew would be
performed as the user that did the mount. However, if any other
thread shares the credential with the one doing this operation,
it could do an RPC (or just about anything else) as the wrong cr_uid.
This patch fixes the above, by using the mount credentials instead of
the one provided as an argument for this case. It appears
to have fixed Martin's problem.
This patch is needed for NFSv4 mounts and NFSv3 mounts against
some non-FreeBSD servers that do not put post operation attributes
in the NFSv3 Statfs RPC reply.

Tested by: cracauer at cons.org, dim


230920 02-Feb-2012 ken

MFC 230592:

Bring in the LSI-supported version of the mps(4) driver.

This involves significant changes to the mps(4) driver, but is not a
complete rewrite.

Some of the changes in this version of the driver:
- Integrated RAID (IR) support.
- Support for WarpDrive controllers.
- Support for SCSI protection information (EEDP).
- Support for TLR (Transport Level Retries), needed for tape drives.
- Improved error recovery code.
- ioctl interface compatible with LSI utilities.

mps.4: Update the mps(4) driver man page somewhat for the driver
changes. The list of supported hardware still needs to be
updated to reflect the full list of supported cards.

conf/files: Add the new driver files.

mps/mpi/*: Updated version of the MPI header files, with a BSD style
copyright.

mps/*: See above for a description of the new driver features.

modules/mps/Makefile:
Add the new mps(4) driver files.

Submitted by: Kashyap Desai <Kashyap.Desai@lsi.com>
Sponsored by: LSI, Spectra Logic
Reviewed by: ken


230896 01-Feb-2012 marius

MFC: r227980

Move to SCHED_ULE by default. Since r226057 SCHED_ULE and sparc64 are
compatible with each other and since r227539 the last issue seen when
using SCHED_ULE is fixed (MFC'ed to stable/9 in r230691 and r227714
respectively). At least on UP and 2-way machines SCHED_4BSD still
performs better than SCHED_ULE, however, the optimizations done in
r225889 (MFC'ed to stable/9 in r230673) pretty much compensate that so
there's at least no net regression.
Thanks go to Peter Jeremy for extensive testing.


230894 01-Feb-2012 marius

MFC: r230664

As it turns out r227960 (MFC'ed to stable/9 in r228126) may still be
insufficient with PREEMPTION so try harder to get the CDMA sync
interrupt delivered and also in a more efficient way:
- wrap the whole process of sending and receiving the CDMA sync
interrupt in a critical section so we don't get preempted,
- send the CDMA sync interrupt to the CPU that is actually waiting
for it to happen so we don't take a detour via another CPU,
- instead of waiting for up to 15 seconds for the interrupt to
trigger try the whole process for up to 15 times using a one
second timeout (the code was also changed to just ignore belated
interrupts of a previous tries should they appear).

According to testing done by Peter Jeremy with the debugging also
added as part of this commit the first two changes apparently are
sufficient to now properly get the CDMA sync interrupts delivered
at the first try though.


230892 01-Feb-2012 marius

MFC: r230662

Fully disable interrupts while we fiddle with the FP context in the
VIS-based block copy/zero implementations. While with 4BSD it's
sufficient to just disable the tick interrupts, with ULE+PREEMPTION
it's otherwise also possible that these are preempted via IPIs.


230890 01-Feb-2012 marius

MFC: r230633, r230634

Now that we have a working OF_printf() since r230631 and a OF_panic()
helper since r230632 (MFC'ed to stable/9 in r230884 and r230886
respectively), use these for output and panicing during the early
cycles and move cninit() until after the static per-CPU data has
been set up. This solves a couple of issue regarding the non-
availability of the static per-CPU data:
- panic() not working and only making things worse when called,
- having to supply a special DELAY() implementation to the low-level
console drivers,
- curthread accesses of mutex(9) usage in low-level console drivers
that aren't conditional due to compiler optimizations (basically,
this is the problem described in r227537 but in this case for
keyboards attached via uart(4)). [1]

PR: 164123 [1]


230888 01-Feb-2012 marius

MFC: r230628

Mark cpu_{halt,reset}() as __dead2 as appropriate.


230886 01-Feb-2012 marius

MFC: r230632

- Now that we have a working OF_printf() since r230631 (MFC'ed to stable/9
in r230884), use it for implementing a simple OF_panic() that may be used
during the early cycles when panic() isn't available, yet.
- Mark cpu_{exit,shutdown}() as __dead2 as appropriate.


230884 01-Feb-2012 marius

MFC: r230631

Implement OF_printf() using kvprintf() directly, avoiding to use a
buffer and allowing to handle newlines properly.


230882 01-Feb-2012 marius

MFC: r230630

For machines where the kernel address space is unrestricted increase
VM_KMEM_SIZE_SCALE to 2, awaiting more insight from alc@. As it turns
out, the VM apparently has problems with machines that have large holes
in the physical address space, causing the kmem_suballoc() call in
kmeminit() to fail with a VM_KMEM_SIZE_SCALE of 1. Using a value of 2
allows these, namely Blade 1500 with 2GB of RAM, to boot.

PR: 164227


230880 01-Feb-2012 marius

MFC: r230627

Using ATA_CAM along with ATAPI DMA causes data corruption with ALI_NEW
and CMD controllers for reasons unknown so disable it.

PR: 164226


230872 01-Feb-2012 mav

MFC r228820, r228851:
Merge to da driver quirks hinting 4K physical sector sizes for SATA disks
connected via SAS or USB. Unluckily I've found that SAS (mps) and USB-SATA
I have translate models in different ways, requiring twice more quirks.
Unluckily for Hitachi, their model names are trimmed on SAS, making
impossible to identify 4K sector drives that way.


230867 01-Feb-2012 pluknet

MFC r230545: Clarify and improve the boot menu with some small changes.

PR: misc/160818
Submitted by: Warren Block <wblock wonkity com>


230849 31-Jan-2012 ken

MFC: 230000, 230544

Fix a race condition in CAM peripheral free handling, locking
in the CAM XPT bus traversal code, and a number of other periph level
issues.

r230544 | ken | 2012-01-25 10:58:47 -0700 (Wed, 25 Jan 2012) | 9 lines

Fix a bug introduced in r230000. We were eliminating all LUNs on a target
in response to CAM_DEV_NOT_THERE, instead of just the LUN in question.

This will now just eliminate the specified LUN in response to
CAM_DEV_NOT_THERE.

Reported by: Richard Todd <rmtodd@servalan.servalan.com>

r230000 | ken | 2012-01-11 17:41:48 -0700 (Wed, 11 Jan 2012) | 72 lines

Fix a race condition in CAM peripheral free handling, locking
in the CAM XPT bus traversal code, and a number of other periph level
issues.

cam_periph.h,
cam_periph.c: Modify cam_periph_acquire() to test the CAM_PERIPH_INVALID
flag prior to allowing a reference count to be gained
on a peripheral. Callers of this function will receive
CAM_REQ_CMP_ERR status in the situation of attempting to
reference an invalidated periph. This guarantees that
a peripheral scheduled for a deferred free will not
be accessed during its wait for destruction.

Panic during attempts to drop a reference count on
a peripheral that already has a zero reference count.

In cam_periph_list(), use a local sbuf with SBUF_FIXEDLEN
set so that mallocs do not occur while the xpt topology
lock is held, regardless of the allocation policy of the
passed in sbuf.

Add a new routine, cam_periph_release_locked_buses(),
that can be called when the caller already holds
the CAM topology lock.

Add some extra debugging for duplicate peripheral
allocations in cam_periph_alloc().

Treat CAM_DEV_NOT_THERE much the same as a selection
timeout (AC_LOST_DEVICE is emitted), but forgo retries.

cam_xpt.c: Revamp the way the EDT traversal code does locking
and reference counting. This was broken, since it
assumed that the EDT would not change during
traversal, but that assumption is no longer valid.

So, to prevent devices from going away while we
traverse the EDT, make sure we properly lock
everything and hold references on devices that
we are using.

The two peripheral driver traversal routines should
be examined. xptpdperiphtraverse() holds the
topology lock for the entire time it runs.
xptperiphtraverse() is now locked properly, but
only holds the topology lock while it is traversing
the list, and not while the traversal function is
running.

The bus locking code in xptbustraverse() should
also be revisited at a later time, since it is
complex and should probably be simplified.

scsi_da.c: Pay attention to the return value from cam_periph_acquire().

Return 0 always from daclose() even if the disk is now gone.

Add some rudimentary error injection support.

scsi_sg.c: Fix reference counting in the sg(4) driver.

The sg driver was calling cam_periph_release() on close,
but never called cam_periph_acquire() (which increments
the reference count) on open.

The periph code correctly complained that the sg(4)
driver was trying to decrement the refcount when it
was already 0.

Sponsored by: Spectra Logic


230799 31-Jan-2012 attilio

MFC r227758,227759,227788:
Introduce macro stubs in the mutex and sxlock implementation that will
be always defined and will allow consumers, willing to provide options,
file and line to locking requests, to not worry about options
redefining the interfaces.
This is typically useful when there is the need to build another
locking interface on top of the mutex one.

Requested by: kib


230788 30-Jan-2012 jhibbits

MFC r228270,228277:

Add a devd notification for closing/opening the lid on PowerBooks and iBooks.

Approved by: nwhitehorn (mentor)


230769 30-Jan-2012 pluknet

MFC r230531: Remove unused variable.


230760 29-Jan-2012 mckusick

MFC r230101:

Convert FFS mount error messages from kernel printf's to using the
vfs_mount_error error message facility provided by the nmount
interface.

Clean up formatting of mount warnings which still need to use
kernel printf's since they do not return errors.

Requested by: Craig Rodrigues <rodrigc@crodrigues.org>


230751 29-Jan-2012 jhibbits

MFC r226449:

Add support for special keys (volume/brightness/eject) on Apple laptops with
ADB keyboards.

Approved by: nwhitehorn (mentor)


230746 29-Jan-2012 marius

MFC: r228858

Update a comment to reflect reality and explain why we're using the
medany code model.


230740 29-Jan-2012 marius

MFC: r228211

It doesn't make much sense to check whether child is NULL after already
having dereferenced it. We either should generally check the device_t's
supplied to bus functions before using them (which we seem to virtually
never do) or just assume that they are not NULL.
While at it make this code fit 78 columns.

Found with: Coverity Prevent(tm)
CID: 4230


230738 29-Jan-2012 marius

MFC: r228209

- In device_probe_child(9) check the return value of device_set_driver(9)
when actually setting a driver as especially ENOMEM is fatal in these
cases.
- Annotate other calls to device_set_devclass(9) and device_set_driver(9)
without the return value being checked and that are okay to fail.

Reviewed by: yongari (slightly earlier version)


230736 29-Jan-2012 marius

MFC: r228027

Move the scsi_da_bios_params() prototype from pc98_machdep.h to md_var.h
where the prototype for pc98_ata_disk_firmware_geom_adjust() also lives
in order to avoid an #ifdef'ed include in cam(4).


230734 29-Jan-2012 marius

MFC: r228024

Update comment.


230733 29-Jan-2012 marius

MFC: r228005

Change another instance of amd(4) to esp(4) missed in r227006 (MFC'ed to
stable/9 in r227305).

Submitted by: Garrett Cooper


230725 29-Jan-2012 mckusick

MFC r230249:

Make sure all intermediate variables holding mount flags (mnt_flag)
and that all internal kernel calls passing mount flags are declared
as uint64_t so that flags in the top 32-bits are not lost.

MFC r230250:

There are several bugs/hangs when trying to take a snapshot on a UFS/FFS
filesystem running with journaled soft updates. Until these problems
have been tracked down, return ENOTSUPP when an attempt is made to
take a snapshot on a filesystem running with journaled soft updates.


230719 29-Jan-2012 marius

MFC: r227912

- Just use cam_calc_geometry(9) on newer version of FreeBSD rather than
duplicating it.
- In hptmv(4) and hptrr(4) use __FBSDID and DEVMETHOD_END.


230717 29-Jan-2012 marius

MFC: r227907, r22791 (for diff reduction)

Add BCM5785 but wrap it in #ifdef notyet for now. According to yongari@ there
are issues probably needing workarounds in bge(4) when brgphy(4) handles this
PHY. Letting ukphy(4) handle it instead results in a working configuration,
although likely with performance penalties.


230716 29-Jan-2012 marius

MFC: r227906

Sync with NetBSD rev. 1.104

Obtained from: NetBSD


230711 29-Jan-2012 marius

MFC: r227688

There's no need export the device interface methods of miibus(4).


230709 29-Jan-2012 marius

MFC: r227687, r228290

- Add a hint.miibus.X.phymask hint, allowing do individually exclude PHY
addresses from being probed and attaching something including ukphy(4)
to it. This is mainly necessarily for PHY switches that create duplicate
or fake PHYs on the bus that can corrupt the PHY state when accessed or
simply cause problems when ukphy(4) isolates the additional instances.
- Change miibus(4) to be a hinted bus, allowing to add child devices via
hints and to set their attach arguments (including for automatically
probed PHYs). This is mainly needed for PHY switches that violate IEEE
802.3 and don't even implement the basic register set so we can't probe
them automatically. However, the ability to alter the attach arguments
for automatically probed PHYs is also useful as for example it allows
to test (or tell a user to test) new variant of a PHY with a specific
driver by letting an existing driver attach to it via manipulating the
IDs without the need to touch the source code or to limit a Gigabit
Ethernet PHY to only announce up to Fast Ethernet in order to save
energy by limiting the capability mask. Generally, a driver has to
be hinted via hint.phydrv.X.at="miibusY" and hint.phydrv.X.phyno="Z"
(which already is sufficient to add phydrvX at miibusY at PHY address
Z). Then optionally the following attach arguments additionally can
be configured:
hint.phydrv.X.id1
hint.phydrv.X.id2
hint.phydrv.X.capmask
- Some minor cleanup.

Reviewed by: adrian, ray


230707 29-Jan-2012 marius

MFC: r227686

There's no need to read DC_10BTSTAT twice in dcphy_status().


230705 29-Jan-2012 marius

MFC: r227685

- There's no need to ignore the return value of mii_attach(9) when attaching
dcphy(4) (CID 9283).
- In dc_detach(), check whether ifp is NULL as dc_attach() may call the
former without ifp being allocated (CID 4288).

Found with: Coverity Prevent(tm)


230703 29-Jan-2012 marius

MFC: r227043

Sprinkle some const.


230701 29-Jan-2012 marius

MFC: r226950

Add multiple inclusion protection.


230699 29-Jan-2012 marius

MFC: r226948

Remove unnecessary DMA constraints.


230697 29-Jan-2012 marius

MFC: r226270

- Remove unused remnants of MII bitbang'ing.
- Sprinkle const.


230695 29-Jan-2012 marius

MFC: r226175

In device_get_children() avoid malloc(0) in order to increase portability
to other operating systems.

PR: 154287


230694 29-Jan-2012 marius

MFC: r226171

Sprinkle const.


230691 29-Jan-2012 marius

MFC: r226057

- Currently, sched_balance_pair() may cause a CPU to send an IPI_PREEMPT to
itself, which sparc64 hardware doesn't support. One way to solve this
would be to directly call sched_preempt() instead of issuing a self-IPI.
However, quoting jhb@:
"On the other hand, you can probably just skip the IPI entirely if we are
going to send it to the current CPU. Presumably, once this routine
finishes, the current CPU will exit softlock (or will do so "soon") and
will then pick the next thread to run based on the adjustments made in
this routine, so there's no need to IPI the CPU running this routine
anyway. I think this is the better solution. Right now what is probably
happening on other platforms is as soon as this routine finishes the CPU
processes its self-IPI and causes mi_switch() which will just switch back
to the softclock thread it is already running."
- With r226054 (MFC'ed to stable/9 in r230690) and the the above change in
place, sparc64 now no longer is incompatible with ULE and vice versa.
However, powerpc/E500 still is.

Submitted by: jhb
Reviewed by: jeff


230690 29-Jan-2012 marius

MFC: r226054

- Use atomic operations rather than sched_lock for safely assigning pm_active
and pc_pmap for SMP. This is key to allowing adding support for SCHED_ULE.
Thanks go to Peter Jeremy for additional testing.
- Add support for SCHED_ULE to cpu_switch().


230687 29-Jan-2012 marius

MFC: r225931, r225932, r227000

Make sparc64 compatible with NEW_PCIB and enable it:
- Implement bus_adjust_resource() methods as far as necessary and in non-PCI
bridge drivers as far as feasible without rototilling them.
- As NEW_PCIB does a layering violation by activating resources at layers
above pci(4) without previously bubbling up their allocation there, move
the assignment of bus tags and handles from the bus_alloc_resource() to
the bus_activate_resource() methods like at least the other NEW_PCIB
enabled architectures do. This is somewhat unfortunate as previously
sparc64 (ab)used resource activation to indicate whether SYS_RES_MEMORY
resources should be mapped into KVA, which is only necessary if their
going to be accessed via the pointer returned from rman_get_virtual() but
not for bus_space(9) as the later always uses physical access on sparc64.
Besides wasting KVA if we always map in SYS_RES_MEMORY resources, a driver
also may deliberately not map them in if the firmware already has done so,
possibly in a special way. So in order to still allow a driver to decide
whether a SYS_RES_MEMORY resource should be mapped into KVA we let it
indicate that by calling bus_space_map(9) with BUS_SPACE_MAP_LINEAR as
actually documented in the bus_space(9) page. This is implemented by
allocating a separate bus tag per SYS_RES_MEMORY resource and passing the
resource via the previously unused bus tag cookie so we later on can call
rman_set_virtual() in sparc64_bus_mem_map(). As a side effect this now
also allows to actually indicate that a SYS_RES_MEMORY resource should be
mapped in as cacheable and/or read-only via BUS_SPACE_MAP_CACHEABLE and
BUS_SPACE_MAP_READONLY respectively.
- Do some minor cleanup like taking advantage of rman_init_from_resource(),
factor out the common part of bus tag allocation into a newly added
sparc64_alloc_bus_tag(), hook up some missing newbus methods and replace
some homegrown versions with the generic counterparts etc.
- While at it, let apb_attach() (which can't use the generic NEW_PCIB code
as APB bridges just don't have the base and limit registers implemented)
regarding the config space registers cached in pcib_softc and the SYSCTL
reporting nodes set up.


230683 28-Jan-2012 marius

MFC: r225901

Remove obsolete macros.


230682 28-Jan-2012 marius

MFC: r225900

Nuke SUN4U #ifdef's which with the demise of sun4v no longer serve any
purpose.


230680 28-Jan-2012 marius

MFC: r225899

Also allocate space for the PIL counters. Given that no machine actually
uses IV_MAX interrupt vectors this wasn't a problem in practice though.


230677 28-Jan-2012 marius

MFC: r225891

Re-reading the Schizo errata suggests that it's actually tolerable to
also use the streaming buffer of pre version 5/revision 2.3 hardware as
long as we stay away from context flushes (which iommu(4) so far doesn't
take advantage of). OpenSolaris does the same.


230675 28-Jan-2012 marius

MFC: r225890

- Add protective parentheses to macros as far as possible.
- Move {r,w,}mb() to the top of this file where they live on most of the
other architectures.


230673 28-Jan-2012 marius

MFC: r225889, r228222

In total store which we use for running the kernel and all of the userland
atomic operations behave as if they were followed by a CPU memory barrier
so there's no need to include ones in the acquire variants of atomic(9) and
it's sufficient to just use include compiler memory barriers to satisfy
the requirements of atomic(9). Removing the CPU memory barriers results in
a small performance improvement, specifically this is sufficient to
compensate the performance loss seen in the worldstone benchmark seen when
using SCHED_ULE instead of SCHED_4BSD.
This change is inspired by Linux even more radically doing the equivalent
thing some time ago.
Thanks go to Peter Jeremy for additional testing.


230671 28-Jan-2012 marius

MFC: r225888

Add a comment about why contrary to what once would think running all of
userland with total store order actually is appropriate.


230669 28-Jan-2012 marius

MFC: r225887

Use the extended integer condition code when comparing 64-bit values. Given
that ATOMIC_INC_LONG currently is unused this happened to not be fatal.


230667 28-Jan-2012 marius

MFC: r225886

- Right-justify backslashes as suggested by style(9).
- Rename ATOMIC_INC_ULONG to ATOMIC_INC_LONG in order to be consistent with
the names of the other macros in this file an adjust accordingly.


230665 28-Jan-2012 marius

MFC: r228022, r228026

For sparc64 also adjust the geometry of da(4) driven disks to not overflow
the 16-bit cylinders field of the VTOC8 disk label (at around 502GB). The
geometry chosen for disks above that limit allows to use disks up to 2TB,
which is the limit of the extended VTOC8 format. The geometry used for
disks smaller than the 16-bit cylinders limit stays the same as used by
cam_calc_geometry(9) for extended translation.
Thanks to Hans-Joerg Sirtl for providing hardware for testing this change.


230637 28-Jan-2012 rmacklem

MFC: r230100
Tai Horgan reported via email that there were two places in
the new NFSv4 server where the code follows the wrong list.
Fortunately, for these fairly rare cases, the lc_stateid[]
lists are normally empty. This patch fixes the code to
follow the correct list.


230607 27-Jan-2012 pluknet

MFC r230496: Remove the stale XXX rt_newaddrmsg comment.


230604 27-Jan-2012 qingli

MFC 227460

A default route learned from the RAs could be deleted manually
after its installation. This removal may be accidental and can
prevent the default route from being installed in the future if
the associated default router has the best preference. The cause
is the lack of status update in the default router on the state
of its route installation in the kernel FIB. This patch fixes
the described problem.

Reviewed by: hrs, discussed with hrs


230518 25-Jan-2012 rmacklem

MFC: r229956
jwd@ reported via email that the "CacheSize" field reported by "nfsstat -e -s"
would go negative after using the "-z" option to zero out the stats.
This patch fixes that by not zeroing out the srvcache_size field
for "-z", since it is the size of the cache and not a counter


230497 24-Jan-2012 pluknet

MFC r230256:
Fix the "lock &zrl->zr_mtx already initialized" assertion by initializing
the allocated memory before calling mtx_init(9) on mtx pointing to it.
Otherwize, random contents of uninitialized memory might occasionally
trigger the assertion.

Reported by: Pavel Polyakov <bsd kobyla org>
Reviewed by: pjd


230485 23-Jan-2012 jh

MFC r229694:

r222004 changed sbuf_finish() to not clear the buffer error status. As a
consequence sbuf_len() will return -1 for buffers which had the error
status set prior to sbuf_finish() call. This causes a problem in
pfs_read() which purposely uses a fixed size sbuf to discard bytes which
are not needed to fulfill the read request.

Work around the problem by using the full buffer length when
sbuf_finish() indicates an overflow. An overflowed sbuf with fixed size
is always full.

PR: kern/163076


230462 22-Jan-2012 jh

MFC r229692:

Check the return value of sbuf_finish() in pfs_readlink() and return
ENAMETOOLONG if the buffer overflowed.


230446 22-Jan-2012 rmacklem

MFC: r229802
opt_inet6.h was missing from some files in the new NFS subsystem.
The effect of this was, for clients mounted via inet6 addresses,
that the DRC cache would never have a hit in the server. It also
broke NFSv4 callbacks when an inet6 address was the only one available
in the client. This patch fixes the above, plus deletes opt_inet6.h
from a couple of files it is not needed for.


230435 21-Jan-2012 alc

MFC r228923, r228935, and r229007
Eliminate many of the unnecessary differences between the native and
paravirtualized pmap implementations for i386.

Fix a bug in the Xen pmap's implementation of
pmap_extract_and_hold(): If the page lock acquisition is retried,
then the underlying thread is not unpinned.

Wrap nearby lines that exceed 80 columns.

Merge r216333 and r216555 from the native pmap
When r207410 eliminated the acquisition and release of the page
queues lock from pmap_extract_and_hold(), it didn't take into
account that pmap_pte_quick() sometimes requires the page queues
lock to be held. This change reimplements pmap_extract_and_hold()
such that it no longer uses pmap_pte_quick(), and thus never
requires the page queues lock.

Merge r177525 from the native pmap
Prevent the overflow in the calculation of the next page
directory. The overflow causes the wraparound with consequent
corruption of the (almost) whole address space mapping.

Strictly speaking, r177525 is not required by the Xen pmap because
the hypervisor steals the uppermost region of the normal kernel
address space. I am nonetheless merging it in order to reduce the
number of unnecessary differences between the native and Xen pmap
implementations.


230431 21-Jan-2012 alc

MFC r228746
The Xen pmap doesn't support superpages. So, there is no point in it
initializing structures, like the pv table, that are only used to
implement superpages. In fact, some of the unnecessary code in
pmap_init() was actually doing harm. It was preventing the kernel from
booting on virtual machines with more than 768 MB of memory.


230425 21-Jan-2012 rmh

MFC r227827
Define __FreeBSD_kernel__ macro in sys/param.h.

__FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,
which by definition is always true on FreeBSD. This macro is also defined
on other systems that use the kernel of FreeBSD, such as GNU/kFreeBSD.

It is tempting to use this macro in userland code when we want to enable
kernel-specific routines, and in fact it's fine to do this in code that
is part of FreeBSD itself. However, be aware that as presence of this
macro is still not widespread (e.g. older FreeBSD versions, 3rd party
compilers, etc), it is STRONGLY DISCOURAGED to check for this macro in
external applications without also checking for __FreeBSD__ as an
alternative.

Approved by: kib (mentor)


230421 21-Jan-2012 alc

MFC r228398
Avoid the possibility of integer overflow in the calculation of
VM_KMEM_SIZE_MAX. Specifically, if the user/kernel address space split
was changed such that the kernel address space was greater than or equal
to 2 GB, then overflow would occur.

PR: 161721


230418 21-Jan-2012 alc

MFC r226163, r228317, and r228324
Fix the handling of an empty kmem map by sysctl_kmem_map_free().

Eliminate the possibility of 32-bit arithmetic overflow in the
calculation of vm_kmem_size that may occur if the system
administrator has specified a vm.vm_kmem_size tunable value that
exceeds the hard cap.

Eliminate stale numbers from a comment.

PR: 162741


230320 18-Jan-2012 gnn

MFC: 229965

Fix for PR 138526.

Add the ability for /dev/null and /dev/zero to accept
being set into non blocking mode via fcntl(). This
brings the code into compliance with IEEE Std 1003.1-2001
as referenced in another PR, 94729.

Reviewed by: jhb


230305 18-Jan-2012 jhibbits

MFC r228869,r228874:

Implement hwpmc counting PMC support for PowerPC G4+ (MPC745x/MPC744x).
Sampling is in progress.

Approved by: nwhitehorn (mentor)


230302 18-Jan-2012 hselasky

MFC r230032, r230050, r230090, r230091 and r228493.
- Various XHCI and USB 3.0 related issues.
- USB 3.0 HUBs should work after this change.


230290 17-Jan-2012 jhibbits

MFC r230035:

Add PWM monitoring sysctl to G4 MDD (Windtunnel) fan driver. While there, clean
up some style nits.


230266 17-Jan-2012 gavin

Merge r229085 from head:

Default to not performing the early-boot memory tests when we detect we
are booting inside a VM. There are three reasons to disable this:

o It causes the VM host to believe that all the tested pages or RAM are
in use. This in turn may force the host to page out pages of RAM
belonging to other VMs, or otherwise cause problems with fair resource
sharing on the VM cluster.
o It adds significant time to the boot process (around 1 second/Gig in
testing)
o It is unnecessary - the host should have already verified that the
memory is functional etc.

Note that this simply changes the default when in a VM - it can still be
overridden using the hw.memtest.tests tunable.

Early MFC requested by: bz


230219 16-Jan-2012 pluknet

MFC r228985,229881:

Unset the environment variables associated with individual menu items
before invoking the kernel.

Get rid of a spurious warning on the console when booting the kernel
from the interactive loader(8) prompt and beastie_disable="YES" is set
in loader.conf(5).

Submitted by: Devin Teske <devin dott teske fisglobal.com>


230175 15-Jan-2012 avg

MFC r228265: critical_exit: ignore td_owepreempt if kdb_active is set


230173 15-Jan-2012 avg

MFC r228718: ule: ensure that batch timeshare threads are scheduled
fairly


230171 15-Jan-2012 avg

MFC r228710: opensolaris compat: fix vcmn_err so that panic(9) produces
a proper message


230169 15-Jan-2012 avg

MFC r228426: syscons: make sc_puts static as it is used only privately


230167 15-Jan-2012 avg

MFC r228430,228433: put sys/systm.h at its proper place or add it if missing


230165 15-Jan-2012 avg

MFC r228267: zfsboot: print boot.config contents before parsing it


230163 15-Jan-2012 avg

MFC r228266: zfs boot: allow file vdevs to be used in testing (e.g. with zfsboottest)


230086 13-Jan-2012 jhb

MFC 229665,229672,229700:
Remove the assertion from tcp_input() that rcv_nxt is always greater
than or equal to rcv_adv and fix tcp_twstart() to handle this case by
assuming the last window was zero rather than a negative value.

The code in tcp_input() already safely handled this case. It can happen
due to delayed ACKs along with a remote sender that sends data beyond
the window we previously advertised. If we have room in our socket buffer
for the extra data beyond the advertised window, we will accept it.
However, if the ACK for that segment is delayed, then we will not
effectively fixup rcv_adv to account for that extra data until the
next segment arrives and forces out an ACK. When that next segment
arrives, rcv_nxt will be beyond rcv_adv.


230085 13-Jan-2012 jhb

MFC 228961:
Further relax the strictness of enforcing allocations to only come from
decoded ranges. Pass any request for a specific range that fails because
it is not in a decoded range for an ACPI Host-PCI bridge up to the parent
to see if it can still be allocated. This is based on the assumption that
many BIOSes are inconsistent/broken and that settings programmed into BARs
or resources assigned to other built-in components are more trustworthy than
the list of decoded resource ranges in _CRS. This effectively limits the
decoded ranges to only being used for "wildcard" ranges when allocating
fresh resources for a BAR, etc. At some point I would like to only be
this permissive during an early scan of firmware-assigned resources during
boot and to be strict about all later allocations, but that isn't viable
currently.


230083 13-Jan-2012 jhb

MFC 228960:
Cap the priority calculated from the current thread's running tick count
at SCHED_PRI_RANGE to prevent overflows in the priority value. This can
happen due to irregularities with clock interrupts under certain
virtualization environments.


230081 13-Jan-2012 jhb

MFC 229519:
Fix 'make clean' for this module so it cleans up the generated gssd.h.


230079 13-Jan-2012 jhb

MFC 229429:
Some small fixes to CPU accounting for threads:
- Only initialize the per-cpu switchticks and switchtime in sched_throw()
for the very first context switch on APs during boot. This avoids a
small gap between the middle of thread_exit() and sched_throw() where
time is not accounted to any thread.
- In thread_exit(), update the timestamp bookkeeping to track the changes
to mi_switch() introduced by td_rux so that the code once again matches
the comment claiming it is mimicing mi_switch(). Specifically, only
update the per-thread stats directly and depend on ruxagg() to update
p_rux rather than adjusting p_rux directly. While here, move the
timestamp bookkeeping as late in the function as possible.


230078 13-Jan-2012 jhb

MFC 229427:
Fix a few bugs in the SRAT parsing code:
- Actually increment ndomain when building our list of known domains
so that we can properly renumber them to be 0-based and dense.
- If the number of domains exceeds the configured maximum (VM_NDOMAIN),
bail out of processing the SRAT and disable NUMA rather than hitting an
obscure panic later.
- Don't bother parsing the SRAT at all if VM_NDOMAIN is set to 1 to
disable NUMA (the default).


230076 13-Jan-2012 jhb

MFC 229390,229420,229479:
Fix some races in the multicast code by removing places where we would
drop the IF_ADDR_LOCK while walking an interface's multicast address list:
- Use TAILQ_FOREACH() instead of TAILQ_FOREACH_SAFE() for some loops that
do not modify the queues they iterate over.
- When cancelling multicast timers on an interface, don't release the
reference on a group in the leaving state while iterating over the loop.
Instead, use the same approach used in igmp_ifdetach() and mld_ifdetach()
of placing the groups to free on a pending release list and then releasing
the references after dropping the IF_ADDR_LOCK.
- Use the mli_relinmhead list normally used to defer calls to
in6m_release_locked() to defer calls to mld_v1_transmit_report() until
after the IF_ADDR_LOCK is dropped.


230074 13-Jan-2012 jhb

MFC 229414,229476,229477:
Various fixes to the SIOC[DG]LIFADDR ioctl handlers:
- Grab a reference on any matching interface address (ifa) before dropping
the IF_ADDR_LOCK() and release the reference after using it to prevent a
potential use-after-free.
- Fix the IPv4 ioctl handlers in in_lifaddr_ioctl() to work with IPv4
interface addresses rather than IPv6.
- Add missing interface address list locking in the IPv4 handlers.


230072 13-Jan-2012 jhb

MFC 229400:
Improve the cscope target's handling of MD directories. Automatically
include the MACHINE_CPUARCH directory if it differents from MACHINE when
building an index for a single machine. Also, include the 'x86' directory
when building an index for i386, pc98, or amd64.


230071 13-Jan-2012 jhb

MFC 229728:
Add 5 spare VOPs as placeholders to avoid breaking the KBI in the future
when new VOPs are MFC'd to a branch.


230069 13-Jan-2012 jhb

MFC 229622:
Fix a logic bug in change 228207 in the check for a thread's new user
priority being a realtime priority.


230067 13-Jan-2012 jhb

MFC 228849, 229727:
Add post-VOP hooks for VOP_DELETEEXTATTR() and VOP_SETEXTATTR() and use
these to trigger a NOTE_ATTRIB EVFILT_VNODE kevent when the extended
attributes of a vnode are changed.


230065 13-Jan-2012 jhb

MFC 228738:
Allow boot0cfg to force a PXE boot via boot0 on the next boot.
- Fix boot0 to check for PXE when using the pre-set setting for the
preferred slice.
- Update boot0cfg to use slice 6 to select PXE. Accept a 'pxe' argument
instead of a number for the 's' option as a way to select PXE as well.


230019 12-Jan-2012 mav

MFC r228461:
Fix few bugs in isp(4) target mode support:
- in destroy_lun_state() assert hold == 1 instead of 0, as it should
receive hold taken by the create_lun_state() or get_lun_statep() before;
- fix hold count leak inside rls_lun_statep() that also fired above assert;
- in destroy_lun_state() use SIM bus number instead of SIM path id for
ISP_GET_PC_ADDR(), as it was before r196008;
- make isp_disable_lun() to set status in CCB;
- make isp_target_mark_aborted() set status into the proper CCB.

Reviewed by: mjacob
Sponsored by: iXsystems, inc.


230014 12-Jan-2012 mav

MFC r228808, r228847, 229395:

r228808, r228847:
Make cd driver to handle Audio CDs, reporting their 2352 bytes sectors to
GEOM and using READ CD command for reading data, same as acd driver does.
Audio CDs identified by checking respective bit of the control field of
the first track in TOC.

229395:
Add support for CDRIOCGETBLOCKSIZE and CDRIOCSETBLOCKSIZE IOCTLs to control
sector size same as acd driver does. Together with r228808 and r228847 this
allows existing multimedia/vlc to play Audio CDs via CAM cd driver.

PR: ports/162190
Sponsored by: iXsystems, Inc.


230012 12-Jan-2012 jhb

MFC 228715:
Add a TASK_INITIALIZER() macro that can be used to statically
initialize a task structure.


229973 11-Jan-2012 mav

MFC r228726, r228727:
Cast some vendor-specific spell on VIA VT1708S codecs to:
- make analog input loopback work;
- get access to the mics boost controls.

Sponsored by: iXsystems, Inc.


229953 11-Jan-2012 rmacklem

MFC: r228827
During investigation of an NFSv4 client crash reported by glebius@,
jhb@ spotted that nfscl_getstateid() might modify credentials when
called from nfsrpc_read() for the case where p != NULL, whereas
nfsrpc_read() only did a crdup() to get new credentials for p == NULL.
This bug was introduced by r195510, since pre-r195510 nfscl_getstateid()
only modified credentials for the p == NULL case. This patch modifies
nfsrpc_read()/nfsrpc_write() so that they do crdup() for the p != NULL case.
It is conceivable that this bug caused the crash reported by glebius@, but
that will not be determined for some time, since the crash occurred after
about 1month of operation.


229935 10-Jan-2012 jh

MFC r228021:

Add LINT-NOINET LINT-NOINET6 and LINT-NOIP to the make clean target.
This was missed in r221353.


229929 10-Jan-2012 pho

MFC: r227550, r227576

Handle invalid large values for getdirentries(2) data buffer size.
Fix build, use %d for int value formatting.


229902 10-Jan-2012 rmacklem

MFC: r228757
jwd@ reported a problem via email where the old NFS client would
get a reply of EEXIST from an NFS server when a Mkdir RPC was retried,
for an NFS over UDP mount.
Upon investigation, it was found that the client was retransmitting
the Mkdir RPC request over UDP, but with a different xid. As such,
the retransmitted message would miss the Duplicate Request Cache
in the server, causing it to reply EEXIST. The kernel client side
UDP rpc code has two timers. The first one causes a retransmit using
the same xid and socket and was set to a fixed value of 3seconds.
(The default can be overridden via CLSET_RETRY_TIMEOUT.)
The second one creates a new socket and xid and should be larger
than the first. However, both NFS clients were setting the second
timer to nm_timeo ("timeout=<value>" mount argument), which defaulted to
1second, so the first timer would never time out.
This patch fixes both NFS clients so that they set the first timer
using nm_timeo and makes the second timer larger than the first one.


229885 09-Jan-2012 thompsa

MFC r226324

Dont just set the pin high when turning on output, use the current value. Also
let this value be set when in input mode.


229883 09-Jan-2012 thompsa

MFC r226034

Add missing newbus glue, this has never attached properly to gpiobus.


229882 09-Jan-2012 thompsa

MFC r225955

Allow ixp425 boot2 to compile after r219452


229874 09-Jan-2012 yongari

MFC r228717:
Increase wait time for OP_TCPSTART command processing. It seems
100us is not enough to ensure prefetch unit work.


229870 09-Jan-2012 yongari

MFC r228716:
TCP header size is represented by number of 32bits words.
Fix the TCP header size calculation such that makes TSO engine
cache all header(ethernet/IP/TCP) bytes to its internal buffer.
While here, remove extra pull up for TCP payload. Unlike some
em(4) controllers, fxp(4) does not require such work around for
TSO.
The two limitations are ethernet/IP/TCP header size should be less
than or equal to the size of controller's internal buffer(80 bytes)
and these header information should be found in the first fragment
of a TSO frame.


229867 09-Jan-2012 yongari

MFC r228479-228480:
r228479:
BCM5720 performance tweak from Broadcom.
o Allow multiple outstanding read requests from non-LSO read DMA engine.
o Allow 4KB burst length reads for non-LSO frames.
o Enable 512B burst length reads for buffer descriptors.

r228480:
Destroy DMA tag for jumbo RX buffer in device detach.


229864 09-Jan-2012 yongari

MFC r228476:
Rework link state tracking and remove superfluous link UP/DOWN
messages.
o Add check for actually resolved speed in miibus_statchg callback
instead of blindly reprogramming BCE_EMAC_MODE register. The
callback may be called multiple times(e.g. link UP, link
transition, auto-negotiate complete etc) while auto-negotiation
is in progress. All unresolved link state changes are ignored
now and setting BCE_EMAC_MODE after link establishment is done
once.
o bce(4) is careful enough not to drive MII_TICK if driver got a
valid link. To detect lost link, bce(4) relied on link state
change interrupt and if driver see the interrupt, it forced to
drive MII_TICK by calling bce_tick() in interrupt handler.
Because bce(4) generates multiple link state change interrupts
while auto-negotiation is in progress, bce_tick() would be
called multiple times and this resulted in generating multiple
link UP/DOWN messages.
With this change, bce_tick() is not called in interrupt handler
anymore such that miibus_statchg callback handles link state
changes with consistent manner.


229858 09-Jan-2012 jh

MFC r227823, r228163:

Append unit number to the WMI status device name to allow attaching
multiple acpi_wmi(4) instances.

PR: kern/162491


229855 09-Jan-2012 ivoras

MFC r227822: Avoid panics from recursive rename operations.

PR: kern/159418


229827 08-Jan-2012 rmacklem

MFC: r228560
Patch the new NFS server in a manner analagous to r228520 for the
old NFS server, so that it correctly handles a count == 0 argument
for Commit.


229799 08-Jan-2012 rmacklem

MFC: r228260
This patch adds a sysctl to the NFSv4 server which optionally disables the
check for a UTF-8 compliant file name. Enabling this sysctl results in
an NFSv4 server that is non-RFC3530 compliant, therefore it is not enabled
by default. However, enabling this sysctl results in NFSv3 compatible
behaviour and fixes the problem reported by "dan at sunsaturn.com"
to freebsd-current@ on Nov. 14, 2011 under the subject "NFSV4 readlink_stat".


229752 07-Jan-2012 rmacklem

MFC: r228217
Post r223774, the NFSv4 client no longer has multiple instances
of the same lock_owner4 string. As such, the handling of cleanup
of lock_owners could be simplified. This simplification permitted
the client to do a ReleaseLockOwner operation when the process that
the lock_owner4 string represents, has exited. This permits the
server to release any storage related to the lock_owner4 string
before the associated open is closed. Without this change, it
is possible to exhaust a server's storage when a long running
process opens a file and then many child processes do locking
on the file, because the open doesn't get closed. A similar patch
was applied to the Linux NFSv4 client recently so that it wouldn't
exhaust a server's storage.


229736 06-Jan-2012 yongari

MFC r228333,228335-228336,228362,228368-228369,228381:
r228333:
Protect SIOCSIFMTU ioctl handler with driver lock.
Don't blindly re-initialize controller whenever MTU is changed.
Now, reinitializing is done only when driver is running.

While here, remove unnecessary assignment of error value since it
was already initialized to 0.

r228335:
Consistently use a tab character instead of using either a space or
tab after #define.
While I'm here consistently use capital letters when it uses
hexadecimal notation.

No functional changes.

r228336:
Disable all clocks and put PHY into COMA before entering into
suspend state. This will save more power.
On resume, make sure to enable all clocks. While I'm here, if
controller is not fast ethernet, enable gigabit PHY.

r228362:
Do not disable interrupt without knowing whether the raised
interrupt is ours. Note, interrupts are automatically ACKed when
the status register is read.
Add RX/TX DMA error to interrupt handler and do full controller
reset if driver happen to encounter these errors. There is no way
to recover from these DMA errors without controller reset.
Rename local variable name intrs with status to enhance
readability.

While I'm here, rename ET_INTR_TXEOF and ET_INTR_RXEOF to
ET_INTR_TXDMA and ET_INTR_RXDMA respectively. These interrupts
indicate that a frame is successfully DMAed to controller's
internal FIFO and they have nothing to do with EOF(end of frame).
Driver does not need to wait actual end of TX/RX of a frame(e.g.
no need to wait the end signal of TX which is generated when a
frame in TX FIFO is emptied by MAC). Previous names were somewhat
confusing.

r228368:
Remove unnecessary definition of ET_PCIR_BAR. Controller support
I/O memory only.
While here, use pci_set_max_read_req(9) rather than directly
manipulating PCIe device control register.

r228369:
Announce flow control ability to PHY driver and enable RX flow
control. Controller does not automatically generate pause frames
based on number of available RX buffers so it's very hard to
know when driver should generate XON frame in time. The only
mechanism driver can detect low number of RX buffer condition is
ET_INTR_RXRING0_LOW or ET_INTR_RXRING1_LOW interrupt. This
interrupt is generated whenever controller notices the number of
available RX buffers are lower than pre-programmed value(
ET_RX_RING0_MINCNT and ET_RX_RING1_MINCNT register). This scheme
does not provide a way to detect when controller sees enough number
of RX buffers again such that efficient generation of XON/XOFF
frame is not easy.

While here, add more flow control related register definition.

r228381:
FreeBSD driver does not require arpcom structure in softc.


229723 06-Jan-2012 jhb

MFC 227070,227341,227502:
Add the posix_fadvise(2) system call. It is somewhat similar to
madvise(2) except that it operates on a file descriptor instead of a
memory region. It is currently only supported on regular files.

Note that this adds a new VOP, so all filesystem modules must be
recompiled.

Approved by: re (kib)


229720 06-Jan-2012 yongari

MFC r228326-228327,228331-228332:
r228326:
Controller does not require TX start command for every frame. So
send a single TX command after setting up all TX frames. This
removes unnecessary register accesses and bus_dmamap_sync(9) calls.
et(4) uses TX interrupt moderation so it's possible to have TX
buffers that were already transmitted but waiting for TX completion
interrupt. If the number of available TX descriptor is less then
1/3 of total TX descriptor, try reclaiming first to get enough free
TX descriptors before setting up TX descriptors.
After r228325, et_txeof() no longer tries to send frames after
reclaiming TX buffers. That change was made to give more chance
to transmit frames in main interrupt handler since we can still
send frames in interrupt handler with RX interrupt. So right
before exiting interrupt hander, after enabling interrupt, try to
send more frames. This gives slightly better performance numbers.

While I'm here reduce number of spare TX descriptors from 8 to 4.
Controller does not require reserved TX descriptors, it was just to
reduce TX overhead. After r228325, driver has much lower TX
overhead so it does not make sense to reserve 8 TX descriptors.

r228327:
Remove et_enable_intrs(), et_disable_intrs() functions and
manipulation of interrupt register access is done through
CSR_WRITE_4 macro. Also add disabling interrupt into et_reset()
because we want interrupt disabled state after controller reset.
While I'm here slightly change interrupt handler to be more
readable one.

r228331:
Rework link state tracking and TX/RX MAC configuration.
o Do not report link status if driver is not running.
o TX/RX MAC configuration should be done with resolved speed,
duplex and flow control after establishing a link so it can't
be done in driver initialization routine.
Move the configuration to miibus_statchg callback which will be
called whenever any link state change is detected.
At this moment, flow-control is not enabled yet mainly because
I was not able to set correct flow control parameters to
generate TX pause frames.
o Now TX/RX MAC is enabled only when a valid link is detected.
Rearragnge hardware initialization routine a bit to leave
enabling MAC to miibus_statchg callback. In order to that,
TX/RX DMA engine is enabled in et_init_locked().
o Introduce ET_FLAG_LINK flag to track current link state.
o Introduce ET_FLAG_FASTETHER flag to mark whether controller is
fast ethernet. This flag is checked in miibus_statchg callback
to know whether PHY established a valid link.
o In et_stop(), TX/RX MAC is explicitly disabled instead of
relying on et_reset(). And move et_reset() from et_stop() to
controller initialization. Controler reset is not required here
and it would also clear critial registers(i.e station address,
RX filter configuration, WOL etc) that are required to make WOL
work.
o Switching to current media is done in et_init_locked() after
setting IFF_DRV_RUNNING flag. This should ensure reliable
auto-negotiation/manual link establishment.
o In et_start_locked(), check whether driver got a valid link
before trying to send frames.
o Remove checking a link in et_tick() as this is done by
miibus_statchg callback.

r228332:
Implement hardware MAC statistics counter. Counters could be
queried with dev.et.%d.stats sysctl node where %d is an instance of
device.


229717 06-Jan-2012 yongari

MFC r228325:
Overhaul bus_dma(9) usage in et(4) and clean up TX/RX path. This
change should make et(4) work on any architectures.
o Remove m_getl inline function and replace it with stanard mbuf
interfaces. Previous code tried to minimize code duplication
but this came from incorrect use of common DMA tag.
Driver may be still use a common RX allocation handler with
additional structure changes but I don't see much point to do
that it would make it hard to understand the code.
o Remove DragonflyBSD specific constant EVL_ENCAPLEN, use
ETHER_VLAN_ENCAP_LEN instead.
o Add bunch of new RX status definition. It seems controller
supports RX checksum offloading but I was not able to make the
feature work yet. Currently driver checks whether recevied
frame is good one or not.
o Avoid a typedef ending in '_t' as style(9) says.
o Controller has no restriction on DMA address space, so there
is no reason to limit the DMA address to 32bit. Descriptor
rings, status blocks and TX/RX buffers now use full 64bit DMA
addressing.
o Allocate DMA memory shared between host and controller as
coherent.
o Create 3 separate DMA tags to be used as TX, mini RX ring and
stanard RX ring. Previously it created a single DMA tag and it
was used to all three rings.
o et(4) does not support jumbo frame at this moment and I still
don't quite understand how jumbo frame works on this controller
so use two RX rings to handle small sized frame and normal sized
frame respectively. The mini RX ring will be used to receive
frames that are less than or equal to 127 bytes. The second RX
ring is used to receive frames that are not handled by the first
RX ring.
If jumbo frame support is implemented, driver may have to choose
better RX scheme by letting the second RX ring handle jumbo
frames. This scheme will mimic Broadcom's efficient jumbo frame
handling feature. However RAM buffer size(16KB) of the
controller is too small to hold 2 jumbo frames, if 9KB
jumbo frame is used, I'm not sure how good performance would it
have.
o In et_rxeof(), make sure to check whether controller received
good frame or not. Passing corrupted frame to upper layer is
bad idea.
o If driver receives a bad frame or driver fails to allocate RX
buffer due to resource shortage condition, reuse previously
loaded DMA map for RX buffer instead of unloading/loading RX
buffer again.
o et_init_tx_ring() never fails so change return type to void.
o In watchdog handler, show TX DMA write back status of errored
frame which could be used as a clue to debug watchdog timeout.
o Add missing bus_dmamap_sync() in various places such that et(4)
should work with bounce buffers(e.g. PAE).
o TX side bus_dmamap_load_mbuf_sg(9) support.
o RX side bus_dmamap_load_mbuf_sg(9) support.
o Controller has no DMA alignment limit in RX buffer so use
m_adj(9) in RX buffer allocation to make IP header align on 2
bytes boundary. Otherwise it would trigger unaligned access
error in upper layer on strict alignment architectures.
One of down side of controller is it provides limited set of RX
buffer length like most Intel controllers. This is not problem
at this moment because driver does not support jumbo frame yet
but it may require alignment fixup code to support jumbo frame
on strict alignment architectures.
o In et_txeof(), don't zero TX descriptors for transmitted frames.
TX descriptors don't need write access after transmission.
Driver sets IFF_DRV_OACTIVE when the number of available TX
descriptors are less than or equal to ET_NSEG_SPARE. Make sure
to clear IFF_DRV_OACTIVE only when the number of available TX
descriptor is greater than ET_NSEG_SPARE.


229711 06-Jan-2012 yongari

MFC r228291-228293,228297-228298:
r228291:
Remove NetBSD license. r199548 removed all bit macros that were
derived from NetBSD.

r228292:
Implement suspend/resume methods. Driver has no issue with
suspend/resume.

r228293:
Fix alt(4) support. Also add check for number of available TX
descriptors before trying to send frames. If we're not able to
send a frame, make sure to prepend it to if_snd queue such that
alt(4) should work.

While I'm here prefer ETHER_BPF_MTAP to BPF_MTAP. ETHER_BPF_MTAP
should be used for controllers that support VLAN hardware tag
insertion. The controller supports VLAN tag insertion but lacks
VLAN tag stripping in RX path though.

r228297:
et(4) supports VLAN oversized frame so correctly set header length.
While I'm here remove initializing if_mtu, it is set by
ether_ifattach(9). Also move callout_init_mtx(9) to the right below
driver lock initialization.

r228298:
Make et_probe() return BUS_PROBE_DEFAULT such that allow other
driver that has high precedence for the controller override et(4).
Add missing callout_drain(9) in device detach and rework detach
routine. While I'm here use rman_get_rid(9) instead of using
cached resource id because bus methods are free to change the
id.


229708 06-Jan-2012 jhb

MFC 228967:
Update if_obytes and if_omcast after successful transmit.
While I'm here update if_oerrors if parent interface of vlan is not
up and running. Previously it updated collision counter and it was
confusing to interprete it.


229678 06-Jan-2012 rmacklem

MFC: r227796
Clean up some cruft in the NFSv4 client left over from the
OpenBSD port, so that it is more readable. No logic change
is made by this commit.


229674 06-Jan-2012 rmacklem

MFC: r227760
Add two arguments to the nfsrpc_rellockown() function in the NFSv4
client. This does not change the client's behaviour, but prepares
the code so that nfsrpc_rellockown() can be called elsewhere in a
future commit.


229661 05-Jan-2012 jhb

MFC 227577: The sys/sysctl.h header is needed when MFI_DEBUG is defined.


229648 05-Jan-2012 yongari

MFC r228286:
Fix off by one error in mbuf access. Previously it caused panic.
While I'm here use NULL to compare mbuf pointer and add additional
check for zero length mbuf before accessing the mbuf.

PR: kern/162932


229641 05-Jan-2012 yongari

MFC r228086:
Announce flow control capability to PHY drivers and enable flow
control for all vr(4) controllers that support it. It's known that
old vr(4) controllers(Rhine II) does not support TX pause but Rhine
III supports both TX and RX pause.
Make TX pause really work on Rhine III by letting controller know
available RX buffers.
While here, adjust XON/XOFF parameters to get better performance
with flow control.


229637 05-Jan-2012 jhb

MFC 228866:
Fix a bug where TAILQ_FIRST(&V_ifnet) was accessed without holding the
proper lock.


229635 05-Jan-2012 jhb

MFC 228593:
Fire a kevent if necessary after seeking on a regular file. This fixes a
case where a kevent would not fire on a regular file if an application read
to EOF and then seeked backwards into the file.


229633 05-Jan-2012 jhb

MFC 228089:
Change the if_vlan driver to use if_transmit for forwarding packets to the
parent interface. This avoids the overhead of queueing a packet to an IFQ
only to immediately dequeue it again.


229627 05-Jan-2012 jhb

MFC 228361:
Explicitly use curthread while manipulating td_fpop during last close
of a devfs file descriptor in devfs_close_f(). The passed in td argument
may be NULL if the close was invoked by garbage collection of open
file descriptors in pending control messages in the socket buffer of a
UNIX domain socket after it was closed.


229625 05-Jan-2012 jhb

MFC 228496:
Implement BUS_ADD_CHILD() for the isab(4) driver. It already calls
bus_generic_probe() and bus_generic_attach() to handle drivers that add
new children via identify methods.


229619 05-Jan-2012 jhb

MFC 228207:
When changing the user priority of a thread, change the real priority
in addition to the user priority for threads whose current real priority
is equal to the previous user priority or if the new priority is a
real-time priority. This allows priority changes of other threads to
have an immediate effect.


229617 05-Jan-2012 jhb

MFC 228185:
Enhance the sequential access heuristic used to perform readahead in the
NFS server and reuse it for writes as well to allow writes to the backing
store to be clustered.


229611 05-Jan-2012 jhb

MFC 227562:
Add single-message MSI support to mfi(4). It is disabled by default but
can be enabled via the hw.mfi.msi tunable. Many mfi(4) controllers also
support MSI-X, but in testing it seems that many adapters do not work with
MSI-X but do work with MSI.


229607 05-Jan-2012 yongari

MFC r228084:
Reuse flag variable to represent driver internal states rather than
using member variables in softc.
While I'm here change media after setting IFF_DRV_RUNNING. This
will remove unnecessary link state handling in vr_tick() if
controller established a link immediately.


229604 05-Jan-2012 jhb

MFC 227507: Finish making 'wcommitsize' an NFS client mount option.


229599 05-Jan-2012 rmacklem

MFC: r227744
Since the nfscl_cleanup() function isn't used by the FreeBSD NFSv4 client,
delete the code and fix up the related comments. This should not have
any functional effect on the client.


229548 05-Jan-2012 rmacklem

MFC: r227743
Post r223774 the NFSv4 client never uses the linked list with the
head nfsc_defunctlockowner. This patch simply removes the code that
loops through this always empty list, since the code no longer does
anything useful. It should not have any effect on the client's
behaviour.


229543 05-Jan-2012 yongari

MFC r227842:
For IP1001 PHY, do not set multi-port device(MASTER). Ideally this
bit should not affect link establishment process of auto-negotiation
if manual configuration is not used, which is true in auto-negotiation.
However it seems setting this bit interfere with IP1001 PHY's
down-shifting feature such that establishing a 10/100Mbps link failed
when 1000baseT link is not available during auto-negotiation process.


229540 05-Jan-2012 yongari

MFC r227828,227835,227837:
r227828:
Always start MII auto polling before accessing any MII registers.

r227835:
Rework link establishment and link state detection logic.
- Remove MIIBUS statchg callback and program VGE_DIAGCTL before
initiating link establishment. Previously driver used to
program VGE_DIAGCTL after getting a link in statchg callback.
It seems the VGE_DIAGCTL register works like a kind of MII
register such that it requires setting a 'to be' mode in advance
rather than relying on resolved speed/duplex of established link.
This means the statchg callback is not needed in driver. In
addition, if there was no link at the time of media change, this
was not called at all.
- Introduce vge_ifmedia_upd_locked() to change current media to
configured one. Actual media change is performed only after PHY
reset and VGE_DIAGCTL setup.
- In WOL configuration, make sure to clear forced mode such that
controller can rely on auto-negotiation.
- Unlike most other drivers that use miibus(4), vge(4) used
controller's auto-polling feature for link state tracking via
interrupt. This came from controller's inefficient mechanism to
access MII registers. On link state change interrupt, vge(4)
used to get current link state with series of MII register
accesses. Because vge(4) already enabled auto polling, read PHY
status register to resolved speed/duplex/flow control parameters.

vge(4) still does not drive MII_TICK to reduce number of MII
register accesses which in turn means the driver does not know the
status of auto-negotiation. This was a one of long standing
issue of vge(4). Probably driver may be able to implement a timer
that keeps track of auto-negotiation state and restart
auto-negotiation when driver couldn't establish a link within a
specified period. However the controller does not provide a
reliable way to detect auto-negotiation failure so I'm not sure
whether it's worth to implement it in driver.

Alternatively driver can completely disable MII auto-polling and
let miibus(4) poll link state by driving MII_TICK. This may reduce
unnecessary overhead of stopping/restarting MII auto-polling of
controller. Unfortunately it was known that some variants of
controller does not work correctly if MII auto-polling is disabled.

r227837:
Announce flow control capability to underlying PHY driver.
Pause timer value is initialized to 0xFFFF. Controller allows just
4 different TX pause thresholds. The lowest possible threshold
value looks too aggressive so use next available threshold value.


229534 04-Jan-2012 yongari

MFC r227850-227851,227854,227914,227916:
r227850:
Writing access to RL_CFG5 register also requires EEPROM write
access.
While I'm here, enable WOL through magic packet but disable waking
up system via unicast, multicast and broadcast frames. Otherwise,
multicast or unicast frame(e.g. ICMP echo request) can wake up
system which is not probably wanted behavior on most environments.
This was not known as problem because RL_CFG5 register access had
not effect until this change.
The capability to wake up system with unicast/multicast frames
are still set in driver, default off, so users who need that
feature can still activate it with ifconfig(8).

r227851:
Perform media change after setting IFF_DRV_RUNNING flag. Without it,
driver would ignore the first link state update if controller
already established a link such that it would have to take
additional link state handling in re_tick().

r227854:
Disable accepting frames in re_stop() to put RX MAC into idle state.
Because there is no reliable way to know whether RX MAC is in
stopped state, rejecting all frames would be the only way to
minimize possible races.
Otherwise it's possible to receive frames while stop command
execution is in progress and controller can DMA the frame to freed
RX buffer during that period.
This was observed on recent PCIe controllers(i.e. RTL8111F).

While this change may not be required on old controllers it
wouldn't make negative effects on old controllers. One side effect
of this change is disabling receive so driver reprograms RL_RXCFG
to receive WOL frames when it is put into suspend or shutdown.

This should address occasional 'memory modified free' errors seen
on recent RealTek controllers.

r227914:
Make sure to stop TX MAC before freeing queued TX frames.
For RTL8111DP, check if the TX MAC is active by reading RL_GTXSTART
register. For RTL8402/8168E-VL/8168F/8411, wait until TX queue is
empty.

r227916:
To save more power, switch to 10/100Mbps link when controller is
put into suspend/shutdown. Old PCI controllers performed that
operation in firmware but for RTL8111C or newer controllers, it's
responsibility of driver. It's not clear whether the firmware of
RTL8111B still downgrades its speed to 10/100Mbps so leave it as it
was.


229529 04-Jan-2012 yongari

MFC r227587,227590-227591,227593,227638-227639:
r227587:
Add preliminary support for RTL8402 PCIe FastEthernet with
integrated card reader.

r227590:
Add preliminary support for RTL8411 PCIe Gigabit ethernet with
integrated card reader.

r227591:
Add missing driver lock in SIOCSIFCAP handler.

r227593:
Disable PCIe ASPM (Active State Power Management) for all
controllers.
More and more RealTek controllers started to implement EEE feature.
Vendor driver seems to load a kind of firmware for EEE with
additional PHY fixups. It is known that the EEE feature may need
ASPM support. Unfortunately there is no documentation for EEE of
the controller so enabling ASPM may cause more problems.

r227638:
Add preliminary support for second generation RTL8105E PCIe
FastEthernet.

r227639:
Add preliminary support for RTL8168/8111F PCIe Gigabit ethernet.


229524 04-Jan-2012 yongari

MFC r227582:
Enable 64bit DMA addressing support for all msk(4) controllers.
Unnecessarily complex LE format used on Marvell controller was
main reason not to enable 64bit DMA addressing in driver. If high
32bit address of DMA address of TX/RX buffer is changed, driver has
to generate a new LE. In TX path, driver will keep track of lastly
used high 32bit address of DMA address and generate a new LE
whenever it sees high address change in the DMA address. In RX path,
driver will always use two LEs to specify 64bit DMA address of RX
buffer. If the high 32bit address of DMA address of RX buffer is
the same as previous DMA address of RX buffer, driver does not have
to use two LEs but driver will use two LEs for simplicity in RX
ring management.

One of draw back for switching to 64bit DMA addressing is that the
large amount of LEs are used to specify 64bit DMA address such that
number of available LEs for TX/RX buffers are considerably reduced.
To mitigate the issue, increase number of available LEs from 256 to
384 for TX and from 256 to 512 for RX. For 32bit architectures,
msk(4) does not use 64bit DMA addressing to save resources.


229520 04-Jan-2012 yongari

MFC r227452:
To send a frame, controller requires a prepended TX header and
the length of frame should be treated as multiple of 4. Actual
frame length is set in the TX header. The TX header position
should be aligned on 4 byte boundary and actual frame start
position should be aligned on 4 byte boundary as well. This means
we need 4(TX header length) + 3(frame length fixup) additional free
space in TX buffer in addition to actual frame length.
Make sure TX handler check these additional bytes.
ae_tx_avail_size() returns actual free space in TX buffer to ease
the calculation of available TX buffer space in caller. While I'm
here, replace magic number to appropriate sizeof operator to
enhance readability.

This change should fix controller lockup issue happened under
certain conditions but it still does not fix watchdog timeout. It
seems the watchdog timeout is side-effect of TxS and TxD
mismatches. The root cause of TxD/TxD mismatch is not known yet but
it looks like silicon bug. I guess driver may have to reinitialize
controller whenever it sees TxS and TxD mismatches but leave it as
it was at this moment.

PR: kern/145918


229505 04-Jan-2012 jhb

MFC 227069:
Move the cleanup of f_cdevpriv when the reference count of a devfs
file descriptor drops to zero out of _fdrop() and into devfs_close_f()
as it is only relevant for devfs file descriptors.


229501 04-Jan-2012 jhb

MFC 226746:
Consolidate duplicate definitions of V86_CY() and V86_ZR() which check for
the carry and zero flags being set, respectively, in <btxv86.h> and use
them throughout the x86 boot code.


229500 04-Jan-2012 jhb

MFC 226364:
Use PAIR32TO64() for the offset and length parameters to
freebsd32_posix_fallocate() to properly handle big-endian platforms.


229499 04-Jan-2012 jhb

MFC 226039:
Ignore SRAT memory entries if the memory range does not overlap with an
existing phys_avail[] entry. If a hw.physmem setting causes a memory
domain to not be present in phys_avail[], the SRAT table will now be
ignored rather than triggering a panic when a CPU in the missing domain
tries to allocate a page.


229492 04-Jan-2012 pluknet

MFC r228916:
Clean up from the 4.x era.

In an example of boot command:
- rename wd(4) IDE disk drives name to ad(4) for the time being.
- update the used kernel path "/kernel" to the current default.

Bump .Dd for this and previous changes.


229487 04-Jan-2012 pluknet

MFC r227447:

struct timespec32: change types of tv_sec and tv_nsec fields to signed
to match native struct timespec ABI on __LP32__.


229485 04-Jan-2012 pluknet

MFC r226882:
Fix arguments list for proc:::signal-discard DTrace probe.

Reported by: Anton Yuzhaninov <citrin citrin ru>


229482 04-Jan-2012 pluknet

MFC r227055:
Remove a couple of write-only variables.


229480 04-Jan-2012 pluknet

Revert MFC r226833,227056.
/stand exists in the MFS root used during a sysinstall-based install.

Reported by: jhb
Pointy hat to: pluknet


229475 04-Jan-2012 pho

MFC: r227527

Removed extra PRELE() call.


229473 04-Jan-2012 pluknet

MFC r226833,r227056:

Remove the long reprecated ``/stand/sysinstall'' from the init_path.


229452 04-Jan-2012 yongari

MFC r227675:
Partially revert r218788. r218788 removed calling dc_setcfg() for
!DC_IS_ADMTEK in dc_miibus_statchg(). This change broke link
establishment of Intel 21143 with dcphy(4) where it stuck in
"ability detect" state without completing auto-negotiation.
Also nuke dc_if_media as it's not actually used.


229441 03-Jan-2012 yongari

MFC r227512:
Overhaul bus_dma(9) usage in driver:
- Don't use a single big DMA block for all rings. Create separate
DMA area for each ring instead. Currently the following DMA
areas are created:
Event ring, standard RX ring, jumbo RX ring, RX return ring,
hardware MAC statistics and producer/consumer status area.
For Tigon II, mini RX ring and TX ring are additionally created.
- Added missing bus_dmamap_sync(9) in various TX/RX paths.
- TX ring is no longer created for Tigon 1 such that it saves more
resources on Tigon 1.
- Data sheet is not clear about alignment requirement of each ring
so use 32 bytes alignment for normal DMA area but use 64 bytes
alignment for jumbo RX ring where the extended RX descriptor
size is 64 bytes.
- For each TX/RX buffers use separate DMA tag(e.g. the size of a
DMA segment, total size of DMA segments etc).
- Tigon allows separate DMA area for event producer, RX return
producer and TX consumer which is really cool feature. This
means TX and RX path could be independently run in parallel.
However ti(4) uses a single driver lock so it's meaningless
to have separate DMA area for these producer/consumer such that
this change creates a single status DMA area.
- It seems Tigon has no limits on DMA address space and I also
don't see any problem with that but old comments in driver
indicates there could be issues on descriptors being located in
64bit region. Introduce a tunable, dev.ti.%d.dac, to disable
using 64bit DMA in driver. The default is 0 which means it would
use full 64bit DMA. If there are DMA issues, users can disable
it by setting the tunable to 0.
- Do not increase watchdog timer in ti_txeof(). Previously driver
increased the watchdog timer whenever there are queued TX frames.
- When stat ticks is set to 0, skip processing ti_stats_update(),
avoiding bus_dmamap_sync(9) and updating if_collisions counter.
- MTU does not include FCS bytes, replace it with
ETHER_VLAN_ENCAP_LEN.

With these changes, ti(4) should work on PAE environments.
Many thanks to Jay Borkenhagen for remote hardware access.


229438 03-Jan-2012 yongari

MFC r227431-227432,227505,227509:
r227431:
style.
No functional changes.

r227432:
Remove dead ifdef. Driver should always check raised interrupt is
for the device.

r227505:
It's bad idea to allocate large memory, 4KB, from stack.
Pre-allocate the memory in device attach time. While I'm here
remove unnecessary reassignment of error variable as it was already
initialized. Also added a missing driver lock in TIIOCSETTRACE
handler.

r227509:
Export sysctl node for various interrupt moderation parameters and
have administrators control them. ti(4) provides a character
device to control various other features of driver via ioctls but
users had to write their own code to manipulate these parameters.
It seems some default values for these parameters are not optimal
on today's system but leave it as it was and let administrators
change them. The following parameters could be changed:

dev.ti.%d.rx_coal_ticks
dev.ti.%d.rx_max_coal_bds
dev.ti.%d.tx_coal_ticks
dev.ti.%d.tx_max_coal_bds
dev.ti.%d.tx_buf_ratio
dev.ti.%d.stat_ticks

The interface has to be brought down and up again before a change
takes effect.

ti(4) controller supports hardware MAC counters with additional
DMA statistics. So it's doable to export these counters via
sysctl interface. Unfortunately, these counters are cumulative
such that driver have to either send an explicit clear command to
controller after extracting them or have to maintain internal
counters to get actual changes. Neither look good to me so
counters were not exported via sysctl.


229432 03-Jan-2012 yongari

MFC r227347,227367:
r227347:
Retire 'options TI_PRIVATE_JUMBOS' and replace local jumbo
allocator with UMA backed jumbo allocator by default. Previously
ti(4) used sf_buf(9) interface for jumbo buffers but it was broken
at this moment such that enabling jumbo frame caused instant panic.
Due to the nature of sf_buf(9) it heavily relies on VM changes but
it seems ti(4) was not received much blessing from VM gurus. I
don't understand VM magic and implications used in driver either.
Switching to UMA backed jumbo allocator like other network drivers
will make jumbo frame work on ti(4).
While I'm here, fully allocate all RX buffers. This means ti(4) now
uses 512 RX buffer and 1024 mini RX buffers.

To use sf_buf(9) interface for jumbo buffers, introduce a new
'options TI_SF_BUF_JUMBO'. If it is proven that sf_buf(9) is better
for jumbo buffers, interesting developers can fix the issue in
future.

ti(4) still needs more bus_dma(9) cleanups and should use separate
DMA tag/map for each ring(standard, jumbo, mini, command, event
etc) but it should work on all platforms except PAE.

Special thanks to Jay[1] who provided complete remote debugging
access.

r227367:
Comment out TI_JUMBO_HDRSPLIT. TI_JUMBO_HDRSPLIT requires TI_SF_BUF_JUMBO.


229421 03-Jan-2012 yongari

MFC r227311-227312,227318-227319,227322-227324:
r227311:
Remove ti_unit member variable in softc.
While I'm here use PCIR_BAR macro.

r227312:
o Remove unnecessary controller reinitialization.
o Do not blindly UP controller when MTU is changed. Reinitialize
controller only if driver is running.
o Remove useless ti_stop() in ti_watchdog() since ti_init_locked()
always invokes ti_stop().

r227318:
Track which ring was updated in RX handler and update only modified
ring. This should reduce unnecessary register accesses.

r227319:
Mini ring is not available on Tigon 1 so do not create DMA maps for
mini ring on Tigon 1 to save resources.

r227322:
Show RX buffer allocation failure and do not blindly send alive
message to firmware. Probably the correct way for this error is to
send a TI_CMD_CODE_STACK_DOWN message to firmware and let firmware
handle the rest.

r227323:
If ti_chipinit() fails in ti_stop(), ignore the error and release
all allocated TX/RX buffer resources. If the interface is brought
to up again after the error, we will leak allocated TX/RX buffers.

r227324:
Do not allow changing MTU to be less than the minimum.


229417 03-Jan-2012 yongari

MFC r227091-227095,227098-227099:
r227091:
Make sure to unload loaded DMA area(descriptor, command, event ring).

r227092:
Announce IFCAP_LINKSTATE capability and let network stack know link
state changes. Hide superfluous link up/down message under
bootverbose since if_link_state_change(9) shows that information.
While I'm here, change baudrate with the resolved speed of the
established link instead of blindly setting it 1G. Unfortunately,
it seems there is no way to differentiate 10/100Mbps from
non-gigabit link so just assume we established a 100Mbps link if
current link is not a gigabit link.

r227093:
Introduce ti_ifmedia_upd_locked() to use in driver initialization
and add missing driver lock for both ti_ifmedia_upd() and
ti_ifmedia_sts().

r227094:
Don't clear upper 4bits from VLAN tag information. It's
responsibility of vlan(4) to extract VLAN id from the tag
information and vlan(4) correctly handles it.

r227095:
Don't abuse if_hwassist and make sure enabling corresponding TX/RX
checksum offloading and VLAN hardware tag insertion/stripping from
the currently enabled hardware offloading capabilities.
Previously if_hwassist, which was initialized to TX/RX checksum
offloading, was blindly used to enable both TX and RX checksum
offloading such that disabling either TX or RX checksum offloading
was not possible.

ti(4) controllers support TX/RX checksum offloading with VLAN
tagging so announce TX/RX checksum offloading capability over VLAN
to vlan(4).

Make VLAN hardware tag insertion/stripping honors currently enabled
interface capability instead of blindly enabling VLAN hardware
tagging. This change allows disabling hardware support of VLAN tag.

Because ti(4) supports VLAN oversized frames, make network stack
know the capability by setting if_hdrlen.

While I'm here, rewrite SIOCSIFCAP handler and make sure to
reinitialize controller whenever TX/RX checksum offloading and VLAN
hardware tagging option is changed. The requirement of controller
reinitialization comes from the limitation of Tigon I/II firmware.
Tigon I/II firmware requires all related RCBs should be
reinitialized whenever any of its hardware offloading capabilities
change.

vlan(4) is also notified whenever the parent interface's capability
changes such that it can correctly handle TX/RX checksum offloading
based on parent interface's enabled offloading capabilities.

RX checksum offloading handler was changed to make upper stack use
controller computed partial checksum value. Previously, ti(4) just
set the computed value for any frames(IPv4, IPv6) and the value was
not used in upper stack because driver didn't set CSUM_DATA_VALID
such that upper network stack had to recompute checksum of TCP/UDP
packets. I have no idea how this was not noticed for a long time.
With this change, upper network stack does not have to fully
recompute the checksum such that calculating pseudo checksum based
on partial checksum is sufficient to know whether received packet's
checksum is correct or not. However, I don't know why ti(4) does
not have controller compute pseudo checksum as controller has
ability to do it. I'm just guessing enabling that feature could
trigger a firmware bug or could be slower than computing it on host
side so just leave it as it was.

In order not to produce false positives, ti(4) now checks whether
controller actually computed IP or TCP/UDP checksum by checking
ti_flags field.

r227098:
Because ti(4) drops a driver lock in RX handler, check whether
driver is still running before re-enabling interrupts.

r227099:
Implement altq(4) support.
While I'm here fix a logic error in r227098 where it didn't
re-enable interrupts when TX queue is empty.


229404 03-Jan-2012 yongari

MFC r227086-227089:
r227086:
Use ANSI function definations.

r227087:
No functional changes.

r227088:
Make ti(4) build with 'options TI_PRIVATE_JUMBOS'.
This was broken in r175872.

We have a UMA backed jumbo allocator and that is much better
implementation than having a local jumbo buffer allocator in
driver. This local allocator would be removed in near future but
fixing build before removal wouldn't be a bad idea.

r227089:
s/u_intXX_t/uintXX_t/g


229391 03-Jan-2012 rmacklem

MFC: r227690
The old NFS client will crash due to the reply being m_freem()'d
twice if the server bogusly returns an error with the NFSERR_RETERR
bit (bit 31) set. No actual NFS error has this bit set, but it seems
that amd will sometimes do this. This patch makes sure the NFSERR_RETERR
bit is cleared to avoid a crash.


229387 03-Jan-2012 mav

MFC r225839:
Import the rest of HID improvements from the branch:
- improve report descriptor parser in libusbhid to handle several kinds of
reports same time;
- add to the libusbhid API two functions wrapping respective kernel IOCTLs
for reading and writing reports;
- tune uhid IOCTL interface to allow reading and writing arbitrary report,
when multiple supported by the device;
- teach usbhidctl to set output and feature reports;
- make usbhidaction support all the same item names as bhidctl.

Sponsored by: iXsystems, inc.


229369 03-Jan-2012 hselasky

MFC r229317:
Fix for USB suspend and resume.


229360 03-Jan-2012 yongari

MFC r226871-226872:
r226871:
Add initial BCM5720 support.
Many thanks to Broadcom for continuing support of FreeBSD.

Submitted by: Geans Pin at Broadcom (initial version)
H/W donated by: Broadcom

r226872:
Disable updating InputDiscards counter for BCM5717, BCM5718,
BCM5719 A0 and BCM5720 A0 and add comment why driver does not try
to read it.


229357 03-Jan-2012 yongari

MFC r226870:
Recognize BCM5720C PHY.


229354 03-Jan-2012 yongari

MFC r226814-226815,226820-226821,226864,226866-226867:
r226814:
Rename definition of BGE_SOFTWARE_GENCOMM_* to more readable ones.
The origin of GENCOMM seems to come from Alteon Tigon Host/NIC
interface definition where it defines general communications region
which is active when firmware is loaded and running. This region
was used in communication between the host and processor internal
to the Tigon chip.
Broadcom data sheet also defines the region as 'Software Gencomm'
in NetXtreme memory map but lacks detailed description of its
interface so it was hard to know which ones are used for which
interface.
This change shall slightly enhance readability.

No functional changes.

r226815:
Define MAC address mail box and use it instead of using
hard-coded value.

r226820:
Offset 0x6810 is RX-RISC event register. Rename BGE_CPU_EVENT with
BGE_RX_CPU_EVENT for readability.
Additionally define BGE_TX_CPU_EVENT for TX-RSIC event register(BCM570[0-4] only).

r226821:
SRAM offset 0x0C04 is used by driver to inform the IPMI/ASF firmware
about the various driver events like load, unload, reset, suspend,
restart, and ioctl operations.
Define driver's event rather than using hard-coded values. We don't
still send suspend/resume event to firmware.

Previously bge(4) used BGE_SDI_STATUS to send events. Because driver
has to access firmware mail box to inform current state, using
BGE_SDI_STATUS register was wrong. The end result was the same as
BGE_SDI_STATUS is 0x0C04.

No functional changes.

r226864:
Rename BGE_FW_DRV_ALIVE/BGE_FW_PAUSE to BGE_FW_CMD_DRV_ALIVE/BGE_FW_CMD_PAUSE.
Also add more firmware commands(not used yet).
No functional changes.

r226866:
Rename hard-coded value 1 << 14 with BGE_RX_CPU_DRV_EVENT.
This bit(SW event 7 in publicly available data sheet) is used to
make RX CPU handle a firmware command and the bit is automatically
cleared after RX CPU completed the command.
Generally firmware command takes the following steps.
1. Write BGE_SRAM_FW_CMD_MB with a command.
2. Write BGE_SRAM_FW_CMD_LEN_MB with the length of the command in bytes.
3. Write BGE_SRAM_FW_CMD_DATA_MB with actual command data.
4. Generate BGE_RX_CPU_EVENT and let firmware handle the command.
5. Wait for the ACK of the firmware command.

No functional changes.

r226867:
Define BGE_FW_HB_TIMEOUT_SEC and remove one more magic value.
bge(4) sends BGE_FW_CMD_DRV_ALIVE command to firmware every 2
seconds. BGE_FW_CMD_DRV_ALIVE command requires 4 bytes data. This
data contains timeout value in seconds until the next
BGE_FW_CMD_DRV_ALIVE command.
Broadcom recommends driver set the value 3 times longer than the
interval that it sends BGE_FW_CMD_DRV_ALIVE. Currently bge(4) uses
3 seconds so probably we have to increase it in future and use
different ALIVE command(e.g. BGE_FW_CMD_DRV_ALIVE3).

No functional changes.


229350 03-Jan-2012 yongari

MFC r226749,226770,226804-226807:
r226749:
Whitespace nits.

r226770:
Fix long standing bge_sysctl_debug_info() issues.
o Protect bge(4) status block access and register dump with driver lock.
o Add missing bus_dmamap_sync() before dumping status block.
o Use minimum status block size, 32 bytes, for status block dump on most
controllers except BCM5700 AX/BX.
While I'm here, make the handler show 5717 Plus in hardware flags.

r226804:
Make CPMU handle GPHY power down control on controllers that have
CPMU capability.

r226805:
It is known that all Broadcom controllers have 4GB boundary DMA
bug. Apply workaround to all controllers.

r226806:
Broadcom says BCM5755 or higher and BCM5906 have short DMA bug.
Apply workaround to these controllers.

r226807:
BCM5719 cannot handle DMA requests for DMA segments that have
larger than 4KB in size. However the maximum DMA segment size
created in DMA tag is 4KB, so we wouldn't encounter the issue here.
Just record this issue such that let developers not to create a DMA
segment that is larger than 4KB for BCM5719. It's possible to split
a DMA segment into multiple smaller ones in run time but I believe
it's not worth to implement that.


229336 02-Jan-2012 yongari

MFC r226701:
Add support for ALi/ULi, now NVIDIA, M5261/M5263 PCI FastEthernet
controller which is found on ULi M1563 South Bridge & M1689 Bridge.
These controllers look like a tulip clone.
M5263 controller does not support MII bitbang so use DC_ROM
register to access MII registers. Like other tulip variants, ULi
controller uses a setup frame to configure RX filter and uses new
setup frame format. It's not clear to me whether the controller
supports a hash based multicast filtering so this patch uses 14
perfect multicast filter to filter multicast frames. If number of
multicast addresses is greater than 14, controller is put into a
mode that receives all multicast frames.
Due to lack of access to M5261, this change was not tested with
M5261 but it probably works. Many thanks to Marco who provided
remote access to M5263.

Tested by: Marco Steinbach <coco <> executive-computing dot de>,
Martin MATO <martin.mato <> orange dot fr>


229333 02-Jan-2012 yongari

MFC r226699:
When driver is run for the first time there would be no established
link such that calling dc_setcfg() right after media change would
be meaningless unless controller in question is not Davicom DM9102.
Ideally dc_setcfg() should be called when speed/duplex is resolved
otherwise it would reprogram controller with wrong speed/duplex
information. Because MII status change callback already calls
dc_setcfg() I think calling dc_setcfg() in dc_init_locked() is
wrong. For instance, it would take some time to establish a link
after mii_mediachg(), so blindly calling dc_setcfg() right after
mii_mediachg() will always yield wrong media configuration.

Extend dc_ifmedia_upd() to handle media change and still allow
21143 and Davidcom controllers program speed/duplex regardless of
current resolved speed/duplex of link. In theory 21143 may not need
to call dc_setcfg() right after media change, but leave it as it is
because there are too many variants to test that change. Probably
dc(4) shall need a PHY reset in dc_ifmedia_upd() but it's hard to
verify correctness of the change.

This change reliably makes ULi M5263 establish a link.

While I'm here correctly report media change result. Previously it
always reported a success.


229303 02-Jan-2012 mav

MFC r227464, r227471
Major GEOM MULTIPATH class rewrite:
- Improved locking and destruction process to fix crashes.
- Improved "automatic" configuration method to make it consistent and safe
by reading metadata back from all specified paths after writing to one.
- Added provider size check to reduce chance of ordering conflict with
other GEOM classes.
- Added "manual" configuration method without using on-disk metadata.
- Added "add" and "remove" commands to allow manage paths manually.
- Failed paths are no longer dropped from geom, but only marked as FAIL
and excluded from I/O operations.
- Automatically restore failed paths when all others paths are marked
as failed, for example, because of device-caused (not transport) errors.
- Added "fail" and "restore" commands to manually control FAIL flag.
- geom is now destroyed on last path disconnection.
- Added optional Active/Active mode support. Unlike Active/Passive
mode, load evenly distributed between all working paths. If supported by
the device, it allows to significantly improve performance, utilizing
bandwidth of all paths. It is controlled by -A option during creation.
Disabled by default now.
- Improved `status` and `list` commands output.

Sponsored by: iXsystems, inc.


229301 02-Jan-2012 mav

MFC r226816:
Clarify disks/volumes above 2TiB support in geom_raid:
- add support for volumes above 2TiB with Promise metadata format;
- enforse and document other limitations:
- Intel and Promise metadata formats do not support disks above 2TiB;
- NVIDIA metadata format does not support volumes above 2TiB.

Sponsored by: iXsystems, Inc.


229299 02-Jan-2012 mav

MFC r228819:
Update list of 4K physical sector hard drives.


229297 02-Jan-2012 mav

MFC r227637:
Introduce CAM_SIM_POLLED SIM flag, indicating that it works in polling mode.
It blocks CAM SWI usage on requests completion, unneeded because of polling
and denied during kernel dumping because of blocked scheduler.

Before r198899 there was periph flag CAM_PERIPH_POLLED, but that was wrong,
because there is whole SIM is polled or handled by SWI, not a single periph.


229295 02-Jan-2012 mav

MFC r228497:
Add PCI IDs for the Intel ICH9M SATA controllers.


229293 02-Jan-2012 mav

MFC r226680:
Some dmesg cosmetics:
- for the legacy PCI ATA channels move channel number out of the device
description, same as it is for ahci(4), siis(4) and mvs(4);
- add device description for the ISA ATA channels.


229291 02-Jan-2012 mav

MFC r228200:
Add hw.ahci.force tunable to control whether AHCI drivers should attach
to known AHCI-capable chips (AMD/NVIDIA), configured for legacy emulation.

Enabled by default to get additional performance and functionality of AHCI
when it can't be enabled by BIOS. Can be disabled to honor BIOS settings if
needed for some reason.


229289 02-Jan-2012 mav

MFC r227635:
Change the way how "not implemented" AHCI channels handled. Instead of
completely skipping them, create ahcich devices for them to allocate unit
numbers, but mark them as disabled to prevent driver probe and attach.

Last time some BIOSes tend to report unused channels as "not implemented".
This change makes ahcichX devices numbering consistent, independently of
connected disks. It makes per-channel driver hints usable and CAM devices
wiring possible on such systems.


229287 02-Jan-2012 rmacklem

MFC: r227543
Modify the new NFS client so that nfs_fsync() only calls ncl_flush()
for regular files. Since other file types don't write into the
buffer cache, calling ncl_flush() is almost a no-op. However, it does
clear the NMODIFIED flag and this shouldn't be done by nfs_fsync() for
directories.


229263 02-Jan-2012 rmacklem

MFC: r227517
Move the setting of the default value for nm_wcommitsize to
before the nfs_decode_args() call in the new NFS client, so
that a specfied command line value won't be overwritten.
Also, modify the calculation for small values of desiredvnodes
to avoid an unusually large value or a divide by zero crash.
It seems that the default value for nm_wcommitsize is very
conservative and may need to change at some time.


229258 02-Jan-2012 rmacklem

MFC: r227494
Since NFSv4 byte range locking only works for regular files,
add a sanity check for the vnode type to the NFSv4 client.


229172 01-Jan-2012 rmacklem

MFC: r227493
Move the assignment of default values for some mount options
to before the nfs_decode_args() call in the new NFS client,
so they don't overwrite the value specified on the command line.


229130 31-Dec-2011 pho

MFC: r226987

Added missing cache purge of from argument for rename().


229121 31-Dec-2011 hselasky

MFC r228195:
Fix checks for error return from urtw_alloc_rx_data_list() and
urtw_alloc_tx_data_list().


229120 31-Dec-2011 hselasky

MFC r228232 and r228303:
Fix clang compile warnings.


229119 31-Dec-2011 hselasky

MFC r227706, r227748, r227749 and r228234:
Simplify the usb_pause_mtx() function by factoring out the generic parts
to the kernel's pause() function. The pause() function can now be used
when cold != 0. Also assert that the timeout in system ticks must be
greater or equal to zero.


229118 31-Dec-2011 hselasky

MFC r227701, r227847 and r227849:
Move the device_delete_all_children() function from usb_util.c
to kern/subr_bus.c. Simplify this function so that it no longer
depends on malloc() to execute. Rename device_delete_all_children()
into device_delete_children(). Identify a few other places where
it makes sense to use device_delete_children().


229117 31-Dec-2011 hselasky

MFC r227610 and r228243:
Add more quirks for USB mass storage devices.


229116 31-Dec-2011 hselasky

MFC r228637:
Add new USB ID.


229115 31-Dec-2011 hselasky

MFC r227781:
Add new USB IDs.

PR: usb/162712, usb/163732


229111 31-Dec-2011 hselasky

MFC r226465 and r226467:
Fix an issue with 11g beacon frames which looks to be a limitation
on the largest multi-write size.


229108 31-Dec-2011 hselasky

MFC r228494, r228508:
Fix for random USB transfer time out.


229107 31-Dec-2011 hselasky

MFC r227462:
Enable power save mode for the USB storage device driver.


229106 31-Dec-2011 hselasky

MFC r226743:
Implement TX/RX checksum offloading support for ASIX AX88772B
controller.


229105 31-Dec-2011 hselasky

MFC r226709:
Allow USB ethernet drivers to define a driver specific
attach handler so that a USB ethernet driver can
announce interface capabilities and do its own MII attach.


229103 31-Dec-2011 hselasky

MFC 228304:
Correct some bInterval USB template descriptor values.


229100 31-Dec-2011 hselasky

MFC r228709, r228711 and r228723:
- Add missing unlock of USB controller's lock, when
doing shutdown, suspend and resume.
- Add code to wait for USB shutdown to be executed at system shutdown.
- Add sysctl which can be used to skip this waiting.


229099 31-Dec-2011 hselasky

MFC r227285:
Add support for new USB modem protocol.

PR: usb/159919


229097 31-Dec-2011 hselasky

MFC r228758:
Fix for race against user-space applications trying to change the
configuration on USB HUBs.

PR: kern/163091


229096 31-Dec-2011 hselasky

MFC r229086, r228483 and r228640:
Implement better support for USB controller suspend and resume.
Fix some build issues in avr32dci.c


229093 31-Dec-2011 hselasky

MFC r226173, r227843, r227848 and r227908:
Use DEVMETHOD_END to mark end of device methods.
Remove superfluous device methods.
Add some missing __FBSBID() macros.


229084 31-Dec-2011 hselasky

MFC r227396, r227401, r227541, r227654 and r228493:
Relax XHCI timeouts which should fix enumeration issues.
Fix definition of XHCI port power bit.
Correct size of some USB 3.0 descriptor fields.

Reported by: Kohji Okuno, Jan Henrik Sylvester


229082 31-Dec-2011 hselasky

MFC r227463, r227383 and r227108:
Add support for modem control lines.
Add support for GPIO pins.

PR: usb/162307
Submitted by: JD Louw


229080 31-Dec-2011 hselasky

MFC r227461:
Style change.
Use memxxx() functions instead of bxxx() functions.


229061 31-Dec-2011 yongari

MFC r226480-226481:
r226480:
Add missing driver lock in media status handler.

r226481:
Make sure to report media change status to caller. Previously it
always reported success.


229060 31-Dec-2011 yongari

MFC r226479:
Close a race where SIOCGIFMEDIA ioctl get inconsistent link status.
Because driver is accessing a common MII structure in
mii_pollstat(), updating user supplied structure should be done
before dropping a driver lock.

Reported by: Karim (fodillemlinkarimi <> gmail dot com)


229057 31-Dec-2011 yongari

MFC r226478:
Close a race where SIOCGIFMEDIA ioctl get inconsistent link status.
Because driver is accessing a common MII structure in
mii_pollstat(), updating user supplied structure should be done
before dropping a driver lock.

Reported by: Karim (fodillemlinkarimi <> gmail dot com)


229052 31-Dec-2011 yongari

MFC r226123:
BCE_MISC_ID register of BCM5716 returns the same id of BCM5709 so
remove explicit checks for BCM5716.
The BCM5709 and BCM5716 chips are virtually indistinguishable by
software except for the PCI device ID. The two chips differ in
that BCM5709 supports TCP/IP and iSCSI offload in Windows while
the BCM5716 doesn't.
While I'm here remove now unused definition of BCE_CHIP_NUM_5716
and BCE_CHIP_ID_5716_C0.


228244 03-Dec-2011 hrs

MFC r226446:
Fix a problem that an interface unexpectedly becomes IFF_UP by
just doing "ifconfing inet6 -ifdisabled" when the interface has
ND6_IFF_AUTO_LINKLOCAL flag and no link-local address.

Approved by: re (bz)


228187 01-Dec-2011 jhb

MFC 227389: Remove some debugging printfs.

Approved by: re (bz)


228126 29-Nov-2011 marius

MFC: r227960

Increase the CDMA sync timeout for Schizo bridges to 15 seconds as used by
OpenSolaris. One second turned out to be not enough for certain loads while
10 seconds were sufficient.
Reported by: Peter Jeremy

Approved by: re (bz)


228041 27-Nov-2011 marcel

MFC rev. 227629:
Wire the kernel text RWX, rather than RX. We're not quite ready
for having kernel text non-writable, because we still need to
apply relocations. On top of that, the PBVM page table has all
pages marked as RWX, so it's an inconsistency to begin with.

Approved by: re (kib)


228036 27-Nov-2011 tuexen

MFC r228031:

Fix a warning reported by arundel@.
Fix a bug where the parameter length of a supported address types
parameter is set to a wrong value if the kernel is built with
with either INET or INET6, but not both.

Approved by: re@


227976 25-Nov-2011 marius

MFC: r227829, r227844

- Add a DEVMETHOD_END alias for KOBJMETHOD_END so that along with 'driver_t'
and DEVMETHOD() we can fully hide the explicit mention of kobj(9) from
device drivers.
- Update the device driver examples to use DEVMETHOD_END.

Submitted by: jhb
Approved by: re (kib)


227971 25-Nov-2011 rstone

MFC r227342. Note that the original commit message, reproduced below, has
error. The final sentence should read "*without* CTF data".

The in-kernel CTF parser caches the result of its first attempt to parse
CTF data from a module. On subsequent attempts to retrieve CTF data for
a module, return an error if there no CTF data.

This fixes a panic if you try to enable fbt probes on a module with CTF
data twice.

Approved by: re (kib)


227948 24-Nov-2011 tuexen

MFC r227930:

Move up the address to the top of the sctp_paddrthlds structure
like in all other structures. This avoids alignment problems.

Approved by: re@


227945 24-Nov-2011 rstone

MFC r227290 and r227291:

r227290:
Fix the DTrace pid return trap interrupt vector. Previously we were using
31, but that vector is reserved.

Without this fix, running dtrace -p <pid> would either cause the target
process to crash or the kernel to page fault

r227291:
Replace fasttrap_copyout() with uwrite(). FreeBSD copyout() is not able to
write to the .text section of a process.

Approved by: re (kib)


227942 24-Nov-2011 tuexen

MFC r227540:

Set the MTU of an path to an approriate value if the interface MTU
can't be determined.

Approved by: re@


227940 24-Nov-2011 tuexen

MFC r227486:

Don't copy uninitialized memory. Also simplify the comparison
of interface names.

Approved by: re@


227923 24-Nov-2011 pjd

MFC r227110,r227111:

r227110:

In zvol_open() if the spa_namespace_lock is already held, it means that
ZFS is trying to open and taste ZVOL as its VDEV. This is not supported,
so return an error instead of panicing on spa_namespace_lock recursion.

Reported by: Robert Millan <rmh@debian.org>
PR: kern/162008

r227111:

Correct typo in comment.

Reported by: Fabian Keil <fk@fabiankeil.de>

Approved by: re (kib)


227898 23-Nov-2011 bz

MFC r226938 (by kevlo):

Add missing PF_UNLOCK in pf_test

Approved by: re (kib)


227894 23-Nov-2011 bz

MFC r227061 (by mlaier):

Fix a use-after-free/redzone issue in the routing code.

Approved by: re (kib)


227890 23-Nov-2011 bz

MFC r227547:

The maximum TSO frame size should be:
maximum IP datagram size (65535 bytes) +
Ethernet header size (14 bytes) +
2 * VLAN tag size (4 bytes) [1].

[1] We need to multiply by 2 to account for the double VLAN tag
provision added in IEEE 802.1ad.

Submitted by: David Somayajulu (david.somayajulu qlogic.com)

Approved by: re (kib)


227888 23-Nov-2011 attilio

MFC r227058:
Disable interrupt and preemption for smp_rendezvous() also in the
UP/!SMP case.

Sponsored by: Sandvine Incorporated
Approved by: re (kib)


227885 23-Nov-2011 bz

MFC r227481:

Return the correct value for the IPV6_MULTICAST_HOPS getsockopt() call.

Submitted by: rpaulo

Approved by: re (kib)


227718 19-Nov-2011 marius

MFC: r227578

Fix compilation with DEBUG defined.

Approved by: re (kib)


227714 19-Nov-2011 marius

MFC: r227539

Define curthread as an inline function that loads the thread pointer
directly from g7, the pcpu pointer. This guarantees correct behavior
when the thread migrates to a different CPU.
Commit message stolen from r205431. Additional testing by Peter Jeremy.

Approved by: re (kib)


227711 19-Nov-2011 marius

MFC: r227537

As it turns out, r186347 actually is insufficient to avoid the use of the
curthread-accessing part of mtx_{,un}lock(9) when using a r210623-style
curthread implementation on sparc64, crashing the kernel in its early
cycles as PCPU isn't set up, yet (and can't be set up as OFW is one of the
things we need for that, which leads to a chicken-and-egg problem). What
happens is that due to the fact that the idea of r210623 actually is to
allow the compiler to cache invocations of curthread, it factors out
obtaining curthread needed for both mtx_lock(9) and mtx_unlock(9) to
before the branch based on kobj_mutex_inited when compiling the kernel
without the debugging options. So change kobj_class_compile_static(9)
to just never acquire kobj_mtx, effectively restricting it to its
documented use, and add a kobj_init_static(9) for initializing objects
using a class compiled with the former and that also avoids using mutex(9)
(and malloc(9)). Also assert in both of these functions that they are
used in their intended way only.
While at it, inline kobj_register_method() and kobj_unregister_method()
as there wasn't much point for factoring them out in the first place
and so that a reader of the code has to figure out the locking for
fewer functions missing a KOBJ_ASSERT.
Tested on powerpc{,64} by andreast.

Reviewed by: nwhitehorn (earlier version), jhb
Approved by: re (kib)


227705 19-Nov-2011 pjd

MFC r226549,r226550,r226551,r226552,r226553,r226554,r226568,r226569,r226611,
r226612:

r226549:

Remove redundant size calculation.

r226550:

Initialize 'rc' properly before using it. This error could lead to infinite
loop when data reconstruction was needed.

r226551:

Don't mark vdev as healthy too soon, so we won't try to use invalid vdevs.

r226552:

Never pass NULL block pointer when reading. This is neither expected nor
handled by lower layers like vdev_raidz, which uses bp for checksum
verification. This bug could lead to NULL pointer reference and resets
during boot.

r226553:

Always pass data size for checksum verification function, as using
physical block size declared in bp may not always be what we want.
For example in case of gang block header physical block size declared
in bp is much larger than SPA_GANGBLOCKSIZE (512 bytes) and checksum
calculation failed. This bug could lead to accessing unallocated
memory and resets/failures during boot.

r226554:

Fix missing return when LOADER_GPT_SUPPORT is defined, but LOADER_MBR_SUPPORT
is not.

r226568:

- Correctly read gang header from raidz.
- Decompress assembled gang block data if compressed.
- Verify checksum of a gang header.
- Verify checksum of assembled gang block data.
- Verify checksum of uber block.

Submitted by: avg

r226569:

With LOADER_MBR_SUPPORT defined and LOADER_GPT_SUPPORT undefined we would
never call disk_openmbr().

Submitted by: avg

r226611:

- Allow to specify multiple files to check, eg.

zfsboottest gpt/system0 gpt/system1 - /boot/kernel/kernel /boot/zfsloader

- Instead of printing file's content calculate MD5 hash of the file,
so it can be easly compared to the hash calculated via file system.
- Some other minor improvements.

r226612:

Because ZFS boot code was very fragile in the past and real PITA to debug,
introduce zfsboottest.sh script that will verify if it will be possible to boot
from the given pool.

# zfsboottest.sh system

Where "system" is pool name of the pool we want to boot from.

What is being verified by the script:
- Does the pool exist?
- Does it have bootfs property configured?
- Is mountpoint property of the boot dataset set to 'legacy'?

Dataset configured in bootfs property has to be mounted to perform more
checks:
- Does the /boot directory in boot dataset exist?
- Is this dataset configured as root file system in /etc/fstab or set
in vfs.root.mountfrom variable in /boot/loader.conf?

By using zfsboottest tool the script will read all the files in /boot
directory using ZFS boot code and calculate their checksums.
Then, it will walk /boot directory using find(1) though regular file sytem
and also read all the files in /boot directory and calculate their checksums.
If any of the files cannot be looked up, read or checksum is invalid it will
be reported and booting off of this pool is probably not possible.

Some additional checks may be interesting as well. For example if the disks
contain proper pmbr and gptzfsboot code or if all expected files in /boot/
are present.

When upgrading FreeBSD, one should snapshot datasets that contain operating
system, upgrade (install new world and kernel) and use zfsboottest.sh to verify
if it will be possible to boot from new configuration. If all is good one
should upgrade boot blocks, by eg.:

# gpart -b /boot/pmbr -p /boot/gptzfsboot -i 1 ada1

If something is wrong, one should rollback datasets and report the problems.

Approved by: re (kib)


227704 19-Nov-2011 pjd

MFC r226617:

zfs vdev_file_io_start: validate vdev before using vdev_tsd

vdev_tsd can be NULL for certain vdev states.
At least in userland testing with ztest.

Submitted by: avg
Approved by: re (kib)


227702 19-Nov-2011 pjd

MFC r226620:

Update per-thread I/O statistics collection in ZFS.
This allows to see processes I/O activity in 'top -m io' output.

PR kern/156218
Reported by: Marcus Reid <marcus@blazingdot.com>
Patch by: avg
Approved by: re (kib)


227677 18-Nov-2011 dougb

MFC r226863:

Fix svnversion for svn 1.7.x by not looking for .svn in ${SYSDIR}
(since it no longer exists). Instead, run svnversion if we can find
the binary and test that the output looks like a version string.

Approved by: re (kib)


227630 17-Nov-2011 rmacklem

MFC: r227059
Both a crash reported on freebsd-current on Oct. 18 under the
subject heading "mtx_lock() of destroyed mutex on NFS" and
PR# 156168 appear to be caused by clnt_dg_destroy() closing
down the socket prematurely. When to close down the socket
is controlled by a reference count (cs_refs), but clnt_dg_create()
checks for sb_upcall being non-NULL to decide if a new socket
is needed. I believe the crashes were caused by the following race:
clnt_dg_destroy() finds cs_refs == 0 and decides to delete socket
clnt_dg_destroy() then loses race with clnt_dg_create() for
acquisition of the SOCKBUF_LOCK()
clnt_dg_create() finds sb_upcall != NULL and increments cs_refs to 1
clnt_dg_destroy() then acquires SOCKBUF_LOCK(), sets sb_upcall to
NULL and destroys socket

This patch fixes the above race by changing clnt_dg_destroy() so
that it acquires SOCKBUF_LOCK() before testing cs_refs.

Tested by: bz
Reviewed by: dfr
Approved by: re (kib)


227624 17-Nov-2011 eadler

Record the merge of r227457, which was done as part of r227565 but not mentioned in the commit log

PR: kern/142999
PR: kern/151365
Submitted by: Takefu Kenji <takefu@airport.fm>
Submitted by: Joerg Niendorf <f5d10a@internode.on.net>
Approved by: re (kib)


227450 11-Nov-2011 trociny

MFC r227449:

Fix false positive EADDRINUSE that could be returned by bind, due to
the typo made in r227207.

Reported by: kib
Tested by: kib

Approved by: re (kib)


227428 10-Nov-2011 trociny

MFC r227204, 227206, 227207:

r227204:

Fix the typo made in r157474.

r227206:

Before dereferencing intotw() check for NULL, the same way as it is
done for in_pcb (see r157474).

r227207:

Cache SO_REUSEPORT socket option in inpcb-layer in order to avoid
inp_socket->so_options dereference when we may not acquire the lock on
the inpcb.

This fixes the crash due to NULL pointer dereference in
in_pcbbind_setup() when inp_socket->so_options in a pcb returned by
in_pcblookup_local() was checked.

Reported by: dave jones <s.dave.jones@gmail.com>, Arnaud Lacombe <lacombar@gmail.com>
Suggested by: rwatson
Glanced by: rwatson
Tested by: dave jones <s.dave.jones@gmail.com>

Approved by: re (kib)


227426 10-Nov-2011 tuexen

MFC 227320:
When loading addresses from INITs, always use the correct
local address.

Approved by: re@


227424 10-Nov-2011 tuexen

MFC 227266:
Initialize all components of the sent COOKIE.

Approved by: re@


227423 10-Nov-2011 andre

Back out r226299 (MFC of r226105) which caused a number of ports
that depend on the incorrect IP length field. The fix stays in
HEAD and ports should test for it.

Requested by: glebius
Approved by: re (kib)


227420 10-Nov-2011 alc

MFC r226740
Speed up vm_page_cache() and vm_page_remove() by checking for a few
common cases that can be handled in constant time.

Approved by: re (kib)


227402 09-Nov-2011 pho

MFC r226971
Added missing cache purge of from argument.

Approved by: re (kensmith)


227400 09-Nov-2011 jhb

MFC 226748:
- Add a new header for the x86 boot code that defines various structures
and constants related to the BIOS Enhanced Disk Drive Specification.
- Use this header instead of magic numbers and various duplicate structure
definitions for doing I/O.
- Use an actual structure for the request to fetch drive parameters in
drvsize() rather than a gross hack of a char array with some magic
size. While here, change drvsize() to only pass the 1.1 version of
the structure and not request device path information. If we want
device path information you have to set the length of the device
path information as an input (along with probably checking the actual
EDD version to see which size one should use as the device path
information is variable-length). This fixes data smashing problems
from passing an EDD 3 structure to BIOSes supporting EDD 4.

Approved by: re (kib)


227397 09-Nov-2011 jhb

MFC 226302:
If an allocation for a specific resource range fails because it is not in
a decoded range for an ACPI Host-PCI bridge, try to allocate it from the
ACPI system resource range. If that works, permit the resource allocation
regardless.

Approved by: re (kib)


227305 07-Nov-2011 marius

MFC: r227006, r227281, r227282

Add a PCI front-end to esp(4) allowing it to support AMD Am53C974 and
replace amd(4) with the former in the amd64, i386 and pc98 GENERIC kernel
configuration files. Besides duplicating functionality, amd(4), which
previously also supported the AMD Am53C974, unlike esp(4) is no longer
maintained and has accumulated enough bit rot over time to always cause
a panic during boot as long as at least one target is attached to it
(see PR 124667).

PR: 124667
Approved by: re (kib)
Obtained from: NetBSD (based on)


227302 07-Nov-2011 marius

MFC: r226947, r226949, r227284

- Use device_t rather than the NetBSDish struct device.
- Move esp_devclass to ncr53c9x.c in order to allow different bus front-ends
to use it.
- Use KOBJMETHOD_END.
- Remove the gl_clear_latched_intr hook as it's not needed for any of the
chips nor the front-ends supported in FreeBSD and likely never will be.
- Correct the DMA constraints and only limit the tag used for the transfer
buffers to 32-bit DMA as that address is written into a 32-bit register.
- The ESP200 also only supports up to 64k transfers.
- Don't let the DMA and SBus front-end supply a maximum transfer size larger
than MAXPHYS as that's the maximum the upper layers use and we otherwise
just waste resources unnecessarily.
- Initialize the ECB callout and don't zero the handle when returning ECBs
to the free list so that ncr53c9x_callout() actually is called with the
driver lock held.
- On detach the driver lock should be held across cam_sim_free() according
to isp(4) and a panic received.
- Check the return value of NCRDMA_SETUP(), i.e. bus_dmamap_load(9), and try
to handle failures gracefully.
- In ncr53c9x_action() replace N calls to xpt_done() in a switch with just
one at the end.
- On XPT_PATH_INQ report "NCR" rather than "Sun" as the vendor as the former
is somewhat more correct as well as the maximum supported transfer size via
maxio in order to take advantage of controllers that that can handle more
than DFLTPHYS.
- Freeze the device queue if a request didn't complete without error and
isn't already frozen.
- Print the number of MESSAGE (EXTENDED) rejected.
- Fix the path encoded in the multiple inclusion protection of ncr53c9xvar.h.
- Correct the DMA constraints used in the LSI64854 core to not exceed the
maximum supported transfer size and include the boundary so we don't need
to check on every setup of a DMA transfer.
- Let the bus DMA map callbacks do nothing in case of an error.
- Correctly handle > 64k transfers for FAS366 in the LSI64854. A new feature
flag NCR_F_LARGEXFER was introduced so we just need to check for this one
and not for individual controllers supporting large transfers in several
places.
- Let the LSI64854 core load transfer buffers using BUS_DMA_NOWAIT as the
NCR53C9x core can't handle EINPROGRESS. Due to lack of bounce buffers
support, sparc64 doesn't actually use EINPROGRESS and likely never will,
as an example for writing additional front-ends for the NCR53C9x core it
makes sense to set BUS_DMA_NOWAIT anyway though.
- Some minor cleanup.

Approved by: re (kib)


227277 06-Nov-2011 marius

MFC: r226995, r227042

- Import the common MII bitbang'ing code from NetBSD and convert drivers to
take advantage of it instead of duplicating it. This reduces the size of
the i386 GENERIC kernel by about 8k. The only potential in-tree users left
unconverted are ed(4) and xe(4). Xe(4) generally should be changed to use
miibus(4) instead of implementing PHY handling on its own, as otherwise it
makes not much sense to add a dependency on miibus(4)/mii_bitbang(4) to it
just for the MII bitbang'ing code. Ed(4) has some chip specific things
interwinded with the MII bitbang'ing code and it's unclear whether it can
be converted to common code, at least not without thorough testing of all
the various chips supported by ed(4).
The common MII bitbang'ing code also is useful in the embedded space for
using GPIO pins to implement MII access.
- Based on lessons learnt with dc(4) (see r185750), add bus barriers to the
MII bitbang read and write functions of the other drivers converted in
order to ensure the intended ordering. Given that register access via an
index register as well as register bank/window switching is subject to the
same problem, also add bus barriers to the respective functions of smc(4),
tl(4) and xl(4).
- Sprinkle some const.

Thanks to the following testers:
Andrew Bliznak (nge(4)), nwhitehorn@ (bm(4)), yongari@ (sis(4) and ste(4))
Thanks to Hans-Joerg Sirtl for supplying hardware to test stge(4).

Reviewed by: yongari (subset of drivers)
Approved by: re (kib)
Obtained from: NetBSD (partially)


227268 06-Nov-2011 bz

MFC r227064:

Add QLogic 10 Gigabit Ethernet & CNA Adapter Driver version 1.30
for 3200 and 8200 series cards.

Submitted by: David C Somayajulu (david.somayajulu@qlogic.com),
Qlogic Corporation

Approved by: re (kib)


227232 06-Nov-2011 bz

MFC r227085:

Always use the opt_*.h options for ipfw.ko, not just when
compiled into the kernel.
Do not try to build the module in case of no INET support but
keep #error calls for now in case we would compile it into the
kernel.

This should fix an issue where the module would fail to enable
IPv6 support from the rc framework, but also other INET and INET6
parts being silently compiled out without giving a warning in the
module case.

While here garbage collect unneeded opt_*.h includes.
opt_ipdn.h is not used anywhere but we need to leave the DUMMYNET
entry in options for conditional inclusion in kernel so keep the
file with the same name.

Reported by: pluknet
Reviewed by: plunket, jhb

Approved by: re (kib)


227230 06-Nov-2011 marius

MFC: r227001

Increase the IOC port initialization timeouts by ten times to what the
corresponding Linux driver uses. This allows mpt(4) to still recognize
all good SATA devices in presence of a defective one, which takes about
45 seconds.
In the long term we probably should implement the logic used by mpt2sas(4)
allowing IOC port initialization to complete at a later time.

Submitted by: Andrew Boyer
Approved by: re (kib)


227229 06-Nov-2011 marius

MFC: r226154, r226165

- Follow the lead of dcphy(4) and pnphy(4) and move the reminder of the PHY
drivers that only ever attach to a particular MAC driver, i.e. inphy(4),
ruephy(4) and xlphy(4), to the directory where the respective MAC driver
lives and only compile it into the kernel when the latter is also there,
also removing it from miibus.ko and moving it into the module of the
respective MAC driver.
- While at it, rename exphy.c, which comes from NetBSD where the MAC driver
it corresponds to also is named ex(4) instead of xl(4) but that in FreeBSD
actually identifies itself as xlphy(4), and its function names accordingly
for consistency.
- Additionally while at it, fix some minor style issues like whitespace
in the register headers and add multi-inclusion protection to inphyreg.h.

Approved by: re (kib)


227226 06-Nov-2011 mav

MFC r226985:
Workaround the problem introduced by combination of r162200 and r215687.
r162200 delays provider orphanization until all running requests complete,
to workaround broken orphan() method implementation in some classes.
r215687 removes persistent periodic (10Hz) event thread wake ups.
Together these changes can indefinitely delay orphanization until some
other event wake up the event thread. One consequence of this is inability
of CAM to destroy device disconnected when busy and, as consequence, create
new one after reconnection.

While the best solution would be to revert r162200, it is not easy, as
some classes still broken in that way. Instead conditionally wake up event
thread if there are some providers waiting for orphanization.

Approved by: re (kib)


227216 06-Nov-2011 hselasky

MFC r227075:
Fix for panic at USB controller attach failure during cold boot.

Approved by: re (kib)


227073 04-Nov-2011 ae

MFC r226880:
Our geom withering function could take some time before geom with its
providers and consumers will be destroyed. Before take some actions
with a geom, check that it is not destroyed at the moment.

Tested by: nwhitehorn

Approved by: re (kib)


227008 01-Nov-2011 qingli

MFC 226710

The host-id/interface-id can have a specific value and is properly
masked out when adding a prefix route through the "route" command.
However, when deleting the route, simply changing the command keyword
from "add" to "delete" does not work. The failoure is observed in
both IPv4 and IPv6 route insertion. The patch makes the route command
behavior consistent between the "add" and the "delete" operation.

Approved by: re (kib)


227007 01-Nov-2011 hselasky

MFC r226903, r225777, r226221 and r226534:
Add some new USB device IDs and some USB device quirks.
Improve the USB mass storage auto quirk detection.

PR: usb/161798, usb/160911
Approved by: re (kib)


227005 01-Nov-2011 qingli

MFC 226451

The IPv6 code was influx at the time of r196865 due to the L2/L3
separation rewrite changes. r196865 was committed to fix a scope
violation problem in the following test scenario:

box-1# ifconfig em0 inet6 2001:db8:1:: prefixlen 64 anycast
box-1# ifconfig em1 inet6 2001:db8:2::1 prefixlen 64

box-2# ifconfig re0 inet6 2001:db8:1::6 prefixlen 64

em0 and re0 are on the same link.

box-2# ping6 2001:db8:1::
PING6(56=40+8+8 bytes) 2001:db8:1::6 --> 2001:db8:1::

the ICMPv6 response should have a source address of em1, which
is 2001:db8:2::1, not the link-local address of em0.

That code is no longer necessary and breaks the IPv6-Ready logo
testing, so revert it now.

Reviewed by: hrs
Approved by: re (kib)


227002 01-Nov-2011 qingli

MFC 226713

Exclude host routes when checking for prefix coverage on multiple
interfaces. A host route has a NULL mask so check for that condition.
I have also been told by developers who customize the packet output
path with direct manipulation of the route entry (or the outgoing
interface to be specific). This patch checks for the route mask
explicitly to make sure custom code will not panic.

PR: kern/161805
Approved by: re (kib)


226965 31-Oct-2011 tuexen

MFC 226869:
When adding a new remote address using sctp_add_remote_addr(),
return the correct net if requested.

Approved by: re@


226963 31-Oct-2011 pho

MFC r226681:
Only unlock if the lock is exclusive.

Approved by: re (kib)
PR: kern/161956


226960 31-Oct-2011 tuexen

MFC 226868:
Send out control chunks which have no specific destination.

Approved by: re@


226956 31-Oct-2011 marcel

MFC r226647:
Add support for Boot Camp. The support is defined as follows:
o Detect when Boot Camp is enabled (i.e. the MBR mirrors the GPT).
o When Boot Camp is enabled, update the MBR whenever we write the GPT.
o Creation of a Boot Camp enabled GPT is not supported.
o Automatically disable Boot Camp when the GPT has been changed so that
there's either no EFI partition or no HFS+ partition.
o The first 4 partitions (by index) get mirrored in the MBR.

Requested by, discussed with and tested by: kris@pcbsd.org
Approved by: re (bz@, kib@)


226934 30-Oct-2011 marius

MFC: r226522

Allow to dump on Solaris swap partitions.

PR: 161764
Submitted by: Peter Jeremy
Approved by: re (kib)


226917 30-Oct-2011 marius

MFC: r226381

Merge from NetBSD:
- Remove clause 3 and 4 from TNF licenses.
- Fix memset usage.
- Various cleanup.
- Kill caddr_t.

Approved by: re (kib)


226910 29-Oct-2011 marius

Merge from r225950:

Set the sense residual properly.

Reviewed by: ken
Approved by: re (kib)


226906 29-Oct-2011 marcel

MFC r226673:
Don't terminate the interactive root mount prompt on mount failure.
This restores the previous behaviour. While here, match '?' and '.'
inputs exactly and improve the error message.

Requested by: avg@
Derived from a patch by: Arnaud Lacombe <lacombar@gmail.com>
Approved by: re (kib@)


226904 29-Oct-2011 hselasky

MFC r226803:
Fix suspend and resume of non-super-speed USB devices
in the generic XHCI driver. There appears to be some minor
logic missing for this feature to work.

Approved by: re (kib)


226894 29-Oct-2011 attilio

Include a missing opt_vm.h which doesn't let VM_NRESERVLEVEL switching
correct utilization.

Approved by: re (kib)


226822 27-Oct-2011 yongari

MFC r226695-226696:
r226695:
Fix a regression introduced in r218832. For TX status check, driver
should use a TX list DMA tag.

r226696:
Add missing bus_dmamap_sync() in setup frame transmit.

Approved by: re (kensmith)


226809 26-Oct-2011 kensmith

MFC r226510,r226547:
Comment out sbp(4) because it appears to cause boot failure on some
systems. Add comment explaining why sbp(4) is commented out.

It was a mistake on my part to omit powerpc's GENERIC for r226510.
But when I noticed the mistake I checked with the powerpc maintainer
to see if I should correct the mistake Marcel said he'd prefer it be
left as-is.

Approved by: re (kib)


226801 26-Oct-2011 glebius

Sync pf(4) and pfsync(4) with head, merging lots of important bugfixes
required for normal operation of pfsync(4). Revisions merged:

r226531 | bz | 2011-10-19 13:34:40 +0400 (ср, 19 окт 2011) | 4 lines

Fix an obvious locking bug where we would lock again rather than unlock.

r226532 | bz | 2011-10-19 14:04:24 +0400 (ср, 19 окт 2011) | 12 lines

Pseudo interfaces should go at SI_SUB_PSEUDO. However at least
pfsync also depends on pf to be initialized already so pf goes at
FIRST and the interfaces go at ANY.
Then the (VNET_)SYSINIT startups for pf stays at SI_SUB_PROTO_BEGIN
and for pfsync we move to the later SI_SUB_PROTO_IF.

This is not ideal either but at least an order that should work for
the moment and can be re-fined with the VIMAGE merge, once this will
actually work with more than one network stack.

r226533 | bz | 2011-10-19 14:08:58 +0400 (ср, 19 окт 2011) | 4 lines

In the non-FreeBSD case we do not expect PF_LOCK and friends to do anything.

r226535 | bz | 2011-10-19 14:16:42 +0400 (ср, 19 окт 2011) | 5 lines

Adjust the PF_ASSERT() macro to what we usually use in the network stack:
PF_LOCK_ASSERT() and PF_UNLOCK_ASSERT().

r226536 | bz | 2011-10-19 15:04:49 +0400 (ср, 19 окт 2011) | 8 lines

De-virtualize the pf_task_mtx lock. At the current state of pf locking
and virtualization it is not helpful but complicates things.

Current state of art is to not virtualize these kinds of locks -
inp_group/hash/info/.. are all not virtualized either.

r226544 | bz | 2011-10-19 17:13:56 +0400 (ср, 19 окт 2011) | 12 lines

Fix recursive pf locking leading to panics. Splatter PF_LOCK_ASSERT()s
to document where we are expecting to be called with a lock held to
more easily catch unnoticed code paths.
This does not neccessarily improve locking in pfsync, it just tries
to avoid the panics reported.

PR: kern/159390, kern/158873
Submitted by: pluknet (at least something that partly resembles
my patch ignoring other cleanup, which I only saw
too late on the 2nd PR)

r226609 | glebius | 2011-10-21 15:11:18 +0400 (пт, 21 окт 2011) | 4 lines

In FreeBSD ip_output() expects ip_len and ip_off in host byte order

PR: kern/159029

r226623 | glebius | 2011-10-22 02:28:15 +0400 (сб, 22 окт 2011) | 5 lines

Fix a race: we should update sc_len before dropping the pf lock, otherwise a
number of packets can be queued on sc, while we are in ip_output(), and then
we wipe the accumulated sc_len. On next pfsync_sendout() that would lead to
writing beyond our mbuf cluster.

r226655 | glebius | 2011-10-23 14:05:25 +0400 (вс, 23 окт 2011) | 5 lines

Correct flag for uma_zalloc() is M_WAITOK. M_WAIT is an old and
deprecated flag from historical mbuf(9) allocator.

This is style only change.

r226656 | glebius | 2011-10-23 14:13:20 +0400 (вс, 23 окт 2011) | 5 lines

Absense of M_WAITOK in malloc flags for UMA doesn't
equals presense of M_NOWAIT. Specify M_NOWAIT explicitly.

This fixes sleeping with PF_LOCK().

r226660 | glebius | 2011-10-23 18:59:54 +0400 (вс, 23 окт 2011) | 22 lines

Fix from r226623 is not sufficient to close all races in pfsync(4).

The root of problem is re-locking at the end of pfsync_sendout().
Several functions are calling pfsync_sendout() holding pointers
to pf data on stack, and these functions expect this data to be
consistent.

To fix this, the following approach was taken:

- The pfsync_sendout() doesn't call ip_output() directly, but
enqueues the mbuf on sc->sc_ifp's interfaces queue, that
is currently unused. Then pfsync netisr is scheduled. PF_LOCK
isn't dropped in pfsync_sendout().
- The netisr runs through queue and ip_output()s packets
on it.

Apart from fixing race, this also decouples stack, fixing
potential issues, that may happen, when sending pfsync(4)
packets on input path.

Reviewed by: eri (a quick review)

r226661 | glebius | 2011-10-23 19:08:18 +0400 (вс, 23 окт 2011) | 13 lines

- Fix a bad typo (FreeBSD specific) in pfsync_bulk_update(). Instead
of scheduling next run pfsync_bulk_update(), pfsync_bulk_fail()
was scheduled.
This lead to instant 100% state leak after first bulk update
request.
- After above fix, it appeared that pfsync_bulk_update() lacks
locking. To fix this, sc_bulk_tmo callout was converted to an
mtx one. Eventually, all pf/pfsync callouts should be converted
to mtx version, since it isn't possible to stop or drain a
non-mtx callout without risk of race.
- Add comment that callout_stop() in pfsync_clone_destroy() lacks
locking. Since pfsync0 can't be destroyed (yet), let it be here.

r226662 | glebius | 2011-10-23 19:10:15 +0400 (вс, 23 окт 2011) | 2 lines

Fix indentation, no code changed.

r226663 | glebius | 2011-10-23 19:15:17 +0400 (вс, 23 окт 2011) | 4 lines

Merge several fixes to bulk update processing from OpenBSD. Merged
revisions: 1.148, 1.149, 1.150. This makes number of states on
master/slave to be of a sane value.

Approved by: re (kib)


226796 26-Oct-2011 bz

MFC r226527:

Fix indentation in a loop and a tiny maze of #ifdefs for just the
__FreeBSD__ parts that had it wrong.

MFC r226530:

Fix a bug when NPFSYNC > 0 that on FreeBSD we would always return
and never remove state.

This fixes the problem some people are seeing that state is removed when pf
is loaded as a module but not in situations when compiled into the kernel.

Approved by: re (kib)


226670 23-Oct-2011 brueffer

MFC: r226406

Properly free resources in case of an error.

Approved by: re (kib)


226667 23-Oct-2011 brueffer

MFC: r226398, r226442

Move the allocation of usrbufs down a few lines to avoid leaking it
in case of an error.

Approved by: re (kib)


226640 22-Oct-2011 brueffer

MFC: r226247, r226253

Properly free linux_gidset in case of an error.

Approved by: re (kib)


226637 22-Oct-2011 brueffer

MFC: r226185

Add missing break statement to make sure all 3DES etypes really are treated
the same.

Approved by: re (kib)


226572 20-Oct-2011 glebius

MFhead 226401,226402:

Remove last remnants of classful addressing:

- Remove ia_net, ia_netmask, ia_netbroadcast from struct in_ifaddr.
- Remove net.inet.ip.subnetsarelocal, I bet no one need it in 2011.
- fix bug when we were not forwarding to a host which matches classful
net address. For example router having 192.168.x.y/16 network attached,
would not forward traffic to 192.168.*.0, which are legal IPs in
CIDR world.
- For compatibility, leave autoguessing of mask based on class.

Reviewed by: andre, bz, rwatson

Add support for IPv4 /31 prefixes, as described in RFC3021.

To run a /31 network, participating hosts MUST drop support
for directed broadcasts, and treat the first and last addresses
on subnet as unicast. The broadcast address for the prefix
should be the link local broadcast address, INADDR_BROADCAST.

Approved by: re (kib)


226571 20-Oct-2011 glebius

MFhead r226367:

Never switch directly from INIT to MASTER, since this produces
nasty status flaps.

PR: kern/161123
Submitted by: Damien Fleuriot <dam my.gd>
OpenBSD: ip_carp.c, rev. 1.115

Approved by: re (kib)


226570 20-Oct-2011 glebius

MFhead r226338:

Restore functions in6_ifaddloop() and in6_ifremloop() that were
inlined by Qing Li in his big new-ARP commit. I am going to utilize
them in my newcarp work, and also these functions left declared
in in6_var.h for all the time they were absent.

Reviewed by: bz

Approved by: re (kib)


226567 20-Oct-2011 nwhitehorn

MFC r226410:
Enforce a memory barrier in stream operations, as is done on other
bus_space calls. This makes ath(4) work correctly on PowerPC.

Submitted by: adrian
Tested by: andreast
Approved by: re (kib)


226455 17-Oct-2011 qingli

MFC 226453

The code change made in r226040 was incomplete and resulted in
routes such as fe80::1%lo0 no being installed. This patch completes
the original intended fix.

Reviewed by: hrs. bz
Approved by: re (ken)


226389 15-Oct-2011 brueffer

MFC: r226149

Fix an infinite loop in siba_bwn_suspend().

Approved by: re (kib)


226387 15-Oct-2011 brueffer

MFC: r226146

Remove dead code, "error" doesn't change between this check and the
previous one.

Approved by: re (kib)


226386 15-Oct-2011 brueffer

MFC: r226117

Add missing va_end() in an error case to clean up after va_start()
(already done in the non-error case).

Approved by: re (kib)


226385 15-Oct-2011 brueffer

MFC: r226116

Add missing va_end() to clean up after va_start().

Approved by: re (kib)


226384 15-Oct-2011 brueffer

MFC: r226143

Remove two dublicated assignments.

Approved by: re (kib)


226368 14-Oct-2011 delphij

MFC r226082:

Return proper errno when we hit error when doing sanity check.
This fixes dtrace crashes when module is not compiled with CTF
data.

Submitted by: Paul Ambrose ambrosehua at gmail.com
Approved by: re (kib)


226337 13-Oct-2011 qingli

MFC 226120

PR: kern/159602
Submitted by: pluknet
Approved by: re (kib)


226333 13-Oct-2011 qingli

MFC 226114

Remove the reference held on the loopback route when the interface
address is being deleted. Only the last reference holder deletes the
loopback route. All other delete operations just clear the IFA_RTSELF
flag.

PR: kern/159601
Submitted by: pluknet
Reviewed by: discussed on net@
Approved by: re (kib)


226332 13-Oct-2011 qingli

MFC 226040

The IFA_RTSELF instead of the IFA_ROUTE flag should be checked to
determine if a loopback route should be installed for an interface
IPv6 address. Another condition is the address must not belong to a
looopback interface.

Reviewed by: hrs
Approved by: re (kib)


226331 13-Oct-2011 qingli

MFC 226224

All indirect routes will fail the rtcheck, except for a special host
route where the destination IP and the gateway IP is the same. This
special case handling is only meant for backward compatibility reason.
The last commit introduced a bug in the route check logic, where a
valid special case is treated as an error. This patch fixes that bug
along with some code cleanup.

Suggested by: glebius smirnoff
Reviewed by: kmacy, discussed with glebius smirnoff
Approved by: re (hrs)


226326 12-Oct-2011 qingli

MFC 225947

A system may have multiple physical interfaces, all of which are on the
same prefix. Since a single route entry is installed for the prefix
(without RADIX_MPATH), incoming packets on the interfaces that are not
associated with the prefix route may trigger an error message about
unable to allocation LLE entry, and fails L2. This patch makes sure a
valid route is present in the system, and allow the aforementioned
condition to exist and treats as valid.

Reviewed by: bz
Approved by: re (kib)


226319 12-Oct-2011 kib

Handle page dirty mask with atomics.

MFC r225838:
Use the explicitly-sized types for the dirty and valid masks.

MFC r225840:
Use the trick of performing the atomic operation on the contained aligned
word to handle the dirty mask updates in vm_page_clear_dirty_mask().

MFC 225841
Remove locking of the vm page queues from several pmaps.

MFC r225843:
Fix grammar.

MFC r225856:
Style nit.

Approved by: re (bz)


226315 12-Oct-2011 marius

MFC: r226176

Recognize the Intel(R) Centrino(R) Wireless-N 130.

PR: 161162
Submitted by: Mikhail Tsatsenko
Approved by: re (kib)


226306 12-Oct-2011 hselasky

MFC r226219
Fix panic due to re-using in-use modem unit number.

Approved by: re (kib)


226304 12-Oct-2011 tuexen

MFC 226252:
Use the most significant 6 bits of the dscp instead of the least
significant ones.
This has changed in the latest version of the socket API ID and
provides backwards compatibility and gets it in syn with the
usage of the IP_TOS socket option.

Approved by: re@


226303 12-Oct-2011 marius

MFC r226118:

Sync with ahc(4)/ahd(4)/sym(4) etc:
Zero any sense not transferred by the device as the SCSI specification
mandates that any untransferred data should be assumed to be zero.

Reviewed by: ken
Approved by: re (kib)


226299 12-Oct-2011 andre

MFC r226105:
Add back the IP header length to the total packet length field on
raw IP sockets. It was deducted in ip_input() in preparation for
protocols interested only in the payload.

On raw sockets the IP header should be delivered as it at came in
from the network except for the byte order swaps in some fields.

Approved by: re (kib)


226295 12-Oct-2011 ed

MFC r226099:

Tab should not blank cells.

It seems I was under the impression that a tab differs from a single
forward tabulation, namely that it blanks the underlying cells. This
seems not to be the case. They are identical.

This should fix applications like jove(1) that use tabs instead of
explicit cursor position setting.

Reported by: Brett Glass <brett lariat net>

MFC r226183:

Properly use the cursor to bound the position for CUP.

We must take the origin region into account when clamping the cursor
position.

Approved by: re@ (kib)


226288 12-Oct-2011 marius

MFC: r226095

Merge from r225950 (merged to stable/9 in r226067):

Set the sense residual properly.

Reviewed by: ken
Approved by: re (kib)


226287 12-Oct-2011 qingli

MFC 225946

This patch allows ARP to work properly in the presence of
self-referencing routes. This patch is a rework of r223862.

Reviewed by: bz, zec
Approved by: re (kib)


226278 12-Oct-2011 tuexen

MFC 226222:
Get struct sctp_net_route in tune with struct route.
struct route was changed in
http://svn.freebsd.org/changeset/base/225698
and since then SCTP support was broken.

Approved by: re@


226268 11-Oct-2011 tuexen

MFC 226203

When moving an stcb to a new inp and we copy over the list of
bound addresses, update the last used address pointer.
If not, it might result in a crash if the old inp goes away.

Approved by: re@


226267 11-Oct-2011 tuexen

MFC 226168
Update the inp stored in a HB-timer when moving an stcb to a new inp.
Use only this stored inp when processing a HB timeout.
This fixes a bug which results in a crash.

Approved by: re@


226254 11-Oct-2011 attilio

MFC r226060:
Skip TCP_SIGNATURE calculation for INP_TIMEWAIT case.

Sponsored by: Sandvine Incorporated
Approved by: re (kib)


226251 11-Oct-2011 kib

MFC r226022:
Move parts of the commit log for r166167, where Tor explained the
interaction between vnode locks and vfs_busy(), into comment.

Approved by: re (bz)


226248 11-Oct-2011 kib

MFC r225791:
Do not deliver SIGTRAP on exec as the normal signal, use ptracestop() on
syscall exit path. Otherwise, if SIGTRAP is ignored, that tdsendsignal()
do not want to deliver the signal, and debugger never get a notification
of exec.

Approved by: re (bz)


226231 10-Oct-2011 jkim

MFC: r226068, r226069, r226071, r226072, r226073, r226074, r226078, r226079

- Unroll inlined strnlen(9) and make it easier to read.
- Inline do_sa_get() function and remove an unused return value.
- Retern more appropriate errno when Linux path name is too long.
- Restore the original socket address length if it was not really AF_INET6.
- Make sure to ignore the leading NULL byte from Linux abstract namespace.
- Use uint32_t instead of u_int32_t. Fix style(9) nits.
- Remove a now-defunct variable.
- Use the caculated length instead of maximum length.

Approved by: re (kib)


226229 10-Oct-2011 jkim

MFC: r226029

Add strnlen() to libkern.

Approved by: re (kib)


226228 10-Oct-2011 andre

MFC r226113:
Prevent TCP sessions from stalling indefinitely in reassembly
when reaching the zone limit of reassembly queue entries.

Approved by: re (kib)


226209 10-Oct-2011 rmacklem

MFC: r226081, r226104
A crash reported on freebsd-fs@ on Sep. 23, 2011 under the subject
heading "kernel panics with RPCSEC_GSS" appears to be caused by a
corrupted tailq list for the client structure. Looking at the code, calls
to the function svc_rpc_gss_forget_client() were done in an SMP unsafe
manner, with the svc_rpc_gss_lock only being acquired in the function
and not before it. As such, when multiple threads called
svc_rpc_gss_forget_client() concurrently, it could try and remove the
same client structure from the tailq lists multiple times.
The patch fixes this by moving the critical code into a separate
function called svc_rpc_gss_forget_client_locked(), which must be
called with the lock held. For the one case where the caller would
have no interest in the lock, svc_rpc_gss_forget_client() was retained,
but a loop was added to check that the client structure is still in
the tailq lists before removing it, to make it safe for multiple
concurrent calls.
Also, remove an extraneous "already" from a comment introduced by r226081.

Approved by: re (kib)


226204 10-Oct-2011 kib

MFC r225943:
Do not allow the kernel to access usermode pages without installed
fault handler. Panic immediately in such situation, on i386 and amd64.

Approved by: re (bz)


226202 10-Oct-2011 kib

MFC r225942:
Assert that exiting process does not return to usermode.

Approved by: re (bz)


226199 10-Oct-2011 kib

MFC r225894:
The sigwait(3) function shall not return EINTR, according to the
POSIX/SUSvN. The sigwait(2) syscall does return EINTR, and libc.so.7
contains the wrapper sigwait(3) which hides EINTR from callers. The
EINTR return is used by libthr to handle required cancellation point
in the sigwait(3).

To help the binaries linked against pre-libc.so.7, i.e. RELENG_6 and
earlier, to have right ABI for sigwait(3), transform EINTR return from
sigwait(2) into ERESTART.

Approved by: re (bz)


226115 07-Oct-2011 delphij

MFC r226026:

Add the 9750 SATA+SAS 6Gb/s RAID controller card driver, tws(4). Many
thanks for their contiued support to FreeBSD.

This is version 10.80.00.003 from codeset 10.2.1 [1]

Obtained from: LSI http://kb.lsi.com/Download16574.aspx [1]
Approved by: re (kib)


226092 07-Oct-2011 trasz

MFC r225938:

Fix bug introduced in r225641, which would cause panic if racct_proc_fork()
returned error -- the racct_destroy_locked() would get called twice.

MFC r225940:

Fix another bug introduced in r225641, which caused rctl to access certain
fields in 'struct proc' before they got initialized in do_fork().

MFC r225944:

Move some code inside the racct_proc_fork(); it spares a few lock operations
and it's more logical this way.

MFC r225981:

Actually enforce limit for inheritable resources on fork.

Approved by: re (kib)


226067 06-Oct-2011 ken

MFC r225950:

Add descriptor sense support to CAM, and honor sense residuals properly in
CAM.

Desriptor sense is a new sense data format that originated in SPC-3. Among
other things, it allows for an 8-byte info field, which is necessary to
pass back block numbers larger than 4 bytes.

This change adds a number of new functions to scsi_all.c (and therefore
libcam) that abstract out most access to sense data.

This includes a bump of CAM_VERSION, because the CCB ABI has changed.
Userland programs that use the CAM pass(4) driver will need to be
recompiled.

camcontrol.c: Change uses of scsi_extract_sense() to use
scsi_extract_sense_len().

Use scsi_get_sks() instead of accessing sense key specific
data directly.

scsi_modes: Update the control mode page to the latest version (SPC-4).

scsi_cmds.c,
scsi_target.c: Change references to struct scsi_sense_data to struct
scsi_sense_data_fixed. This should be changed to allow the
user to specify fixed or descriptor sense, and then use
scsi_set_sense_data() to build the sense data.

ps3cdrom.c: Use scsi_set_sense_data() instead of setting sense data
manually.

cam_periph.c: Use scsi_extract_sense_len() instead of using
scsi_extract_sense() or accessing sense data directly.

cam_ccb.h: Bump the CAM_VERSION from 0x15 to 0x16. The change of
struct scsi_sense_data from 32 to 252 bytes changes the
size of struct ccb_scsiio, but not the size of union ccb.
So the version must be bumped to prevent structure
mis-matches.

scsi_all.h: Lots of updated SCSI sense data and other structures.

Add function prototypes for the new sense data functions.

Take out the inline implementation of scsi_extract_sense().
It is now too large to put in a header file.

Add macros to calculate whether fields are present and
filled in fixed and descriptor sense data

scsi_all.c: In scsi_op_desc(), allow the user to pass in NULL inquiry
data, and we'll assume a direct access device in that case.

Changed the SCSI RESERVED sense key name and description
to COMPLETED, as it is now defined in the spec.

Change the error recovery action for a number of read errors
to prevent lots of retries when the drive has said that the
block isn't accessible. This speeds up reconstruction of
the block by any RAID software running on top of the drive
(e.g. ZFS).

In scsi_sense_desc(), allow for invalid sense key numbers.
This allows calling this routine without checking the input
values first.

Change scsi_error_action() to use scsi_extract_sense_len(),
and handle things when invalid asc/ascq values are
encountered.

Add a new routine, scsi_desc_iterate(), that will call the
supplied function for every descriptor in descriptor format
sense data.

Add scsi_set_sense_data(), and scsi_set_sense_data_va(),
which build descriptor and fixed format sense data. They
currently default to fixed format sense data.

Add a number of scsi_get_*() functions, which get different
types of sense data fields from either fixed or descriptor
format sense data, if the data is present.

Add a number of scsi_*_sbuf() functions, which print
formatted versions of various sense data fields. These
functions work for either fixed or descriptor sense.

Add a number of scsi_sense_*_sbuf() functions, which have a
standard calling interface and print the indicated field.
These functions take descriptors only.

Add scsi_sense_desc_sbuf(), which will print a formatted
version of the given sense descriptor.

Pull out a majority of the scsi_sense_sbuf() function and
put it into scsi_sense_only_sbuf(). This allows callers
that don't use struct ccb_scsiio to easily utilize the
printing routines. Revamp that function to handle
descriptor sense and use the new sense fetching and
printing routines.

Move scsi_extract_sense() into scsi_all.c, and implement it
in terms of the new function, scsi_extract_sense_len().
The _len() version takes a length (which should be the
sense length - residual) and can indicate which fields are
present and valid in the sense data.

Add a couple of new scsi_get_*() routines to get the sense
key, asc, and ascq only.

mly.c: Rename struct scsi_sense_data to struct
scsi_sense_data_fixed.

sbp_targ.c: Use the new sense fetching routines to get sense data
instead of accessing it directly.

sbp.c: Change the firewire/SCSI sense data transformation code to
use struct scsi_sense_data_fixed instead of struct
scsi_sense_data. This should be changed later to use
scsi_set_sense_data().

ciss.c: Calculate the sense residual properly. Use
scsi_get_sense_key() to fetch the sense key.

mps_sas.c,
mpt_cam.c: Set the sense residual properly.

iir.c: Use scsi_set_sense_data() instead of building sense data by
hand.

iscsi_subr.c: Use scsi_extract_sense_len() instead of grabbing sense data
directly.

umass.c: Use scsi_set_sense_data() to build sense data.

Grab the sense key using scsi_get_sense_key().

Calculate the sense residual properly.

isp_freebsd.h: Use scsi_get_*() routines to grab asc, ascq, and sense key
values.

Calculate and set the sense residual.

Approved by: re (kib)
Sponsored by: Spectra Logic Corporation


226061 06-Oct-2011 ae

MFC r225878:
Add Oxford Semiconductor OXPCIe952 (0x1c38) 1 port serial card.

PR: kern/160895
Submitted by: Konstantin V. Krotov

Approved by: re (kib)


225971 04-Oct-2011 bz

MFC r225885:

Fix an obvious bug from r186196 shadowing a variable, not correctly
appending the new mbuf to the chain reference but possibly causing an mbuf
nextpkt loop leading to a memory used after handoff (or having been freed)
and leaking an mbuf here.

Reviewed by: rwatson, brooks
Approved by: re (kib)


225970 04-Oct-2011 bz

MFC r225837:

Pass the fibnum where we need filtering of the message on the
rtsock allowing routing daemons to filter routing updates on an
rtsock per FIB.

Adjust raw_input() and split it into wrapper and a new function
taking an optional callback argument even though we only have one
consumer [1] to keep the hackish flags local to rtsock.c.

Submitted by: multiple (see PR)
Suggested by: rwatson [1]
Reviewed by: rwatson
PR: kern/134931
Approved by: re (kib)


225965 04-Oct-2011 bz

MFC r225793:

Unbreak no-ip and no-inet6 module builds with ipfw. For now continue to
build the ip_fw_pfil.c hooks and ipfw even in case of no-ip under the
assumption that the private L2 hook (which hopefully eventually will be a
pfil hook as well) can still be useful.

Allow building the module without inet as well.

Approved by: re (kib)


225963 04-Oct-2011 mav

MFC 225953:
Revert r225875, r225877:
It is reported that on some chips (e.g. the 970MP) behavior of POW bit set
simultaneously with modifying other bits is undefined and may cause hangs.
The race should be handled in some other way, but for now just get back.

Reported by: nwitehorn
Approved by: re (kib)


225918 02-Oct-2011 mav

MFC r225869:
- Add special support for the MFI_CMD ioctl with MFI_CMD_STP command,
used by present MegaCLI version. It has some special meaning for the
first s/g list entry, while the main s/g list begins from the the second
entry, and those lists should remain separate after loading to the
busdma map.
- Fix bug in 32bit ioctl compatibility shims when s/g list consists of
more then on element.

Approved by: re (kib)


225917 02-Oct-2011 mav

MFC r225875, r225877:
Handle the race in cpu_idle() when due to the critical section CPU could
get into sleep after receiving interrupt, delaying interrupt thread
execution indefinitely until the next interrupt arrive.

Reviewed by: nwhitehorn
Approved by: re (kib)


225873 29-Sep-2011 mav

MFC r225789:
Add one more ID for the Marvell 88SE9128 6Gbps SATA controller.

Approved by: re (kib)


225799 27-Sep-2011 mav

MFC r225788:
Fix interrupt counters dumping on SW_WATCHDOG fire.

Approved by: re (kib)


225797 27-Sep-2011 attilio

Backout r225372.
Eventhandler mutex cannot be acquired in kernel context.

Sponsored by: Sandvine Incorporated
Approved by: re (kib)


225736 23-Sep-2011 kensmith

Copy head to stable/9 as part of 9.0-RELEASE release cycle.

Approved by: re (implicit)


223758 04-Jul-2011 attilio

With retirement of cpumask_t and usage of cpuset_t for representing a
mask of CPUs, pc_other_cpus and pc_cpumask become highly inefficient.

Remove them and replace their usage with custom pc_cpuid magic (as,
atm, pc_cpumask can be easilly represented by (1 << pc_cpuid) and
pc_other_cpus by (all_cpus & ~(1 << pc_cpuid))).

This change is not targeted for MFC because of struct pcpu members
removal and dependency by cpumask_t retirement.

MD review by: marcel, marius, alc
Tested by: pluknet
MD testing by: marcel, marius, gonzo, andreast


222813 07-Jun-2011 attilio

etire the cpumask_t type and replace it with cpuset_t usage.

This is intended to fix the bug where cpu mask objects are
capped to 32. MAXCPU, then, can now arbitrarely bumped to whatever
value. Anyway, as long as several structures in the kernel are
statically allocated and sized as MAXCPU, it is suggested to keep it
as low as possible for the time being.

Technical notes on this commit itself:
- More functions to handle with cpuset_t objects are introduced.
The most notable are cpusetobj_ffs() (which calculates a ffs(3)
for a cpuset_t object), cpusetobj_strprint() (which prepares a string
representing a cpuset_t object) and cpusetobj_strscan() (which
creates a valid cpuset_t starting from a string representation).
- pc_cpumask and pc_other_cpus are target to be removed soon.
With the moving from cpumask_t to cpuset_t they are now inefficient
and not really useful. Anyway, for the time being, please note that
access to pcpu datas is protected by sched_pin() in order to avoid
migrating the CPU while reading more than one (possible) word
- Please note that size of cpuset_t objects may differ between kernel
and userland. While this is not directly related to the patch itself,
it is good to understand that concept and possibly use the patch
as a reference on how to deal with cpuset_t objects in userland, when
accessing kernland members.
- KTR_CPUMASK is changed and now is represented through a string, to be
set as the example reported in NOTES.

Please additively note that no MAXCPU is bumped in this patch, but
private testing has been done until to MAXCPU=128 on a real 8x8x2(htt)
machine (amd64).

Please note that the FreeBSD version is not yet bumped because of
the upcoming pcpu changes. However, note that this patch is not
targeted for MFC.

People to thank for the time spent on this patch:
- sbruno, pluknet and Nicholas Esborn (nick AT desert DOT net) tested
several revision of the patches and really helped in improving
stability of this work.
- marius fixed several bugs in the sparc64 implementation and reviewed
patches related to ktr.
- jeff and jhb discussed the basic approach followed.
- kib and marcel made targeted review on some specific part of the
patch.
- marius, art, nwhitehorn and andreast reviewed MD specific part of
the patch.
- marius, andreast, gonzo, nwhitehorn and jceel tested MD specific
implementations of the patch.
- Other people have made contributions on other patches that have been
already committed and have been listed separately.

Companies that should be mentioned for having participated at several
degrees:
- Yahoo! for having offered the machines used for testing on big
count of CPUs.
- The FreeBSD Foundation for having sponsored my devsummit attendance,
which has been instrumental.
- Sandvine for having offered offices and infrastructure during
development.

(I really hope I didn't forget anyone, if it happened I apologize in
advance).


215681 22-Nov-2010 jhb

Remove some bogus, self-referential mergeinfo.


207736 07-May-2010 mckusick

Merger of the quota64 project into head.

This joint work of Dag-Erling Smørgrav and myself updates the
FFS quota system to support both traditional 32-bit and new 64-bit
quotas (for those of you who want to put 2+Tb quotas on your users).

By default quotas are not compiled into the kernel. To include them
in your kernel configuration you need to specify:

options QUOTA # Enable FFS quotas

If you are already running with the current 32-bit quotas, they
should continue to work just as they have in the past. If you
wish to convert to using 64-bit quotas, use `quotacheck -c 64';
if you wish to revert from 64-bit quotas back to 32-bit quotas,
use `quotacheck -c 32'.

There is a new library of functions to simplify the use of the
quota system, do `man quotafile' for details. If your application
is currently using the quotactl(2), it is highly recommended that
you convert your application to use the quotafile interface.
Note that existing binaries will continue to work.

Special thanks to John Kozubik of rsync.net for getting me
interested in pursuing 64-bit quota support and for funding
part of my development time on this project.


207673 05-May-2010 joel

Switch to our preferred 2-clause BSD license.

Approved by: kmacy


190633 01-Apr-2009 piso

Implement an ipfw action to reassemble ip packets: reass.


190581 30-Mar-2009 mav

Integrate user/mav/ata branch:

Add ch_suspend/ch_resume methods for PCI controllers and implement them
for AHCI. Refactor AHCI channel initialization according to it.

Fix Port Multipliers operation. It is far from perfect yet, but works now.
Tested with JMicron JMB363 AHCI + SiI 3726 PMP pair.
Previous version was also tested with SiI 4726 PMP.

Hardware sponsored by: Vitsch Electronics / VEHosting.nl


189699 11-Mar-2009 dfr

Merge in support for Xen HVM on amd64 architecture.


189614 10-Mar-2009 dfr

Port Xen HVM support forward from 6.x. Add support for TSO/LRO to netfront.


188707 17-Feb-2009 dfr

Pull in support for Xen HVM from user/dfr/xenhvm/6.


185637 05-Dec-2008 dfr

Major cleaning up and refactoring, including but not limited to:

* Move MI Xen headers from <machine/xen/foo.h> to <xen/foo.h>
* Try to cut down the amount of times one include cross-includes another
* Remove all the linux compatibiity macros in favour of an unobfuscated
native FreeBSD style.
* Don't multiplex error and result values using negative errno return values.
* On FreeBSD, malloc(..., M_WAITOK) doesn't return NULL - simplify accordingly.


185578 03-Dec-2008 dfr

Use newbus to manage Xen devices.


185386 28-Nov-2008 dfr

Add some Xen support for amd64 - initially HVM only.


185181 22-Nov-2008 dfr

Clone Kip's Xen on stable/6 tree so that I can work on improving FreeBSD/amd64
performance in Xen's HVM mode.


184235 25-Oct-2008 kmacy

Merge basic SMP support from HEAD


183962 16-Oct-2008 kmacy

- Fix floating point handling for xen
- Enable SMP


183927 16-Oct-2008 kmacy

- pull in xen_machdep.c from HEAD
- pull in xen changes to common files
- remove unused i386/xen/machdep.c


183906 15-Oct-2008 kmacy

Add i386 specific xen support