]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agohyperv/vmbus: Add macro to get channel packet data length.
sephe [Thu, 11 Aug 2016 03:20:38 +0000 (03:20 +0000)]
hyperv/vmbus: Add macro to get channel packet data length.

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

7 years agocam/da: Add quirk for I-O Data USB Flash Disk
sephe [Thu, 11 Aug 2016 03:12:56 +0000 (03:12 +0000)]
cam/da: Add quirk for I-O Data USB Flash Disk

PR: 211716
Submitted by: Jun Su <junsu microsoft com>
Reported by: Jun Su <junsu microsoft com>
MFC after: 1 week
Sponsored by: Microsoft

7 years agoAllow enforce_statfs (see jail(8)) to be set per jail
dteske [Wed, 10 Aug 2016 23:24:21 +0000 (23:24 +0000)]
Allow enforce_statfs (see jail(8)) to be set per jail

Reviewed by: jelischer
MFC after: 3 days

7 years agoFix sorting in r303934.
bdrewery [Wed, 10 Aug 2016 21:59:59 +0000 (21:59 +0000)]
Fix sorting in r303934.

Reported by: jhb
X-MFC-With: r303934
MFC after: 3 days
Sponsored by: EMC / Isilon Storage Division

7 years agoProvide the CloudABI vDSO to its executables.
ed [Wed, 10 Aug 2016 21:02:41 +0000 (21:02 +0000)]
Provide the CloudABI vDSO to its executables.

CloudABI executables already provide support for passing in vDSOs. This
functionality is used by the emulator for OS X to inject system call
handlers. On FreeBSD, we could use it to optimize calls to
gettimeofday(), etc.

Though I don't have any plans to optimize any system calls right now,
let's go ahead and already pass in a vDSO. This will allow us to
simplify the executables, as the traditional "syscall" shims can be
removed entirely. It also means that we gain more flexibility with
regards to adding and removing system calls.

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D7438

7 years agoUse proper argument length for rmdir(2) for r303934.
bdrewery [Wed, 10 Aug 2016 18:45:26 +0000 (18:45 +0000)]
Use proper argument length for rmdir(2) for r303934.

Reported by: kib
X-MFC-With: r303934
MFC after: 3 days
Sponsored by: EMC / Isilon Storage Division

7 years agoAdd kernel environment variables under smbios.system for the following
stevek [Wed, 10 Aug 2016 18:23:23 +0000 (18:23 +0000)]
Add kernel environment variables under smbios.system for the following
SMBIOS Type 1 fields:
smbios.system.sku      - SKU Number (SMBIOS 2.4 and above)
smbios.system.family   - Family (SMBIOS 2.4 and above)

Add kernel environment variables under smbios.planar for the following
SMBIOS Type 2 fields:
smbios.planar.tag      - Asset Tag
smbios.planar.location - Location in Chassis

Reviewed by: jhb, grembo
Approved by: sjg (mentor)
MFC after: 2 weeks
Sponsored by: Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D7453

7 years agoOnly remove empty directories before packaging.
lwhsu [Wed, 10 Aug 2016 18:22:42 +0000 (18:22 +0000)]
Only remove empty directories before packaging.

This preserves files are intentionally empty, most of them are in tests.txz

Reviewed by: bdrewery
MFC after: 3 days

7 years agoSupport rmdir(2).
bdrewery [Wed, 10 Aug 2016 18:19:17 +0000 (18:19 +0000)]
Support rmdir(2).

MFC after: 3 days
Sponsored by: EMC / Isilon Storage Division

7 years agoSquelch a false-positive Clang static analyzer warning.
bdrewery [Wed, 10 Aug 2016 18:19:14 +0000 (18:19 +0000)]
Squelch a false-positive Clang static analyzer warning.

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

7 years agoFix -b failure not restoring flags on the destination file.
bdrewery [Wed, 10 Aug 2016 18:19:11 +0000 (18:19 +0000)]
Fix -b failure not restoring flags on the destination file.

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

7 years agoFix -S with -l not being atomic.
bdrewery [Wed, 10 Aug 2016 18:19:08 +0000 (18:19 +0000)]
Fix -S with -l not being atomic.

It was unlinking the target even though it uses rename(2) which already
effectively does that.  -S is intended to not unlink(2) the target first.

MFC after: 1 week
Reviewed by: jhb
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D7452

7 years agoSupport -v for -l.
bdrewery [Wed, 10 Aug 2016 18:19:05 +0000 (18:19 +0000)]
Support -v for -l.

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

7 years agoFix -S with -b not atomically updating the destination file.
bdrewery [Wed, 10 Aug 2016 18:19:02 +0000 (18:19 +0000)]
Fix -S with -b not atomically updating the destination file.

With both of these flags, the backup was created via rename(dest, backup)
followed by rename(tmp, dest).  This left the destination file missing
for a moment which contradicts the point of -S.

This fixes a race with installworld where PRECIOUSPROG and PRECIOUSLIB
files (which use -S for installation) would briefly be missing.  In the
case of installing rtld with parallel installworld it could render an
error due to not having rtld present to run install/cp in another
process.

Reported by: jhb
Reviewed by: jhb
MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D7451

7 years agoTrim out excessive / with -v when target directory ends with a trailing '/'.
bdrewery [Wed, 10 Aug 2016 18:18:51 +0000 (18:18 +0000)]
Trim out excessive / with -v when target directory ends with a trailing '/'.

