]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agoFix possible crash for the NFSv4.1 pNFS client.
rmacklem [Sat, 29 Jul 2017 02:25:49 +0000 (02:25 +0000)]
Fix possible crash for the NFSv4.1 pNFS client.

If the nfsrpc_createlayoutrpc() call in nfsrpc_getcreatelayout() fails,
the code used nfhpp when it might be set NULL. This patch checks for
the error cases (laystat != 0) and avoids using nfhpp for the failure case.
This would only affect NFSv4.1 mounts with the "pnfs" option.
Found while testing the "umount -N" patch not yet in head.

MFC after: 2 weeks

7 years agoMFV r321673:
mm [Fri, 28 Jul 2017 23:56:07 +0000 (23:56 +0000)]
MFV r321673:
Sync libarchive with vendor.

Relevant vendor changes:
  PR #926: ensure ar strtab is null terminated

MFC after: 1 week

7 years agocxgbe/iw_cxgbe: Log the end point's history and flags to the trace
np [Fri, 28 Jul 2017 22:28:45 +0000 (22:28 +0000)]
cxgbe/iw_cxgbe: Log the end point's history and flags to the trace
buffer just before it's freed.

MFC after: 1 week
Sponsored by: Chelsio Communications

7 years agoMerge ACPICA 20170728.
jkim [Fri, 28 Jul 2017 22:23:29 +0000 (22:23 +0000)]
Merge ACPICA 20170728.

7 years agobhyve/vga.c: fix atc_color_select_67 bit shift
rlibby [Fri, 28 Jul 2017 21:47:10 +0000 (21:47 +0000)]
bhyve/vga.c: fix atc_color_select_67 bit shift

Gcc noticed that the result of the bit shift is always zero.  Shift so
that the ATC_CS_C67 bits end up in bits 6 & 7.

Reviewed by: grehan, tychon
Approved by: markj (mentor)
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D11775

7 years agobhyve/pci_e82545.c: squelch gcc warning for noreturn procedure
rlibby [Fri, 28 Jul 2017 21:42:59 +0000 (21:42 +0000)]
bhyve/pci_e82545.c: squelch gcc warning for noreturn procedure

Gcc complained that e82545_tx_thread has a return type declared but
doesn't return anything.  Annotate the procedure with _Noreturn.

Reviewed by: grehan
Approved by: markj (mentor)
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D11774

7 years agoAdd an entry to UPDATING for r321665.
rmacklem [Fri, 28 Jul 2017 21:14:28 +0000 (21:14 +0000)]
Add an entry to UPDATING for r321665.

7 years agoModify /etc/rc.d/nfsd so it doesn't force a startup of nfsuserd for NFSv4.
rmacklem [Fri, 28 Jul 2017 21:07:57 +0000 (21:07 +0000)]
Modify /etc/rc.d/nfsd so it doesn't force a startup of nfsuserd for NFSv4.

Given that RFC7530 allows uid/gids to be placed in owner/owner_group
strings directly, many NFSv4 environments don't need the nfsuserd.
This small patch modified /etc/rc.d/nfsd so that it does not force
startup of the nfsuserd daemon unless nfs_server_managegids is enabled.
This implies that nfsuserd_enable="YES" must be added to /etc/rc.conf
for NFSv4 server environments that use Kerberos mounts or clients that
do not support the uid/gid in string capability.
Since this could be considered a POLA violation, it will not be MFC'd.

Discussed on: freebsd-current

7 years agoPull in r308891 from upstream llvm trunk (by Benjamin Kramer):
dim [Fri, 28 Jul 2017 20:13:25 +0000 (20:13 +0000)]
Pull in r308891 from upstream llvm trunk (by Benjamin Kramer):

  [CodeGenPrepare] Cut off FindAllMemoryUses if there are too many uses.

  This avoids excessive compile time. The case I'm looking at is
  Function.cpp from an old version of LLVM that still had the giant
  memcmp string matcher in it. Before r308322 this compiled in about 2
  minutes, after it, clang takes infinite* time to compile it. With
  this patch we're at 5 min, which is still bad but this is a
  pathological case.

  The cut off at 20 uses was chosen by looking at other cut-offs in LLVM
  for user scanning. It's probably too high, but does the job and is
  very unlikely to regress anything.

  Fixes PR33900.

  * I'm impatient and aborted after 15 minutes, on the bug report it was
    killed after 2h.

Pull in r308986 from upstream llvm trunk (by Simon Pilgrim):

  [X86][CGP] Reduce memcmp() expansion to 2 load pairs (PR33914)

  D35067/rL308322 attempted to support up to 4 load pairs for memcmp
  inlining which resulted in regressions for some optimized libc memcmp
  implementations (PR33914).

  Until we can match these more optimal cases, this patch reduces the
  memcmp expansion to a maximum of 2 load pairs (which matches what we
  do for -Os).

  This patch should be considered for the 5.0.0 release branch as well

  Differential Revision: https://reviews.llvm.org/D35830

These fix a hang (or extremely long compile time) when building older
LLVM ports.

Reported by:    antoine
PR:             219139

7 years agoRevert r321659, re-enabling ChallengeResponseAuthentication, which was
gjb [Fri, 28 Jul 2017 18:46:02 +0000 (18:46 +0000)]
Revert r321659, re-enabling ChallengeResponseAuthentication, which was
discussed a while back between cperciva@ and so@, and I forgot.

Reported by: cperciva
Sponsored by: The FreeBSD Foundation

7 years agoTurn off ChallengeResponseAuthentication for EC2 AMIs, one of EC2's
gjb [Fri, 28 Jul 2017 18:27:30 +0000 (18:27 +0000)]
Turn off ChallengeResponseAuthentication for EC2 AMIs, one of EC2's
requirements.

MFC after: 3 days
Sponsored by: The FreeBSD Foundation

