]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agoDisable GNU rcs by default
bapt [Sun, 18 Sep 2016 15:01:11 +0000 (15:01 +0000)]
Disable GNU rcs by default

All remaining tools using rcs has been switched to directly use diff3(1):
- etcupdate(8)
- freebsd-update(8)

Note that the ident(1) tool is been already replaced long ago with a BSD
licensed version, as such it remains installed.

GNU rcs is still available from ports:
- rcs: newer GPLv3 version
- rcs57: the latest version from base (GPLv2)

7 years agoIn preparation for removal of GNU rcs, replace merge(1) usage with direct
bapt [Sun, 18 Sep 2016 14:48:28 +0000 (14:48 +0000)]
In preparation for removal of GNU rcs, replace merge(1) usage with direct
diff3(1) usage

7 years agoRemove backup_uses_rcs from rc.subr
bapt [Sun, 18 Sep 2016 12:49:23 +0000 (12:49 +0000)]
Remove backup_uses_rcs from rc.subr

In preparation for the removal of GNU rcs from base, remove the backup_uses_rcs
functionality from the rc.subr backup_file feature. This functionnality was off
by default

Reviewed by: wblock
Differential Revision: https://reviews.freebsd.org/D7883

7 years agoAdd very preliminary support for CloudABI for ARMv6.
ed [Sun, 18 Sep 2016 11:36:54 +0000 (11:36 +0000)]
Add very preliminary support for CloudABI for ARMv6.

In order to make CloudABI work on ARMv6, start off by copying over the
sysvec for ARM64 and adjust it to use 32-bit registers. Also add code
for fetching arguments from the stack if needed, as there are fewer
register than on ARM64.

Also import the vDSO that is needed to invoke system calls. This vDSO
uses the intra procedure call register (ip) to store the system call
number. This is a bit simpler than what native FreeBSD does, as FreeBSD
uses r7, while preserving the original r7 into ip.

This sysvec seems to be complete enough to start CloudABI processes.
These processes are capable of linking in the vDSO and are therefore
capable of executing (most?) system calls successfully. Unfortunately,
the biggest show stopper is still that TLS is completely broken:

- The linker used by CloudABI, LLD, still has troubles with some of the
  relocations needed for TLS. See LLVM bug 30218 for more details.

- Whereas FreeBSD uses the tpidruro register for TLS, for CloudABI I
  want to make use of tpidrurw, so that userspace can modify the base
  address directly. This is needed for efficient emulation.
  Unfortunately, this register doesn't seem to be preserved across
  context switches yet.

Obtained from: https://github.com/NuxiNL/cloudabi (the vDSO)

7 years agoRemove reference of z(s)diff which was dropped before importing
bapt [Sun, 18 Sep 2016 10:06:35 +0000 (10:06 +0000)]
Remove reference of z(s)diff which was dropped before importing

7 years agohyperv/hn: Add sysctls to dynamic adjust RSS key and indirect table
sephe [Sun, 18 Sep 2016 08:19:33 +0000 (08:19 +0000)]
hyperv/hn: Add sysctls to dynamic adjust RSS key and indirect table

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7890

7 years agohyperv/hn: Don't mess up RSS key and indirect table after attachment.
sephe [Sun, 18 Sep 2016 08:10:40 +0000 (08:10 +0000)]
hyperv/hn: Don't mess up RSS key and indirect table after attachment.

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7889

7 years agohyperv/hn: Put debug message under bootverbose
sephe [Sun, 18 Sep 2016 07:47:57 +0000 (07:47 +0000)]
hyperv/hn: Put debug message under bootverbose

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7875

7 years agohyperv/hn: Regroup ifnet setup code.
sephe [Sun, 18 Sep 2016 07:37:59 +0000 (07:37 +0000)]
hyperv/hn: Regroup ifnet setup code.

While I'm here, add comment along the attach DEVMETHOD.

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7874

7 years agoFix LINT building.
sephe [Sun, 18 Sep 2016 07:37:00 +0000 (07:37 +0000)]
Fix LINT building.

Sponsored by: Microsoft

7 years agoSimilar to r305920, remove spurious newlines from ATF_REQUIRE_MSG calls
ngie [Sun, 18 Sep 2016 06:00:07 +0000 (06:00 +0000)]
Similar to r305920, remove spurious newlines from ATF_REQUIRE_MSG calls

MFC after: 1 week
Sponsored by: Dell EMC Isilon

7 years agoRemove spurious newlines from atf_tc_fail calls
ngie [Sun, 18 Sep 2016 05:54:13 +0000 (05:54 +0000)]
Remove spurious newlines from atf_tc_fail calls

This changes the results from broken (incorrect) to failed (correct) on
i386

MFC after: 1 week
Sponsored by: Dell EMC Isilon

7 years agoDon't define PACKAGE in lib/libc/tests/{iconv,net/getaddrinfo}
ngie [Sun, 18 Sep 2016 05:12:23 +0000 (05:12 +0000)]
Don't define PACKAGE in lib/libc/tests/{iconv,net/getaddrinfo}
needlessly

This is already being done by bsd.test.mk

The other subdirectory Makefiles were intentionally left alone

MFC after: 1 week
Sponsored by: Dell EMC Isilon

7 years agoOnly chmod $TMPDIR if it's not /tmp
ngie [Sun, 18 Sep 2016 05:10:15 +0000 (05:10 +0000)]
Only chmod $TMPDIR if it's not /tmp

This is a safety belt to ensure that the /tmp sticky bit stuff doesn't
get whacked by accident if someone runs the script outright

MFC after: 1 week
X-MFC with: r305916
Sponsored by: Dell EMC Isilon

7 years ago[iwm] fix up RSSI calculations for both scan results and normal RX operations.
adrian [Sun, 18 Sep 2016 05:07:18 +0000 (05:07 +0000)]
[iwm] fix up RSSI calculations for both scan results and normal RX operations.

