]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
8 years agoMerge ^/head r294599 through r294776.
Dimitry Andric [Tue, 26 Jan 2016 07:49:11 +0000 (07:49 +0000)]
Merge ^/head r294599 through r294776.

8 years agoFix the various qemu configs to be buildable.
Warner Losh [Tue, 26 Jan 2016 07:22:22 +0000 (07:22 +0000)]
Fix the various qemu configs to be buildable.

8 years agoCleanup unused-but-set-variable spotted by gcc-4.9.
Marcelo Araujo [Tue, 26 Jan 2016 07:17:21 +0000 (07:17 +0000)]
Cleanup unused-but-set-variable spotted by gcc-4.9.

Reviewed by: neel
Approved by: rodrigc (mentor)
Differential Revision: https://reviews.freebsd.org/D5042

8 years agoAdd support for automatic leap-second file updates.
Cy Schubert [Tue, 26 Jan 2016 07:06:44 +0000 (07:06 +0000)]
Add support for automatic leap-second file updates.

The working copy of leapfile resides in /var/dbntpd.leap-seconds.list.
/etc/ntp/leap-seconds (periodically updated from ftp://time.nist.gov/pub/
or ftp://tycho.usno.navy.mil/pub/ntp/) contains the master copy should
automatic leapfile updates be disabled (default).

Automatic leapfile updates are fetched from $ntp_leapfile_sources,
defaulting to https://www.ietf.org/timezones/data/leap-seconds.list,
within $ntp_leapfile_expiry_days (default 30 days) from leap-seconds
file expiry. Automatic updates can be enabled by setting
$daily_ntpd_leapfile_enable="YES" in periodic.conf. To avoid congesting
the ntp leapfile source the automatic update randomized by default but
can be disabled through daily_ntpd_avoid_congestion="NO" in
periodic.conf.

Suggested by: des
Reviewed by: des, roberto, dwmalone, ian, cperciva, glebius, gjb
MFC after: 1 week
X-MFC with: r289421, r293037

8 years agoAllow new lines as white space for arguments that are parsed to allow
Warner Losh [Tue, 26 Jan 2016 06:26:56 +0000 (06:26 +0000)]
Allow new lines as white space for arguments that are parsed to allow
boot1 to pass in files with newlines in them. Now that the EFI loader
groks foo=bar on the command line, this can allow a more general setup
than traditional boot loader args will allow.

Differential Revision: https://reviews.freebsd.org/D5038

8 years agoRead in /boot/config and /boot.config, like all the other boot
Warner Losh [Tue, 26 Jan 2016 06:26:55 +0000 (06:26 +0000)]
Read in /boot/config and /boot.config, like all the other boot
loaders and pass it along to /boot/loader.efi.

Differential Revision: https://reviews.freebsd.org/D5038

8 years agoParse the command line arguments, and do it before we initialize the
Warner Losh [Tue, 26 Jan 2016 06:26:46 +0000 (06:26 +0000)]
Parse the command line arguments, and do it before we initialize the
console so it can be changed by the command line arguments.

Differential Revision: https://reviews.freebsd.org/D5038

8 years agoRBX_ defines are in rbx.h, move it there.
Warner Losh [Tue, 26 Jan 2016 06:26:44 +0000 (06:26 +0000)]
RBX_ defines are in rbx.h, move it there.

Differential Revision: https://reviews.freebsd.org/D5038

8 years agoMove all the separate copies of the same strings into paths.h. There's
Warner Losh [Tue, 26 Jan 2016 06:26:19 +0000 (06:26 +0000)]
Move all the separate copies of the same strings into paths.h. There's
nothing machine specific about these.

Differential Revision: https://reviews.freebsd.org/D5038

8 years agoRevert one chunk from commit 285362, which introduced an off-by-one error
Luigi Rizzo [Tue, 26 Jan 2016 04:48:24 +0000 (04:48 +0000)]
Revert one chunk from commit 285362, which introduced an off-by-one error
in computing a shift index. The error was due to the use of mixed
fls() / __fls() functions in another implementation of qfq.
To avoid that the problem occurs again, properly document which
incarnation of the function we need.
Note that the bug only affects QFQ in FreeBSD head from last july, as
the patch was not merged to other versions.

8 years agoOlder Book-E processors (e500v1/e500v2) don't support dcbzl.
Justin Hibbits [Tue, 26 Jan 2016 04:41:18 +0000 (04:41 +0000)]
Older Book-E processors (e500v1/e500v2) don't support dcbzl.

The only difference between dcbzl and dcbz is dcbzl operates on native cache
line lengths regardless of L1CSR0[DCBZ32].  Since we don't change the cache line
size, the cacheline_size variable will reflect the used cache line length, and
dcbz will work as expected.

8 years agoFix a debug printf().
Justin Hibbits [Tue, 26 Jan 2016 03:52:14 +0000 (03:52 +0000)]
Fix a debug printf().

Somehow this printf() was missed in the conversion of vm_paddr_t to 64-bit, and
made it through until now.

Sponsored by: Alex Perez/Inertial Computing

8 years agoRemove a duplicate setting of the AH_DEBUG_ALQ option.
Mark Johnston [Tue, 26 Jan 2016 01:16:45 +0000 (01:16 +0000)]
Remove a duplicate setting of the AH_DEBUG_ALQ option.

8 years agoEvaluate the sysctl_running fail point before taking the sysctl lock.
Mark Johnston [Tue, 26 Jan 2016 01:15:18 +0000 (01:15 +0000)]
Evaluate the sysctl_running fail point before taking the sysctl lock.

The fail point handler may sleep, but this is not permitted while holding a
rm read lock.

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division

8 years agoUse LIBADD instead of LDADD in rping's Makefile and add libcxgb4 (the
Navdeep Parhar [Tue, 26 Jan 2016 01:02:19 +0000 (01:02 +0000)]
Use LIBADD instead of LDADD in rping's Makefile and add libcxgb4 (the
userspace iWARP library for cxgbe) to the list of libraries.