7 years agobinmiscctl should use modfind instead of kldfind
sbruno [Fri, 28 Jul 2017 18:11:53 +0000 (18:11 +0000)]
binmiscctl should use modfind instead of kldfind

kldfind() only matches kernel modules, so if you link imgact_binmisc directly
into the kernel, binmiscctl can't find it, tries to load it, and errors
out with:
  Can't load imgact_binmisc kernel module: File exists

A quick search of other base commands shows that the correct procedure is to
call modfind(), and then try kldload() if that fails.

PR: 218593
Submitted by: Dan Nelson <dnelson_1901@yahoo.com>
MFC after: 1 week

7 years agoImport ACPICA 20170728.
jkim [Fri, 28 Jul 2017 17:44:36 +0000 (17:44 +0000)]
Import ACPICA 20170728.

7 years agoSimplify flow control.
kib [Fri, 28 Jul 2017 12:22:32 +0000 (12:22 +0000)]
Simplify flow control.

Also add explicit comment why libc cannot simply rely on open(2)
failure in capability mode.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoFix remapping VM attributes on Armada 38x
mw [Fri, 28 Jul 2017 11:51:55 +0000 (11:51 +0000)]
Fix remapping VM attributes on Armada 38x

pmap_remap_vm_attr() function requires indexes to
pte2_attr_tab as the arguments (VM_MEMATTR_).
Mistakenly, instead of them, actual values from the
table were used (PTE2_ATTR_), when applying
work-around for Marvell Armada 38x SoCs.

Submitted by: Marcin Wojtas (mw@semihalf.com)
Reported by: Rafal Kozik (rk@semihalf.com)
Reviewed by: cognet (mentor)
Approved by: cognet (mentor)
Obtained from: Semihalf
Differential Revision: https://reviews.freebsd.org/D11704

7 years agoRemove the unused mutex since r273220.
loos [Fri, 28 Jul 2017 04:41:57 +0000 (04:41 +0000)]
Remove the unused mutex since r273220.

MFC after: 1 week
Sponsored by: Rubicon Communications, LLC (Netgate)

7 years agoFix style bugs in ksyms.c.
markj [Fri, 28 Jul 2017 03:18:18 +0000 (03:18 +0000)]
Fix style bugs in ksyms.c.

No functional change intended.

MFC after: 3 days

7 years agoRestrict permissions on /dev/ksyms to 0400.
markj [Fri, 28 Jul 2017 03:14:31 +0000 (03:14 +0000)]
Restrict permissions on /dev/ksyms to 0400.

The ksyms(4) device was added specifically for use by lockstat(1), which
as a DTrace consumer must run as root.

Discussed with: emaste
MFC after: 3 days

7 years agoAllow _.disk.image to be specified.
imp [Fri, 28 Jul 2017 02:00:03 +0000 (02:00 +0000)]
Allow _.disk.image to be specified.

Submitted by: ask at develooper dot com (reworked to new structure)
PR: 199191
Sponsored by: Netflix
MFC After: 3 days

7 years agoEnsure that ordinary files that happen to start with .git, .hg and
imp [Fri, 28 Jul 2017 01:59:58 +0000 (01:59 +0000)]
Ensure that ordinary files that happen to start with .git, .hg and
.cvs into the image.

This makes .gitignore files in the working tree appear in the final
tree...

PR: 192178
Submitted by: Jason Unovitch
Sponsored by: Netflix
MFC After: 3 days

7 years agoProperly expand shell glob characters in NANO_PACKAGE_LIST.
imp [Fri, 28 Jul 2017 01:59:53 +0000 (01:59 +0000)]
Properly expand shell glob characters in NANO_PACKAGE_LIST.

The defualt NANO_PACKAGE_LIST is *, which fails to work
properly. Expand glob characters and make sure that we install the
special pkg package first.

Sponsored by: Netflix
Submitted by: wout at canodus dot be
PR: 219405
MFC After: 3 days

7 years ago[ar71xx] get rid of ath_pci - it's built as a module now.
adrian [Fri, 28 Jul 2017 01:17:38 +0000 (01:17 +0000)]
[ar71xx] get rid of ath_pci - it's built as a module now.

7 years agoFix TEX index acquisition using L2 attributes
zbb [Thu, 27 Jul 2017 23:14:17 +0000 (23:14 +0000)]
Fix TEX index acquisition using L2 attributes

The TEX index is selected using (TEX0 C B) bits
from the L2 descriptor. Use correct index by masking
and shifting those bits accordingly.

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

7 years agoDrop IXL RX lock during TCP_LRO, fixes LOR mahem while holding the RX
sbruno [Thu, 27 Jul 2017 23:01:07 +0000 (23:01 +0000)]
Drop IXL RX lock during TCP_LRO, fixes LOR mahem while holding the RX
queue lock when the uppoer stack is called inside TCP_LRO

Submitted by: Kevin Bowling <kevin.bowling@kev009.com>
Reviewed by: erj
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D11724

7 years agoSlight restructure of iflib_busdma_load_mbuf_sg() to fix accounting
sbruno [Thu, 27 Jul 2017 22:53:47 +0000 (22:53 +0000)]
Slight restructure of iflib_busdma_load_mbuf_sg() to fix accounting
when m_collapse() fails.

Submitted by: krzystof.galazka@intel.com
Reviewed by: Jeb Cramer <cramerj@intel.com>
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D11476

7 years agoDeprecate unused int isc_max_txqsets and int isc_max_rxqsets as they
sbruno [Thu, 27 Jul 2017 21:21:43 +0000 (21:21 +0000)]
Deprecate unused int isc_max_txqsets and int isc_max_rxqsets as they
were redundant and not being used to set anything up.

Submitted by: Matt Macy <mmacy@mattmacy.io>
Reported by: Jeb Cramer <cramerj@intel.com>
Sponsored by: Limelight Networks