This is a minor nit after r289391 made all installations to a directory always
end in a trailing '/'.

MFC after: 3 days
Sponsored by: EMC / Isilon Storage Division

7 years agoImprove a consistency check to not detect valid cases for
tuexen [Wed, 10 Aug 2016 17:19:33 +0000 (17:19 +0000)]
Improve a consistency check to not detect valid cases for
unordered user messages using DATA chunks as invalid ones.
While there, ensure that error causes are provided when
sending ABORT chunks in case of reassembly problems detected.
Thanks to Taylor Brandstetter for making me aware of this problem.
MFC after: 3 days

7 years agoReplace all remaining calls to vprint(9) with vn_printf(9), and remove
trasz [Wed, 10 Aug 2016 16:12:31 +0000 (16:12 +0000)]
Replace all remaining calls to vprint(9) with vn_printf(9), and remove
the old macro.

MFC after: 1 month

7 years agoMake cpu_set_user_tls() work when called on the running thread.
ed [Wed, 10 Aug 2016 15:45:25 +0000 (15:45 +0000)]
Make cpu_set_user_tls() work when called on the running thread.

On all the other architectures, this function can also be called on the
currently running thread. In this case, we shouldn't fix up the address
in the PCB, but also patch up the register itself. Otherwise it will not
become active and will simply become overwritten by the next switch.

Reviewed by: imp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D7437

7 years agoktrace: do a lockless check on fork to see if tracing is enabled
mjg [Wed, 10 Aug 2016 15:25:44 +0000 (15:25 +0000)]
ktrace: do a lockless check on fork to see if tracing is enabled

This saves 2 lock acquisitions in the common case.

7 years agosigio: do a lockless check in funsetownlist
mjg [Wed, 10 Aug 2016 15:24:15 +0000 (15:24 +0000)]
sigio: do a lockless check in funsetownlist

There is no need to grab the lock first to see if sigio is used, and it
typically is not.

7 years agoMake libcrypt thread-safe. Add crypt_r(3).
ed [Wed, 10 Aug 2016 15:16:28 +0000 (15:16 +0000)]
Make libcrypt thread-safe. Add crypt_r(3).

glibc has a pretty nice function called crypt_r(3), which is nothing
more than crypt(3), but thread-safe. It accomplishes this by introducing
a 'struct crypt_data' structure that contains a buffer that is large
enough to hold the resulting string.

Let's go ahead and also add this function. It would be a shame if a
useful function like this wouldn't be usable in multithreaded apps.
Refactor crypt.c and all of the backends to no longer declare static
arrays, but write their output in a provided buffer.

There is no need to do any buffer length computation here, as we'll just
need to ensure that 'struct crypt_data' is large enough, which it is.
_PASSWORD_LEN is defined to 128 bytes, but in this case I'm picking 256,
as this is going to be part of the actual ABI.

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

7 years agoFix indentation.
kib [Wed, 10 Aug 2016 14:41:53 +0000 (14:41 +0000)]
Fix indentation.

Reported by: hselasky
MFC after: 17 days

7 years agoConvert another tmpfs assert into runtime check.
kib [Wed, 10 Aug 2016 13:50:21 +0000 (13:50 +0000)]
Convert another tmpfs assert into runtime check.

The offset of the directory file, passed to getdirentries(2) syscall,
is user-controllable.  The value of the offset must not be asserted,
instead the invalid value should be checked and rejected if invalid.

Reported and tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoConsider CROSS_BINUTILS_PREFIX environment variable so we use correct
br [Wed, 10 Aug 2016 13:49:17 +0000 (13:49 +0000)]
Consider CROSS_BINUTILS_PREFIX environment variable so we use correct
objdump.

Sponsored by: DARPA, AFRL
Sponsored by: HEIF5

7 years agoRe-schedule signals after kthread exits, since apparently there are
kib [Wed, 10 Aug 2016 13:47:12 +0000 (13:47 +0000)]
Re-schedule signals after kthread exits, since apparently there are
processes which combine kernel and non-kernel threads, e.g. nfsd.  For
such processes, termination of a kthread must recheck signal delivery
among other threads according to masks.

Reported and tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoUnconditionally perform checks that FPU region was entered, when #NM
kib [Wed, 10 Aug 2016 13:44:03 +0000 (13:44 +0000)]
Unconditionally perform checks that FPU region was entered, when #NM
exception is caught in kernel mode.  There are third-party modules
which trigger the issue, and since the problem causes usermode state
corruption at least, panic in production kernels as well.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoRemove extra -msoft-float flags settings.
br [Wed, 10 Aug 2016 13:32:27 +0000 (13:32 +0000)]
Remove extra -msoft-float flags settings.
This helps to build firmware modules.

Sponsored by: DARPA, AFRL
Sponsored by: HEIF5

7 years agoo Remove operation in machine mode.
br [Wed, 10 Aug 2016 12:41:36 +0000 (12:41 +0000)]
o Remove operation in machine mode.
  Machine privilege level was specially designed to use in vendor's
  firmware or bootloader. We have implemented operation in machine
  mode in FreeBSD as part of understanding RISC-V ISA, but it is time
  to remove it.
  We now use BBL (Berkeley Boot Loader) -- standard RISC-V firmware,
  which provides operation in machine mode for us.
  We now use standard SBI calls to machine mode, instead of handmade
  'syscalls'.