rping using the libcxgb4 + iw_cxgbe combo was tested with T5 hardware.

Obtained from: Chelsio Communications

8 years agoAllow us to be told about memory past the first 4GB point, but ignore it.
Andrew Turner [Mon, 25 Jan 2016 23:04:40 +0000 (23:04 +0000)]
Allow us to be told about memory past the first 4GB point, but ignore it.
This allows, for example, UEFI pass a memory map with some ram in this
region, but for us to ignore it. This is the case when running under the
qemu virt machine type.

Sponsored by: ABT Systems Ltd

8 years ago- Make the code consistent with itself style-wise and bring it closer
Marius Strobl [Mon, 25 Jan 2016 22:58:06 +0000 (22:58 +0000)]
- Make the code consistent with itself style-wise and bring it closer
  to style(9).
- Mark unused arguments as such.
- Make the ttystates table const.

8 years agoFix PROGS not reading .depend files after r284288 by making DEPENDFILE work.
Bryan Drewery [Mon, 25 Jan 2016 22:29:44 +0000 (22:29 +0000)]
Fix PROGS not reading .depend files after r284288 by making DEPENDFILE work.

We have had this user-modifable DEPENDFILE variable forever that does nothing
relevant for the user since fmake always used '.depend'.  Bmake
introduced the .MAKE.DEPENDFILE variable that can be modified to change
the name of '.depend'.

Prior to r284288, bsd.progs.mk was setting .MAKE.DEPENDFILE to allow
working incremental builds.  This was modified most likely to not
conflict with the META MODE handling of .MAKE.DEPENDFILE as it has a lot
more special logic for that variable.

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division

8 years agoRemove unneeded beforebuild hacks for dtrace probes.
Bryan Drewery [Mon, 25 Jan 2016 22:29:41 +0000 (22:29 +0000)]
Remove unneeded beforebuild hacks for dtrace probes.

This still allows skipping 'make depend'.  Headers in SRCS generate
properly.

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division

8 years agoFix incremental build of dtrace probes.
Bryan Drewery [Mon, 25 Jan 2016 22:29:32 +0000 (22:29 +0000)]
Fix incremental build of dtrace probes.