* hard code a noise floor of -96 for now. The noise floor update code returns
  some "interesting" values that I can't map to anything useful right now.
* Ensure a default noise floor is set - otherwise the initial scan results
  have a noise floor of '0'.
* Fix up the RSSI calculation to be correctly relative to the noise floor.
  The RSSI routines return an absolute value in dBm - so fix this up.
* Cap RSSI values appropriately.
* Ensure we pass in a 1/2 dB unit value in to net80211.

Tested:

* Intel 7260, STA mode

iwm0: <Intel Dual Band Wireless AC 7260> mem 0xf1400000-0xf1401fff irq 17 at device 0.0 on pci2
iwm0: hw rev 0x140, fw ver 16.242414.0, address xx:xx:xx:xx:xx:xx

7 years agoMake sure $TMPDIR is created with 0755 permissions
ngie [Sun, 18 Sep 2016 05:06:15 +0000 (05:06 +0000)]
Make sure $TMPDIR is created with 0755 permissions

This is required to ensure that the temporary script can be executed,
as the default mode is apparently too restrictive

MFC after: 3 days
Sponsored by: Dell EMC Isilon

7 years agocxgbe/t4_tom: Update the active/passive open code to support T6. Data
np [Sat, 17 Sep 2016 23:08:49 +0000 (23:08 +0000)]
cxgbe/t4_tom: Update the active/passive open code to support T6.  Data
path works as-is.

Sponsored by: Chelsio Communications

7 years agobhnd(4): Fix regression in BCM4331 SPROM pin reference counting.
landonf [Sat, 17 Sep 2016 22:18:32 +0000 (22:18 +0000)]
bhnd(4): Fix regression in BCM4331 SPROM pin reference counting.

In r304870, refcount handling was lifted out into a common OTP/SPROM code
path, but the refcount assertions in chipc_disable_sprom_pins() were not
updated accordingly; this triggered an assertion on BCM4331 devices when
releasing a SPROM pin reservation.

Approved by: adrian (mentor, implicit)

7 years agocxgbe/t4_tom: The SMAC entry for a VI is at a different location in the T6.
np [Sat, 17 Sep 2016 22:13:03 +0000 (22:13 +0000)]
cxgbe/t4_tom: The SMAC entry for a VI is at a different location in the T6.

Sponsored by: Chelsio Communications

7 years agobapt stepped down from portmgr
rene [Sat, 17 Sep 2016 21:49:11 +0000 (21:49 +0000)]
bapt stepped down from portmgr

7 years agoFix libprocstat build after r305902.
kib [Sat, 17 Sep 2016 18:14:31 +0000 (18:14 +0000)]
Fix libprocstat build after r305902.
- Use _Bool to not require userspace to include stdbool.h.
- Make extattr.h usable without vnode_if.h.
- Follow i_ump to get cdev pointer.

Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

7 years agoReduce size of ufs inode.
kib [Sat, 17 Sep 2016 16:47:34 +0000 (16:47 +0000)]
Reduce size of ufs inode.

Remove redunand i_dev and i_fs pointers, which are available as
ip->i_ump->um_dev and ip->i_ump->um_fs, and reorder members by size to
reduce padding.  To compensate added derefences, the most often i_ump
access to differentiate between UFS1 and UFS2 dinode layout is
removed, by addition of the new i_flag IN_UFS2.  Overall, this
actually reduces the amount of memory dereferences.

On 64bit machine, original struct inode size is 176, reduced to 152
bytes with the change.

Tested by: pho (previous version)
Reviewed by: mckusick
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

7 years agoCreate aliases for named virtio-console ports.
jceel [Sat, 17 Sep 2016 16:03:33 +0000 (16:03 +0000)]
Create aliases for named virtio-console ports.

Make virtio_console(4) create `/dev/vtcon/<port_name>` alias pointing
to /dev/ttyVx.y upon receiving PORT_NAME (id = 7) event over the control
queue.

Approved by: trasz
MFC after: 1 month
Sponsored by: iXsystems, Inc.
Differential Revision: https://reviews.freebsd.org/D7182

7 years agoRemove all kernel uses of pcb_psl, but keep in in the struct to
bde [Sat, 17 Sep 2016 14:00:52 +0000 (14:00 +0000)]
Remove all kernel uses of pcb_psl, but keep in in the struct to
preserve the ABI and API for applications.  It was removed in the port
to amd64, but was remained as garbage giving a micro-pessimization and
spurious single-step traps on i386.

pcb_psl was intended to be used just to do a context switch of PSL_I,
but this context switch was null in most or all versions, and
mis-switching of PSL_T was done instead.

Some history:
- in 386BSD-0.0, cpu_switch() ran at splhigh() and splhigh() did too
  much interrupt disabling, so interrupts were hard-disabled across
  cpu_switch() and too many other places
- in 386BSD-0.0-patchkit through FreeBSD-4 and FreeBSD-5 before
  SMPng, splhigh() did soft interrupt masking, and cpu_switch() was
  excessively cautious and did a cli at the start and a sti at the
  end to hard-disable interrupts across the switch
- SMPng replaced the spl's and cli's by spinlocks (just sched_lock?),
  so interrupts were hard-disabled across cpu_switch() and too many
  other places again
- initial attempts to fix this intended to restore some soft
  interrupt disabling, but to support variations in this cpu_switch()
  used pushfl/popfl into pcb_psl to avoid hard-coding the assumption
  that the initial and final states have PSL_I enabled.  But the
  version with soft interrupt disabling wasn't used for long, or was
  never committed, (except I always used my different version of it
  for UP) so the pushfl/popl and pcb_psl to hold them have been doing
  less than nothing for about 14 years.

7 years agoAdd virtio-console support to bhyve.
jceel [Sat, 17 Sep 2016 13:48:01 +0000 (13:48 +0000)]
Add virtio-console support to bhyve.