o Remove HTIF bus.
  HTIF bus is now legacy and no longer exists in RISC-V specification.
  HTIF code still exists in Spike simulator, but BBL do not provide
  raw interface to it.
  Memory disk is only choice for now to have multiuser booted in Spike,
  until Spike has implemented more devices (e.g. Virtio, etc).

Sponsored by: DARPA, AFRL
Sponsored by: HEIF5

7 years agoUncomment the vm.kvm_size and vm.kvm_free sysctls. These work as expected so
andrew [Wed, 10 Aug 2016 10:36:11 +0000 (10:36 +0000)]
Uncomment the vm.kvm_size and vm.kvm_free sysctls. These work as expected so
there is no reason to leave them commented out.

Obtained from: ABT Systems Ltd
MFC after: 1 month
Sponsored by: The FreeBSD Foundation

7 years agoImplement pmap_align_superpage on arm64 based on the amd64 implementation.
andrew [Wed, 10 Aug 2016 10:13:34 +0000 (10:13 +0000)]
Implement pmap_align_superpage on arm64 based on the amd64 implementation.
This will be needed when superpage support is added.

Obtained from: ABT Systems Ltd
MFC after: 1 month
Sponsored by: The FreeBSD Foundation

7 years agohyperv/hn: Reorganize send done callback.
sephe [Wed, 10 Aug 2016 03:11:07 +0000 (03:11 +0000)]
hyperv/hn: Reorganize send done callback.

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

7 years agoHighball memory requirement (4GB) with common/{raise,safety}
ngie [Wed, 10 Aug 2016 03:10:34 +0000 (03:10 +0000)]
Highball memory requirement (4GB) with common/{raise,safety}

Both test suites require more memory than my amd64 VM using
GENERIC-NODEBUG can provide and reliably panic it with OOM issues in
dtrace(4).

Some of the testcases fail, but this at least bypasses the panic behavior
on platforms that don't have enough resources

MFC after: 2 weeks
Discussed with: markj
Sponsored by: EMC / Isilon Storage Division

7 years agoPass overrides to make(1) when building ports for arm/armv6
gjb [Tue, 9 Aug 2016 22:48:46 +0000 (22:48 +0000)]
Pass overrides to make(1) when building ports for arm/armv6
targets, similar to what is done for the run-autotools-fixup
override for non-arm targets.

MFC after: 3 days
Tested on: 12-CURRENT building 10-STABLE
Sponsored by: The FreeBSD Foundation

7 years agoRemove obsolete manpage that is not currently installed.
jhb [Tue, 9 Aug 2016 22:10:40 +0000 (22:10 +0000)]
Remove obsolete manpage that is not currently installed.

7 years agosys/pcpu.h: Revert change introduced in r303890
dumbbell [Tue, 9 Aug 2016 21:45:47 +0000 (21:45 +0000)]
sys/pcpu.h: Revert change introduced in r303890

`device_t` is not defined outside the kernel but this header is used by
eg. libkvm or vmstat(8). Thus, r303890 broke the build.

So let's restore `struct device` here until a longer term solution is
found.

Reported by: Michael Butler <imb@protected-networks.net>, Jenkins
MFC after: 3 days
MFC with: r303890

7 years agoancontrol(8): replace comma with semicolon when pertinent.
pfg [Tue, 9 Aug 2016 19:46:05 +0000 (19:46 +0000)]
ancontrol(8): replace comma with semicolon when pertinent.

Uses of commas instead of a semicolons can easily go undetected. The comma
can serve as a statement separator but this shouldn't be abused when
statements are meant to be standalone.

Detected with devel/coccinelle following a hint from DragonFlyBSD.

MFC after: 1 month

7 years agolibpcap: replace comma with semicolon when pertinent.
pfg [Tue, 9 Aug 2016 19:44:33 +0000 (19:44 +0000)]
libpcap: replace comma with semicolon when pertinent.

Uses of commas instead of a semicolons can easily go undetected. The comma
can serve as a statement separator but this shouldn't be abused when
statements are meant to be standalone.

Detected with devel/coccinelle following a hint from DragonFlyBSD.

MFC after: 1 month

7 years agosys: replace comma with semicolon when pertinent.
pfg [Tue, 9 Aug 2016 19:42:20 +0000 (19:42 +0000)]
sys: replace comma with semicolon when pertinent.

Uses of commas instead of a semicolons can easily go undetected. The comma
can serve as a statement separator but this shouldn't be abused when
statements are meant to be standalone.

Detected with devel/coccinelle following a hint from DragonFlyBSD.

MFC after: 1 month

7 years agosys/dev: replace comma with semicolon when pertinent.
pfg [Tue, 9 Aug 2016 19:41:46 +0000 (19:41 +0000)]
sys/dev: replace comma with semicolon when pertinent.

Uses of commas instead of a semicolons can easily go undetected. The comma
can serve as a statement separator but this shouldn't be abused when
statements are meant to be standalone.

Detected with devel/coccinelle following a hint from DragonFlyBSD.

MFC after: 1 month

7 years agoConsistently use `device_t`
dumbbell [Tue, 9 Aug 2016 19:32:06 +0000 (19:32 +0000)]
Consistently use `device_t`

Several files use the internal name of `struct device` instead of
`device_t` which is part of the public API. This patch changes all
`struct device *` to `device_t`.

