]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agoFix tests/sys/kqueue NetBSD tests on 32-bit platforms by using proper
ngie [Tue, 6 Sep 2016 17:22:25 +0000 (17:22 +0000)]
Fix tests/sys/kqueue NetBSD tests on 32-bit platforms by using proper
format specifier for pointers when printing them out with printf(3)

MFC after: 57 days
Pointyhat to: ngie
Reported by: bz, cy, Jenkins (i386 job)
Submitted by: cy
Sponsored by: EMC / Isilon Storage Division

7 years agocv: do a lockless check for no waiters in cv_signal and cv_broadcastpri
mjg [Tue, 6 Sep 2016 17:16:59 +0000 (17:16 +0000)]
cv: do a lockless check for no waiters in cv_signal and cv_broadcastpri

In case of some consumers like zfs there are no waiters vast majority of
the time

Reviewed by: jhb
MFC after: 1 week

7 years agoRenumber the advertising clause.
imp [Tue, 6 Sep 2016 15:17:35 +0000 (15:17 +0000)]
Renumber the advertising clause.

7 years agoImport missing enum declaration in pci_host_generic header file
wma [Tue, 6 Sep 2016 15:11:37 +0000 (15:11 +0000)]
Import missing enum declaration in pci_host_generic header file

Other files including pci_host_generic.h failed to compile
due to missing declaration of enum pci_id_type.

Obtained from:         Semihalf
Submitted by:          Michal Stanek <mst@semihalf.com>
Sponsored by:          Annapurna Labs
Reviewed by:           wma
Differential Revision: https://reviews.freebsd.org/D7561

7 years agoRemove check for 64-bit FDT ranges in pci-host-generic
wma [Tue, 6 Sep 2016 15:06:08 +0000 (15:06 +0000)]
Remove check for 64-bit FDT ranges in pci-host-generic

This allows 32-bit platforms to use pci-host-generic.

Obtained from:         Semihalf
Submitted by:          Michal Stanek <mst@semihalf.com>
Sponsored by:          Annapurna Labs
Reviewed by:           wma
Differential Revision: https://reviews.freebsd.org/D7560

7 years agoUpdate Annapurna Alpine HAL to a newer version.
wma [Tue, 6 Sep 2016 14:59:13 +0000 (14:59 +0000)]
Update Annapurna Alpine HAL to a newer version.
  HAL version: 2.7a

Import from vendor-sys, r305475

7 years agobhnd: remove redundant ;s at the end of functions or switch statements
emaste [Tue, 6 Sep 2016 13:34:10 +0000 (13:34 +0000)]
bhnd: remove redundant ;s at the end of functions or switch statements

7 years agorum: use m_get2() in Rx path.
avos [Tue, 6 Sep 2016 12:00:16 +0000 (12:00 +0000)]
rum: use m_get2() in Rx path.

7 years agortwn: fix firmware readiness check in rtwn_load_firmware().
avos [Tue, 6 Sep 2016 11:08:32 +0000 (11:08 +0000)]
rtwn: fix firmware readiness check in rtwn_load_firmware().

7 years agoTeach acpidump how to parse ACPI 5.1 tables found on the development
andrew [Tue, 6 Sep 2016 10:13:49 +0000 (10:13 +0000)]
Teach acpidump how to parse ACPI 5.1 tables found on the development
ThunderX units in the netperf cluster.

Approved by: jkim
Obtained from: ABT Systems Ltd
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D7252

7 years agoiwm: fix scanning for hidden SSIDs.
avos [Tue, 6 Sep 2016 10:08:32 +0000 (10:08 +0000)]
iwm: fix scanning for hidden SSIDs.

Setup SSIDs in scan command so firmware will send direct probe request(s)
while scanning.

Tested by: dbkirk@gmail.com

PR: 211519
MFC after: 1 week

7 years agoEnsure that we always open only files that is named by explicitly
delphij [Tue, 6 Sep 2016 08:52:00 +0000 (08:52 +0000)]
Ensure that we always open only files that is named by explicitly
using shell redirections instead of having gzip(1) to decide what
file to open.

Issue reported in the "non-cryptanalytic attacks against freebsd
update components" anonymous gist.

Reviewed by: allanjude, emaste
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D7653

7 years agoPort contrib/netbsd-tests/kernel/kqueue/... as tests/sys/kqueue/...
ngie [Tue, 6 Sep 2016 08:50:21 +0000 (08:50 +0000)]
Port contrib/netbsd-tests/kernel/kqueue/... as tests/sys/kqueue/...

proc2_test must be skipped because the invariant tested
(`ke.fflags & NOTE_TRACKERR`) doesn't pass.

MFC after: 58 days
Submitted by: kib (earlier form)
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D6172

7 years agoMove tests/sys/kqueue/... to tests/sys/kqueue/libkqueue/...
ngie [Tue, 6 Sep 2016 08:45:29 +0000 (08:45 +0000)]
Move tests/sys/kqueue/... to tests/sys/kqueue/libkqueue/...

This is being done to clearly distinguish the libkqueue tests
from the (soon to be imported) NetBSD tests.

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

7 years agorum: fix frame length checks in Rx path.
avos [Tue, 6 Sep 2016 06:40:59 +0000 (06:40 +0000)]
rum: fix frame length checks in Rx path.

Split usbd_xfer_status() check:
- Check xfer length: must be longer, than Rx descriptor size.
- Check frame size: must be shorter than xfer length.
- Discard too short frames.

Tested with WUSB54GC, STA/MONITOR modes.

7 years agofix zfs pool creation accidentally broken by r305331
avg [Tue, 6 Sep 2016 06:09:12 +0000 (06:09 +0000)]
fix zfs pool creation accidentally broken by r305331

The upstream change introduced a new load state, SPA_LOAD_CREATE,
and vdev_geom code needs to be aware of it.

Tested by: cy
MFC after: 1 week
X-MFC with: r305331