7 years agoReplace the checks for MNTK_UNMOUNTF with a macro that does the same thing.
rmacklem [Thu, 27 Jul 2017 20:55:31 +0000 (20:55 +0000)]
Replace the checks for MNTK_UNMOUNTF with a macro that does the same thing.

This patch defines a macro that checks for MNTK_UNMOUNTF and replaces
explicit checks with this macro. It has no effect on semantics, but
prepares the code for a future patch where there will also be a
NFS specific flag for "forced dismount about to occur".

Suggested by: kib
MFC after: 2 weeks

7 years agoMake it possible to request nosys logging to console.
kib [Thu, 27 Jul 2017 20:45:41 +0000 (20:45 +0000)]
Make it possible to request nosys logging to console.

New kern.lognosys values are
1 - log to ctty
2 - log to console
3 - log to both.

Inspired by: eugen
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoAllwinner A64: fix typo
manu [Thu, 27 Jul 2017 17:51:51 +0000 (17:51 +0000)]
Allwinner A64: fix typo

'pll_ddr0' is the dram parent, not 'pll_ddr'

7 years agoMake the number of children for pctrie node available outside subr_pctrie.c.
kib [Thu, 27 Jul 2017 16:40:14 +0000 (16:40 +0000)]
Make the number of children for pctrie node available outside subr_pctrie.c.

Reviewed by: alc, markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
X-Differential revision: https://reviews.freebsd.org/D11435

7 years agoRemove duplicate assignments from r321622.
ken [Thu, 27 Jul 2017 15:51:56 +0000 (15:51 +0000)]
Remove duplicate assignments from r321622.

Submitted by: mav
MFC after: 3 days
Sponsored by: Spectra Logic

7 years agoFix probing FC targets with hard addressing turned on.
ken [Thu, 27 Jul 2017 15:33:57 +0000 (15:33 +0000)]
Fix probing FC targets with hard addressing turned on.

This largely reverts FreeBSD SVN change 289937 from October 25th, 2015.

The intent of that change was to keep loop IDs persistent across
chip reinits.

The problem is that the change turned on the PREVLOOP /
PREV_ADDRESS bit (bit 7 in Firmware Options 2), which tells the
Qlogic chip to not participate in the loop if it can't get the
requested loop address.  It also turned off soft addressing on 2400
(4Gb) and newer controllers.

The isp(4) driver defaults to loop address 0, and the tape drives
I have tested default to loop address 0 if hard addressing is turned
on.  So when hard loop addressing is turned on on the drive, the isp(4)
driver just refuses to participate in the loop.

The solution is to largely revert that change.  I left some elements
in place that are related to virtual ports, since they were new.

This does work with IBM tape drives with hard and soft addressing
turned on.  I have tested it with 4Gb, 8Gb, and 16Gb controllers.

sys/dev/isp.c:
Largely revert FreeBSD SVN change 289937.  I left the
ispmbox.h changes in place.

Don't use the PREV_ADDRESS bit on initialization.  It tells
the chip to not participate if it can't get the requested
loop ID.

Do use soft addressing on 2400 and newer chips.

Use hard addressing when the user has requested a specific
initiator ID.  (hint.isp.X.iid=N in /boot/loader.conf)

Leave some of the virtual port options from that change in
place, but don't turn on the PREV_ADDRESS bit.

Reviewed by: mav
MFC after: 3 days
Sponsored by: Spectra Logic

7 years agoAlways set the receive mask in loader.efi. Some UEFI implementations set
andrew [Thu, 27 Jul 2017 15:06:34 +0000 (15:06 +0000)]
Always set the receive mask in loader.efi. Some UEFI implementations set
this to be too restrictive. We need to have both broadcast and unicast
enabled for loader to work. Set them in all cases to ensure this is true.

This allows the Cavium ThunderX 2s in the netperf cluster to netboot using
a USB NIC.

PR: 221001
Reviewed by: emaste, tsoome
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D11732

7 years agoFix singular/plural "users" output.
mav [Thu, 27 Jul 2017 14:34:57 +0000 (14:34 +0000)]
Fix singular/plural "users" output.

It was broken during libxo'fication.

PR: 221039
Submitted by: timur@
MFC after: 1 week

7 years agoBump the image size for BANANAPI and CUBIEBOARD2 to 1.5G, as
gjb [Thu, 27 Jul 2017 13:37:21 +0000 (13:37 +0000)]
Bump the image size for BANANAPI and CUBIEBOARD2 to 1.5G, as
1G is no longer large enough.

Reported by: manu
Sponsored by: The FreeBSD Foundation

7 years agoAfter inpcb route caching was put back in place there is no need for
bz [Thu, 27 Jul 2017 13:03:36 +0000 (13:03 +0000)]
After inpcb route caching was put back in place there is no need for
flowtable anymore (as flowtable was never considered to be useful in
the forwarding path).

Reviewed by: np
Differential Revision: https://reviews.freebsd.org/D11448

7 years agogenericize target exclusion for missing external toolchain
emaste [Thu, 27 Jul 2017 12:29:31 +0000 (12:29 +0000)]
genericize target exclusion for missing external toolchain

Previously we excluded riscv from make universe / tinderbox if the
required xtoolchain package was not installed. Make that logic generic
so that we can loop over multiple architectures, in preparation to test
patches to have other architectures rely on external toolchain.

Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D11652

7 years agoUse MFENCE to serialize RDTSC on non-Intel CPUs.
kib [Thu, 27 Jul 2017 08:37:07 +0000 (08:37 +0000)]
Use MFENCE to serialize RDTSC on non-Intel CPUs.

Kernel already used the stronger barrier instruction for AMDs, correct
the userspace fast gettimeofday() implementation as well.

Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D11728