The remaining occurrences of `struct device` are those referring to the
Linux or OpenBSD version of the structure, or the code is not built on
FreeBSD and it's unclear what to do.

Submitted by: Matthew Macy <mmacy@nextbsd.org> (previous version)
Approved by: emaste, jhibbits, sbruno
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D7447

7 years agolibc/rpc: replace comma with semicolon when pertinent.
pfg [Tue, 9 Aug 2016 19:20:53 +0000 (19:20 +0000)]
libc/rpc: replace comma with semicolon when pertinent.

Uses of commas instead of a semicolons can easily go undetected. The comma
can serve as a statement separator but this shouldn't be abused when
statements are meant to be standalone.

Detected with devel/coccinelle following a hint from DragonFlyBSD.

MFC after: 1 month

7 years agoAdd a dmardump utility to dump the VT-d context tables.
jhb [Tue, 9 Aug 2016 19:06:05 +0000 (19:06 +0000)]
Add a dmardump utility to dump the VT-d context tables.

This tool parses the ACPI DMAR table looking for DMA remapping devices.
For each device it walks the root table and any context tables
referenced to display mapping info for PCI devices.

Note that acpidump -t already parses the info in the ACPI DMAR tables
directly.  This tool examines some of the data structures the DMAR
remapping engines use to translate DMA requests.

Reviewed by: kib, grehan
MFC after: 1 month
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D7444

7 years agoAdd additional constants.
jhb [Tue, 9 Aug 2016 19:02:14 +0000 (19:02 +0000)]
Add additional constants.

- Add constants for the fields in the root-entry table address register,
  namely the root type type (RTT) and root table address (RTA) mask.
- Add macros for the bitmask of the domain ID field in the second word
  of context table entries as well as a helper macro (DMAR_CTX2_GET_DID)
  to extract the domain ID from a context table entry.

Reviewed by: kib
MFC after: 1 month
Sponsored by: Chelsio Communications

7 years agoReliably return PCI_GETCONF_LAST_DEVICE from PCIOCGETCONF.
jhb [Tue, 9 Aug 2016 17:57:11 +0000 (17:57 +0000)]
Reliably return PCI_GETCONF_LAST_DEVICE from PCIOCGETCONF.

Previously the loop in PCIIOCGETCONF would terminate as soon as it
found enough matches.  Now it will continue iterating through the
PCI device list and only terminate if it finds another matching device
for which it has no room to store a conf structure.  This means that
PCI_GETCONF_LAST_DEVICE is reliably returned when the number of
matching devices is equal to the number of slots in the matches
buffer.  For example, if a program requests the conf structure for a
single PCI function with a specified domain/bus/slot/function it will
now get PCI_GETCONF_LAST_DEVICE instead of PCI_GETCONF_MORE_DEVS.

While here, simplify the loop conditional a bit more by explicitly
breaking out of the loop if copyout() fails and removing a redundant
i < pci_numdevs check.

Reviewed by: vangyzen, imp
MFC after: 1 month
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D7445

7 years agoTrack the base absolute ID of ingress and egress queues.
jhb [Tue, 9 Aug 2016 17:49:42 +0000 (17:49 +0000)]
Track the base absolute ID of ingress and egress queues.

Use this to map an absolute queue ID to a logical queue ID in interrupt
handlers.  For the regular cxgbe/cxl drivers this should be a no-op as
the base absolute ID should be zero.  VF devices have a non-zero base
absolute ID and require this change.  While here, export the absolute ID
of egress queues via a sysctl.

Reviewed by: np
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D7446

7 years agoRemove some NULL checks after M_WAITOK allocations from sys/arm/.
trasz [Tue, 9 Aug 2016 16:02:35 +0000 (16:02 +0000)]
Remove some NULL checks after M_WAITOK allocations from sys/arm/.

MFC after: 1 month

7 years agoWrite kern.randompid to /etc/sysctl.conf
skreuzer [Tue, 9 Aug 2016 15:57:37 +0000 (15:57 +0000)]
Write kern.randompid to /etc/sysctl.conf

PR: 211471
Reported by: survo@protonmail.com
Reviewed by: robak@
Approved by: allanjude@
MFC after: 3 days
Differential Revision:  https://reviews.freebsd.org/D7440

7 years agoRemove NULL checks after M_WAITOK allocations from nand(4).
trasz [Tue, 9 Aug 2016 15:56:33 +0000 (15:56 +0000)]
Remove NULL checks after M_WAITOK allocations from nand(4).

MFC after: 1 month

7 years agoRemove NULL checks after M_WAITOK allocations from sys/dev/ofw/.
trasz [Tue, 9 Aug 2016 15:55:14 +0000 (15:55 +0000)]
Remove NULL checks after M_WAITOK allocations from sys/dev/ofw/.

MFC after: 1 month

7 years agoRemove NULL check after M_WAITOK allocation from mpt(4).
trasz [Tue, 9 Aug 2016 15:52:17 +0000 (15:52 +0000)]
Remove NULL check after M_WAITOK allocation from mpt(4).

MFC after: 1 month

7 years agoRemove NULL checks after M_WAITOK allocations from msk(4).
trasz [Tue, 9 Aug 2016 15:51:11 +0000 (15:51 +0000)]
Remove NULL checks after M_WAITOK allocations from msk(4).

MFC after: 1 month