7 years agohyperv/hn: Avoid bit fields for LSOv2 setup.
sephe [Tue, 6 Sep 2016 04:37:53 +0000 (04:37 +0000)]
hyperv/hn: Avoid bit fields for LSOv2 setup.

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

7 years agohyperv/hn: Fix VLAN tag setup for outgoing VLAN packets.
sephe [Tue, 6 Sep 2016 03:31:31 +0000 (03:31 +0000)]
hyperv/hn: Fix VLAN tag setup for outgoing VLAN packets.

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

7 years agohyperv/hn: Stringent RNDIS packet message length/offset check.
sephe [Tue, 6 Sep 2016 03:20:06 +0000 (03:20 +0000)]
hyperv/hn: Stringent RNDIS packet message length/offset check.

While I'm here, use definition in net/rndis.h

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

7 years agoFix lib/libc/rpc test assumptions added in r305358
ngie [Tue, 6 Sep 2016 01:07:12 +0000 (01:07 +0000)]
Fix lib/libc/rpc test assumptions added in r305358

- Require root in the tcp/udp subtests (it's needed on FreeBSD when
  registering services).
- Skip the tests if service registration fails.

MFC after: 59 days
X-MFC with: r305358
Reported by: Jenkins, rodrigc
Sponsored by: EMC / Isilon Storage Division

7 years agoInstall h_db to unbreak some of the lib/libc/db testcases after
ngie [Tue, 6 Sep 2016 00:51:25 +0000 (00:51 +0000)]
Install h_db to unbreak some of the lib/libc/db testcases after
r305358

MFC after: 59 days
X-MFC with: r305358
Reported by: Jenkins, rodrigc
Sponsored by: EMC / Isilon Storage Division

7 years agoFix send/recv limit mixup.
np [Mon, 5 Sep 2016 23:12:24 +0000 (23:12 +0000)]
Fix send/recv limit mixup.

7 years agobhnd(4): Implement backplane interrupt handling.
landonf [Mon, 5 Sep 2016 22:11:46 +0000 (22:11 +0000)]
bhnd(4): Implement backplane interrupt handling.

This adds bhnd(4) bus-level support for querying backplane interrupt vector
routing, and delegating machine/bridge-specific interrupt handling to the
concrete bhnd(4) driver implementation.

On bhndb(4) bridged PCI devices, we provide the PCI/MSI interrupt directly
to attached cores.

On MIPS devices, we report a backplane interrupt count of 0, effectively
disabling the bus-level interrupt assignment. This allows mips/broadcom
to temporarily continue using hard-coded MIPS IRQs until bhnd_mips PIC
support is implemented.

Reviewed by: mizhka
Approved by: adrian (mentor, implicit)

7 years agobwn(4): ignore BCM4321's unpopulated USB11 host controller core.
landonf [Mon, 5 Sep 2016 21:55:27 +0000 (21:55 +0000)]
bwn(4): ignore BCM4321's unpopulated USB11 host controller core.

Broadcom Intensi-fi chipsets provided a common set of IP cores; on PCI/PCIe
devices, the USB11 host controller is left floating.

Approved by: adrian (mentor, implicit)

7 years agobhnd(4): Add device classes for USB host/dev/dual-mode controller cores.
landonf [Mon, 5 Sep 2016 21:48:16 +0000 (21:48 +0000)]
bhnd(4): Add device classes for USB host/dev/dual-mode controller cores.

Approved by: adrian (mentor, implicit)

7 years agorum: do not restart device when protmode / rtsthreshold is changed.
avos [Mon, 5 Sep 2016 19:42:35 +0000 (19:42 +0000)]
rum: do not restart device when protmode / rtsthreshold is changed.

7 years agocxgbe/t4_tom: toepcb should be all-zero on allocation because the code
np [Mon, 5 Sep 2016 19:37:47 +0000 (19:37 +0000)]
cxgbe/t4_tom: toepcb should be all-zero on allocation because the code
that cleans up on failure assumes that non-NULL values indicate
initialized items.

Sponsored by: Chelsio Communications

7 years agoRevert r305119, move the control module register data to am335x_scm.h and
loos [Mon, 5 Sep 2016 18:42:21 +0000 (18:42 +0000)]
Revert r305119, move the control module register data to am335x_scm.h and
fix if_cpsw.c to include the correct header.

Discussed with: bz

7 years agoDefine libcpp's HAVE_DESIGNATED_INITIALIZERS in a defined and portable
dim [Mon, 5 Sep 2016 18:02:37 +0000 (18:02 +0000)]
Define libcpp's HAVE_DESIGNATED_INITIALIZERS in a defined and portable
way.

MFC after: 3 days

7 years ago[BHND/USB] Port of EHCI/OHCI support from ZRouter
mizhka [Mon, 5 Sep 2016 16:06:52 +0000 (16:06 +0000)]
[BHND/USB] Port of EHCI/OHCI support from ZRouter

This patch adds driver implementation for BHND USB core. Driver has been
imported from ZRouter project with small adaptions for FreeBSD 11.

Also it's enabled for BroadCom MIPS74k boards by default. It's fully tested
on Asus boards (RT-N16: external USB, RT-N53: USB bus between SoC and WiFi
chips).

Reviewed by:    adrian (mentor), ray
Approved by: adrian (mentor)
Obtained from: ZRouter
Differential Revision:  https://reviews.freebsd.org/D7781

7 years agoRemove an unreachable return state from ARM's minidumpsys().
markj [Mon, 5 Sep 2016 16:04:40 +0000 (16:04 +0000)]
Remove an unreachable return state from ARM's minidumpsys().

Submitted by: Dominik Ermel <der@semihalf.com>
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D7787

7 years agoMFV r305420:
mm [Mon, 5 Sep 2016 15:40:41 +0000 (15:40 +0000)]
MFV r305420:
Sync libarchive with vendor

Vendor issues fixed:
PR #777: Multiple bugfixes for setup_acls()