7 years agoAllow to specify targets by absolute paths in libmap.conf.
kib [Thu, 27 Jul 2017 08:33:31 +0000 (08:33 +0000)]
Allow to specify targets by absolute paths in libmap.conf.

Submitted by: Tatu Kilappa <tatu.kilappa@iki.fi>
PR: 221032
MFC after: 2 weeks

7 years agoadaasync(): Set ADA_STATE_WCACHE based on ADA_FLAG_CAN_WCACHE
mav [Thu, 27 Jul 2017 07:28:29 +0000 (07:28 +0000)]
adaasync(): Set ADA_STATE_WCACHE based on ADA_FLAG_CAN_WCACHE

The attached patch lets adaasync() set ADA_STATE_WCACHE based on
ADA_FLAG_CAN_WCACHE instead of ADA_FLAG_CAN_RAHEAD.

This fixes a regression introduced in r300207 which changed
the flag names.

PR: 220948
Submitted by: Fabian Keil <fk@fabiankeil.de>
Obtained from: ElectroBSD
MFC after: 1 week

7 years agoAs in r315225, discard 3072 bytes of RC4 bytestream instead of 1024.
cy [Thu, 27 Jul 2017 06:26:15 +0000 (06:26 +0000)]
As in r315225, discard 3072 bytes of RC4 bytestream instead of 1024.

PR: 217920
Submitted by: codarren@hackers.mu
Reviewed by: emaste, cem
Approved by: so (implicit, in r315225)
MFC after: 1 week
Differential Revision: D11747
Patterned after: r315225

7 years agoFix some broken logic used in obtaining the certain config pages. I'm
scottl [Thu, 27 Jul 2017 05:31:48 +0000 (05:31 +0000)]
Fix some broken logic used in obtaining the certain config pages.  I'm
surprised that this even pretended to work.

PR: 215793
Submitted by: longwitz@incore.de

7 years agouart: add AX99100 chipset support
emaste [Thu, 27 Jul 2017 02:53:18 +0000 (02:53 +0000)]
uart: add AX99100 chipset support

PR: 215837
Submitted by: joe@thrallingpenguin.com
MFC after: 2 weeks

7 years agoFix the port vlan support in e6000 based switches.
loos [Thu, 27 Jul 2017 02:38:53 +0000 (02:38 +0000)]
Fix the port vlan support in e6000 based switches.

Reduce the use of local copies of switch register data.

The switch now works with the upstream dsa node (i.e. the upstream DTS).

Tested on: ClearFog Pro (88E6176), SG-3100 (88E6141)
Sponsored by: Rubicon Communications, LLC (Netgate)

7 years ago- Check the slot type capability, set SDHCI_SLOT_{EMBEDDED,NON_REMOVABLE}
marius [Wed, 26 Jul 2017 22:04:23 +0000 (22:04 +0000)]
- Check the slot type capability, set SDHCI_SLOT_{EMBEDDED,NON_REMOVABLE}
  for embedded slots. Fail in the sdhci(4) initialization for slot type
  shared, which is completely unsupported by this driver at the moment. [1]
  For Intel eMMC controllers, taking the embedded slot type into account
  obsoltes setting SDHCI_QUIRK_ALL_SLOTS_NON_REMOVABLE so remove these quirk
  entries.
- Hide the 1.8 V VDD capability when the slot is detected as non-embedded,
  as the SDHCI specification explicitly states that 1.8 V VDD is applicable
  to embedded slots only. [2]
- Define some easy bits of the SDHCI specification v4.20. [3]
- Don't leak bus_dma(9) resources in failure paths of sdhci_init_slot().

Obtained from: DragonFlyBSD 65704a46 [1], 7ba10b88 [2], 0df14648 [3]

7 years agoCorrectly use the size of a pointer rather than that of a pointer to a
marius [Wed, 26 Jul 2017 21:59:37 +0000 (21:59 +0000)]
Correctly use the size of a pointer rather than that of a pointer to a
pointer.

Reported by: Coverity
CID: 1378432

7 years agocc_cubic: restore braces around if-condition block
emaste [Wed, 26 Jul 2017 21:23:09 +0000 (21:23 +0000)]
cc_cubic: restore braces around if-condition block

r307901 was reverted in r321480, restoring an incorrect block
delimitation bug present in the original cc_cubic commit. Restore
only the bugfix (brace addition) from r307901.

CID: 1090182
Approved by: sbruno

7 years agoAdd a debug sysctl that lets you see i2c bus traffic through this device.
ian [Wed, 26 Jul 2017 21:20:57 +0000 (21:20 +0000)]
Add a debug sysctl that lets you see i2c bus traffic through this device.

7 years agoAdd support for tracking nested calls to iicbus_request/release_bus().
ian [Wed, 26 Jul 2017 21:06:26 +0000 (21:06 +0000)]
Add support for tracking nested calls to iicbus_request/release_bus().

Usually it is sufficient to use iicbus_transfer_excl(), or one of the
higher-level convenience functions that use it, to reserve the bus for the
duration of each register access.  Occasionally it is important that a
series of accesses or read-modify-write operations must be done without any
other intervening access to the device, to prevent corrupting state.

Without support for nested request/release, slave device drivers would have
to stop using high-level convenience functions and resort to working with
arrays of iic_msg structs just for a few operations (often involving
one-time device setup or infrequent configuration changes).

The changes here appear large from a glance at the diff, but in fact they're
nearly trivial, and the large diff is because of changes in indentation and
the re-wrapping of comments caused by that.  One notable change is that
iicbus_release_bus() now ignores the IICBUS_CALLBACK(IIC_RELEASE_BUS) return
value.  The old error handling left the bus in a kind of limbo state where
it was still owned at the iicbus layer, but drivers rarely check the return
of the release call, and it's unclear what they would do to recover from an
error return anyway.  No existing low-level drivers return any kind of error
from IIC_RELEASE_BUS except one EINVAL for "you don't own the bus", to which
the right response is probably to carry on with the process of releasing the
reference to the bus anyway.