7 years agoRemove NULL checks after M_WAITOK allocations from tws(4).
trasz [Tue, 9 Aug 2016 15:50:03 +0000 (15:50 +0000)]
Remove NULL checks after M_WAITOK allocations from tws(4).

MFC after: 1 month

7 years agoFix for use after free.
hselasky [Tue, 9 Aug 2016 07:43:15 +0000 (07:43 +0000)]
Fix for use after free.

Clear the device description to avoid use after free because the
bsddev is not destroyed when the mlx5en module is unloaded. Only when
the parent mlx5 module is unloaded the bsddev is destroyed. This fixes
a panic on listing sysctls which refer strings in the bsddev after the
mlx5en module has been unloaded.

Sponsored by: Mellanox Technologies
MFC after: 1 week

7 years agofix a zfs cross-device rename crash introduced in r303763
avg [Tue, 9 Aug 2016 06:11:24 +0000 (06:11 +0000)]
fix a zfs cross-device rename crash introduced in r303763

The problem was that 'zfsvfs' variable was not initialized if the error
was detected, but in the exit path the variable was dereferenced before
the error code was checked.

Reported by: np
MFC after: 3 days
X-MFC with: r303763

7 years agohyperv/hn: Move gpa array out of netvsc_packet.
sephe [Tue, 9 Aug 2016 04:50:20 +0000 (04:50 +0000)]
hyperv/hn: Move gpa array out of netvsc_packet.

Prepare to deprecate the netvsc_packet.

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

7 years agoMove IPv4-specific jail functions to new file netinet/in_jail.c
stevek [Tue, 9 Aug 2016 02:16:21 +0000 (02:16 +0000)]
Move IPv4-specific jail functions to new file netinet/in_jail.c
_prison_check_ip4 renamed to prison_check_ip4_locked

Move IPv6-specific jail functions to new file netinet6/in6_jail.c
_prison_check_ip6 renamed to prison_check_ip6_locked

Add appropriate prototypes to sys/sys/jail.h

Adjust kern_jail.c to call prison_check_ip4_locked and
prison_check_ip6_locked accordingly.

Add netinet/in_jail.c and netinet6/in6_jail.c to the list of files that
need to be built when INET and INET6, respectively, are configured in the
kernel configuration file.

Reviewed by: jtl
Approved by: sjg (mentor)
Sponsored by: Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D6799

7 years ago[ar9300] don't program a negative readytime.
adrian [Tue, 9 Aug 2016 01:05:29 +0000 (01:05 +0000)]
[ar9300] don't program a negative readytime.

7 years agoReserve an adapter flag IS_VF to mark VF devices vs PF devices.
jhb [Mon, 8 Aug 2016 21:45:39 +0000 (21:45 +0000)]
Reserve an adapter flag IS_VF to mark VF devices vs PF devices.

Sponsored by: Chelsio Communications

7 years agoFix a typo.
jhb [Mon, 8 Aug 2016 21:28:02 +0000 (21:28 +0000)]
Fix a typo.

7 years agoHandle races with listening socket close when connecting a unix socket.
markj [Mon, 8 Aug 2016 20:25:04 +0000 (20:25 +0000)]
Handle races with listening socket close when connecting a unix socket.

If the listening socket is closed while sonewconn() is executing, the
nascent child socket is aborted, which results in recursion on the
unp_link lock when the child's pru_detach method is invoked. Fix this
by using a flag to mark such sockets, and skip a part of the socket's
teardown during detach.

Reported by: Raviprakash Darbha <rdarbha@juniper.net>
Tested by: pho
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D7398

7 years agoAvoid panic from ng_uncallout when unpluggin ethernet cable with active
sbruno [Mon, 8 Aug 2016 19:31:01 +0000 (19:31 +0000)]
Avoid panic from ng_uncallout when unpluggin ethernet cable with active
PPTP VPN connection.

Submitted by: Michael Zhilin <mizhka@gmail.com>
Reviewed by: ngie
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D7209

7 years agoFixup ixl(4) options parsing to actually compile when using RSS/PCBGROUP
sbruno [Mon, 8 Aug 2016 18:57:50 +0000 (18:57 +0000)]
Fixup ixl(4) options parsing to actually compile when using RSS/PCBGROUP
in GENERIC.

Fixup #ifdef RSS code blocks so that they build and add/delete variables
that were missesd during the creation of this code.

This code is untested and should have a big red warning on it.

Reported by: npn@
MFC after: 2 days

7 years agoFix formatting of setfib opcode.
ae [Mon, 8 Aug 2016 18:30:50 +0000 (18:30 +0000)]
Fix formatting of setfib opcode.

Zero fib is correct value and it conflicts with IP_FW_TARG.
Use bprint_uint_arg() only when opcode contains IP_FW_TARG,
otherwise just print numeric value with cleared high-order bit.

MFC after: 3 days

7 years agomake world: Allow installworld to be ran in parallel.
bdrewery [Mon, 8 Aug 2016 18:13:03 +0000 (18:13 +0000)]
make world: Allow installworld to be ran in parallel.

This has been safe for a while.

Sponsored by: EMC / Isilon Storage Division

7 years agoFix constructing of setdscp opcode with tablearg keyword.
ae [Mon, 8 Aug 2016 18:10:30 +0000 (18:10 +0000)]
Fix constructing of setdscp opcode with tablearg keyword.