This includes a bugfix for a bug that caused ACLs not to be read properly
for files and directories inside subdirectories and as a result not being
stored or being incorrectly stored in tar archives.

MFC after: 3 days

7 years agoResolve deadlock between device_detach() and usbd_do_request_flags()
hselasky [Mon, 5 Sep 2016 15:35:58 +0000 (15:35 +0000)]
Resolve deadlock between device_detach() and usbd_do_request_flags()
by reviving the SX control request lock and refining which lock
protects the common scratch area in "struct usb_device".

The SX control request lock was removed by r246759 because it caused a
lock order reversal with the USB enumeration lock inside
usbd_transfer_setup() as a function of r246616. It was thought that
reducing the number of locks would resolve the LOR, but because some
USB device drivers use usbd_do_request_flags() inside callback
functions, like in taskqueues, a deadlock may occur when these are
drained from device_detach(). By restoring the SX control request
lock usbd_do_request_flags() is allowed to complete its execution
when a USB device driver is detaching. By using the SX control request
lock to protect the scratch area, the LOR introduced by r246616 is
also resolved.

Bump the FreeBSD version while at it to force recompilation of all USB
kernel modules.

Found by: avos@
MFC after: 1 week

7 years agoUpdate vendor/libarchive to git b4099917d6893ed77af24caff1156e044ebd4fa5
mm [Mon, 5 Sep 2016 15:20:55 +0000 (15:20 +0000)]
Update vendor/libarchive to git b4099917d6893ed77af24caff1156e044ebd4fa5

Vendor issues fixed:
PR #777: Multiple bugfixes for setup_acls()

This fixes a bug that caused ACLs not to be read properly for files and
directories inside subdirectories and as a result not being stored in tar
archives.

7 years agoAdd sy8106a to Allwinner kernel. This regulator is used to control VDD_CPUX
jmcneill [Mon, 5 Sep 2016 13:45:45 +0000 (13:45 +0000)]
Add sy8106a to Allwinner kernel. This regulator is used to control VDD_CPUX
and is connected to R_TWI on some H3-based Orange Pi boards.

7 years agoAdd driver for Silergy Corp. SY8106A buck regulator.
jmcneill [Mon, 5 Sep 2016 13:39:54 +0000 (13:39 +0000)]
Add driver for Silergy Corp. SY8106A buck regulator.

7 years agoAdd support for Allwinner H3 PLL_CPUX.
jmcneill [Mon, 5 Sep 2016 12:36:54 +0000 (12:36 +0000)]
Add support for Allwinner H3 PLL_CPUX.

The H3 PLL_CPUX register looks exactly like the one found in A23, but we
need to follow a specific protocol when making adjustments to the clock.

7 years agoAdd support for the Allwinner H3 Thermal Sensor Controller. The H3 embeds
jmcneill [Mon, 5 Sep 2016 11:05:14 +0000 (11:05 +0000)]
Add support for the Allwinner H3 Thermal Sensor Controller. The H3 embeds
a single thermal sensor located in the CPU.

7 years agobsdinstall: add warning when unsupported partition is modified
wma [Mon, 5 Sep 2016 08:42:36 +0000 (08:42 +0000)]
bsdinstall: add warning when unsupported partition is modified

Right now is possible to modify bootable partition type to
non-bootable type without getting warning from partedit.
Example: if you auto parition drive for arm64, you will
get freebsd-ufs as bootable partition; now you are able
to change bootable partition type to freebsd-zfs; there
will be no warning and the system will install but
will not be bootable afterwards.

After this fix, partedit will issue the same warning it
does when user attempts to create bootable partition of
not supported type, notyfing a user about incoming
problem and allowing to think the decision over before
commiting the schema.

This has been tested on amd64 and arm64.

Obtained from:         Semihalf
Submitted by:          Dominik Ermel <der@semihalf.com>
Sponsored by:          Cavium
Reviewed by:           nwhitehorn
Differential Revision: https://reviews.freebsd.org/D6879

7 years agoAdd a toggle to display the approximate amount of swap used by each
des [Mon, 5 Sep 2016 08:27:04 +0000 (08:27 +0000)]
Add a toggle to display the approximate amount of swap used by each
process.  We don't *quite* pull that number out of our backside, as
the actual number is difficult to determine without modifying the VM
system to report it, but it's still useful to get an idea of what's
going on when a machine unexpectedly starts swapping.

MFC after: 1 week

7 years agoFix error handling.
ache [Mon, 5 Sep 2016 06:46:04 +0000 (06:46 +0000)]
Fix error handling.

MFC after:      3 days

7 years agoFix n == 1 case. Here should be no physical read (fill buffer) attempt
ache [Mon, 5 Sep 2016 06:10:51 +0000 (06:10 +0000)]
Fix n == 1 case. Here should be no physical read (fill buffer) attempt
(we read n - 1 chars with the room for NUL, see fgets()),
and no NULL return.

MFC after:      3 days

7 years agohyperv/hn: Stringent RNDIS control message length check.
sephe [Mon, 5 Sep 2016 05:07:40 +0000 (05:07 +0000)]
hyperv/hn: Stringent RNDIS control message length check.

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

7 years agonet/rndis: Define RNDIS status message, which could be sent by device.
sephe [Mon, 5 Sep 2016 04:56:56 +0000 (04:56 +0000)]
net/rndis: Define RNDIS status message, which could be sent by device.

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

7 years ago1) Prevent out of bounds access to ws[-1] (passed buffer) which happens
ache [Mon, 5 Sep 2016 04:49:58 +0000 (04:49 +0000)]
1) Prevent out of bounds access to ws[-1] (passed buffer) which happens
when the first mb sequence is incomplete and there are not enougn chars in
the read buffer. ws[-1] may lead to memory faults or false results, in
case the memory here contains '\n'.

2) Fix EOF checking I mess in my previos r305406 commit.

MFC after:      3 days