Adds virtio-console device support to bhyve, allowing to create
bidirectional character streams between host and guest.

Syntax:
-s <slotnum>,virtio-console,port1=/path/to/port1.sock,anotherport=...

Maximum of 16 ports per device can be created. Every port is named
and corresponds to an Unix domain socket created by bhyve. bhyve
accepts at most one connection per port at a time.

Limitations:
- due to lack of destructors of in bhyve, sockets on the filesystem
  must be cleaned up manually after bhyve exits
- there's no way to use "console port" feature, nor the console port
  resize as of now
- emergency write is advertised, but no-op as of now

Approved by: trasz
MFC after: 1 month
Relnotes: yes
Sponsored by: iXsystems, Inc.
Differential Revision: D7185

7 years agoSilently ignore unexpected single-step traps (except for turning
bde [Sat, 17 Sep 2016 11:43:51 +0000 (11:43 +0000)]
Silently ignore unexpected single-step traps (except for turning
off single-stepping).  Only do this on arches (only x86 so far)
which classify single-step traps unambiguously.

This allows other parts of the kernel to be intentionally and
unintentionally sloppy about generating single-step traps.  On
x86, at least the following places were unintentionally sloppy:
- all operations that context-switched [er]flags.  Especially
  spinlock_enter()/exit() and cpu_switch().  When single-stepped,
  saving the flags leaves PSL_T set in the saved flags, so
  restoring gives a trap that is spurious if it occurs after
  single-step mode has been left.  Switching contexts away from
  a low priority thread gives especially long-lived saved copies.
- the vm86 emulation allows user mode to set PSL_T.  This was
  correct until vm86 bios call mode was unintentionally given
  access to kdb handling its single-step traps.
Now these places are intentionally sloppy, but unexpected
debugger traps still cause panics if no debugger that handles
the trap is attached when the trap is delivered.

7 years agoImplement BLKSSZGET ioctl for the Linuxulator.
dchagin [Sat, 17 Sep 2016 08:10:01 +0000 (08:10 +0000)]
Implement BLKSSZGET ioctl for the Linuxulator.

PR: 212700
Submitted by: Erik Cederstrand
Reported by: Erik Cederstrand
MFC after: 1 week

7 years ago[net80211] add a HT method to populate HTCAP based on IBSS requirements.
adrian [Sat, 17 Sep 2016 05:44:57 +0000 (05:44 +0000)]
[net80211] add a HT method to populate HTCAP based on IBSS requirements.

IBSS negotiation is a subset of the STA/AP negotiation.  We always have a
current channel, so base the HT capabilities on the current channel.
This is then put into IBSS probe requests to inform peers of our
11n capabilities.

7 years agoIncrease the boot1 file size on the HFS boot image.
jhibbits [Fri, 16 Sep 2016 22:51:37 +0000 (22:51 +0000)]
Increase the boot1 file size on the HFS boot image.

The boot1.elf is too fat for 30k, it's not 32k on powerpc64, and 34k on powerpc.
Without this, boot1 will fail with odd behaviors.

MFC after: 1 day

7 years agoUpdate history. Patch supplied by Sevan Janiyan <venture37@geeklan.co.uk>.
wblock [Fri, 16 Sep 2016 14:23:16 +0000 (14:23 +0000)]
Update history.  Patch supplied by Sevan Janiyan <venture37@geeklan.co.uk>.

PR: 181390
Submitted by: ksmakoto@dd.iij4u.or.jp
MFC after: 1 week

7 years agomlx5en: Fix duplicate mbuf free-by-code.
hselasky [Fri, 16 Sep 2016 11:57:48 +0000 (11:57 +0000)]
mlx5en: Fix duplicate mbuf free-by-code.

When mlx5e_sq_xmit() returns an error code and the mbuf pointer is set,
we should not free the mbuf, because the caller will keep the mbuf in
the drbr. Make sure the mbuf pointer is correctly set upon function
exit.

Sponsored by: Mellanox Technologies
MFC after: 1 week

7 years agomlx5en: Remove unused pdev pointer.
hselasky [Fri, 16 Sep 2016 11:55:38 +0000 (11:55 +0000)]
mlx5en: Remove unused pdev pointer.

Sponsored by: Mellanox Technologies
MFC after: 1 week

7 years agomlx5en: Verify port type is ethernet before creating network device
hselasky [Fri, 16 Sep 2016 11:53:53 +0000 (11:53 +0000)]
mlx5en: Verify port type is ethernet before creating network device

Else the mlx5en driver might attach to infiniband ports.

Sponsored by: Mellanox Technologies
MFC after: 1 week

7 years agomlx5en: Allow setting the software MTU size below 1500 bytes
hselasky [Fri, 16 Sep 2016 11:51:31 +0000 (11:51 +0000)]
mlx5en: Allow setting the software MTU size below 1500 bytes

The hardware MTU size can't be set to a value less than 1500 bytes due
to side-band management support. Allow setting the software MTU size
below 1500 bytes, thus creating a mismatch between hardware and
software MTU sizes.

Sponsored by: Mellanox Technologies
MFC after: 1 week

7 years agomlx5en: Factor out common sendqueue code for use with rate limiting SQs.
hselasky [Fri, 16 Sep 2016 11:47:16 +0000 (11:47 +0000)]
mlx5en: Factor out common sendqueue code for use with rate limiting SQs.

Try to reuse code to setup sendqueues when possible by making some static
functions global. Further split the mlx5e_close_sq_wait() function to
separate out reusable parts.

Sponsored by: Mellanox Technologies
MFC after: 1 week

7 years agomlx5en: Properly declare doorbell lock for 32-bit CPUs.
hselasky [Fri, 16 Sep 2016 11:45:35 +0000 (11:45 +0000)]
mlx5en: Properly declare doorbell lock for 32-bit CPUs.

Sponsored by: Mellanox Technologies
MFC after: 1 week

7 years agomlx5en: Optimise away duplicate UAR pointers.
hselasky [Fri, 16 Sep 2016 11:40:45 +0000 (11:40 +0000)]
mlx5en: Optimise away duplicate UAR pointers.

This change also reduces the size of the mlx5e_sq structure so that the last
queue_state element will fit into the previous cacheline and then the mlx5e_sq
structure becomes one cacheline less for amd64.

Sponsored by: Mellanox Technologies
MFC after: 1 week

7 years agomlx5en: Make the mlx5e_open_cq() and mlx5e_close_cq() functions global.
hselasky [Fri, 16 Sep 2016 11:39:15 +0000 (11:39 +0000)]
mlx5en: Make the mlx5e_open_cq() and mlx5e_close_cq() functions global.

Make some functions and structures global to allow for code reuse
when creating rate limiting sendqueues.

Sponsored by: Mellanox Technologies
MFC after: 1 week

7 years agomlx5en: Minor completion queue control path code refactor.
hselasky [Fri, 16 Sep 2016 11:37:35 +0000 (11:37 +0000)]
mlx5en: Minor completion queue control path code refactor.

Move setting of CQ moderation mode together with the other
CQ moderation parameters. Pass completion event vector as
a separate argument to mlx5e_open_cq(), because its value is
different for each call. Pass mlx5e_priv pointer instead of
mlx5e_channel pointer so that code can be used by rate
limiting sendqueues.

Sponsored by: Mellanox Technologies
MFC after: 1 week

7 years agomlx5en: Separate the sendqueue from using the mlx5e_channel structure.
hselasky [Fri, 16 Sep 2016 11:35:45 +0000 (11:35 +0000)]
mlx5en: Separate the sendqueue from using the mlx5e_channel structure.

This change allows for reusing the transmit path for so called
rate limited senqueues. While at it optimise some pointer lookups
in the fast path.

Sponsored by: Mellanox Technologies
MFC after: 1 week

7 years agoUpdate the MLX5 core module:
hselasky [Fri, 16 Sep 2016 11:28:16 +0000 (11:28 +0000)]
Update the MLX5 core module:
- Add new firmware commands and update existing ones.
- Add more firmware related structures and update existing ones.
- Some minor fixes, like adding missing \n to some prints.

Sponsored by: Mellanox Technologies
MFC after: 1 week

7 years agoFix decoding of tf_rsp on amd64, and move TF_HAS_STACKREGS() to the
bde [Fri, 16 Sep 2016 07:09:35 +0000 (07:09 +0000)]
Fix decoding of tf_rsp on amd64, and move TF_HAS_STACKREGS() to the
i386-only section, and fix a comment about the amd64 kernel trapframe
not having stackregs.

tf_rsp doesn't need decoding on amd64, but had an old clone of i386
code to do this in 1 place, and since the amd64 kernel trapframe does
have stackregs, the result was an off-by-16 error for %rsp in an error
message.

7 years agoStatically initialize the run mode to the one that will become
bde [Fri, 16 Sep 2016 06:31:10 +0000 (06:31 +0000)]
Statically initialize the run mode to the one that will become
current on first entry.  This fixes a spurious "Stepping aborted"
message when the first entry is for a breakpoint.

Don't reset to the run mode to STEP_NONE when stopping, and remove
STEP_NONE.  This mode was never really used, except transiently to
mis-decide whether to print the message on first entry.

7 years agoInvert calloc(3) argument order.
araujo [Fri, 16 Sep 2016 05:33:08 +0000 (05:33 +0000)]
Invert calloc(3) argument order.

Reviewed by: ed.
MFC after: 4 weeks.
Differential Revision: https://reviews.freebsd.org/D7902

7 years ago(1) Ifdef the new dr6 variable for KDB.
bde [Fri, 16 Sep 2016 04:58:37 +0000 (04:58 +0000)]
(1) Ifdef the new dr6 variable for KDB.

While here, avoid using the old variable 'code' and remove it
in trap().  ('code' was meant for holding things like %dr6,
but is too small to hold %dr6 on amd64 and was reduced to an
obfuscation of tf_err, with early truncation on amd64.)

Submitted by: Michael Butler (imb@...)

7 years agoAdd missing history sections to a number of storage related man pages
allanjude [Fri, 16 Sep 2016 04:28:31 +0000 (04:28 +0000)]
Add missing history sections to a number of storage related man pages

gmultipath.8: Add HISTORY
Adjust sentences with bad phrases picked up by igor

ggatec.8: Add HISTORY

ggated.8: Add HISTORY

ggatel.8: Add HISTORY
Seperate out sentence as advised by igor.

hastctl.8: Add HISTORY

hastd.8: Add HISTORY
Fix sentence highlighted by igor.

iscontrol.8: Add HISTORY

mdmfs.8: Add HISTORY
Address issues raised by igor

mount_nfs.8: Add HISTORY
Not sure where mount_nfs first showed up, but the verison used
in the BSD's originates from 4.4BSD according to CSRG archive.

Though commercial offerings from Sun and others covers older
systems, eg https://groups.google.com/forum/#!topic/net.unix-wizards/lMe7aQikqJI

nandfs.8: Add HISTORY
Adjust sentence in description to address bad phrase highlighted
by igor.

nvmecontrol.8: Add HISTORY

PR: 212491
PR: 212498
PR: 212499
PR: 212500
PR: 212501
PR: 212502
PR: 212505
PR: 212508
PR: 212540
PR: 212543
PR: 212546
Submitted by: Sevan Janiyan <venture37@geeklan.co.uk>

7 years agoAdd an option called "random" that combined with "ether" can generate a
araujo [Fri, 16 Sep 2016 04:22:21 +0000 (04:22 +0000)]
Add an option called "random" that combined with "ether" can generate a
random MAC address for an Ethernet interface.

PR: 211984
Submitted by: pi@
Reviewed by: gnn, cem, jhb, lidl, rpokala, wblock
Approved by: wblock (manpages)

7 years agosbin/umount/umount.8: Amend HISTORY
allanjude [Fri, 16 Sep 2016 04:12:32 +0000 (04:12 +0000)]
sbin/umount/umount.8: Amend HISTORY

umount first appeared in V1, confirmed using TUHS archive
http://minnie.tuhs.org/cgi-bin/utree.pl?file=V1/man/man1/umount.1

PR: 212554
Submitted by: Sevan Janiyan <venture37@geeklan.co.uk>

7 years agosbin/reboot/reboot.8: Amend HISTORY
allanjude [Fri, 16 Sep 2016 04:11:04 +0000 (04:11 +0000)]
sbin/reboot/reboot.8: Amend HISTORY

A standalone reboot utility showed up in 4.0BSD, in AT&T UNIX init has a
case for reboot and is present in the version shipped with V5

either way, current entry is incorrect.

PR: 212548
Submitted by: Sevan Janiyan <venture37@geeklan.co.uk>

7 years agosbin/rcorder/rcorder.8: Amend HISTORY
allanjude [Fri, 16 Sep 2016 04:08:34 +0000 (04:08 +0000)]
sbin/rcorder/rcorder.8: Amend HISTORY

rcorder appeared in FreeBSD 5.0.
Address issues raised by igor.

PR: 212547
Submitted by: Sevan Janiyan <venture37@geeklan.co.uk>

7 years agolinprocfs: garbage collect meminfo fields not present in linux
mjg [Fri, 16 Sep 2016 03:36:43 +0000 (03:36 +0000)]
linprocfs: garbage collect meminfo fields not present in linux

In particular memshared not only does not exist in linux, it was
extremely expensive to calculate.

7 years agoWhen MAKEOBJDIRPREFIX points to a case-insensitive file system, the
marcel [Fri, 16 Sep 2016 03:04:48 +0000 (03:04 +0000)]
When MAKEOBJDIRPREFIX points to a case-insensitive file system, the
build can break when different source files create the same object
files (case-insensitivity speaking).  This is the case for _Exit.c
and _exit.s.  Compile _Exit.c as C99_Exit.c

Reviewed by: sjg@
MFC after: completion
Sponsored by: Bracket Computing
Differential Revision: https://reviews.freebsd.org/D7893

7 years agoUse arch-specific .text padding fill value in EFI loaders
emaste [Fri, 16 Sep 2016 01:38:22 +0000 (01:38 +0000)]
Use arch-specific .text padding fill value in EFI loaders

The fill pattern was previously an ia64 instruction sequence. Presumably
ia64's linker script was copied as a starting point.

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

7 years agocxgbe(4): Attach to cards with the Terminator 6 ASIC. T6 cards will
np [Fri, 16 Sep 2016 00:08:37 +0000 (00:08 +0000)]
cxgbe(4): Attach to cards with the Terminator 6 ASIC.  T6 cards will
come up as 't6nex' nexus devices with 'cc' ports hanging off them.

The T6 firmware and configuration files will be added as soon as they
are released.  For now the driver will try to work with whatever
firmware and configuration is on the card's flash.

Sponsored by: Chelsio Communications

7 years agoWhitespace nits.
np [Thu, 15 Sep 2016 22:31:49 +0000 (22:31 +0000)]
Whitespace nits.

7 years agonet80211: allow to override SWCRYPT/SWMIC bits in the driver
avos [Thu, 15 Sep 2016 22:27:00 +0000 (22:27 +0000)]
net80211: allow to override SWCRYPT/SWMIC bits in the driver

Add IEEE80211_KEY_SWCRYPT / IEEE80211_KEY_SWMIC bits to the
IEEE80211_KEY_DEVICE mask - as a result, those bits will be preserved
during group key handshake.

A driver can override them in iv_key_alloc() for some keys in case
when hardware crypto support is not possible. As an example:
 - multi-vap without multicast key search support;
 - IBSS RSN for devices w/ fixed storage for group keys;

Tested with RTL8188EU (AP, sw crypto) and
RTL8821AU (STA, sw crypto for group keys + hw crypto for pairwise keys)

Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D7901

7 years agoDecode some REX prefixes in inst_call(). This makes the 'next' and
bde [Thu, 15 Sep 2016 18:30:53 +0000 (18:30 +0000)]
Decode some REX prefixes in inst_call().  This makes the 'next' and
'until' commands work in more cases.

7 years agoThe TLS offset is a property of the process ABI.
brooks [Thu, 15 Sep 2016 17:25:52 +0000 (17:25 +0000)]
The TLS offset is a property of the process ABI.

Move to a per-proc TLS offset rather than incorrectly keying off the
presense of freebsd32 compability in the kernel.

Reviewed by: adrian, sbruno
Obtained from: CheriBSD
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D7843

7 years agoImplement multibyte encoding support for -v with fallback
ache [Thu, 15 Sep 2016 17:24:39 +0000 (17:24 +0000)]
Implement multibyte encoding support for -v with fallback

MFC after:      7 days

7 years agoAbort single stepping in ddb if the trap is not for single-stepping.
bde [Thu, 15 Sep 2016 17:24:23 +0000 (17:24 +0000)]
Abort single stepping in ddb if the trap is not for single-stepping.
This is not very easy to do, since ddb didn't know when traps are
for single-stepping.  It more or less assumed that traps are either
breakpoints or single-step, but even for x86 this became inadequate
with the release of the i386 in ~1986, and FreeBSD passes it other
trap types for NMIs and panics.

On x86, teach ddb when a trap is for single stepping using the %dr6
register.  Unknown traps are now treated almost the same as breakpoints
instead of as the same as single-steps.  Previously, the classification
of breakpoints was almost correct and everything else was unknown so
had to be treated as a single-step.  Now the classification of single-
steps is precise, the classification of breakpoints is almost correct
(as before) and everything else is unknown and treated like a
breakpoint.

This fixes:
- breakpoints not set by ddb, including the main one in kdb_enter(),
  were treated as single-steps and not stopped on when stepping
  (except for the usual, simple case of a step with residual count 1).
  As special cases, kdb_enter() didn't stop for fatal traps or panics
- similarly for "hardware breakpoints".

Use a new MD macro IS_SSTEP_TRAP(type, code) to code to classify
single-steps.  This is excessively complicated for bug-for-bug and
backwards compatibilty.  Design errors apparently started in Mach
in ~1990 or perhaps in the FreeBSD interface in ~1993.  Common trap
types like single steps should have a unique MI code (like the TRAP*
codes for user SIGTRAP) so that debuggers don't need macros like
IS_SSTEP_TRAP() to decode them.  But 'type' is actually an ambiguous
MD trap number, and code was always 0 (now it is (int)%dr6 on x86).
So it was impossible to determine the trap type from the args.
Global variables had to be used.

There is already a classification macro db_pc_is_single_step(), but
this just gets in the way.  It is only used to recover from bugs in
IS_BREAKPOINT_TRAP().  On some arches, IS_BREAKPOINT_TRAP() just
duplicates the ambiguity in 'type' and misclassifies single-steps as
breakpoints.  It defaults to 'false', which is the opposite of what is
needed for bug-for-bug compatibility.

When this is cleaned up, MI classification bits should be passed in
'code'.  This could be done now for positive-logic bits, since 'code'
was always 0, but some negative logic is needed for compatibility so
a simple MI classificition is not usable yet.

After reading %dr6, clear the single-step bit in it so that the type
of the next debugger trap can be decoded.  This is a little
ddb-specific.  ddb doesn't understand the need to clear this bit and
doing it before calling kdb is easiest.  gdb would need to reverse
this to support hardware breakpoints, but it just doesn't support
them now since gdbstub doesn't support %dr*.

Fix a bug involving %dr6: when emulating a single-step trap for vm86,
set the bit for it in %dr6.  Userland debuggers need this.  ddb now
needs this for vm86 bios calls.  The bit gets copied to 'code' then
cleared again.

Fix related style bugs:
- when clearing bits for hardware breakpoints in %dr6, spell the mask
  as ~0xf on both amd64 and i386 to get the correct number of bits
  using sign extension and not need a comment about using the wrong
  mask on amd64 (amd64 traps for invalid results but clearing the
  reserved top bits didn't trap since they are 0).
- rewrite my old wrong comments about using %dr6 for ddb watchpoints.

7 years agoRemove 'cpu' and 'cpu_class' on amd64.
jhb [Thu, 15 Sep 2016 17:05:54 +0000 (17:05 +0000)]
Remove 'cpu' and 'cpu_class' on amd64.

The 'cpu' and 'cpu_class' variables were always set to the same value
on amd64 and are legacy holdovers from i386.  Remove them entirely on
amd64.

Reviewed by: imp, kib (older version)
Differential Revision: https://reviews.freebsd.org/D7888

7 years agoChange the getnewvnode(9) tag for nullfs from "null" to "nullfs".
trasz [Thu, 15 Sep 2016 13:57:37 +0000 (13:57 +0000)]
Change the getnewvnode(9) tag for nullfs from "null" to "nullfs".
It's more consistent, and besides, the "null" alone looks weird.

MFC after: 1 month

7 years agoBump __FreeBSD_version for r305824.
kevlo [Thu, 15 Sep 2016 13:40:36 +0000 (13:40 +0000)]
Bump __FreeBSD_version for r305824.

Suggested by: ngie

7 years agoRenumber license clauses in sys/kern to avoid skipping #3
emaste [Thu, 15 Sep 2016 13:16:20 +0000 (13:16 +0000)]
Renumber license clauses in sys/kern to avoid skipping #3

7 years agocxgbe(4): Use the interface's viid to calculate the PF/VF/VFValid fields
np [Thu, 15 Sep 2016 08:30:47 +0000 (08:30 +0000)]
cxgbe(4): Use the interface's viid to calculate the PF/VF/VFValid fields
to use in tx work requests.

7 years agoRemove the 4.3BSD compatible macro m_copy(), use m_copym() instead.
kevlo [Thu, 15 Sep 2016 07:41:48 +0000 (07:41 +0000)]
Remove the 4.3BSD compatible macro m_copy(), use m_copym() instead.

Reviewed by: gnn
Differential Revision: https://reviews.freebsd.org/D7878

7 years agosdiff: improve errx string
emaste [Thu, 15 Sep 2016 02:48:56 +0000 (02:48 +0000)]
sdiff: improve errx string

errx() appends a newline so \n is superfluous. Also switch to lower case
with no period for consistency with other errx strings.

7 years agobspatch: use #define for header size instead of magic number
emaste [Thu, 15 Sep 2016 01:58:12 +0000 (01:58 +0000)]
bspatch: use #define for header size instead of magic number

Reviewed by: allanjude, kib
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D7861

7 years agologin: clean up errx strings
emaste [Thu, 15 Sep 2016 01:55:18 +0000 (01:55 +0000)]
login: clean up errx strings

errx() prefixes the error string with argv[0] so including "login: "
in the string is redundant. Also remove a superfluous newline.

Sponsored by: The FreeBSD Foundation

7 years agoOnly define db_show_spr if DDB is enabled.
jhibbits [Wed, 14 Sep 2016 23:24:23 +0000 (23:24 +0000)]
Only define db_show_spr if DDB is enabled.

PR: 212667
Reported by: Kenneth Salerno <kennethsalerno_AT_yahoo_dot_com>

7 years agoMFV r305816:
mm [Wed, 14 Sep 2016 21:15:01 +0000 (21:15 +0000)]
MFV r305816:
Sync libarchive with vendor including important security fixes.

Issues fixed (FreeBSD):
PR #778: ACL error handling
Issue #745: Symlink check prefix optimization is too aggressive
Issue #746: Hard links with data can evade sandboxing restrictions

This update fixes the vulnerability #3 and vulnerability #4 as reported in
"non-cryptanalytic attacks against FreeBSD update components".
https://gist.github.com/anonymous/e48209b03f1dd9625a992717e7b89c4f

Fix for vulnerability #2 has already been merged in r304989.

MFC after: 1 week
Security: http://gist.github.com/anonymous/e48209b03f1dd9625a992717e7b89c4f

7 years agovtfontcvt: remove superfluous newlines in errx messages
emaste [Wed, 14 Sep 2016 18:22:12 +0000 (18:22 +0000)]
vtfontcvt: remove superfluous newlines in errx messages

7 years agoufsread: Do not cast struct direct from void *
manu [Wed, 14 Sep 2016 17:43:32 +0000 (17:43 +0000)]
ufsread: Do not cast struct direct from void *
This cause alignment problem on ARM (and possibly other archs), instead copy it.

MFC after: 1 week

7 years agolocaledef(1): make better use of calloc(3) arguments.
pfg [Wed, 14 Sep 2016 16:47:18 +0000 (16:47 +0000)]
localedef(1): make better use of calloc(3) arguments.

The first argument of calloc(3) should be an ordinal type, and the
second a size: split a multiplication to make better use of calloc(3)
and detect overflows.

Do some other re-ordering and style fixes while here.

MFC after: 3 weeks

7 years agofifolog(1): invert order of calloc(3) arguments.
pfg [Wed, 14 Sep 2016 16:34:52 +0000 (16:34 +0000)]
fifolog(1): invert order of calloc(3) arguments.

The second argment to calloc(3) should be the size, make it so.

While here be a little bit more cautious in fifolog_reader_open()
to protect in the unlikely event of an overflowed allocation.

MFC after: 3 weeks

7 years agoTry to fix LINT builds after r305807. Seems to be a simple s&r error
bz [Wed, 14 Sep 2016 16:08:23 +0000 (16:08 +0000)]
Try to fix LINT builds after r305807.  Seems to be a simple s&r error
I missed while reading through the 1st time as well.

7 years agoEnsure that the IPPROTO_TCP level socket options
tuexen [Wed, 14 Sep 2016 14:48:00 +0000 (14:48 +0000)]
Ensure that the IPPROTO_TCP level socket options
* TCP_KEEPINIT
* TCP_KEEPINTVL
* TCP_KEEPIDLE
* TCP_KEEPCNT
always always report the values currently used when getsockopt()
is used. This wasn't the case when the sysctl-inherited default
values where used.
Ensure that the IPPROTO_TCP level socket option TCP_INFO has the
TCPI_OPT_ECN flag set in the tcpi_options field when ECN support
has been negotiated successfully.

Reviewed by: rrs, jtl, hiren
MFC after: 1 month
Differential Revision: 7833

7 years agoUse the MI macro TRAPF_USERMODE() instead of open-coded checks for
bde [Wed, 14 Sep 2016 12:57:40 +0000 (12:57 +0000)]
Use the MI macro TRAPF_USERMODE() instead of open-coded checks for
SEL_UPL and sometimes PSL_VM.  This is just a style change on amd64,
but on i386 it fixes 1 unimportant place where the PSL_VM check was
missing and starts fixing 1 important place where the PSL_VM check
had a logic error.

Fix logic errors in treating vm86 bioscall mode as kernel mode.  The
main place checked all the necessary flags, but put the necessary
parentheses for the PSL_VM and PCB_VM86CALL checks in the wrong
place.  The broken case is only reached if a vm86 bioscall uses a
%cs which is nonzero mod 4, but that is unusual -- most bios calls
start with %cs = 0xc000 or 0xf000 and rarely change it.  Another
place was missing the check for PCB_VM86CALL, but was only reachable
if there are bugs virtualizing PSL_I.

Add a macro TF_HAS_STACKREGS() and use this instead of converting
open-coded checks of SEL_UPL, etc. to TRAPF_USERMODE() when we only
care about whether the frame has stack registers.  This fixes 3
places in my recent fix for register variables in vm86 mode where I
messed up the PSL_VM check and cleans up other places.

7 years agoImprove USB polling mode by not locking any mutexes, asserting any
hselasky [Wed, 14 Sep 2016 12:07:34 +0000 (12:07 +0000)]
Improve USB polling mode by not locking any mutexes, asserting any
mutexes or using any callouts when active.

Trying to lock a mutex when KDB is active or the scheduler is stopped
can result in infinite wait loops. The same goes for calling callout
related functions which in turn lock mutexes.

If the USB controller at which a USB keyboard is connected is idle
when KDB is entered, polling the USB keyboard via USB will always
succeed. Else polling may fail depending on which state the USB
subsystem and USB interrupt handler is in. This is unavoidable unless
KDB can wait for USB interrupt threads to complete before stalling the
CPU(s).

Tested by: Bruce Evans <bde@freebsd.org>
MFC after: 4 weeks

7 years agoUse proper argument order for calloc(3).
trasz [Wed, 14 Sep 2016 11:20:58 +0000 (11:20 +0000)]
Use proper argument order for calloc(3).

MFC after: 1 month

7 years agoMake the callout structure in the boot loader's kernel shim more
hselasky [Wed, 14 Sep 2016 11:16:00 +0000 (11:16 +0000)]
Make the callout structure in the boot loader's kernel shim more
similar to the kernel one.

MFC after: 1 week

7 years agohyperv/hn: Fix some ifnet settings
sephe [Wed, 14 Sep 2016 09:17:00 +0000 (09:17 +0000)]
hyperv/hn: Fix some ifnet settings

- ifnet.if_mtu does not require explicit setting.
- ifnet.if_hdrlen must be set after ether_ifattach().

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7873

7 years agohyperv/hn: Remove the FreeBSD_version check for TSO configuration
sephe [Wed, 14 Sep 2016 08:59:13 +0000 (08:59 +0000)]
hyperv/hn: Remove the FreeBSD_version check for TSO configuration

It is available on both stable/10 and stable/11. This eases future MFCs
to stable/10.

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7872

7 years agohyperv/hn: Bring in shims from stable/10
sephe [Wed, 14 Sep 2016 08:48:08 +0000 (08:48 +0000)]
hyperv/hn: Bring in shims from stable/10

This eases future MFCs to stable/10.

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7871

7 years agohyperv/hn: Use sx for the main lock.
sephe [Wed, 14 Sep 2016 08:33:08 +0000 (08:33 +0000)]
hyperv/hn: Use sx for the main lock.

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7870

7 years agohyperv/hn: Cleanup hn_ioctl.
sephe [Wed, 14 Sep 2016 08:24:01 +0000 (08:24 +0000)]
hyperv/hn: Cleanup hn_ioctl.

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7869

7 years agohyperv/hn: Function renaming: hn_ifinit -> hn_init
sephe [Wed, 14 Sep 2016 08:08:45 +0000 (08:08 +0000)]
hyperv/hn: Function renaming: hn_ifinit -> hn_init

No functional changes.

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7868

7 years agohyperv/hn: Deprecate hn_softc_t
sephe [Wed, 14 Sep 2016 08:00:30 +0000 (08:00 +0000)]
hyperv/hn: Deprecate hn_softc_t

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7867

7 years agohyperv/hn: Remove unused softc field
sephe [Wed, 14 Sep 2016 06:47:25 +0000 (06:47 +0000)]
hyperv/hn: Remove unused softc field

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7866

7 years agohyperv/vmbus: Make sure that the sub-channel count is valid.
sephe [Wed, 14 Sep 2016 06:30:14 +0000 (06:30 +0000)]
hyperv/vmbus: Make sure that the sub-channel count is valid.

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7865

7 years agohyperv/hn: Pull RSS key and indirect table setup up.
sephe [Wed, 14 Sep 2016 06:15:45 +0000 (06:15 +0000)]
hyperv/hn: Pull RSS key and indirect table setup up.

This paves the way for the dynamic RSS key and indirect table setting.

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7864

7 years agoSwitch from .CURDIR to the simpler, more legible SRCTOP.
cy [Wed, 14 Sep 2016 01:47:01 +0000 (01:47 +0000)]
Switch from .CURDIR to the simpler, more legible SRCTOP.

Suggested by: emaste
X-MFC-with: upcoming amd upgrade

7 years agonet80211: improve error checking in ieee80211_parse_{wpa,rsn}()
avos [Tue, 13 Sep 2016 22:59:38 +0000 (22:59 +0000)]
net80211: improve error checking in ieee80211_parse_{wpa,rsn}()

- Add few checks for group/pairwise ciphers into
ieee80211_parse_{wpa,rsn}().
- Split error code and cipher value in wpa_cipher() / rsn_cipher(); current
hack with (1 << 32) does not work - it's 1, not 0 (detected by CSA).
- Return IEEE80211_REASON_UNSUPP_RSN_IE_VERSION instead of
IEEE80211_REASON_IE_INVALID when version field is not equal to RSN_VERSION.

Tested with wpi(4) / urtwn(4) (HOSTAP mode).

Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D7887

7 years agoAvoid clobbering existing value of META_COOKIE_TOUCH
sjg [Tue, 13 Sep 2016 22:17:25 +0000 (22:17 +0000)]
Avoid clobbering existing value of META_COOKIE_TOUCH

7 years agoFix swap tables between sets when this functional is enabled.
ae [Tue, 13 Sep 2016 18:16:15 +0000 (18:16 +0000)]
Fix swap tables between sets when this functional is enabled.

We have 6 opcode rewriters for table opcodes. When `set swap' command
invoked, it is called for each rewriter, so at the end we get the same
result, because opcode rewriter uses ETLV type to match opcode. And all
tables opcodes have the same ETLV type. To solve this problem, use
separate sets handler for one opcode rewriter. Use it to handle TEST_ALL,
SWAP_ALL and MOVE_ALL commands.

PR: 212630
MFC after: 1 week

7 years agoAdd a missing opt_ddb.h include from places that include debug_moditor.h
andrew [Tue, 13 Sep 2016 16:20:31 +0000 (16:20 +0000)]
Add a missing opt_ddb.h include from places that include debug_moditor.h
to fix the build.

Obtained from: ABT Systems Ltd
X-MFC with: r305771
Sponsored by: The FreeBSD Foundation

7 years agoFix the arm64 kernel build when DDB is disabled, debug_monitor.c depends on
andrew [Tue, 13 Sep 2016 15:45:22 +0000 (15:45 +0000)]
Fix the arm64 kernel build when DDB is disabled, debug_monitor.c depends on
DDB, and is unused when it's disabled.

Obtained from: ABT Systems Ltd
MFC after: 3 days
Sponsored by: The FreeBSD Foundation

7 years agoAdd a comment on the #endif related to the guards
bapt [Tue, 13 Sep 2016 15:41:05 +0000 (15:41 +0000)]
Add a comment on the #endif related to the guards

Reported by: tsoome

7 years agoRemove code that crept in r305125 by accident
bapt [Tue, 13 Sep 2016 15:37:23 +0000 (15:37 +0000)]
Remove code that crept in r305125 by accident

Reported by: tsoome

7 years agoAdd a warning about a known erratum we have observed on ThunderX pass 1.1.
andrew [Tue, 13 Sep 2016 14:10:49 +0000 (14:10 +0000)]
Add a warning about a known erratum we have observed on ThunderX pass 1.1.
As this is evaluation hardware with only a few users, and there is a lack
of information add a warning when booting on this hardware.

Reported by: cognet
Obtained from: ABT Systems Ltd
MFC after: Instant
Sponsored by: The FreeBSD Foundation