setdscp's argument can have zero value that conflicts with IP_FW_TARG value.
Always set high-order bit if parser doesn't find tablearg keyword.

MFC after: 3 days

7 years agoRevert r298434 which should be fixed by r301287, r301394, and r301403.
bdrewery [Mon, 8 Aug 2016 17:59:59 +0000 (17:59 +0000)]
Revert r298434 which should be fixed by r301287, r301394, and r301403.

PR: 208703, 208963

7 years agoAdd timer_settime tests using SIGEV_THREAD.
jhb [Mon, 8 Aug 2016 17:57:25 +0000 (17:57 +0000)]
Add timer_settime tests using SIGEV_THREAD.

Note that these tests should work fine on NetBSD and other systems as
SIGEV_THREAD is POSIX.

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

7 years agoSwitch to the new block based LRO input function for the mlx5en
hselasky [Mon, 8 Aug 2016 16:22:16 +0000 (16:22 +0000)]
Switch to the new block based LRO input function for the mlx5en
driver. This change significantly increases the overall RX aggregation
ratio for heavily loaded networks handling 10-80 thousand simultaneous
connections.

Remove the turbo LRO code and all references to it which has now been
superceeded by the tcp_lro_queue_mbuf() function.

Tested by: Netflix
Sponsored by: Mellanox Technologies
MFC after: 1 week

7 years agoDon't enqueue NULL on a drbr
rstone [Mon, 8 Aug 2016 16:19:24 +0000 (16:19 +0000)]
Don't enqueue NULL on a drbr

In one corner case in the bxe TX path, a NULL mbuf could be enqueued onto
a drbr queue.  This could case a KASSERT to fire with INVARIANTS enabled,
or the processing of packets from the queue to be prematurely ended later
on.

Submitted by: Matt Joras (matt.joras AT isilon.com)
Reviewed by: davidcs
MFC after: 3 days
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D7041

7 years agoFix the sending of FORWARD-TSN and I-FORWARD-TSN chunks. The
tuexen [Mon, 8 Aug 2016 13:52:18 +0000 (13:52 +0000)]
Fix the sending of FORWARD-TSN and I-FORWARD-TSN chunks. The
last SID/SSN pair wasn't filled in.
Thanks to Julian Cordes for providing a packetdrill script
triggering the issue and making me aware of the bug.

MFC after: 3 days

7 years agoImport vDSO-related source files from the CloudABI repository.
ed [Mon, 8 Aug 2016 13:15:37 +0000 (13:15 +0000)]
Import vDSO-related source files from the CloudABI repository.

CloudABI executables that are emulated on Mac OS X do not invoke system
calls through "syscall". Instead, they make use of a vDSO that is
provided by the emulator that provides symbols for all of the system
call routines. The emulator can implement these any way it likes.

At some point in time we want to do this for native execution as well,
so that CloudABI executables are entirely oblivious of how system calls
need to be performed. They will simply call into functions and let that
deal with all of the details.

These source files can be used to generate a simple vDSO that does
nothing more than invoke "syscall". All we need to do now is map it into
the processes.

Obtained from: https://github.com/NuxiNL/cloudabi

7 years agoTry to check whether each key file exists before adding it, and bail out
des [Mon, 8 Aug 2016 10:46:18 +0000 (10:46 +0000)]
Try to check whether each key file exists before adding it, and bail out
if we didn't find any of them.  This reduces log spam about key files for
deprecated algorithms, which we look for but don't generate.

PR: 208254
MFC after: 3 days

7 years agoFix a locking issue found by stress testing with tsctp.
tuexen [Mon, 8 Aug 2016 08:20:10 +0000 (08:20 +0000)]
Fix a locking issue found by stress testing with tsctp.
The inp read lock neeeds to be held when considering control->do_not_ref_stcb.
MFC after: 3 days

7 years agoRemove vestigal references to __alpha__
ngie [Mon, 8 Aug 2016 07:19:30 +0000 (07:19 +0000)]
Remove vestigal references to __alpha__

Replace alpha reference in getconf(1) with amd64 [*]

MFC after: 1 week
PR:   211300 [*]
Submitted by: Sevan Janiyan <venture37@geeklan.co.uk> [*]
Sponsored by: EMC / Isilon Storage Division

7 years agohyperv/ic: Pass the channel callback to hv_util_attach()
sephe [Mon, 8 Aug 2016 06:18:54 +0000 (06:18 +0000)]
hyperv/ic: Pass the channel callback to hv_util_attach()

The saved channel callback in util softc is actually never used.

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

7 years agohyperv/ic: Expose the receive buffer length for callers to use.
sephe [Mon, 8 Aug 2016 06:11:28 +0000 (06:11 +0000)]
hyperv/ic: Expose the receive buffer length for callers to use.

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

7 years agohyperv/ic: Remove never used second parameter of hv_negotiate_version()
sephe [Mon, 8 Aug 2016 05:57:38 +0000 (05:57 +0000)]
hyperv/ic: Remove never used second parameter of hv_negotiate_version()

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

7 years agoetherswitch: Unbreak LINT build
sephe [Mon, 8 Aug 2016 05:57:04 +0000 (05:57 +0000)]
etherswitch: Unbreak LINT build

Sponsored by: Microsoft

7 years agoConsistently check for unsent data on the stream queues.
tuexen [Sun, 7 Aug 2016 23:04:46 +0000 (23:04 +0000)]
Consistently check for unsent data on the stream queues.