7 years agohyperv/hn: Stringent NVS RNDIS packets length checks.
sephe [Mon, 5 Sep 2016 04:47:31 +0000 (04:47 +0000)]
hyperv/hn: Stringent NVS RNDIS packets length checks.

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

7 years agohyperv/hn: Stringent NVS notification length check.
sephe [Mon, 5 Sep 2016 03:39:04 +0000 (03:39 +0000)]
hyperv/hn: Stringent NVS notification length check.

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

7 years agoFix errors handling.
ache [Mon, 5 Sep 2016 03:37:28 +0000 (03:37 +0000)]
Fix errors handling.

MFC after:      3 days

7 years agohyperv/vmbus: Stringent header length and total length check.
sephe [Mon, 5 Sep 2016 03:21:31 +0000 (03:21 +0000)]
hyperv/vmbus: Stringent header length and total length check.

While I'm here, minor style changes.

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

7 years agoA64 thermal sensor IRQ is GIC_SPI 31, not 41.
jmcneill [Sun, 4 Sep 2016 22:30:46 +0000 (22:30 +0000)]
A64 thermal sensor IRQ is GIC_SPI 31, not 41.

7 years agoReplace the number 4 in pmap_ts_referenced() by PMAP_TS_REFERENCED_MAX,
alc [Sun, 4 Sep 2016 22:08:04 +0000 (22:08 +0000)]
Replace the number 4 in pmap_ts_referenced() by PMAP_TS_REFERENCED_MAX,
like we've done elsewhere, e.g., amd64.

As an optimization to the machine-independent layer, change the machine-
dependent pmap_ts_referenced() so that it updates the page's dirty field
if a modified bit is found while counting reference bits.  This
opportunistic update can be performed at low cost and can eliminate the
need for some future calls to pmap_is_modified() by the machine-
independent layer.

MFC after: 3 weeks

7 years agoAdd _US_ACTION_MASK to libcxxrt's arm-specific unwind header. This
dim [Sun, 4 Sep 2016 21:48:58 +0000 (21:48 +0000)]
Add _US_ACTION_MASK to libcxxrt's arm-specific unwind header.  This
value is used in newer versions of compiler-rt.

MFC after: 3 days

7 years agolibifconfig: style(9) fixes
kp [Sun, 4 Sep 2016 20:55:27 +0000 (20:55 +0000)]
libifconfig: style(9) fixes

Also switch from BSD 3-clause to 2-clause license where possible, and
consolidate duplicate 3-clause license into one.

Submitted by: Marie Helene Kvello-Aune <marieheleneka@gmail.com>
Reviewed by: cem, kp
Differential Revision: https://reviews.freebsd.org/D7764

7 years agoMake some additional -Wconstant-conversion warnings from clang 3.9.0 in
dim [Sun, 4 Sep 2016 17:56:55 +0000 (17:56 +0000)]
Make some additional -Wconstant-conversion warnings from clang 3.9.0 in
bwn(4) non-fatal for now.

7 years agoFor kernel builds, instead of suppressing certain clang warnings, make
dim [Sun, 4 Sep 2016 17:55:22 +0000 (17:55 +0000)]
For kernel builds, instead of suppressing certain clang warnings, make
them non-fatal, so there is some incentive to fix them eventually.

7 years agoEnable superpages on arm64 by default. These seem to be stable, having
andrew [Sun, 4 Sep 2016 17:50:23 +0000 (17:50 +0000)]
Enable superpages on arm64 by default. These seem to be stable, having
survived multiple world and kernel builds, and of poudriere building full
package sets.

I have observed a 3% reduction in buildworld times with superpages enabled,
however further testing is needed to see if this is observed in other
workloads.

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

7 years agoWith clang 3.9.0, compiling sys/netinet/igmp.c results in the following
dim [Sun, 4 Sep 2016 17:23:10 +0000 (17:23 +0000)]
With clang 3.9.0, compiling sys/netinet/igmp.c results in the following
warning:

sys/netinet/igmp.c:546:21: error: implicit conversion from 'int' to 'char' changes value from 148 to -108 [-Werror,-Wconstant-conversion]
        p->ipopt_list[0] = IPOPT_RA;    /* Router Alert Option */
                         ~ ^~~~~~~~
sys/netinet/ip.h:153:19: note: expanded from macro 'IPOPT_RA'
#define IPOPT_RA                148             /* router alert */
                                ^~~

This is because ipopt_list is an array of char, so IPOPT_RA is wrapped
to a negative value.  It would be nice to change ipopt_list to an array
of u_char, but it changes the signature of the public struct ipoption,
so add an explicit cast to suppress the warning.

Reviewed by: imp
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D7777

7 years agoWith clang 3.9.0, compiling uplcom results in the following warnings:
dim [Sun, 4 Sep 2016 16:59:35 +0000 (16:59 +0000)]
With clang 3.9.0, compiling uplcom results in the following warnings:

sys/dev/usb/serial/uplcom.c:543:29: error: implicit conversion from 'int' to 'int8_t' (aka 'signed char') changes value from 192 to -64 [-Werror,-Wconstant-conversion]
        if (uplcom_pl2303_do(udev, UT_READ_VENDOR_DEVICE, UPLCOM_SET_REQUEST, 0x8484, 0, 1)
            ~~~~~~~~~~~~~~~~       ^~~~~~~~~~~~~~~~~~~~~
sys/dev/usb/usb.h:179:53: note: expanded from macro 'UT_READ_VENDOR_DEVICE'
#define UT_READ_VENDOR_DEVICE   (UT_READ  | UT_VENDOR | UT_DEVICE)
                                 ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~

This is because UT_READ is 0x80, so the int8_t argument is wrapped to a
negative value.  Fix this by using uint8_t instead.

Reviewed by: imp, hselasky
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D7776

7 years agocache: defer freeing entries until after the global lock is dropped
mjg [Sun, 4 Sep 2016 16:52:14 +0000 (16:52 +0000)]
cache: defer freeing entries until after the global lock is dropped

This also defers vdrop for held vnodes.

Glanced at by: kib

7 years agoOops, the previous i386 version of e_fmodf.S and e_fmodl.S was
bde [Sun, 4 Sep 2016 15:08:14 +0000 (15:08 +0000)]
Oops, the previous i386 version of e_fmodf.S and e_fmodl.S was
actually the amd64 version.

7 years agoDisconnect the "optimized" asm variants of cos(), sin() and tan() from
bde [Sun, 4 Sep 2016 14:12:19 +0000 (14:12 +0000)]
Disconnect the "optimized" asm variants of cos(), sin() and tan() from
the build on i386.  Leave them in the source tree for regression tests.

The asm functions were always much less accurate (by a factor of more
than 10**18 in the worst case).  They were faster on old CPUs.  But
with each new generation of CPUs they get relatively slower.  The
double precision C version's average advantage is about a factor of 2
on Haswell.

The asm functions were already intentionally avoided in float and long
double precision on i386 and in all precisions on amd64.  Float
precision and amd64 give larger advantages to the C version.  The long
double precision C code and compilers' understanding of long double
precision are not so good, so the i387 is still slightly faster for
long double precision, except for the unimportant subcase of huge args
where the sub-optimal C code now somehow beats the i387 by about a
factor of 2.

7 years agofd: fix up fdeget_file
mjg [Sun, 4 Sep 2016 13:31:57 +0000 (13:31 +0000)]
fd: fix up fdeget_file

It was supposed to return NULL if a fp is not installed.

Facepalm-by: mjg
7 years agoAdd asm versions of fmod(), fmodf() and fmodl() on amd64. Add asm
bde [Sun, 4 Sep 2016 12:22:14 +0000 (12:22 +0000)]
Add asm versions of fmod(), fmodf() and fmodl() on amd64.  Add asm
versions of fmodf() amd fmodl() on i387.

fmod is similar to remainder, and the C versions are 3 to 9 times
slower than the asm versions on x86 for both, but we had the strange
mixture of all 6 variants of remainder in asm and only 1 of 6
variants of fmod in asm.

7 years agoUpgrade to Unbound 1.5.9.
des [Sun, 4 Sep 2016 12:17:57 +0000 (12:17 +0000)]
Upgrade to Unbound 1.5.9.

7 years agoFix missing fmodl() on arches with 53-bit long doubles.
bde [Sun, 4 Sep 2016 12:01:32 +0000 (12:01 +0000)]
Fix missing fmodl() on arches with 53-bit long doubles.

PR: 199422, 211965
MFC after: 1 week

7 years agocache: manage negative entry list with a dedicated lock
mjg [Sun, 4 Sep 2016 08:58:35 +0000 (08:58 +0000)]
cache: manage negative entry list with a dedicated lock

Since negative entries are managed with a LRU list, a hit requires a
modificaton.

Currently the code tries to upgrade the global lock if needed and is
forced to retry the lookup if it fails.

Provide a dedicated lock for use when the cache is only shared-locked.

Reviewed by: kib
MFC after: 1 week

7 years agocache: put all negative entry management code into dedicated functions
mjg [Sun, 4 Sep 2016 08:55:15 +0000 (08:55 +0000)]
cache: put all negative entry management code into dedicated functions

Reviewed by: kib
MFC after: 1 week

7 years agobhndb(4): Fix probing of bhndb-attached bhnd_nvram devices.
landonf [Sun, 4 Sep 2016 01:47:21 +0000 (01:47 +0000)]
bhndb(4): Fix probing of bhndb-attached bhnd_nvram devices.

This fixes bhnd(4) nvram handling on devices that map SPROM CSRs via PCI
configuration space.

The probe method previously required that a bhnd(4) device be attached to the
parent bridge; now that the bhnd_nvram device is always attached first, this
unnecessary sanity check always failed.

Approved by: adrian (mentor, implicit)

7 years agobhndb(4): Skip disabled cores when performing bridge configuration probing.
landonf [Sun, 4 Sep 2016 01:43:54 +0000 (01:43 +0000)]
bhndb(4): Skip disabled cores when performing bridge configuration probing.

On BCM4321 chipsets, both PCI and PCIe cores are included, with one of
the cores potentially left floating.

Since the PCI core appears first in the device table, and the PCI
profiles appear first in the resource configuration tables, this resulted in
incorrectly matching and using the PCI/v1 resource configuration on PCIe
devices, rather than the correct PCIe/v1 profile.

Approved by: adrian (mentor, implicit)

7 years agosiba(4): Add missing bhnd_device/bhnd_device_quirk table terminator entries.
landonf [Sun, 4 Sep 2016 01:25:46 +0000 (01:25 +0000)]
siba(4): Add missing bhnd_device/bhnd_device_quirk table terminator entries.

This resulted in an over-read on siba chipsets that failed to match the
existing entries.

Approved by: adrian (mentor, implicit)

7 years agoRemove empty directories left by r299241, r302190, r304870, and r301410
landonf [Sun, 4 Sep 2016 01:17:16 +0000 (01:17 +0000)]
Remove empty directories left by r299241, r302190, r304870, and r301410

Approved by: adrian (mentor, implicit)

7 years agoMigrate bhndb(4) to the new bhnd_erom API.
landonf [Sun, 4 Sep 2016 00:58:19 +0000 (00:58 +0000)]
Migrate bhndb(4) to the new bhnd_erom API.

Adds support for probing and initializing bhndb(4) bridge state using
the bhnd_erom API, ensuring that full bridge configuration is available
*prior* to actually attaching and enumerating the bhnd(4) child device,
allowing us to safely allocate bus-level agent/device resources during
bhnd(4) bus enumeration.

- Add a bhnd_erom_probe() method usable by bhndb(4). This is an analogue
  to the existing bhnd_erom_probe_static() method, and allows the bhndb
  bridge to discover the best available erom parser class prior to newbus
  probing of its children.
- Add support for supplying identification hints when probing erom
  devices. This is required on early EXTIF-only chipsets, where chip
  identification registers are not available.
- Migrate bhndb over to the new bhnd_erom API, using bhnd_core_info
  records rather than bridged bhnd(4) device_t references to determine
  the bridged chipsets' capability/bridge configuration.
- The bhndb parent (e.g. if_bwn) is now required to supply a hardware
  priority table to the bridge. The default table is currently sufficient
  for our supported devices.
- Drop the two-pass attach approach we used for compatibility with bhndb(4) in
  the bhnd(4) bus drivers, and instead perform bus enumeration immediately,
  and allocate bridged per-child bus-level resources during that enumeration.

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

7 years agoMicro-optimize sleepq_signal().
markj [Sun, 4 Sep 2016 00:29:48 +0000 (00:29 +0000)]
Micro-optimize sleepq_signal().

Lift a comparison out of the loop that finds the highest-priority thread
on the queue.

MFC after: 1 week

7 years agoRespect the caller's hints when performing swap readahead.
markj [Sun, 4 Sep 2016 00:25:49 +0000 (00:25 +0000)]
Respect the caller's hints when performing swap readahead.

The pager getpages interface allows the caller to bound the number of
readahead and readbehind pages, and vm_fault_hold() makes use of this
feature. These bounds were ignored after r305056, causing the swap pager
to potentially page in more than the specified number of pages.

Reported and reviewed by: alc
X-MFC with: r305056

7 years agoImplement a generic bhnd(4) device enumeration table API.
landonf [Sat, 3 Sep 2016 23:57:17 +0000 (23:57 +0000)]
Implement a generic bhnd(4) device enumeration table API.

This defines a new bhnd_erom_if API, providing a common interface to device
enumeration on siba(4) and bcma(4) devices, for use both in the bhndb bridge
and SoC early boot contexts, and migrates mips/broadcom over to the new API.

This also replaces the previous adhoc device enumeration support implemented
for mips/broadcom.

Migration of bhndb to the new API will be implemented in a follow-up commit.

- Defined new bhnd_erom_if interface for bhnd(4) device enumeration, along
  with bcma(4) and siba(4)-specific implementations.
- Fixed a minor bug in bhndb that logged an error when we attempted to map the
  full siba(4) bus space (18000000-17FFFFFF) in the siba EROM parser.
- Reverted use of the resource's start address as the ChipCommon enum_addr in
  bhnd_read_chipid(). When called from bhndb, this address is found within the
  host address space, resulting in an invalid bridged enum_addr.
- Added support for falling back on standard bus_activate_resource() in
  bhnd_bus_generic_activate_resource(), enabling allocation of the bhnd_erom's
  bhnd_resource directly from a nexus-attached bhnd(4) device.
- Removed BHND_BUS_GET_CORE_TABLE(); it has been replaced by the erom API.
- Added support for statically initializing bhnd_erom instances, for use prior
  to malloc availability. The statically allocated buffer size is verified both
  at runtime, and via a compile-time assertion (see BHND_EROM_STATIC_BYTES).
- bhnd_erom classes are registered within a module via a linker set, allowing
  mips/broadcom to probe available EROM parser instances without creating a
  strong reference to bcma/siba-specific symbols.
- Migrated mips/broadcom to bhnd_erom_if, replacing the previous MIPS-specific
  device enumeration implementation.

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

7 years agoThe bug:
ache [Sat, 3 Sep 2016 23:04:56 +0000 (23:04 +0000)]
The bug:
$ echo x | awk '/[[:cntrl:]]/'
x

The NUL character in cntrl class truncates the pattern, and an empty
pattern matches anything. The patch skips NUL as a quick fix.

PR:     195792
Submitted by:   kdrakehp@zoho.com
Approved by:    bwk@cs.princeton.edu (the author)
MFC after:      3 days

7 years agoRemove redefinitions of some kernel types from mbuf.d.
markj [Sat, 3 Sep 2016 20:43:59 +0000 (20:43 +0000)]
Remove redefinitions of some kernel types from mbuf.d.

These override the kernel's definitions and do not match in some cases,
which can break scripts that use these types. With r305055, dtrace is able
to trace fields of struct mbuf's anonymous structs and unions, so there is
no need to redefine types already defined in CTF.

MFC after: 3 days

7 years agoRemove support for idle page zeroing.
markj [Sat, 3 Sep 2016 20:38:13 +0000 (20:38 +0000)]
Remove support for idle page zeroing.

Idle page zeroing has been disabled by default on all architectures since
r170816 and has some bugs that make it seemingly unusable. Specifically,
the idle-priority pagezero thread exacerbates contention for the free page
lock, and yields the CPU without releasing it in non-preemptive kernels. The
pagezero thread also does not behave correctly when superpage reservations
are enabled: its target is a function of v_free_count, which includes
reserved-but-free pages, but it is only able to zero pages belonging to the
physical memory allocator.

Reviewed by: alc, imp, kib
Differential Revision: https://reviews.freebsd.org/D7714

7 years agoWith clang 3.9.0, compiling cxgb results in the following warning:
dim [Sat, 3 Sep 2016 19:01:11 +0000 (19:01 +0000)]
With clang 3.9.0, compiling cxgb results in the following warning:

sys/dev/cxgb/cxgb_sge.c:2873:44: error: implicit conversion from 'int'
to 'char' changes value from 128 to -128 [-Werror,-Wconstant-conversion]
                        *mtod(m, char *) = CPL_ASYNC_NOTIF;
                                         ~ ^~~~~~~~~~~~~~~

This is because CPL_ASYNC_NOTIF is 0x80, so the plain char argument is
wrapped to a negative value.  Fix this by using uint8_t instead.

Reviewed by: np
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D7772

7 years agoUse correct CTR<n> variant.
np [Sat, 3 Sep 2016 18:54:26 +0000 (18:54 +0000)]
Use correct CTR<n> variant.

7 years agoUpdate contrib/netbsd-tests with new content from NetBSD
ngie [Sat, 3 Sep 2016 18:11:48 +0000 (18:11 +0000)]
Update contrib/netbsd-tests with new content from NetBSD

This updates the snapshot from 09/30/2014 to 08/11/2016

This brings in a number of new testcases from upstream, most
notably:

- bin/cat
- lib/libc
- lib/msun
- lib/libthr
- usr.bin/sort

lib/libc/tests/stdio/open_memstream_test.c was moved to
lib/libc/tests/stdio/open_memstream2_test.c to accomodate
the new open_memstream test from NetBSD.

MFC after: 2 months
Tested on: amd64 (VMware fusion VM; various bare metal platforms); i386 (VMware fusion VM); make tinderbox
Sponsored by: EMC / Isilon Storage Division

7 years agoSkip testcases 9/10 if jail(8) isn't installed
ngie [Sat, 3 Sep 2016 17:59:46 +0000 (17:59 +0000)]
Skip testcases 9/10 if jail(8) isn't installed

These testcases require jail support

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

7 years agoAdd a missing "Bail out!" if zpool create fails
ngie [Sat, 3 Sep 2016 17:31:13 +0000 (17:31 +0000)]
Add a missing "Bail out!" if zpool create fails

This will make the exit info more meaningful if/when zpool create fails,
and establishes parity with the other 2 zfs acl testcases (01, 03).

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

7 years agoExplicitly include all .rodata.* sections in the kernel .rodata. This
andrew [Sat, 3 Sep 2016 17:23:24 +0000 (17:23 +0000)]
Explicitly include all .rodata.* sections in the kernel .rodata. This
helps link the kernel with lld as it will then put all these into a single
.rodata section.

MFC after: 1 week
Sponsored by: ABT Systems Ltd

7 years agoUse the root key in the Security ID EFUSE (when valid) to generate a
jmcneill [Sat, 3 Sep 2016 15:28:09 +0000 (15:28 +0000)]
Use the root key in the Security ID EFUSE (when valid) to generate a
MAC address instead of creating a random one each boot.

7 years agoDon't use -N to set the OMAGIC with data and text writeable and data
imp [Sat, 3 Sep 2016 15:26:28 +0000 (15:26 +0000)]
Don't use -N to set the OMAGIC with data and text writeable and data
not page aligned. To do this, use the ld script gnu ld installs on my
system.

This is imperfect: LDFLAGS_BIN and LD_FLAGS_BIN describe different
things. The loader script could be better named and take into account
other architectures. And having two different mechanisms to do
basically the same thing needs study. However, it's blocking forward
progress on lld, so I'll work in parallel to sort these out.

Differential Revision: https://reviews.freebsd.org/D7409
Reviewed by: emaste

7 years agoAdd support for Allwinner A64 thermal sensors.
jmcneill [Sat, 3 Sep 2016 15:26:00 +0000 (15:26 +0000)]
Add support for Allwinner A64 thermal sensors.

7 years agoAdd cpu-supply xref to cpu@0
jmcneill [Sat, 3 Sep 2016 15:24:30 +0000 (15:24 +0000)]
Add cpu-supply xref to cpu@0

7 years agoAdd SID, THS, and CPU operating points.
jmcneill [Sat, 3 Sep 2016 15:23:59 +0000 (15:23 +0000)]
Add SID, THS, and CPU operating points.

7 years agoAdd support for reading root key on A83T/A64.
jmcneill [Sat, 3 Sep 2016 15:22:50 +0000 (15:22 +0000)]
Add support for reading root key on A83T/A64.

7 years agoimport unbound 1.5.9
des [Sat, 3 Sep 2016 15:08:13 +0000 (15:08 +0000)]
import unbound 1.5.9

7 years agoWith clang 3.9.0, compiling ppbus(4) results in the following warnings:
dim [Sat, 3 Sep 2016 13:48:44 +0000 (13:48 +0000)]
With clang 3.9.0, compiling ppbus(4) results in the following warnings:

sys/dev/ppbus/ppb_1284.c:296:46: error: implicit conversion from 'int'
to 'char' changes value from 144 to -112 [-Werror,-Wconstant-conversion]
        if ((error = do_peripheral_wait(bus, SELECT | nBUSY, 0))) {
                     ~~~~~~~~~~~~~~~~~~      ~~~~~~~^~~~~~~
sys/dev/ppbus/ppb_1284.c:785:48: error: implicit conversion from 'int'
to 'char' changes value from 240 to -16 [-Werror,-Wconstant-conversion]
                if (do_1284_wait(bus, nACK | SELECT | PERROR | nBUSY,
                    ~~~~~~~~~~~~      ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
sys/dev/ppbus/ppb_1284.c:786:29: error: implicit conversion from 'int'
to 'char' changes value from 240 to -16 [-Werror,-Wconstant-conversion]
                                        nACK | SELECT | PERROR | nBUSY)) {
                                        ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~

This is because nBUSY is 0x80, so the plain char argument is wrapped to
a negative value.  Fix this in a minimal fashion, by using uint8_t in a
few places.

Reviewed by: emaste
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D7771

7 years agoDefine drmP.h's __OS_HAS_AGP and __OS_HAS_MTRR macros in a defined and
dim [Sat, 3 Sep 2016 13:33:28 +0000 (13:33 +0000)]
Define drmP.h's __OS_HAS_AGP and __OS_HAS_MTRR macros in a defined and
portable way.

Reviewed by: dumbbell
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D7770

7 years agoremove CONSTRUCTORS from MIPS uboot linker script
emaste [Sat, 3 Sep 2016 13:01:37 +0000 (13:01 +0000)]
remove CONSTRUCTORS from MIPS uboot linker script

The linker script CONSTRUCTORS keyword is only meaningful "when linking
object file formats which do not support arbitrary sections, such as
ECOFF and XCOFF"[1] and is ignored for other object file formats.

LLVM's lld does not yet accept (and ignore) CONSTRUCTORS, so just remove
CONSTRUCTORS from the linker script as it has no effect.

[1] https://sourceware.org/binutils/docs/ld/Output-Section-Keywords.html

7 years agoMissed FreeBSD-specific piece of r305338.
mav [Sat, 3 Sep 2016 11:17:33 +0000 (11:17 +0000)]
Missed FreeBSD-specific piece of r305338.

7 years agoMFC r305337: 7004 dmu_tx_hold_zap() does dnode_hold() 7x on same object
mav [Sat, 3 Sep 2016 11:00:29 +0000 (11:00 +0000)]
MFC r305337: 7004 dmu_tx_hold_zap() does dnode_hold() 7x on same object

Using a benchmark which has 32 threads creating 2 million files in the
same directory, on a machine with 16 CPU cores, I observed poor
performance. I noticed that dmu_tx_hold_zap() was using about 30% of
all CPU, and doing dnode_hold() 7 times on the same object (the ZAP
object that is being held).

dmu_tx_hold_zap() keeps a hold on the dnode_t the entire time it is
running, in dmu_tx_hold_t:txh_dnode, so it would be nice to use the
dnode_t that we already have in hand, rather than repeatedly calling
dnode_hold(). To do this, we need to pass the dnode_t down through
all the intermediate calls that dmu_tx_hold_zap() makes, making these
routines take the dnode_t* rather than an objset_t* and a uint64_t
object number. In particular, the following routines will need to have
analogous *_by_dnode() variants created:

dmu_buf_hold_noread()
dmu_buf_hold()
zap_lookup()
zap_lookup_norm()
zap_count_write()
zap_lockdir()
zap_count_write()

This can improve performance on the benchmark described above by 100%,
from 30,000 file creations per second to 60,000. (This improvement is on
top of that provided by working around the object allocation issue. Peak
performance of ~90,000 creations per second was observed with 8 CPUs;
adding CPUs past that decreased performance due to lock contention.) The
CPU used by dmu_tx_hold_zap() was reduced by 88%, from 340 CPU-seconds
to 40 CPU-seconds.

Sponsored by: Intel Corp.

Closes #109

Reviewed by: Steve Gonczi <steve.gonczi@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
Reviewed by: Ned Bass <bass6@llnl.gov>
Reviewed by: Brian Behlendorf <behlendorf1@llnl.gov>
Author: Matthew Ahrens <mahrens@delphix.com>

openzfs/openzfs@d3e523d489a169ab36f9ec1b2a111a60a5563a9f

7 years agoMFV r305336: 7247 zfs receive of deduplicated stream fails
mav [Sat, 3 Sep 2016 10:59:05 +0000 (10:59 +0000)]
MFV r305336: 7247 zfs receive of deduplicated stream fails

This resolves two 'zfs recv' issues. First, when receiving into an
existing filesystem, a snapshot created during the receive process is
not added to the guid->dataset map for the stream, resulting in failed
lookups for deduped streams when a WRITE_BYREF record refers to a
snapshot received earlier in the stream. Second, the newly created
snapshot was also not set properly, referencing the snapshot before the
new receiving dataset rather than the existing filesystem.

Closes #159

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Author: Chris Williamson <chris.williamson@delphix.com>

openzfs/openzfs@b09697c8c18be68abfe538de9809938239402ae8

7 years agoMFV r305335: 7003 zap_lockdir() should tag hold
mav [Sat, 3 Sep 2016 10:58:14 +0000 (10:58 +0000)]
MFV r305335: 7003 zap_lockdir() should tag hold

zap_lockdir() / zap_unlockdir() should take a "void *tag" argument which
tags the hold on the zap. This will help diagnose programming errors
which misuse the hold on the ZAP.

Sponsored by: Intel Corp.

Closes #108

Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
Reviewed by: Steve Gonczi <steve.gonczi@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Brian Behlendorf <behlendorf1@llnl.gov>
Author: Matthew Ahrens <mahrens@delphix.com>

openzfs/openzfs@0780b3eab5a2c13e04328b39ecd2a6d0d3c4f7cb

7 years agoMFV r304157:
mav [Sat, 3 Sep 2016 10:10:58 +0000 (10:10 +0000)]
MFV r304157:
7230 add assertions to dmu_send_impl() to verify that stream includes BEGIN and END records

illumos/illumos-gate@12b90ee2d3b10689fc45f4930d2392f5fe1d9cfa
https://github.com/illumos/illumos-gate/commit/12b90ee2d3b10689fc45f4930d2392f5f
e1d9cfa

https://www.illumos.org/issues/7230
  A test failure occurred where a send stream had only a BEGIN record. This
  should not be possible if the send returns without error. Prevented this from
  happening in the future by adding an assertion to dmu_send_impl() to verify
  that if the function returns 0 (success) both a BEGIN and END record are
  present. Did this by adding flags to dmu_sendarg_t (indicating whether BEGIN o
r
  END records sent), having dump_record() set flags appropriately, adding VERIFY
  statement to dmu_send_impl().

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Paul Dagnelie <pcd@delphix.com>
Reviewed by: Igor Kozhukhov <ikozhukhov@gmail.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Matt Krantz <matt.krantz@delphix.com>

7 years agoMFV r304156: 7235 remove unused func dsl_dataset_set_blkptr
mav [Sat, 3 Sep 2016 10:09:23 +0000 (10:09 +0000)]
MFV r304156: 7235 remove unused func dsl_dataset_set_blkptr

illumos/illumos-gate@bd56f80007857b960e0981ed0797ad8ec844a96b
https://github.com/illumos/illumos-gate/commit/bd56f80007857b960e0981ed0797ad8ec
844a96b

https://www.illumos.org/issues/7235
  The function dsl_dataset_set_blkptr() is unused. We should remove it.

Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Alex Reece <alex@delphix.com>
Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Reviewed by: Igor Kozhukhov <ikozhukhov@gmail.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Matthew Ahrens <mahrens@delphix.com>