Currently dtrace(1) -Go does not properly rebuild the target if it
exists.  It results in missing symbols.

  dtrace -C -x nolibs -G -o usdt.o -s /root/git/freebsd/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/json/usdt.d tst.usdt.o
  dtrace: target object (usdt.o) already exists. Please remove the target
  dtrace: object and rebuild all the source objects if you wish to run the DTrace
  dtrace: linking process again
  cc -O2 -pipe -O0 -g -I/root/git/freebsd/cddl/usr.sbin/dtrace/tests/common/json -std=gnu99 -fstack-protector-strong -Qunused-arguments  -o tst.usdt.exe.full tst.usdt.o usdt.o
  tst.usdt.o: In function `main':
  /root/git/freebsd/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/json/tst.usdt.c:56: undefined reference to `__dtrace_bunyan_fake___log__debug'
  /root/git/freebsd/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/json/tst.usdt.c:60: undefined reference to `__dtrace_bunyan_fake___log__debug'
  cc: error: linker command failed with exit code 1 (use -v to see invocation)
  *** [tst.usdt.exe.full] Error code 1

This is a consequence of r212358.

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division

8 years agoAllow the (old rc-style) exec_afterstart jail parameters to start numbering
Jamie Gritton [Mon, 25 Jan 2016 22:14:31 +0000 (22:14 +0000)]
Allow the (old rc-style) exec_afterstart jail parameters to start numbering
at 0, like exec_prestart and the others do.  Make param0 optional, i.e.
still look for param1.

PR: 142973
MFC after: 3 days

8 years agoPrune a definition which is / was never used.
Marko Zec [Mon, 25 Jan 2016 20:35:15 +0000 (20:35 +0000)]
Prune a definition which is / was never used.

8 years agoReplace .CURDIR with SRCTOP to respect LIBC_SRCTOP feature.
Bryan Drewery [Mon, 25 Jan 2016 19:11:34 +0000 (19:11 +0000)]
Replace .CURDIR with SRCTOP to respect LIBC_SRCTOP feature.

8 years agoImport latest host-target.mk 1.11 from contrib/bmake/mk
Bryan Drewery [Mon, 25 Jan 2016 18:43:21 +0000 (18:43 +0000)]
Import latest host-target.mk 1.11 from contrib/bmake/mk

8 years agoImport latest gendirdeps.mk 1.29 from contrib/bmake/mk
Bryan Drewery [Mon, 25 Jan 2016 18:40:25 +0000 (18:40 +0000)]
Import latest gendirdeps.mk 1.29 from contrib/bmake/mk

8 years agoImport latest meta.subdir.mk 1.11 from contrib/bmake/mk
Bryan Drewery [Mon, 25 Jan 2016 18:34:15 +0000 (18:34 +0000)]
Import latest meta.subdir.mk 1.11 from contrib/bmake/mk

8 years agoImport latest auto.obj.mk 1.12 from contrib/bmake/mk.
Bryan Drewery [Mon, 25 Jan 2016 18:16:41 +0000 (18:16 +0000)]
Import latest auto.obj.mk 1.12 from contrib/bmake/mk.

8 years agoIntroduce support for HW watchpoints and single stepping for ARMv6/v7
Zbigniew Bodek [Mon, 25 Jan 2016 18:02:28 +0000 (18:02 +0000)]
Introduce support for HW watchpoints and single stepping for ARMv6/v7

Allows for using hardware watchpoints for 1, 2, 4, 8 byte long addresses.
The default configuration of watchpoint is RW but code allows to select
RO or WO and X.
Since debugging registers are per-CPU (CP14) the watchpoint is set on
the CPU that was lucky (or not) to enter DDB.

HW breakpoints are used to perform single step in KDB.
When HW breakpoint is enabled all watchpoints are temporary disabled
to avoid recursive abort on both watchpoint and breakpoint.
In case of branch, the breakpoint is set to both - next instruction
and possible branch address. This requires at least 2 breakpoints
supported in the CPU however this is a must for ARMv6/v7 CPUs.

Reviewed by:   imp
Submitted by:  Zbigniew Bodek <zbb@semihalf.com>
Obtained from: Semihalf
Sponsored by:  Juniper Networks Inc.
Differential Revision: https://reviews.freebsd.org/D4037

8 years agoDisable gprof and users on RISC-V, they don't build.
Ruslan Bukin [Mon, 25 Jan 2016 16:49:39 +0000 (16:49 +0000)]
Disable gprof and users on RISC-V, they don't build.

8 years agoDon't allow opening the callout device when the callin device is already
Konstantin Belousov [Mon, 25 Jan 2016 16:47:20 +0000 (16:47 +0000)]
Don't allow opening the callout device when the callin device is already
open (in disguise as the console device).  The only allowed combination
was supposed to be the callin device with the console.

Fix the assertion in ttydev_close() that was meant to detect this (it
only detected all 3 devices being open).  Assert this in ttydev_open()
too.

Submitted by: bde
MFC after: 2 weeks

8 years agoFix ixgbe compliation with DBG 1
Steven Hartland [Mon, 25 Jan 2016 16:18:53 +0000 (16:18 +0000)]
Fix ixgbe compliation with DBG 1

Fixed ERROR_REPORTXX macros so that ixgbe compiles with #define DBG 1

MFC after: 1 week
Sponsored by: Multiplay
Differential Revision: https://reviews.freebsd.org/D5061

8 years agoFix the %b flags string for ddb. All bits above the 5th
Konstantin Belousov [Mon, 25 Jan 2016 15:37:01 +0000 (15:37 +0000)]
Fix the %b flags string for ddb.  All bits above the 5th
(TF_OPENED_CONS) were broken in r188147 by adding TF_OPENED_CONS
without updating the string.  It was especially confusing to display
OPENED_CONS as GONE and BYPASS as ZOMBIE.  2 flags at the end were
not updated in r188487.

Don't print an extra 0x prefix for %p in a ddb command.  In the rest
of the kernel there are more than 6000 lines with %p and only about
40 with this bug.

Print a non-extra 0x prefix for %b in a ddb command.  In the rest
of the kernel, there are approx. 180 lines with %b and 2/3 of them
have this bug.

Submitted by: bde
MFC after: 2 weeks

8 years agoSimplify GICv3 related drivers' naming
Zbigniew Bodek [Mon, 25 Jan 2016 15:18:32 +0000 (15:18 +0000)]
Simplify GICv3 related drivers' naming

Rename gic_v3_ instances to simply use 'gic' and 'its'.
The information about the controller's revision is printed
in the device announcement during boot anyway.
The intention behind this change is to avoid somewhat misleading
GIC instances naming such as:
    gic_v30
    gic_v31
    ...
etc.

Submitted by:  Zbigniew Bodek <zbb@semihalf.com>
Obtained from: Semihalf
Sponsored by:  Cavium
Differential Revision: https://reviews.freebsd.org/D5016

8 years agoCreate proper FDT attachment for GICv2m
Zbigniew Bodek [Mon, 25 Jan 2016 15:10:43 +0000 (15:10 +0000)]
Create proper FDT attachment for GICv2m

Avoid probing GICv2m to any parent bus/driver. Instead, match
GICv2m driver with FDT complatible strings as not every GIC
has a MSI controller in the form of GICv2m extension.

Submitted by:  Zbigniew Bodek <zbb@semihalf.com>
Obtained from: Semihalf
Sponsored by:  Cavium
Differential Revision: https://reviews.freebsd.org/D5015

8 years agoDo not destroy input buffer of the OF_getencprop() function on error
Zbigniew Bodek [Mon, 25 Jan 2016 14:42:44 +0000 (14:42 +0000)]
Do not destroy input buffer of the OF_getencprop() function on error

Currently when the OF_getprop() function returns with error,
the caller (OF_getencprop()) still changes the buffer endiannes.
This may destroy the default value passed in the input buffer if
used on a Little Endian platform.

Reviewed by:   mmel
Submitted by:  Zbigniew Bodek <zbb@semihalf.com>
Obtained from: Semihalf
Sponsored by:  Cavium

8 years agoFix an occasional undefined instruction abort during module loading.
Svatopluk Kraus [Mon, 25 Jan 2016 14:09:35 +0000 (14:09 +0000)]
Fix an occasional undefined instruction abort during module loading.

Even if data cache maintenance was done by IO code, the relocation
fixup process creates dirty cache entries that we must write back
before doing icache sync.

Reported by: Thiagarajan Venkatasubramanian <tvenkata at juniper.net>
Reviewed by: ian

8 years agoDo not use blk_write_cont() and remove it. There si no need to call
Svatopluk Kraus [Mon, 25 Jan 2016 12:55:24 +0000 (12:55 +0000)]
Do not use blk_write_cont() and remove it. There si no need to call
blk_flush() between two writes by physical address when these are
PAGE_SIZE aligned.

Fix some style nits.

8 years agoMake minidump more like its i386 original back as with new pmap dump
Svatopluk Kraus [Mon, 25 Jan 2016 12:49:08 +0000 (12:49 +0000)]
Make minidump more like its i386 original back as with new pmap dump
interface all used physical addresses are PAGE_SIZE aligned.
Add missing copyright.

This is a follow up to r294722.

8 years agoCreate new pmap dump interface for minidump and use it for existing
Svatopluk Kraus [Mon, 25 Jan 2016 12:43:07 +0000 (12:43 +0000)]
Create new pmap dump interface for minidump and use it for existing
pmap implementations on ARM. This way minidump code can be used without
any platform specific modification.

Also, this is the last piece missing for ARM_NEW_PMAP.

Differential Revision: https://reviews.freebsd.org/D5023

8 years agoStyle.
Ruslan Bukin [Mon, 25 Jan 2016 10:44:10 +0000 (10:44 +0000)]
Style.

8 years agoDo build libproc and librtld_db for RISC-V as well.
Ruslan Bukin [Mon, 25 Jan 2016 10:23:36 +0000 (10:23 +0000)]
Do build libproc and librtld_db for RISC-V as well.

8 years agoWe don't support libdtrace for RISC-V yet.
Ruslan Bukin [Mon, 25 Jan 2016 10:18:41 +0000 (10:18 +0000)]
We don't support libdtrace for RISC-V yet.

8 years agoConvert TCP mtu checks to the new routing KPI.
Alexander V. Chernikov [Mon, 25 Jan 2016 10:06:49 +0000 (10:06 +0000)]
Convert TCP mtu checks to the new routing KPI.

8 years agoFix flowtable part missed in r294706.
Alexander V. Chernikov [Mon, 25 Jan 2016 09:31:32 +0000 (09:31 +0000)]
Fix flowtable part missed in r294706.

8 years agoAdd allwinner_machdep.h, it was missed in r294698.
Andrew Turner [Mon, 25 Jan 2016 08:19:16 +0000 (08:19 +0000)]
Add allwinner_machdep.h, it was missed in r294698.

8 years agoMFP r287070,r287073: split radix implementation and route table structure.
Alexander V. Chernikov [Mon, 25 Jan 2016 06:33:15 +0000 (06:33 +0000)]
MFP r287070,r287073: split radix implementation and route table structure.

There are number of radix consumers in kernel land (pf,ipfw,nfs,route)
  with different requirements. In fact, first 3 don't have _any_ requirements
  and first 2 does not use radix locking. On the other hand, routing
  structure do have these requirements (rnh_gen, multipath, custom
  to-be-added control plane functions, different locking).
Additionally, radix should not known anything about its consumers internals.

So, radix code now uses tiny 'struct radix_head' structure along with
  internal 'struct radix_mask_head' instead of 'struct radix_node_head'.
  Existing consumers still uses the same 'struct radix_node_head' with
  slight modifications: they need to pass pointer to (embedded)
  'struct radix_head' to all radix callbacks.

Routing code now uses new 'struct rib_head' with different locking macro:
  RADIX_NODE_HEAD prefix was renamed to RIB_ (which stands for routing
  information base).

New net/route_var.h header was added to hold routing subsystem internal
  data. 'struct rib_head' was placed there. 'struct rtentry' will also
  be moved there soon.

8 years agohyperv/vmbus: Avoid extra copy of page information.
Sepherosa Ziehau [Mon, 25 Jan 2016 05:33:18 +0000 (05:33 +0000)]
hyperv/vmbus: Avoid extra copy of page information.

The page information array could contain up to 32 elements (i.e. 512B).
And on network side w/ TSO, 11+ (176B+) elements, i.e. ~44K TSO packet,
in the page information array is quite common.

This saves us some cpu cycles.

Reviewed by: adrian, delphij
Approved by: adrian (mentor)
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D4992

8 years agoRemove unused radix_mpath definitions.
Alexander V. Chernikov [Mon, 25 Jan 2016 05:28:19 +0000 (05:28 +0000)]
Remove unused radix_mpath definitions.

8 years agohyperv/hn: Trust host TCP segment checksum verification by default.
Sepherosa Ziehau [Mon, 25 Jan 2016 05:25:39 +0000 (05:25 +0000)]
hyperv/hn: Trust host TCP segment checksum verification by default.

According to all available information, VMSWITCH always does the
TCP segment checksum verification before sending the segment to
guest.

Reviewed by: adrian, delphij, Hongjiang Zhang <honzhan microsoft com>
Approved by: adrian (mentor)
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D4991

8 years agohyperv/hn: Remove unnecessary zeroing out the netvsc_packet
Sepherosa Ziehau [Mon, 25 Jan 2016 05:18:57 +0000 (05:18 +0000)]
hyperv/hn: Remove unnecessary zeroing out the netvsc_packet

All used fields are setup one by one, so there is no need to zero
out this large struct.

While I'm here, move the stack variable near its usage.

Reviewed by: adrian, delphij, Jun Su <junsu microsoft com>
Approved by: adrian (mentor)
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D4978

8 years agohyperv/hn: Use m_copydata for chimney sending.
Sepherosa Ziehau [Mon, 25 Jan 2016 05:12:00 +0000 (05:12 +0000)]
hyperv/hn: Use m_copydata for chimney sending.

While I'm here, move stack variables near their usage.

Reviewed by: adrian, delphij, Jun Su <junsu microsoft com>
Approved by: adrian (mentor)
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D4977

8 years agohyperv/hn: Partly rework transmission path
Sepherosa Ziehau [Mon, 25 Jan 2016 05:01:32 +0000 (05:01 +0000)]
hyperv/hn: Partly rework transmission path

- Avoid unnecessary malloc/free on transmission path.
- busdma(9)-fy transmission path.
- Properly handle IFF_DRV_OACTIVE.  This should fix the network
  stalls reported by many.
- Properly setup TSO parameters.
- Properly handle bpf(4) tapping.  This 5 times the performance
  during TCP sending test, when there is one bpf(4) attached.
- Allow size of chimney sending be tuned on a running system.
  Default value still needs more test to determine.

Reviewed by: adrian, delphij
Approved by: adrian (mentor)
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D4972

8 years agoelfdump: handle STT_SPARC_REGISTER
Ed Maste [Mon, 25 Jan 2016 04:22:01 +0000 (04:22 +0000)]
elfdump: handle STT_SPARC_REGISTER

STT_SPARC_REGISTER is a SPARC-specific symbol type specified by the
Sparcv9 ABI to provide some information on register use by the object.

Also rework st_info type lookup to avoid out-of-bounds array access.

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

8 years agoUpdate the Allwinner kernels:
Andrew Turner [Mon, 25 Jan 2016 00:24:57 +0000 (00:24 +0000)]
Update the Allwinner kernels:
 * Use the ARM PLATFORM framework
 * Use ARM_INTRNG on teh A20 as it has a GICv2
 * Add a method to find which Allwinner SoC we are running on

Differential Revision: https://reviews.freebsd.org/D5059

8 years agonet80211: reduce stack usage for ieee80211_ioctl*() methods.
Andriy Voskoboinyk [Sun, 24 Jan 2016 23:35:20 +0000 (23:35 +0000)]
net80211: reduce stack usage for ieee80211_ioctl*() methods.

Use malloc(9) for
 - struct ieee80211req_wpaie2 (518 bytes, used in
ieee80211_ioctl_getwpaie())
 - struct ieee80211_scan_req (128 bytes, used in setmlme_assoc_adhoc()
and ieee80211_ioctl_scanreq())

Also, drop __noinline workarounds; stack overflow is not reproducible
with recent compilers.

Tested with Clang 3.7.1, GCC 4.2.1 (from 9.3-RELEASE) and 4.9.4
(with -fstack-usage flag)

Approved by: adrian (mentor)
Differential Revision: https://reviews.freebsd.org/D5041

8 years agonet80211: reduce code duplication
Andriy Voskoboinyk [Sun, 24 Jan 2016 23:28:14 +0000 (23:28 +0000)]
net80211: reduce code duplication

Do not duplicate code between IEEE80211_IOC_WPAIE and IEEE80211_IOC_WPAIE2
switch cases.

Approved by: adrian (mentor)
Differential Revision: D5041 (part)

8 years agoext2fs: passthrough any extra timestamps to the dinode struct.
Pedro F. Giffuni [Sun, 24 Jan 2016 23:24:47 +0000 (23:24 +0000)]
ext2fs: passthrough any extra timestamps to the dinode struct.

In general we don't trust any of the extended timestamps unless the
EXT2F_ROCOMPAT_EXTRA_ISIZE feature is set. However, in the case where
we freshly allocated a new inode the information is valid and it is
better to pass it along instead of leaving the value undefined.

This should have no practical effect but should reduce the amount of
garbage if EXT2F_ROCOMPAT_EXTRA_ISIZE is set, like in cases where the
filesystem is converted from ext3 to ext4.

MFC after: 4 days

8 years agosctp_sendx() needs to provide the assoc_id back.
Michael Tuexen [Sun, 24 Jan 2016 22:31:34 +0000 (22:31 +0000)]
sctp_sendx() needs to provide the assoc_id back.

MFC after: 3 days

8 years agosh: Constify internal representation in expand.c.
Jilles Tjoelker [Sun, 24 Jan 2016 22:26:25 +0000 (22:26 +0000)]
sh: Constify internal representation in expand.c.

Forbid (temporary or permanent) modifications of the strings in NARG nodes
during expansion.

Tilde expansion now needs to copy the username for the terminating '\0'.

8 years agoFix bug in the readpassphrase(3) function, which can be exposed
Maxim Sobolev [Sun, 24 Jan 2016 22:20:13 +0000 (22:20 +0000)]
Fix bug in the readpassphrase(3) function, which can be exposed
by application closing its stdin (i.e. STDIN_FILENO) prior to
calling readpassphrase WITHOUT setting RPP_STDIN. What happens
then is that the readpassphrase would open /dev/tty, and since
file descriptors are reused, the call would return first unused
fd, which is 0 which is also STDIN_FILENO. Then due to the usage
of "input != STDIN_FILENO" in the code to do its logic, that
would result in noecho flags not set on that file descriptor,
which was original issue I've been trying to fix.

In addition to that, the readpassphrase() would leak file
descriptor on its way out, so fix that one as well.

This problem can be tested with:

 $ ssh-add - < /tmp/myprivate.key

The password will not be hidden as it should and ktrace will
show:

 53326 ssh-add  CALL  open(0x80142443c,0x100002<O_RDWR|O_CLOEXEC>,<unused>0x165f030)
 53326 ssh-add  NAMI  "/dev/tty"
 53326 ssh-add  RET   open 0
 53326 ssh-add  CALL  sigprocmask(SIG_SETMASK,0x802eb1324,0x7fffffffd5e0)
 53326 ssh-add  RET   sigprocmask 0
 53326 ssh-add  CALL  sigaction(SIGALRM,0x7fffffffd630,0x7fffffffd610)

Instead of:

 57690 ssh-add  CALL  open(0x80142443c,0x100002<O_RDWR|O_CLOEXEC>,<unused>0x165f030)
 57690 ssh-add  NAMI  "/dev/tty"
 57690 ssh-add  RET   open 4
 57690 ssh-add  CALL  ioctl(0x4,TIOCGETA,0x7fffffffd860)
 57690 ssh-add  RET   ioctl 0
 57690 ssh-add  CALL  ioctl(0x4,TIOCSETAF,0x7fffffffd680)
 57690 ssh-add  RET   ioctl 0
 57690 ssh-add  CALL  sigprocmask(SIG_SETMASK,0x802eb1324,0x7fffffffd620)
 57690 ssh-add  RET   sigprocmask 0
 57690 ssh-add  CALL  sigaction(SIGALRM,0x7fffffffd670,0x7fffffffd650)

For the case when the key is read from the file.

Technically this can also be workaround'ed at the application side
by not closing the STDIN_FILENO in the first place, but readpassphrase(3)
doesn't need to make any assumptions about that. Plus the file descriptor
leak confirms that this is an oversight, rather than a deliberate behaviour.

MFC after: 1 week

8 years agosctp_sendv() needs to fill in the association id on return.
Michael Tuexen [Sun, 24 Jan 2016 22:08:15 +0000 (22:08 +0000)]
sctp_sendv() needs to fill in the association id on return.

MFC after: 3 days

8 years agoBump copyright for change from fbt to syscall
Devin Teske [Sun, 24 Jan 2016 21:18:54 +0000 (21:18 +0000)]
Bump copyright for change from fbt to syscall

MFC after: 3 days
X-MFC-to: stable/10
X-MFC-with: r294548 r294556

8 years agoRemove an extra newline that crept in.
Andrew Turner [Sun, 24 Jan 2016 19:12:16 +0000 (19:12 +0000)]
Remove an extra newline that crept in.

8 years agoAdd support for controlling the clocks for the audio codec and DMA engines.
Andrew Turner [Sun, 24 Jan 2016 19:10:30 +0000 (19:10 +0000)]
Add support for controlling the clocks for the audio codec and DMA engines.

Submitted by: Jared McNeill <jmcneill@invisible.ca>
Differential Revision: https://reviews.freebsd.org/D5052

8 years agoThe <libutil.h> is an ordinary header file; should sort just like any other.
Edward Tomasz Napierala [Sun, 24 Jan 2016 18:11:36 +0000 (18:11 +0000)]
The <libutil.h> is an ordinary header file; should sort just like any other.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

8 years agoFix a typo in a comment
Devin Teske [Sun, 24 Jan 2016 17:15:42 +0000 (17:15 +0000)]
Fix a typo in a comment

MFC after: 3 days
X-MFC-to: stable/10

8 years agoFix the style of the reading of a nodes xref to make it readable.
Andrew Turner [Sun, 24 Jan 2016 17:09:11 +0000 (17:09 +0000)]
Fix the style of the reading of a nodes xref to make it readable.

8 years agosh: Remove a global variable from cd.c.
Jilles Tjoelker [Sun, 24 Jan 2016 17:01:34 +0000 (17:01 +0000)]
sh: Remove a global variable from cd.c.

8 years agoWe don't support a.out executables on RISC-V.
Ruslan Bukin [Sun, 24 Jan 2016 15:15:57 +0000 (15:15 +0000)]
We don't support a.out executables on RISC-V.

Reviewed by: emaste
Sponsored by: DARPA, AFRL
Sponsored by: HEIF5
Differential Revision: https://reviews.freebsd.org/D5048

8 years agoAdd config for RISC-V ISA.
Ruslan Bukin [Sun, 24 Jan 2016 15:12:49 +0000 (15:12 +0000)]
Add config for RISC-V ISA.

Reviewed by: emaste
Sponsored by: DARPA, AFRL
Sponsored by: HEIF5
Differential Revision: https://reviews.freebsd.org/D5046

8 years agoTypo in comment.
Konstantin Belousov [Sun, 24 Jan 2016 13:38:41 +0000 (13:38 +0000)]
Typo in comment.

8 years agoAdd support for RISC-V ISA.
Ruslan Bukin [Sun, 24 Jan 2016 12:10:29 +0000 (12:10 +0000)]
Add support for RISC-V ISA.

Reviewed by: andrew
Sponsored by: DARPA, AFRL
Sponsored by: HEIF5
Differential Revision: https://reviews.freebsd.org/D5040

8 years agoAdd reset framework, a second part of new 'extended resources' family of
Michal Meloun [Sun, 24 Jan 2016 11:03:35 +0000 (11:03 +0000)]
Add reset framework, a second part of new 'extended resources' family of
support frameworks (i.e. regulators/phy/tsensors/fuses...).

It provides simple unified consumers interface for manipulations with
on-chip resets.

Reviewed by: ian, imp (paritaly)

8 years agoAdd clock framework, a first part of new 'extended resources' family of
Michal Meloun [Sun, 24 Jan 2016 11:00:38 +0000 (11:00 +0000)]
Add clock framework, a first part of new 'extended resources' family of
support frameworks(i.e. reset/regulators/phy/tsensors/fuses...).

The clock framework significantly simplifies handling of complex clock
structures found in modern SoCs. It provides the unified consumers
interface, holds and manages actual clock topology, frequency and gating.

It's tested on three different ARM boards (Nvidia Tegra TK1, Inforce 6410 and
Odroid XU2) and on one MIPS board (Creator Ci20) by kan@.

The framework is still far from perfect and probably doesn't have stable
interface yet, but we want to start testing it on more real boards and
different architectures.

Reviewed by: ian, kan (earlier version)

8 years agoext2: rename some directory index constants.
Pedro F. Giffuni [Sun, 24 Jan 2016 04:30:30 +0000 (04:30 +0000)]
ext2: rename some directory index constants.

Missed from r294653.

Pointyhat: me

8 years agoFix comment.
Pedro F. Giffuni [Sun, 24 Jan 2016 02:44:00 +0000 (02:44 +0000)]
Fix comment.

8 years agoRename some directory index constants.
Pedro F. Giffuni [Sun, 24 Jan 2016 02:41:49 +0000 (02:41 +0000)]
Rename some directory index constants.

Directory index was introduced in ext3. We don't always use the
prefix to denote the ext2 variant they belong to but when we
do we should try to be accurate.

8 years agoext2: Initialize i_flag after allocation.
Pedro F. Giffuni [Sun, 24 Jan 2016 02:25:41 +0000 (02:25 +0000)]
ext2: Initialize i_flag after allocation.

We use i_flag to carry some flags like IN_E4INDEX which newer
ext2fs variants uses internally.

fsck.ext3 rightfully complains after our implementation tags
non-directory inodes with INDEX_FL.

Initializing i_flag during allocation removes the noise factor
and quiets down fsck.

Patch from: Damjan Jovanovic
PR: 206530

8 years agosh: Use OLDPWD shell variable for 'cd -'.
Jilles Tjoelker [Sat, 23 Jan 2016 23:00:38 +0000 (23:00 +0000)]
sh: Use OLDPWD shell variable for 'cd -'.

Per POSIX, 'cd -' should use the OLDPWD shell variable, not internal state.
This variable is normally exported.

Also, if OLDPWD is not set, fail 'cd -' instead of changing to the current
directory.

8 years agoUse different ports in the TCP/UDP testcases with the first set and
Enji Cooper [Sat, 23 Jan 2016 22:51:22 +0000 (22:51 +0000)]
Use different ports in the TCP/UDP testcases with the first set and
the second set (increment the original ports by 10)

This avoids issues where the first listening socket might not be torn
down by the time it makes it to the second set of testcases.

The sockets should likely only be setup once, but this keeps in the
spirit of the original testcases, so this will be easier to backport
to ^/stable/9

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division

8 years agoDon't run the t_cmsg_len testcase on 64-bit architectures
Enji Cooper [Sat, 23 Jan 2016 22:49:13 +0000 (22:49 +0000)]
Don't run the t_cmsg_len testcase on 64-bit architectures

It always fails when trying to send through the sendit(9) private KPI in the
kernel due to a size mismatch between the msghdr and data being sent [*], which
suspiciously seems like it's related to sizeof pointers instead of scalars, or
something of that ilk

MFC after: 1 week
PR: 206543, 206544 [*]
Sponsored by: EMC / Isilon Storage Division

8 years ago- Don't return immediately in check_xucred, check_scm_creds_cmsgcred, and
Enji Cooper [Sat, 23 Jan 2016 22:44:00 +0000 (22:44 +0000)]
- Don't return immediately in check_xucred, check_scm_creds_cmsgcred, and
  check_scm_creds_sockcred after initial != NULL checks have been done for
  debugging purposes
- Use more terse names for bintime (bt), cmesgcred (cmcred),
  sockcred (sc), and timeval (tv) [*]
- Add some debug messages to better understand some of the flow of the test
  program

MFC after: 1 week
Requested by: bde [*]
Use of the word "terse" (^.^) corrected by: jhb, rpokala [*]
Sponsored by: EMC / Isilon Storage Division

8 years agoDocument that hashinit(9) can wait for memory to be available
Benjamin Kaduk [Sat, 23 Jan 2016 20:01:46 +0000 (20:01 +0000)]
Document that hashinit(9) can wait for memory to be available

Also tweak nearby grammar while here.

Submitted by: Daniel O'Connor (original version)

8 years agoAdd a minimal gcc config for RISC-V.
Ruslan Bukin [Sat, 23 Jan 2016 15:33:11 +0000 (15:33 +0000)]
Add a minimal gcc config for RISC-V.
This is required to build csu.

Reviewed by: andrew
Sponsored by: DARPA, AFRL
Sponsored by: HEIF5
Differential Revision: https://reviews.freebsd.org/D5039

8 years agoUndo r294499 for now (which disabled -mlong-calls), so arm builds can
Dimitry Andric [Sat, 23 Jan 2016 14:17:21 +0000 (14:17 +0000)]
Undo r294499 for now (which disabled -mlong-calls), so arm builds can
succeed again.

8 years agoo Add gain-level control registers.
Ruslan Bukin [Sat, 23 Jan 2016 13:34:55 +0000 (13:34 +0000)]
o Add gain-level control registers.
o Fix style.

Sponsored by: Machdep, Inc.

8 years agoAdvertise support for ext3 and ext4.
Edward Tomasz Napierala [Sat, 23 Jan 2016 12:25:24 +0000 (12:25 +0000)]
Advertise support for ext3 and ext4.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

8 years agoDon't mention the "canonical six" in setfacl(1); it describes semantics
Edward Tomasz Napierala [Sat, 23 Jan 2016 12:19:37 +0000 (12:19 +0000)]
Don't mention the "canonical six" in setfacl(1); it describes semantics
that's long gone.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

8 years agoFix ru_oublocks accounting for ZFS. There are two code paths that can be
Edward Tomasz Napierala [Sat, 23 Jan 2016 12:13:09 +0000 (12:13 +0000)]
Fix ru_oublocks accounting for ZFS. There are two code paths that can be
called from zfs_write() - one of them, through dmu_write(), was handled
correctly; the other wasn't.

Reviewed by: avg@
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D4923

8 years agoAdd "kldstat -h"; showing module sizes in hex is rather weird.
Edward Tomasz Napierala [Sat, 23 Jan 2016 12:10:16 +0000 (12:10 +0000)]
Add "kldstat -h"; showing module sizes in hex is rather weird.

Reviewed by: emaste@ (earlier version)
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D4969

8 years agoFollow r293066 adding a generalized exec hook for RISC-V as well.
Ruslan Bukin [Sat, 23 Jan 2016 11:46:52 +0000 (11:46 +0000)]
Follow r293066 adding a generalized exec hook for RISC-V as well.

8 years agoRemove obsolete comment.
Dmitry Chagin [Sat, 23 Jan 2016 08:08:06 +0000 (08:08 +0000)]
Remove obsolete comment.

MFC after: 3 days

8 years agoFix a typo.
Dmitry Chagin [Sat, 23 Jan 2016 08:04:29 +0000 (08:04 +0000)]
Fix a typo.

MFC after: 3 days

8 years agoNow that the flashmap code knows about SPI flash, add it in builds.
Adrian Chadd [Sat, 23 Jan 2016 05:27:55 +0000 (05:27 +0000)]
Now that the flashmap code knows about SPI flash, add it in builds.

PR: kern/206227
Submitted by: Stanislav Galabov <sgalabov@gmail.com>

8 years agoTeach the flashmap code about the SPI flash.
Adrian Chadd [Sat, 23 Jan 2016 05:26:29 +0000 (05:26 +0000)]
Teach the flashmap code about the SPI flash.

PR: kern/206227
Submitted by: Stanislav Galabov <sgalabov@gmail.com>

8 years agoAdd an IOCTL rr_limit to let users fine tuning the number of packets to be
Marcelo Araujo [Sat, 23 Jan 2016 04:18:44 +0000 (04:18 +0000)]
Add an IOCTL rr_limit to let users fine tuning the number of packets to be
sent using roundrobin protocol and set a better granularity and distribution
among the interfaces. Tuning the number of packages sent by interface can
increase throughput and reduce unordered packets as well as reduce SACK.

Example of usage:
# ifconfig bge0 up
# ifconfig bge1 up
# ifconfig lagg0 create
# ifconfig lagg0 laggproto roundrobin laggport bge0 laggport bge1 \
192.168.1.1 netmask 255.255.255.0
# ifconfig lagg0 rr_limit 500

Reviewed by: thompsa, glebius, adrian (old patch)
Approved by: bapt (mentor)
Relnotes: Yes
Differential Revision: https://reviews.freebsd.org/D540

8 years agoFix a regression in the .de and .dk whois special cases
Tony Finch [Sat, 23 Jan 2016 01:20:58 +0000 (01:20 +0000)]
Fix a regression in the .de and .dk whois special cases

Ensure the special cases trigger whether we come via a referral
or via the -c option. Match host names case-insensitively.

Use the default character set supported by .de (UTF-8) since that
is more compatible with the modern world than ISO 8859-1. Persuade
them to give us a useful answer whether an internationalized
domain name is given in UTF-8 or in punycode.

8 years agoA lot of the cleverness in whois is no longer needed!
Tony Finch [Sat, 23 Jan 2016 00:28:18 +0000 (00:28 +0000)]
A lot of the cleverness in whois is no longer needed!

The IANA whois server has the right referral information for domain
names, IP addresses, and AS numbers, so whois does not need to be
able to choose servers itself (except for a few cases where referrals
do not work). We can delete a chunk of code, which is always fun.

This change improves the referral handling to be less sensitive to
all the various formats, and to allow multi-hop referral chains,
such as IANA -> registry -> registrar.

ARIN queries have the "+" flag added if no flags are present, so we
get full details if the query matches multiple objects. The Verisign
anti-spam logic is also now suppressed if the user provided a non-
trivial query string.

Uninformative rubric is now trimmed by default. The -S option
turns off trimming, and disables query fettling.

The -i option is back to its traditional pre-1999 hostname, since
whois.internic.net is more useful than whois.networksolutions.com.
Note that the old fallback/default server whois.crsnic.net is an
alias for whois.internic.net.

The manual is more informative about query syntax.

8 years agoFix for iWARP servers that listen on INADDR_ANY.
Navdeep Parhar [Fri, 22 Jan 2016 23:33:34 +0000 (23:33 +0000)]
Fix for iWARP servers that listen on INADDR_ANY.

The iWARP Connection Manager (CM) on FreeBSD creates a TCP socket to
represent an iWARP endpoint when the connection is over TCP. For
servers the current approach is to invoke create_listen callback for
each iWARP RNIC registered with the CM. This doesn't work too well for
INADDR_ANY because a listen on any TCP socket already notifies all
hardware TOEs/RNICs of the new listener. This patch fixes the server
side of things for FreeBSD. We've tried to keep all these modifications
in the iWARP/TCP specific parts of the OFED infrastructure as much as
possible.

Submitted by: Krishnamraju Eraparaju @ Chelsio (with design inputs from Steve Wise)
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D4801

8 years agoUpdate llvm and clang to release_38 branch r258549.
Dimitry Andric [Fri, 22 Jan 2016 21:50:08 +0000 (21:50 +0000)]
Update llvm and clang to release_38 branch r258549.