7 years agoAdd a pair of convenience routines for doing simple "register" read/writes
ian [Wed, 26 Jul 2017 20:40:24 +0000 (20:40 +0000)]
Add a pair of convenience routines for doing simple "register" read/writes
on i2c devices, where the "register" can be any length.

Many (perhaps most) common i2c devices are organized as a collection of
(usually 1-byte-wide) registers, and are accessed by first writing a 1-byte
register index/offset number, then by reading or writing the data.
Generally there is an auto-increment feature so the when multiple bytes
are read or written, multiple contiguous registers are accessed.

Most existing slave device drivers allocate an array of iic_msg structures,
fill in all the transfer info, and invoke iicbus_transfer().  These new
functions commonize all that and reduce register access to a simple call
with a few arguments.

7 years agocxgbe(4): Some updates to the common code.
np [Wed, 26 Jul 2017 20:20:58 +0000 (20:20 +0000)]
cxgbe(4): Some updates to the common code.

- Updated register ranges.
- Helper routines for access to TP registers.
- Updated routine to read flash parameters.

Obtained from: Chelsio Communications
MFC after: 2 weeks
Sponsored by: Chelsio Communications

7 years agoMark pages after EOF as clean after pageout.
kib [Wed, 26 Jul 2017 20:07:05 +0000 (20:07 +0000)]
Mark pages after EOF as clean after pageout.

Suppose that a file on NFS has partially filled last page, and this
page is dirty.  NFS VOP_PAGEOUT() method only marks the the page clean
up to the block of the last written byte, leaving other blocks dirty.
Also any page which erronously exists in the vnode vm_object past EOF
is also left marked as dirty.

With the introduction of the buf-cache coherent pager, each pass of
syncer over the object with such page results in creation of B_DELWRI
buffer due to VOP_WRITE() call.  This buffer is noted on next syncer
pass, which results e.g. a visible manifestation of shutdown never
finishing vnode sync.  Note that before buf-cache coherency commit, a
dirty page might left never synced to server if a partial writes
occur.

Fix this by clearing dirty bits after EOF.  Only blocks of the partial
page which are completely after EOF are marked clean, to avoid
possible user data loss.

Reported by: mav
Reviewed by: alc, markj
Tested by: mav, pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D11697

7 years agoMove rtvals initialization out of the region protected by NFS node
kib [Wed, 26 Jul 2017 20:01:31 +0000 (20:01 +0000)]
Move rtvals initialization out of the region protected by NFS node
lock.

Noted by: alc
Reviewed by: alc, markj
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
X-Differential revision: https://reviews.freebsd.org/D11697

7 years agoPass the last exception trap frame to kdb_trap. This allows show registers
andrew [Wed, 26 Jul 2017 17:39:10 +0000 (17:39 +0000)]
Pass the last exception trap frame to kdb_trap. This allows show registers
in ddb to show the traps registers, and not the registers from within the
panic call.

Sponsored by: DARPA, AFRL

7 years agoAdd an auxiliary subroutine to generate some events for testing
lwhsu [Wed, 26 Jul 2017 12:07:46 +0000 (12:07 +0000)]
Add an auxiliary subroutine to generate some events for testing

This test is also timeout on a quiet system because there is nobody triggering
read probefunc while test execution.

Reviewed by: gnn, markj, ngie
Differential Revision: https://reviews.freebsd.org/D11731

7 years agoUpgrade to the latest sources generated from the CloudABI specification.
ed [Wed, 26 Jul 2017 06:57:15 +0000 (06:57 +0000)]
Upgrade to the latest sources generated from the CloudABI specification.

The CloudABI specification has had some minor changes over the last half
year. No substantial features have been added, but some features that
are deemed unnecessary in retrospect have been removed:

- mlock()/munlock():

  These calls tend to be used for two different purposes: real-time
  support and handling of sensitive (cryptographic) material that
  shouldn't end up in swap. The former use case is out of scope for
  CloudABI. The latter may also be handled by encrypting swap.

  Removing this has the advantage that we no longer need to worry about
  having resource limits put in place.

- SOCK_SEQPACKET:

  Support for SOCK_SEQPACKET is rather inconsistent across various
  operating systems. Some operating systems supported by CloudABI (e.g.,
  macOS) don't support it at all. Considering that they are rarely used,
  remove support for the time being.

- getsockname(), getpeername(), etc.:

  A shortcoming of the sockets API is that it doesn't allow you to
  create socket(pair)s, having fake socket addresses associated with
  them. This makes it harder to test applications or transparently
  forward (proxy) connections to them.

  With CloudABI, we're slowly moving networking connectivity into a
  separate daemon called Flower. In addition to passing around socket
  file descriptors, this daemon provides address information in the form
  of arbitrary string labels. There is thus no longer any need for
  requesting socket address information from the kernel itself.

This change also updates consumers of the generated code accordingly.
Even though system calls end up getting renumbered, this won't cause any
problems in practice. CloudABI programs always call into the kernel
through a kernel-supplied vDSO that has the numbers updated as well.

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

7 years agoMark name_PCTRIE_LOOKUP_LE() generated function unused.
kib [Wed, 26 Jul 2017 06:42:01 +0000 (06:42 +0000)]
Mark name_PCTRIE_LOOKUP_LE() generated function unused.

The PCTRIE macro will be shortly applied in a situation where
LOOKUP_LE is not needed.

Reviewed by: alc, markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
X-Differential revision: https://reviews.freebsd.org/D11435