MFC after: 3 days

7 years agoSync in the latest CloudABI constants and data types.
ed [Sun, 7 Aug 2016 21:23:55 +0000 (21:23 +0000)]
Sync in the latest CloudABI constants and data types.

The only change is the addition of AT_SYSINFO_EHDR, which can be used
for providing a vDSO.

Obtained from: https://github.com/NuxiNL/cloudabi

7 years agoSet EN_MAS7_UPDATE HID0 bit for e500 core.
jhibbits [Sun, 7 Aug 2016 19:09:56 +0000 (19:09 +0000)]
Set EN_MAS7_UPDATE HID0 bit for e500 core.

Without enabling this bit, tlbre and tlbsx don't update the MAS7 register,
resulting in garbage in the register after a read (rather, the previous setting
of it for a tlbwe).  This can result in mmu_booke_mapdev_attr() thinking
mappings that should match actually don't, because tlb1_read_entry() can't
determine the correct address of a given entry.

MFC after: 11-RELEASE

7 years agoixl(4): Update to ixl-1.6.6-k.
sbruno [Sun, 7 Aug 2016 18:12:36 +0000 (18:12 +0000)]
ixl(4): Update to ixl-1.6.6-k.

Submitted by: erj
Reviewed by: jeffrey.e.pieper@intel.com
MFC after: 3 days
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D7391

7 years agopowerpc busdma: Use pmap_quick_enter_page()/pmap_quick_remove_page() to handle
jah [Sun, 7 Aug 2016 15:50:08 +0000 (15:50 +0000)]
powerpc busdma: Use pmap_quick_enter_page()/pmap_quick_remove_page() to handle
bouncing of unmapped buffers.  Also treat userspace buffers as unmapped, to
avoid borrowing the UVA for copies.  This allows sync'ing userspace buffers
outside the context of the owning process, and sync'ing bounced maps in
non-sleepable contexts.

This change is equivalent to r286787 for x86.

Reviewed by: jhibbits
Differential Revision: https://reviews.freebsd.org/D3989

7 years agoRemove stream queue entry consistently from wheel.
tuexen [Sun, 7 Aug 2016 12:51:13 +0000 (12:51 +0000)]
Remove stream queue entry consistently from wheel.
While there, improve the handling of drain.

MFC after: 3 days

7 years agoUse a more conventional spelling of "breakpoint".
brooks [Sun, 7 Aug 2016 09:02:54 +0000 (09:02 +0000)]
Use a more conventional spelling of "breakpoint".

7 years agoExtract out the various local definitions of ETHER_IS_BROADCAST() and
adrian [Sun, 7 Aug 2016 03:48:33 +0000 (03:48 +0000)]
Extract out the various local definitions of ETHER_IS_BROADCAST() and
turn them into a shared definition.

Set M_MCAST/M_BCAST appropriately upon packet reception in net80211, just
before they are delivered up to the ethernet stack.

Submitted by: rstone

7 years ago[arswitch] extend the debug support to be configurable at runtime.
adrian [Sun, 7 Aug 2016 01:32:37 +0000 (01:32 +0000)]
[arswitch] extend the debug support to be configurable at runtime.

* remove the DEBUG ifdef; defining it is too far reaching throughout
  the whole system;
* add a bitmask in the softc for controlling debugging;
* .. enable said debugging as a sysctl;
* add bitmaps for register access, reset and vlans.

TODO:

* Now that the debug statements are configurable, we definitely could
  do with more debugging
* Move the debugging into the top-level etherswitch driver and have
  sub-drivers obey.

7 years ago[mips] add support for using the MIPS user register for TLS data.
adrian [Sun, 7 Aug 2016 01:29:55 +0000 (01:29 +0000)]
[mips] add support for using the MIPS user register for TLS data.

This work, originally from Stacey Son, uses the MIPS UserReg for
reading the TLS data, and will fall back to the normal syscall path
when it isn't supported.

This code dynamically patches cpu_switch() to bypass the UserReg
instruction so to avoid generating a machine exception.

Thanks to sson for the original work, and to Dan Nelson for
bringing it to date and testing it on MIPS32 with me.

Tested:

* mips64 (sson)
* mips74k (dnelson_1901@yahoo.com) - AR9344 SoC, UserReg support
* mips24k (adrian) - AR9331 SoC, no UserReg support

Obtained from: sson, dnelson_1901@yahoo.com

7 years agoAdd Logitech Unifying receiver.
cy [Sat, 6 Aug 2016 20:27:12 +0000 (20:27 +0000)]
Add Logitech Unifying receiver.

MFC after: 1 week

7 years agoRe-correct the documentation for the 'type' parameter of the _SWAP
bjk [Sat, 6 Aug 2016 19:12:23 +0000 (19:12 +0000)]
Re-correct the documentation for the 'type' parameter of the _SWAP
macros from sys/queue.h -- only the singly-linked forms do not need
the 'field' argument.

Pointy Hat to: bjk
Reported by: akshay1994.leo_gmail.com

7 years agoFix building usr.bin/tar/tests with PIE symbol building enabled by
ngie [Sat, 6 Aug 2016 19:05:01 +0000 (19:05 +0000)]
Fix building usr.bin/tar/tests with PIE symbol building enabled by
removing CFLAGS+= -static