7 years ago[iwm] Sync rs (rate-selection) API definitions from Linux iwlwifi.
adrian [Wed, 26 Jul 2017 05:52:37 +0000 (05:52 +0000)]
[iwm] Sync rs (rate-selection) API definitions from Linux iwlwifi.

* While there clean up alignments and line wrapping in existing
  definitions for rs API in if_iwmreg.h

Obtained from: dragonflybsd.git 085e37a042bdb17081e495e46919359ce43aa118

7 years ago[iwm] Add iwm_mvm_send_lq_cmd() from Linux iwlwifi to if_iwm_util.c.
adrian [Wed, 26 Jul 2017 05:51:31 +0000 (05:51 +0000)]
[iwm] Add iwm_mvm_send_lq_cmd() from Linux iwlwifi to if_iwm_util.c.

Obtained from: dragonflybsd.git 8a5dd7783e407856754093f5b1c9c757c64534b7

7 years ago[iwm] Sync statistics API definitions with Linux iwlwifi.
adrian [Wed, 26 Jul 2017 05:40:52 +0000 (05:40 +0000)]
[iwm] Sync statistics API definitions with Linux iwlwifi.

Obtained from: dragonflybsd.git 75895a53a9c1ba60d75be9b4bf6e49a37f91a7cf

7 years ago[iwm] Cleanup mbufq draining. Add iwm_xmit_queue_drain() like in iwn(4).
adrian [Wed, 26 Jul 2017 05:29:08 +0000 (05:29 +0000)]
[iwm] Cleanup mbufq draining. Add iwm_xmit_queue_drain() like in iwn(4).

* iwm_xmit_queue_drain() calls ieee80211_free_node(), removing a possible
  memory leak, compared to using just mbufq_drain().

* Remove duplicate mbufq_drain() from iwm_mvm_rm_sta(), this should be
  handled in the caller.

Obtained from: dragonflybsd.git 339d45fda40072e0aca5ece639173204716f11fe

7 years ago[iwm] if_iwm - Use chan list from ieee80211_scan_state for scan, not ic_channels.
adrian [Wed, 26 Jul 2017 05:26:01 +0000 (05:26 +0000)]
[iwm] if_iwm - Use chan list from ieee80211_scan_state for scan, not ic_channels.

* Limiting the channel list with "ifconfig wlan0 chanlist ..." now will
  actually set the list of channels scanned by iwm.

Tested:

* Intel 7260, STA mode, setting chanlist to 1-14 and 36-254, and indeed it does what
  it should!

7 years agoRemove trailing slash (/) for consistency.
cy [Wed, 26 Jul 2017 02:05:09 +0000 (02:05 +0000)]
Remove trailing slash (/) for consistency.

7 years agoQuiet a message that sounds far more dire than it really is.
scottl [Wed, 26 Jul 2017 01:48:13 +0000 (01:48 +0000)]
Quiet a message that sounds far more dire than it really is.

7 years agoNO_CLEAN: Hide delete-old output.
bdrewery [Tue, 25 Jul 2017 20:51:06 +0000 (20:51 +0000)]
NO_CLEAN: Hide delete-old output.

It is full of distracting noise about UPDATING and may confuse
the user about what is actually being deleted.  It is also
possible to have directories removed on every run with
use of WITHOUT_ knobs that the mtree files do not
account for and for which the directories are incorrectly
in OLD_DIRS currently.

X-MFC-With: r321443
MFC after: 1 month
Sponsored by: Dell EMC Isilon

7 years agoOnly build libzfs_core in 'make libraries' if needed.
bdrewery [Tue, 25 Jul 2017 20:43:37 +0000 (20:43 +0000)]
Only build libzfs_core in 'make libraries' if needed.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

7 years agoRemove unneeded dependency for libzfs.
bdrewery [Tue, 25 Jul 2017 20:43:26 +0000 (20:43 +0000)]
Remove unneeded dependency for libzfs.

This dependency does nothing since cddl/lib/libzfs is never
added into the 'make libraries' dependency chain
directly.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

7 years agoImprove the clarity of a comment added in r321385 by not referring to
marius [Tue, 25 Jul 2017 20:36:44 +0000 (20:36 +0000)]
Improve the clarity of a comment added in r321385 by not referring to
volatile SDHCI specification lingo.

7 years agoUse the MD __size_t to avoid a dependency on/include of non-MD header files.
ian [Tue, 25 Jul 2017 17:39:06 +0000 (17:39 +0000)]
Use the MD __size_t to avoid a dependency on/include of non-MD header files.

This should fix the compilation of the lua 5.3.4 port, among others.

Reported by: Russell Haley <russ.haley@gmail.com>

7 years agoindent(1): add option -tsn for setting tab size.
pstef [Tue, 25 Jul 2017 17:04:35 +0000 (17:04 +0000)]
indent(1): add option -tsn for setting tab size.

7 years agoRe-add #endif accidentally deleted in r321484
ngie [Tue, 25 Jul 2017 16:57:25 +0000 (16:57 +0000)]
Re-add #endif accidentally deleted in r321484

MFC after: 1 month
MFC with: r321455, r321484

7 years agoAllow -DNO_SKIP_DEPEND to override the _SKIP_DEPEND logic.
bdrewery [Tue, 25 Jul 2017 16:46:12 +0000 (16:46 +0000)]
Allow -DNO_SKIP_DEPEND to override the _SKIP_DEPEND logic.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

7 years agoOnly test ld_pi_odd with LDBL_MANT_DIG == 64 to fix the build
ngie [Tue, 25 Jul 2017 16:21:22 +0000 (16:21 +0000)]
Only test ld_pi_odd with LDBL_MANT_DIG == 64 to fix the build

The empty (unimplemented) test inputs for sparc64 trigger a -Wtype-limits build
failure because nitems of an empty array is always false, i.e., deadcode.

MFC after: 1 month
MFC with: r321455
Reported by: Jenkins (sparc64 job)

7 years agoMask issues with duplicate definitions for __fnstcw, __fldenv, and __fldcw on
ngie [Tue, 25 Jul 2017 16:11:36 +0000 (16:11 +0000)]
Mask issues with duplicate definitions for __fnstcw, __fldenv, and __fldcw on
i386 by ignoring -Wmacro-redefined.

This is a bandaid until the code is fixed and will be reverted before MFC.

7 years agobnxt: Implement interrupt coalescing options using sysctl.
sbruno [Tue, 25 Jul 2017 15:33:34 +0000 (15:33 +0000)]
bnxt: Implement interrupt coalescing options using sysctl.

Submitted by:  bhargava.marreddy@broadcom.com
Differential Revision: https://reviews.freebsd.org/D11702

7 years agoRevert r307901 - Inform CC modules about loss events.
sbruno [Tue, 25 Jul 2017 15:08:52 +0000 (15:08 +0000)]
Revert r307901 - Inform CC modules about loss events.

This was discussed between various transport@ members and it was
requested to be reverted and discussed.

Submitted by: Kevin Bowling <kevin.bowling@kev009.com>
Reported by: lawrence
Reviewed by: hiren
Sponsored by: Limelight Networks

7 years agoRevert r308180 - Set slow start threshold more accurrately on loss ...
sbruno [Tue, 25 Jul 2017 15:03:05 +0000 (15:03 +0000)]
Revert r308180 - Set slow start threshold more accurrately on loss ...

This was discussed between various transport@ members and it was
requested to be reverted and discussed.

Submitted by: kevin
Reported by: lawerence
Reviewed by: hiren

7 years agoDon't hold the RM lock during lagg_proto_addport() to avoid an LOR.
sbruno [Tue, 25 Jul 2017 14:41:50 +0000 (14:41 +0000)]
Don't hold the RM lock during lagg_proto_addport() to avoid an LOR.

Submitted by: Kevin Bowling <kevin.bowling@kev009.com>
Reviewed by: mav
MFC after: 1 week
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D11711

7 years agoDrop ixgbe RX lock during TCP_LRO processing. This eliminates a "storm"
sbruno [Tue, 25 Jul 2017 14:38:30 +0000 (14:38 +0000)]
Drop ixgbe RX lock during TCP_LRO processing.  This eliminates a "storm"
of LOR detection and a bit of lock release/acquire collision when using LRO.

Submitted by:   Kevin Bowling <kevin.bowling@kev009.com>
MFC after:      2 days
Differential Revision:  https://reviews.freebsd.org/D11712

7 years agoThe test case common.funcs.t_dtrace_contrib.tst_basename_d generates a
lwhsu [Tue, 25 Jul 2017 13:18:28 +0000 (13:18 +0000)]
The test case common.funcs.t_dtrace_contrib.tst_basename_d generates a
verifying script which needs being run to complete the test.

While here, add missing shebang.

Reviewed by: gnn, markj, ngie
Differential Revision: https://reviews.freebsd.org/D11716

7 years agospa_import_rootpool should be able to handle an imported root pool
avg [Tue, 25 Jul 2017 13:17:06 +0000 (13:17 +0000)]
spa_import_rootpool should be able to handle an imported root pool

That is required to support reboot -r with a new root filesystem being
on an already imported pool.

PR: 210721
Reported by: Jan Bramkamp <crest_maintainer@rlwinm.de>
MFC after: 2 weeks

7 years agoModify glob patterns and expected output to match FreeBSD's implementation.
lwhsu [Tue, 25 Jul 2017 13:14:02 +0000 (13:14 +0000)]
Modify glob patterns and expected output to match FreeBSD's implementation.

Reviewed by: gnn, markj, ngie
Differential Revision: https://reviews.freebsd.org/D11713

7 years agoMake this test case accepts basename() in D script returns "" or "."
lwhsu [Tue, 25 Jul 2017 13:11:20 +0000 (13:11 +0000)]
Make this test case accepts basename() in D script returns "" or "."

In Solaris, basename(1) and basename(3) both return "." while being given an
empty string (""), while in BSD (and Linux) basename(1) returns "" and
basename(3) returns "."

While here, also change #!/usr/bin/ksh to #!/usr/bin/env ksh to find ksh in
$PATH

Reviewed by: gnn, markj (earlier version), ngie (earlier version)
Differential Revision: https://reviews.freebsd.org/D11707

7 years agoExplicitly set dynamic variable buffer size.
lwhsu [Tue, 25 Jul 2017 13:07:06 +0000 (13:07 +0000)]
Explicitly set dynamic variable buffer size.

We added too many variable assignments in BEGIN block, which will run out of
default auto-configured variable buffer space.  The test VM has 4G RAM which
should be enough for most cases so it's reasonable to increase limitation to
these case.

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

7 years agoExplicitly set dynamic variable buffer size.
lwhsu [Tue, 25 Jul 2017 13:04:24 +0000 (13:04 +0000)]
Explicitly set dynamic variable buffer size.

We added too many variable assignments in BEGIN block, which will run out of
default auto-configured variable buffer space.  The test VM has 4G RAM which
should be enough for most cases so it's reasonable to increase limitation to
these case.

Reviewed by: gnn, markj, ngie
Differential Revision: https://reviews.freebsd.org/D11674

7 years agoAdd an auxiliary subroutine to generate read(2) event while testing.
lwhsu [Tue, 25 Jul 2017 13:01:10 +0000 (13:01 +0000)]
Add an auxiliary subroutine to generate read(2) event while testing.

Reviewed by: gnn, ngie
Differential Revision: https://reviews.freebsd.org/D11673

7 years agoAdd a simple script which calls open(2) and others to generate events for
lwhsu [Tue, 25 Jul 2017 12:58:03 +0000 (12:58 +0000)]
Add a simple script which calls open(2) and others to generate events for
testing.