`CFLAGS+= -static` was a carryover from pre-r289195 with
usr.bin/tar/test/Makefile that should have been specified in LDFLAGS
There doesn't seem to be an apparent need for static compilation
of the test binaries.

Differential Revision: https://reviews.freebsd.org/D7430
MFC after: 1 week
Obtained-from: opBSD (418a491eed20d2603ddd1f1bd92c2c0d95094002)
Submitted by: op
Sponsored by: EMC / Isilon Storage Division

7 years agoAdd hw.fdt sysctl node.
stevek [Sat, 6 Aug 2016 18:48:47 +0000 (18:48 +0000)]
Add hw.fdt sysctl node.
Make FDT blob available via opaque hw.fdt.dtb sysctl, if a DTB has been
installed by the time sysctls are registered.

Reviewed by: andrew
Approved by: sjg (mentor)
Sponsored by: Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D7411

7 years agoUpdate with the members of the 9th core team.
bcr [Sat, 6 Aug 2016 17:53:53 +0000 (17:53 +0000)]
Update with the members of the 9th core team.

7 years agoCorrect the documentation of the 'type' parameter for the _SWAP
bjk [Sat, 6 Aug 2016 17:27:07 +0000 (17:27 +0000)]
Correct the documentation of the 'type' parameter for the _SWAP
macros from sys/queue.h

Submitted by: akshay1994.leo_gmail.com (for STAILQ)
Differential Revision: https://reviews.freebsd.org/D7428

7 years agoext2fs: Add defines for some missing ext4 feature flags.
pfg [Sat, 6 Aug 2016 17:24:35 +0000 (17:24 +0000)]
ext2fs: Add defines for some missing ext4 feature flags.

These are currently unused in our implementation and some even appear to
have not been implemented yet on linux but it is good to keep them for
reference.

Obtained from: NetBSD (CVS Rev. 1.41)
MFC after: 1 month

7 years agoext2fs: Add some more inode flags.
pfg [Sat, 6 Aug 2016 16:48:40 +0000 (16:48 +0000)]
ext2fs: Add some more inode flags.

These are currently unused in out implementation but it is good to keep
them for reference.

Obtained from: NetBSD (CVS Rev. 1.35)
MFC after: 1 month

7 years agoDon't modify a structure without holding a reference count on it.
tuexen [Sat, 6 Aug 2016 15:29:46 +0000 (15:29 +0000)]
Don't modify a structure without holding a reference count on it.

MFC after: 3 days

7 years agoCheck the first byte of the array for NUL, instead of the array as a NULL pointer
jhibbits [Sat, 6 Aug 2016 15:10:14 +0000 (15:10 +0000)]
Check the first byte of the array for NUL, instead of the array as a NULL pointer

The partition_name field is an array, so can never be NULL itself.  Check only
the first byte instead.

This was found when test building with clang, but I'm not sure how it passes
gcc's warnings either.

7 years agoTwo fixups for dtrace
jhibbits [Sat, 6 Aug 2016 15:06:19 +0000 (15:06 +0000)]
Two fixups for dtrace

* Use the right incantation to get the next stack pointer.  Since powerpc uses
  special frames for traps, dereferencing the stack pointer straight up won't
  get us the next stack pointer in every case.
* Clear EE using the correct instruction sequence.  The PowerISA states that
  'andi.' ANDs the register with 0||<imm>, instead of sign extending or filling
  out the unavailable bits with 1.  Even if it did sign extend, PSL_EE is
  0x8000, so ~PSL_EE is 0x7fff, and the upper bits would be cleared.  Use rlwinm
  in the 32-bit case, and a two-rotate sequence in the 64-bit case, the latter
  chosen to follow the output generated by gcc.

MFC after: 1 week

7 years agoAdd __cxa_thread_atexit(3) API implementation.
kib [Sat, 6 Aug 2016 13:32:40 +0000 (13:32 +0000)]
Add __cxa_thread_atexit(3) API implementation.

This is the backing feature to implement C++11 thread storage duration
specified by the thread_local keyword.  A destructor for given
thread-local object is registered to be executed at the thread
termination time using __cxa_thread_atexit().  Libc calls the
__cxa_thread_calls_dtors() during exit(3), before finalizers and
atexit functions, and libthr calls the function at the thread
termination time, after the stack unwinding and thread-specific key
destruction.

There are several uncertainties in the API which lacks a formal
specification.  Among them:
- is it allowed to register destructors during destructing;
we allow, but limiting the nesting level.  If too many iterations
detected, a diagnostic is issued to stderr and thread forcibly
terminates for now.
- how to handle destructors which belong to an unloading dso;
for now, we ignore destructor calls for such entries, and
issue a diagnostic.  Linux does prevent dso unload until all
threads with destructors from the dso terminated.
It is supposed that the diagnostics allow to detect real-world
applications relying on the above details and possibly adjust
our implementation.  Right now the choices were to provide the slim
API (but that rarely stands the practice test).

Tests are added to check generic functionality and to specify some of
the above implementation choices.

Submitted by: Mahdi Mokhtari <mokhi64_gmail.com>
Reviewed by: theraven
Discussed with: dim (detection of -std=c++11 supoort for tests)
Sponsored by: The FreeBSD Foundation (my involvement)
MFC after: 2 weeks
Differential revisions: https://reviews.freebsd.org/D7224,
    https://reviews.freebsd.org/D7427