This test times-out on a quiet system because there is nobody triggers
syscall::open:entry or syscall::: probe while test execution.

Reviewed by: gnn, markj (earlier version)
Differential Revision: https://reviews.freebsd.org/D11671

7 years agoAdd a simple program which calls sigtimedwait(2) to generate events for testing
lwhsu [Tue, 25 Jul 2017 12:52:32 +0000 (12:52 +0000)]
Add a simple program which calls sigtimedwait(2) to generate events for testing

This test timeout on a quiet system because there is nobody triggers
'syscall::*wait*:entry' probe while test execution.

Reviewed by: gnn, markj, ngie
Differential Revision: https://reviews.freebsd.org/D11668

7 years agoRemove duplicate statement.
tuexen [Tue, 25 Jul 2017 11:05:53 +0000 (11:05 +0000)]
Remove duplicate statement.

7 years agoBuild the 32-bit ARM libstand and loader parts with -fPIC. Many of them are
andrew [Tue, 25 Jul 2017 10:41:34 +0000 (10:41 +0000)]
Build the 32-bit ARM libstand and loader parts with -fPIC. Many of them are
already built with this flag so libstand should also be build as such.
This will be needed when moving to lld as it refuses to link due to
incompatible relocations.

Sponsored by: DARPA, AFRL

7 years agoFix indent.
kib [Tue, 25 Jul 2017 09:48:33 +0000 (09:48 +0000)]
Fix indent.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

7 years agoReplace unnecessary _KERNEL by double-include protection.
dchagin [Tue, 25 Jul 2017 06:59:35 +0000 (06:59 +0000)]
Replace unnecessary _KERNEL by double-include protection.

MFC after: 2 week

7 years agoMark :reduction as an expected failure
ngie [Tue, 25 Jul 2017 03:56:42 +0000 (03:56 +0000)]
Mark :reduction as an expected failure

It fails with clang 5.0+.

PR: 220989
MFC after: 2 months
MFC with: r321369
Reported by: Jenkins

7 years agoConvert lib/msun/trig_test from TAP to ATF format
ngie [Tue, 25 Jul 2017 03:55:44 +0000 (03:55 +0000)]
Convert lib/msun/trig_test from TAP to ATF format

Only expose :accuracy and :reduction if !i386, similar to before,
but more holistically to avoid future -Wunused issue with the unused
functions.

MFC after: 1 month

7 years agoRaise WARNS to 1
ngie [Tue, 25 Jul 2017 03:54:35 +0000 (03:54 +0000)]
Raise WARNS to 1

This will enable warnings with the msun tests.

MFC after: 1 month

7 years agobsdgrep(1): Don't exit before processing every file
kevans [Tue, 25 Jul 2017 01:50:37 +0000 (01:50 +0000)]
bsdgrep(1): Don't exit before processing every file

Given an empty pattern (i.e. grep "" A B), bsdgrep(1) would previously exit()
with the appropriate exit code upon encountering an empty file. Likely intended
as an optimization, but this behavior is technically incorrect since an empty
pattern should match every line.

PR: 220924
Reviewed by: emaste, cem (earlier version), ngie
Approved by: emaste (mentor)
Differential Revision: https://reviews.freebsd.org/D11698

7 years agoUnconditionally install etc/mtree/BSD.debug.dist again
ngie [Tue, 25 Jul 2017 00:28:23 +0000 (00:28 +0000)]
Unconditionally install etc/mtree/BSD.debug.dist again

r279248 unconditionally installed BSD.debug.dist for ease-of-developer-use.
Restore the previous behavior.

While here, add a comment to note that this is intentional to avoid accidental
future removal.

MFC after: 2 months
MFC with: r321444

7 years agocleandir: Fix ESTALE errors from parallel removals.
bdrewery [Tue, 25 Jul 2017 00:12:48 +0000 (00:12 +0000)]
cleandir: Fix ESTALE errors from parallel removals.

This fixes 'make cleandir' to use the same ordering as 'make cleanobj'.
Meaning that SUBDIR will be recursed before the current directory is
handled.  This avoids an 'rm -rf /usr/obj/usr/src/lib/libc' while
a child 'rm -rf /usr/obj/usr/src/lib/libc/tests' is being ran next,
or even removing the current directory and then recursing into a child
and using the 'missing OBJDIR' logic to remove files rather than the
directory.

The most ideal ordering here would be for 'cleanobj' and 'cleandir' to
simply remove the .OBJDIR and then not recurse at all.  This is only
safe if it is guaranteed that all children directories have no orphaned
files in their source checkout and are only using obj directories.  This
is usually safe from the top-level build targets and when using
WITH_AUTO_OBJ.  Improving the build for those cases is coming.

Reported by: cperciva, scottl
X-MFC-With: r321427
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

7 years agoRemove ${MTREE} and leverage etc/mtree/Makefile instead with
ngie [Mon, 24 Jul 2017 23:57:43 +0000 (23:57 +0000)]
Remove ${MTREE} and leverage etc/mtree/Makefile instead with
"make distribution".

This also fixes the fact that BSD.debug.dist was being installed if/when
${MK_DEBUG_FILES} != "no" before this commit.

MFC after: 2 months

7 years agoNO_CLEAN: Utilize delete-old to remove old orphaned libraries/headers in WORLDTMP.
bdrewery [Mon, 24 Jul 2017 23:32:46 +0000 (23:32 +0000)]
NO_CLEAN: Utilize delete-old to remove old orphaned libraries/headers in WORLDTMP.

This prevents situations with -DNO_CLEAN from finding stale headers or
libraries in places that no longer exist or have moved.  It avoids
the need to remove all of WORLDTMP by reusing what we already know
is obsolete.

MFC after: 1 month
Sponsored by: Dell EMC Isilon