]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agoMFC 308456: Pass the correct flag to find_symdef() from _rtld_bind().
jhb [Thu, 1 Dec 2016 20:36:48 +0000 (20:36 +0000)]
MFC 308456: Pass the correct flag to find_symdef() from _rtld_bind().

When symbol versioning was added to rtld, the boolean 'in_plt' argument
to find_symdef() was converted to a bitmask of flags.  The first flag
added was 'SYMLOOK_IN_PLT' which replaced the 'in_plt' bool.  This
happened to still work by accident as SYMLOOK_IN_PLT had the value of 1
which is the same as 'true', so there should be no functional change.

7 years agoBacking out r309368 as it got commited prematurely as we still do not
tsoome [Thu, 1 Dec 2016 20:31:37 +0000 (20:31 +0000)]
Backing out r309368 as it got commited prematurely as we still do not
provide skein feature support in boot loader.

Approved by: allanjude (mentor)

7 years agoMFC r308776
tsoome [Thu, 1 Dec 2016 19:06:09 +0000 (19:06 +0000)]
MFC r308776

loader: zfs toplevel vdev must have spa set.

PR: 214375
Reported by: lstewart
Reviewed by: allanjude, imp
Approved by: allanjude (mentor), imp (mentor)
Differential Revision: https://reviews.freebsd.org/D8487

7 years agoMFC r306577 r306652 306830
vangyzen [Wed, 30 Nov 2016 21:53:06 +0000 (21:53 +0000)]
MFC r306577 r306652 306830

Add GARP retransmit capability

A single gratuitous ARP (GARP) is always transmitted when an IPv4
address is added to an interface, and that is usually sufficient.
However, in some circumstances, such as when a shared address is
passed between cluster nodes, this single GARP may occasionally be
dropped or lost.  This can lead to neighbors on the network link
working with a stale ARP cache and sending packets destined for
that address to the node that previously owned the address, which
may not respond.

To avoid this situation, GARP retransmissions can be enabled by setting
the net.link.ether.inet.garp_rexmit_count sysctl to a value greater
than zero.  The setting represents the maximum number of retransmissions.
The interval between retransmissions is calculated using an exponential
backoff algorithm, doubling each time, so the retransmission intervals
are: {1, 2, 4, 8, 16, ...} (seconds).

Due to the exponential backoff algorithm used for the interval
between GARP retransmissions, the maximum number of retransmissions
is limited to 16 for sanity.  This limit corresponds to a maximum
interval between retransmissions of 2^16 seconds ~= 18 hours.
Increasing this limit is possible, but sending out GARPs spaced
days apart would be of little use.

Update arp(4) to document the net.link.ether.inet.garp_rexmit_count sysctl.

Submitted by: dab
Relnotes: yes
Sponsored by: Dell EMC

7 years agoMFC r308340
vangyzen [Wed, 30 Nov 2016 20:51:14 +0000 (20:51 +0000)]
MFC r308340

ncal: fix a reference to an out-of-scope stack buffer

PR: 214237
Submitted by: Jonathan de Boyne Pollard
Sponsored by: Dell EMC

7 years agoMFC r308904
vangyzen [Wed, 30 Nov 2016 20:47:54 +0000 (20:47 +0000)]
MFC r308904

Fix error reporting from wcstof()

When wcstof() skipped initial space and then parsing failed, it set
endptr to the first non-space character.  Fix it to correctly report
failure by setting endptr to the beginning of the input string.
The fix is from theraven@, who fixed this bug in wcstod() and
wcstold() in r227753.

While I'm here:

Move assignments out of declarations in wcstod() and wcstold().
This is against my personal preference, but it is our agreed style(9).

Set endptr correctly on malloc() failure in all three functions.

Remove an incorrect comment:  This is pointer arithmetic,
so the code was not actually making that assumption.

wcstold() advanced the wcp pointer beyond leading whitespace
and then reset it back to the beginning of the string.
Do not reset it.  This seems to have no functional effect,
since strtold_l() also skips leading whitespace.  I'm making
the change to keep this function consistent with wcstof() and
wcstod(), and because the C11 spec prescribes the use of iswspace()
to skip leading space.

Reported by: libc++ unit test for std::stof(std::wstring)
Sponsored by: Dell EMC

7 years agoMFC r308824
vangyzen [Wed, 30 Nov 2016 18:26:22 +0000 (18:26 +0000)]
MFC r308824

locale: fix display of "grouping" and "mon_grouping" values

The "grouping" and "mon_grouping" values are arrays of one-byte
integers, not arrays of ASCII characters.  Display them in a format
similar to GNU and MacOS.

Sponsored by: Dell EMC

7 years agoMFC r308129:
bapt [Wed, 30 Nov 2016 12:06:03 +0000 (12:06 +0000)]
MFC r308129:

When issuing a PXE dhcp request, always issue a param request (DHCP option 55)
with all dhcp parameters we might be interested in.

Some DHCP server like the new kea (by ISC) expect it.

This makes pxeboot functional with ISC kea.

Submitted by: Vincent Legout <vincent.legout@gandi.net>
Sponsored by: Gandi.net

7 years agoMFC 308797-308799, 309082
dexuan [Wed, 30 Nov 2016 07:22:46 +0000 (07:22 +0000)]
MFC 308797-308799, 309082

    r308797
    update the hv_vmbus(4) manual by adding a dependency on pci

    We enhanced the vmbus driver to support PCIe pass-through recently.

    Reviewed by:        sephe
    Approved by:        sephe (mentor)
    Sponsored by:       Microsoft

    r308798
    remove the hv_ata_pci_disengage(4) manual

    A few months ago, we removed the driver, which was not necessary any longer.

    Reviewed by:        sephe
    Approved by:        sephe (mentor)
    Sponsored by:       Microsoft

    r308799
    fix share/man/man4/Makefile for hv_ata_pci_disengage.4

    We need to remove the line since we removed the related manual just now.

    Reviewed by:        sephe
    Approved by:        sephe (mentor)
    Sponsored by:       Microsoft

    r309082
    share/man/man4/Makefile: Only install Hyper-V man pages on amd64 and i386

    We shouldn't install them on the architectures not supported by Hyper-V.

    And, hv_ata_pci_disengage.4.gz should be removed from all architectures:
    1) It should have only applied to Hyper-V;
    2) For Hyper-V platforms (amd64 and i386), the related driver was removed by
    r306426 | sephe | 2016-09-29 09:41:52 +0800 (Thu, 29 Sep 2016),
    because now we have a better mechanism to disble the ata driver for hard
    disks when the VM runs on Hyper-V.

    Reviewed by:        sephe, andrew, jhb
    Approved by:        sephe (mentor)
    Sponsored by:       Microsoft
    Differential Revision:      https://reviews.freebsd.org/D8572

7 years agoMFC: 308723-308725,308793-308795,309127
dexuan [Wed, 30 Nov 2016 06:20:43 +0000 (06:20 +0000)]
MFC: 308723-308725,308793-308795,309127

Approved by: sephe (mentor)

r308723
    hyperv/vmbus: add a new method to get vcpu_id

    vcpu_id is host's representation of guest CPU.
    We get the mapping between vcpu_id and FreeBSD kernel's cpu id when VMBus
    driver is loaded. Later, when a driver, like the coming pcib driver, talks
    to the host and needs to refer to a guest CPU, the driver must use the
    vcpu_id.

    Reviewed by:    jhb, sephe
    Approved by:    sephe (mentor)
    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8410

r308724
    hyperv/vmbus: add new vmbus methods to support PCIe pass-through

    The new methods will be used by the coming pcib driver.

    Reviewed by:    sephe
    Approved by:    sephe (mentor)
    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8409

r308725
    hyperv/pcib: enable PCIe pass-through (a.k.a. Discrete Device Assignment)

    The feature enables us to pass through physical PCIe devices to FreeBSD VM
    running on Hyper-V (Windows Server 2016) to get near-native performance with
    low CPU utilization.

    The patch implements a PCI bridge driver to support the feature:

    1) The pcib driver talks to the host to discover device(s) and presents
    the device(s) to FreeBSD's pci driver via PCI configuration space (note:
    to access the configuration space, we don't use the standard I/O port
    0xCF8/CFC method; instead, we use an MMIO-based method supplied by Hyper-V,
    which is very similar to the 0xCF8/CFC method).

    2) The pcib driver allocates resources for the device(s) and initialize
    the related BARs, when the device driver's attach method is invoked;

    3) The pcib driver talks to the host to create MSI/MSI-X interrupt
    remapping between the guest and the host;

    4) The pcib driver supports device hot add/remove.

    Reviewed by:    sephe
    Approved by:    sephe (mentor)
    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8332

r308793
    hyperv/pcib: Fix the build for some kernel configs

    Add the dependency on pci explicitly for the pcib and vmbus drivers.
    The related Makefiles are updated accordingly too.

    Reviewed by:    sephe
    Approved by:    sephe (mentor)
    Sponsored by:   Microsoft

r308794
    hyperv/vmbus,pcib: Add MODULE_DEPEND on pci

    We'd better add this dependency explicitly, though usually the pci
    driver is built into the kernel by default.

    Reviewed by:    sephe
    Approved by:    sephe (mentor)
    Sponsored by:   Microsoft

r308795
    hyperv/pcib: change the file name: pcib.c -> vmbus_pcib.c

    This makes the file name and the variable naming in the file consistent.

    Reviewed by:    sephe
    Approved by:    sephe (mentor)
    Sponsored by:   Microsoft

r309127
    hyperv/vmbus,pcib: unbreak build in case NEW_PCIB is undefined

    vmbus_pcib requires NEW_PCIB, but in case that's not defined, we at
    least shouldn't break build.

    Reviewed by:    sephe
    Approved by:    sephe (mentor)
    Sponsored by:   Microsoft

7 years agoMFC r309027:
brooks [Wed, 30 Nov 2016 01:17:02 +0000 (01:17 +0000)]
MFC r309027:

Allocate a struct ifreq rather than using a (wrong) computed size for
the BIOCSETIF ioctl.

The kernel always copies an entire struct ifreq and IPv4 addresses will
always fit in an ifreq.

On systems with pointers larger than 64-bits, the computed size will be
less than the size of struct ifreq, potentially resulting in the kernel
attempting to copyin memory from outside the allocation.

Reviewed by: jhb
Obtained from: CheriBSD
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D8445

7 years agoMFC r308980:
kib [Tue, 29 Nov 2016 08:20:55 +0000 (08:20 +0000)]
MFC r308980:
Use buffer pager for NFS.

MFC note: really do not, by default.

7 years agoMFC r308973:
kib [Tue, 29 Nov 2016 08:17:24 +0000 (08:17 +0000)]
MFC r308973:
Minor cleanup.

7 years agoMFC r308969:
kib [Tue, 29 Nov 2016 08:15:12 +0000 (08:15 +0000)]
MFC r308969:
Restore vnode pager statistic for buffer pagers.

7 years agoMFC r308995:
kib [Tue, 29 Nov 2016 08:12:18 +0000 (08:12 +0000)]
MFC r308995:
Do not dereference bp after bread(9) on error.

7 years agoMFC r309006: remove unnecessary vm includes from setproctitle
emaste [Tue, 29 Nov 2016 01:08:09 +0000 (01:08 +0000)]
MFC r309006: remove unnecessary vm includes from setproctitle

vm headers were needed only for the PS_STRINGS fallback, which was
removed in r297888.

7 years agoMFC r308780
asomers [Mon, 28 Nov 2016 22:35:10 +0000 (22:35 +0000)]
MFC r308780

Fix "camcontrol rescan" with SATA drives behind a SAS controller

A bug in CAM's serial number hash logic resulted in SATA drives behind a SAS
controller getting removed and readded anytime the drive was rescanned for
any reason

7 years agoMFC r309194, r309216
bapt [Mon, 28 Nov 2016 22:19:41 +0000 (22:19 +0000)]
MFC r309194, r309216

Properly initialize nextp

Reported by: Coverity via cem
MFC after: 2 days
CID: 1365665

7 years agoMFC 307756: Define max_align_t for C11.
jhb [Mon, 28 Nov 2016 18:36:37 +0000 (18:36 +0000)]
MFC 307756: Define max_align_t for C11.

libc++'s stddef.h includes an existing definition of max_align_t for
C++11, but it is only defined for C++, not for C.  In addition, GCC and
clang both define an alternate version of max_align_t that uses a
union of multiple types rather than a plain long double as in libc++.
This adds a __max_align_t to <sys/_types.h> that matches the GCC and
clang definition that is mapped to max_align_t in <stddef.h>.

PR: 210890

7 years agoMFC r308730:
hselasky [Mon, 28 Nov 2016 17:22:45 +0000 (17:22 +0000)]
MFC r308730:
Make sure MAC address is reprogrammed when if_init() callback is
invoked. Else promiscious mode must be used to pass traffic. While at
it fix a debug print macro.

7 years agoMFC r308618:
kib [Sun, 27 Nov 2016 09:10:33 +0000 (09:10 +0000)]
MFC r308618:
Provide simple mutual exclusion between mount point update and unmount.
In the update path in ffs_mount(), drop vfs_busy() reference around namei().

7 years agoMFC r308608:
mav [Sun, 27 Nov 2016 05:58:47 +0000 (05:58 +0000)]
MFC r308608:
Use providergone method to cover race between destroy and g_access().

7 years agoMFC r308579: Do not report error on close even if we have no paths left.
mav [Sat, 26 Nov 2016 07:59:18 +0000 (07:59 +0000)]
MFC r308579: Do not report error on close even if we have no paths left.

7 years agoMFC r307003, r307564: makewhatis: make output reproducible
emaste [Sat, 26 Nov 2016 03:39:02 +0000 (03:39 +0000)]
MFC r307003, r307564: makewhatis: make output reproducible

r307003: Instead:

1) provide fts_open() with a comparison function to process directories
   and files in a deterministic order
2) in addition to the existing hash, insert pages into a linked list
   which will be sorted (by virtue of 1)
3) iterate over pages by the list in 2, instead of hash order

Idea from: des

r307564: makewhatis: avoid skipping another page after one with no mlinks

Submitted by: Ingo Schwarze

Sponsored by: The FreeBSD Foundation

7 years agoMFC r308808, r308809: Lookup locale when print all keywords as well.
ume [Sat, 26 Nov 2016 02:48:04 +0000 (02:48 +0000)]
MFC r308808, r308809: Lookup locale when print all keywords as well.

7 years agoMFC r308580:
rstone [Sat, 26 Nov 2016 01:16:33 +0000 (01:16 +0000)]
MFC r308580:

  Don't read if_counters with if_addr_lock held

  Calling into an ifnet implementation with the if_addr_lock already
  held can cause a LOR and potentially a deadlock, as ifnet
  implementations typically can take the if_addr_lock after their
  own locks during configuration.  Refactor a sysctl handler that
  was violating this to read if_counter data in a temporary buffer
  before the if_addr_lock is taken, and then copying the data
  in its final location later, when the if_addr_lock is held.

  PR: 194109
  Reported by: Jean-Sebastien Pedron
  MFC after: 2 weeks
  Differential Revision:        https://reviews.freebsd.org/D8498
  Reviewed by: sbruno

7 years agoMFC r308064:
mckusick [Sat, 26 Nov 2016 00:43:38 +0000 (00:43 +0000)]
MFC r308064:
Avoid possible overflow when calclating malloc size for auxillary
data structure sizes when mounting and reloading UFS/FFS filesystems.

7 years agoMFC 307333: Reprogram I/O APIC interrupt pins when registering an I/O APIC.
jhb [Fri, 25 Nov 2016 22:12:03 +0000 (22:12 +0000)]
MFC 307333: Reprogram I/O APIC interrupt pins when registering an I/O APIC.

All I/O APIC pins are masked when an I/O APIC is first probed.  The
APIC enumerator (MP Table or MADT) then parses its associated tables to
configure individual pins to set custom delivery modes or alternate
routing (e.g. routing IRQ 0 to intpin 2).  Pins for regular interrupt
pins are left masked until the first interrupt is assigned.  However,
pins with unusual settings (e.g. NMI or SMI) are never assigned an
interrupt and thus never re-programmed.  The I/O APIC code used to
reprogram all interrupt pins during registration but this was lost in
r151979.

In theory, this is mostly a no-op as the ACPI APIC table does not
include a way to enumerate NMI or SMI pins for the I/O APIC, so only
systems using an MP Table would be affected.

7 years agoMFC r308443, r308459, r308462, r308478, r308786
araujo [Fri, 25 Nov 2016 05:54:17 +0000 (05:54 +0000)]
MFC r308443, r308459, r308462, r308478, r308786

r308443:
Add -d flag that prints domain only.

PR: 212875
Submitted by: Ben RUBSON <ben.rubson@gmail.com>
Reviewed by: pi

r308459:
Fix missing '-' for the flags -s and -d on both manpage and usage.

Reported by: garga, bde

r308462:
Add flag -B which does the same like batch mode but without exiting after
print. Also add a new flag -s that add blocks size to statistics.

PR: 198347, 212726
Submitted by: Ben RUBSON <ben.rubson@gmail.com>
Tested by: pi
MFC After: 2 weeks.

r308478:
We can't use protect(1) inside a jail(8)!
To avoid have warning for services that are using oomprotect, oomprotect
will only be applied on services that won't run inside jails.

Reported by: allanjude
MFC after: 2 weeks.

r308786:
rc.subr: Swap checks so we only fork sysctl if *_oomprotect is set.

7 years agoMFC r307969: strings: fix exit status if a file before the last one fails
emaste [Fri, 25 Nov 2016 00:25:59 +0000 (00:25 +0000)]
MFC r307969: strings: fix exit status if a file before the last one fails

Previously a command like "strings f1 f2 f3" reported the exit status
based only on processing the last file.

As with GNU strings, report an error exit status if an error was
encountered processing any of the files. While here simplify the
exit status handling to just success (0) / failure (1).

7 years agoMFC r308772: crunchide: report explicit error for combined string table
emaste [Thu, 24 Nov 2016 00:45:00 +0000 (00:45 +0000)]
MFC r308772: crunchide: report explicit error for combined string table

Some tools produce objects with a combined strtab and shstrtab.
These objects are not supported by crunchide since it rewrites the
symtab and strtab to "hide" symbols. This invalidates section header
offsets into a combined strtab/shstrtab.

In the future we could support these objects (by ensuring that we retain
unmodified section name strings in the output .strtab, and then rewriting
each section header's sh_name).

7 years agoMFC 308056: Fix formatting of tables.
jhb [Wed, 23 Nov 2016 23:53:52 +0000 (23:53 +0000)]
MFC 308056: Fix formatting of tables.

Specifically, use .Ta instead of tabs to separate column entries.  While
here fix a few other things:
- Use .Sy for all column headers (previously only the first column header
  was bold)
- Use .Dv to markup constants used for MIB names.
- Use "1234" and "4321" for the byte order descriptions without
  thousands separators.
- Mark up header files in the first table with .In.

7 years agoMFC 307975: Enable EFER_NXE properly on APs.
jhb [Wed, 23 Nov 2016 23:45:42 +0000 (23:45 +0000)]
MFC 307975: Enable EFER_NXE properly on APs.

EFER_NXE is set in the EFER MSR by initializecpu() and must be set on all
CPUs in the system.  When PG_NX support was added to PAE on i386, the
block to enable EFER_NXE was placed in a section of initializecpu() that
only runs if 'cpu == CPU_686'.  During early boot, locore does an
initial pass to set cpu that sets it to CPU_686 on all CPUs later than
a Pentium.  Later, printcpuinfo() adjusts the 'cpu' variable on
PII and later CPUs to one of CPU_PII, CPU_PIII, or CPU_P4.  However,
printcpuinfo() is called after initializecpu() on the BSP, so the BSP
would enable EFER_NXE and pg_nx.  The APs execute initializecpu() much
later after printcpuinfo() has run.  The end result on a modern CPU was
that cpu was set to CPU_PIII when the APs invoked initializecpu(), so
they did not enable EFER_NXE.  As a result, the APs would fault when
trying to access any pages marked with PG_NX set.

When booting a 2 CPU PAE kernel in bhyve this manifested as a hang before
single user mode.  The attempt to execute /bin/init tried to copy out
the exec strings (argv, etc.) to a non-executable mapping while running
on the AP.  The instruction kept faulting due to invalid bits in the PTE
in an infinite loop.

Fix this by moving the code to enable EFER_NXE out of the switch statement
on 'cpu' and always doing it if 'amd_feature' supports AMDID_NX.

7 years agoMFC: 307541
gnn [Wed, 23 Nov 2016 13:14:19 +0000 (13:14 +0000)]
MFC: 307541

Limit the number of mbufs that can be allocated for IPV6_2292PKTOPTIONS
(and IPV6_PKTOPTIONS).

PR: 100219
Submitted by: Joseph Kong

7 years agoMFC r308733:
kib [Wed, 23 Nov 2016 09:37:02 +0000 (09:37 +0000)]
MFC r308733:
Move the fast fault path into the separate function.

7 years agoMFC r308689:
kib [Wed, 23 Nov 2016 09:25:51 +0000 (09:25 +0000)]
MFC r308689:
Pass CPUID[1] %edx (cpu_feature), %ecx (cpu_feature2) and
CPUID[7].%ebx (cpu_stdext_feature), %ecx (cpu_stdext_feature2) to the
ifunc resolvers on x86.

MFC r308925:
Adjust r308689 to make rtld compilable with either in-tree or
(hopefully) stock gcc 4.2.1 on i386 and other arches.

7 years agoMFC r308425: Add support for EIIOE flag in Additional Element Status.
mav [Wed, 23 Nov 2016 09:10:11 +0000 (09:10 +0000)]
MFC r308425: Add support for EIIOE flag in Additional Element Status.

It was added in SES-3 spec, and its support required to properly link
the Additional Element Status page data to the original elements.

7 years agoMFC r307584
asomers [Tue, 22 Nov 2016 20:28:17 +0000 (20:28 +0000)]
MFC r307584

Fix C++ includability of crypto headers with static array sizes

C99 allows array function parameters to use the static keyword for their
sizes. This tells the compiler that the parameter will have at least the
specified size, and calling code will fail to compile if that guarantee is
not met. However, this syntax is not legal in C++.

This commit reverts r300824, which worked around the problem for
sys/sys/md5.h only, and introduces a new macro: min_size(). min_size(x) can
be used in headers as a static array size, but will still compile in C++
mode.

7 years agoMFC 306999: Add a missing word.
jhb [Tue, 22 Nov 2016 18:46:01 +0000 (18:46 +0000)]
MFC 306999: Add a missing word.

7 years agoMFC 308142: Move declarations of invpcid_works and pmap_pcid_enabled to pmap.h.
jhb [Tue, 22 Nov 2016 18:43:04 +0000 (18:43 +0000)]
MFC 308142: Move declarations of invpcid_works and pmap_pcid_enabled to pmap.h.

Previously these were only declared under #ifdef SMP in <machine/smp.h>.
However, these variables are defind in pmap.c unconditionally, and efirt.c
references them unconditionally.  This fixes non-SMP kernel builds.

7 years agoMFC r308694:
markj [Tue, 22 Nov 2016 17:42:59 +0000 (17:42 +0000)]
MFC r308694:
Plug a lock leak in sysctl_ifmalist().

PR: 214542

7 years agoMFC r308957: MFV r308954:
delphij [Tue, 22 Nov 2016 16:22:51 +0000 (16:22 +0000)]
MFC r308957: MFV r308954:

ntp 4.2.8p9.

Approved by: so

7 years agoMFC r308673:
ae [Tue, 22 Nov 2016 10:09:04 +0000 (10:09 +0000)]
MFC r308673:
  Add missing support of named lookup tables to the IPv6 code.

  PR: 214419

7 years agoMFC r308688:
kib [Tue, 22 Nov 2016 09:37:31 +0000 (09:37 +0000)]
MFC r308688:
Assert that there is no unresolved symbols during rtld linking.

7 years agoMFC r308687:
kib [Tue, 22 Nov 2016 09:35:50 +0000 (09:35 +0000)]
MFC r308687:
Update hint to utilize user variable.

7 years agoMFC r308642:
kib [Mon, 21 Nov 2016 10:44:40 +0000 (10:44 +0000)]
MFC r308642:
Initialize reserved bytes in struct mq_attr.

PR: 214488

7 years agoMFC r308089: zfsbootcfg: a simple tool to set next boot (one time)
avg [Mon, 21 Nov 2016 10:13:09 +0000 (10:13 +0000)]
MFC r308089: zfsbootcfg: a simple tool to set next boot (one time)
options for zfsboot

7 years agoZero etherswitch_vlangroup structure before doing partial assignments.
loos [Sun, 20 Nov 2016 17:03:52 +0000 (17:03 +0000)]
Zero etherswitch_vlangroup structure before doing partial assignments.

Sponsored by: Rubicon Communications, LLC (Netgate)

7 years agoMFC r308617:
kib [Sun, 20 Nov 2016 09:11:21 +0000 (09:11 +0000)]
MFC r308617:
Move common cleanup code into helper.

7 years agoMFC r307755: swapoff: Remove only late devices with -aL.
jilles [Sat, 19 Nov 2016 20:02:49 +0000 (20:02 +0000)]
MFC r307755: swapoff: Remove only late devices with -aL.

Currently, '/etc/rc.d/swaplate stop' removes all swap devices. This can be
very slow and may not even be possible if there is a lot of swap space in
use. However, removing swap devices is only needed for late swap devices
that may depend on daemons that subsequent shutdown steps stop. Normal swap
devices such as hard disk partitions will remain available throughout the
shutdown process and need not be removed.

In swapoff, interpret -aL to remove late swap devices only, and use this in
etc/rc.d/swaplate. The meaning of -aL in swapon remains unchanged (add all
swap devices, both normal and late).

PR: 187081

7 years agoMFC r306585: swapon(8): Update to reality: swapoff ignores -L and the late
jilles [Sat, 19 Nov 2016 19:25:38 +0000 (19:25 +0000)]
MFC r306585: swapon(8): Update to reality: swapoff ignores -L and the late
option in fstab.

7 years agoMFC r307752
asomers [Fri, 18 Nov 2016 22:28:57 +0000 (22:28 +0000)]
MFC r307752

Close some file descriptor leaks in pw

7 years agoMFC r308538:
kib [Fri, 18 Nov 2016 09:01:44 +0000 (09:01 +0000)]
MFC r308538:
Increase the max allowed size of the microcode update blob for x86.

7 years agoMFC r308288:
kib [Fri, 18 Nov 2016 08:59:47 +0000 (08:59 +0000)]
MFC r308288:
Do not sleep in vm_wait() if pagedaemon did not yet started.  Panic instead.

7 years agoMFC r308247: MFV r308222: 6051 lzc_receive: allow the caller to read the
avg [Thu, 17 Nov 2016 15:19:27 +0000 (15:19 +0000)]
MFC r308247: MFV r308222: 6051 lzc_receive: allow the caller to read the
begin record

7 years agoMFC r308218: Add support for microcode update on newer AMD CPUs (10h+)
avg [Thu, 17 Nov 2016 15:16:52 +0000 (15:16 +0000)]
MFC r308218: Add support for microcode update on newer AMD CPUs (10h+)

7 years agoMFC r308101: hwpmc: fix a race between amd_stop_pmc and amd_intr
avg [Thu, 17 Nov 2016 15:14:54 +0000 (15:14 +0000)]
MFC r308101: hwpmc: fix a race between amd_stop_pmc and amd_intr

7 years agoMFC r307195: convert iicsmb to use iicbus_transfer for all operations
avg [Thu, 17 Nov 2016 15:13:16 +0000 (15:13 +0000)]
MFC r307195: convert iicsmb to use iicbus_transfer for all operations

7 years agoMFC r308040,308479: nap time between pats is forced to be at most half
avg [Thu, 17 Nov 2016 15:10:52 +0000 (15:10 +0000)]
MFC r308040,308479: nap time between pats is forced to be at most half
of the timeout

7 years agoMFC r308237:
loos [Thu, 17 Nov 2016 14:32:23 +0000 (14:32 +0000)]
MFC r308237:

Remove the mbuf tag after use (for reinjected packets).

Fixes the packet processing in dummynet l2 rules.

Obtained from: pfSense
Sponsored by: Rubicon Communications, LLC (Netgate)

7 years agoMFC r308464, r308471: Add some device IDs found in my new laptop.
mav [Wed, 16 Nov 2016 18:38:40 +0000 (18:38 +0000)]
MFC r308464, r308471: Add some device IDs found in my new laptop.

7 years agoMFC r308212:
kib [Wed, 16 Nov 2016 16:14:01 +0000 (16:14 +0000)]
MFC r308212:
Allow some dotdot lookups in capability mode.

7 years agoMFC r308477:
bapt [Wed, 16 Nov 2016 07:05:42 +0000 (07:05 +0000)]
MFC r308477:

make pxeboot consistent with common/dev_net.c

Always define boot.netif.server in kenv in pxeboot
Add "boot.tftproot.server" to kenv when pxeboot uses tftpfs
Change the code order when setting env for TFTP or NFS to be the same as
common/dev_net.c

Reported by: tsoome

7 years agoMFC r308160:
bapt [Wed, 16 Nov 2016 07:04:49 +0000 (07:04 +0000)]
MFC r308160:

syslogd(8): add an 'include' keyword

All the '.conf' files not beginning with a '.' contained int he directory
following the keyword will be included.

This keyword can only be used in the first level configuration files.

Modify the default syslogd.conf to 'include' /etc/syslog.d and
/usr/local/etc/syslog.d

It simplify a lot handling of syslog from automation tools.

Reviewed by: markj, kib (via irc)
Approved by: markj
MFC after: 2 weeks
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D8402

7 years agoMFC r308139, r308157-r308158
bapt [Wed, 16 Nov 2016 07:03:24 +0000 (07:03 +0000)]
MFC r308139, r308157-r308158

r308139:
cron(8): add support for /etc/cron.d and /usr/local/etc/cron.d

For automation tools it is way easier to maintain files in directories rather
than modifying /etc/crontab.

The files in those directories are in the same format as /etc/crontab

Reviewed by: adrian
MFC after: 2 weeks
Relnotes: yes
Sponsored by: Gandi.net
Differential Revision: https://reviews.freebsd.org/D8400

r308157:
Fix typo in cron(8) date

Reported by: jilles

r308158:
Allow symlinks to be followed in cron.d directories and fix detection of
regular files on NFS

Reported by: jilles

7 years agoMFC r307238:
bapt [Wed, 16 Nov 2016 07:01:52 +0000 (07:01 +0000)]
MFC r307238:

Stop closing the network device when netbooting for loaders using the common
dev_net.c code.

The NETIF_OPEN_CLOSE_ONCE flag was added in r201932 to prevent that behaviour
on some architectures (sparc64 and powerpc64) the default was left to always
open and close the device for each open and close of a file by the loader
because it was necessary for u-boot on arm.

Since it has been added, the flag was turned on for every arches including the
u-boot loader for arm.

This also fixes netbooting on RPi3 (tested by gonzo@)

For the loader.efi it greatly speeds up netbooting

Reviewed by: emaste, gonzo, tsoome
Approved by: gonzo
MFC after: 1 month
Sponsored by: Gandi.net
Differential Revision: https://reviews.freebsd.org/D8230

7 years agoMFC r308348:
hrs [Wed, 16 Nov 2016 03:54:30 +0000 (03:54 +0000)]
MFC r308348:

  Add link-layer address option in RA even for IFT_L2VLAN and IFT_BRIDGE.

  Reported by:  philip

7 years agoMFC r308347:
hrs [Wed, 16 Nov 2016 03:51:05 +0000 (03:51 +0000)]
MFC r308347:

  Fix an infinite loop at an non-responding hop when other echo replies
  are kept arriving in the waittime time window.

  Submitted by: Denny Page
  PR:           210286

7 years agoMFC r307978:
mckusick [Wed, 16 Nov 2016 01:03:42 +0000 (01:03 +0000)]
MFC r307978:
Bug 180894 reports that rm -rf on a directory causes kernel panic and reboot.
Return EINVAL rather than panic for low directory link count.

PR: 180894

7 years agoMFC r308567: Fix build when WITHOUT_BLACKLIST=yes is specified
lidl [Tue, 15 Nov 2016 23:03:57 +0000 (23:03 +0000)]
MFC r308567: Fix build when WITHOUT_BLACKLIST=yes is specified

Sponsored by: The FreeBSD Foundation

7 years agoMFC r302474 (By gnn)
hiren [Tue, 15 Nov 2016 22:18:52 +0000 (22:18 +0000)]
MFC r302474 (By gnn)

On FreeBSD there is a setsockopt option SO_USER_COOKIE which allows
setting a 32 bit value on each socket. This can be used by applications
and DTrace as a rendezvous point so that an applicaton's data can
more easily be captured at run time. Expose the user cookie via
DTrace by updating the translator in tcp.d and add a quick test
program, a TCP server, that sets the cookie on each connection
accepted.

Sponsored by:     Limelight Networks

7 years agoMFC r308416:
hselasky [Tue, 15 Nov 2016 08:54:03 +0000 (08:54 +0000)]
MFC r308416:
Add timer to watch the RQ when we are out of mbufs.

The firmware/hardware does not generate additional completion
events unless we post new buffers. Use a timer to try to post
more buffers in case we are temporarily out of mbufs. Else
the receive schedule completely stops.

Sponsored by: Mellanox Technologies

7 years agoMFC r308414:
hselasky [Tue, 15 Nov 2016 08:53:25 +0000 (08:53 +0000)]
MFC r308414:
Add more firmware related structures and update existing ones in the
MLX5 core module. Update the set and query diagnostics counter API.

Sponsored by: Mellanox Technologies

7 years agoMFC r308413:
hselasky [Tue, 15 Nov 2016 08:52:45 +0000 (08:52 +0000)]
MFC r308413:
Query flow table capabilities according to the correct capability bit
for infiniband.

Sponsored by: Mellanox Technologies

7 years agoMFC r308412:
hselasky [Tue, 15 Nov 2016 08:52:06 +0000 (08:52 +0000)]
MFC r308412:
Correct checksum fields in the "mlx5_mini_cqe8" structure. The fields
in question are currently not used.

Sponsored by: Mellanox Technologies

7 years agoMFC r308411:
hselasky [Tue, 15 Nov 2016 08:51:29 +0000 (08:51 +0000)]
MFC r308411:
Ensure the firmware is notified of any host memory allocation
failures. Else firmware commands may time out waiting for host
memory.

Sponsored by: Mellanox Technologies

7 years agoMFC r308409:
hselasky [Tue, 15 Nov 2016 08:50:42 +0000 (08:50 +0000)]
MFC r308409:
When a firmware command times out do not free the command structure to
avoid use after free.

Sponsored by: Mellanox Technologies

7 years agoMFC r308295:
gonzo [Tue, 15 Nov 2016 03:40:22 +0000 (03:40 +0000)]
MFC r308295:

[gpio] Add GPIO driver for Intel Bay Trail SoC

Bay Trail has three banks of GPIOs exposed to userland as /dev/gpiocN,
where N is 1, 2, and 3. Pins in each bank are pre-named to match names
on boards schematics: GPIO_S0_SCnn, GPIO_S0_NCnn, and GPIO_S5_nn.

Controller supports edge-triggered and level-triggered interrupts but
current version of the driver does not have interrupts support

7 years agoStop abusing from struct ifnet presence to determine the packet direction
loos [Tue, 15 Nov 2016 01:20:36 +0000 (01:20 +0000)]
Stop abusing from struct ifnet presence to determine the packet direction
for dummynet, use the correct argument for that, remove the false coment
about the presence of struct ifnet.

Fixes the input match of dummynet l2 rules.

Obtained from: pfSense
Sponsored by: Rubicon Communications, LLC (Netgate)

7 years agoMFC r308428:
gonzo [Tue, 15 Nov 2016 00:28:07 +0000 (00:28 +0000)]
MFC r308428:

Refactor FDT part of gpioled driver

- Split driver in two parts: FDT and non-FDT
- Instead of reattach gpioled nodes to GPIO bus use
    gpio_pin_get_by_ofw_idx and add ofwbus and simplebus as parrent buses

Reviewed by: loos
Differential Revision: https://reviews.freebsd.org/D8233

7 years agoMFC r308581:
gonzo [Mon, 14 Nov 2016 22:39:33 +0000 (22:39 +0000)]
MFC r308581:

[rpi_ft5406] Add missing dependency on mbox_if.h

Submitted by: hselasky

7 years agoMFC r308240:
gonzo [Mon, 14 Nov 2016 22:33:57 +0000 (22:33 +0000)]
MFC r308240:

[evdev] Add evdev support to atkbd(4) driver

To enable event sourcing from atkbd kern.evdev.rcpt_mask value
should have bit 3 set.

Submitted by: Vladimir Kondratiev <wulf@cicgroup.ru>
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D8381

7 years agoMFC r308189:
gonzo [Mon, 14 Nov 2016 21:27:18 +0000 (21:27 +0000)]
MFC r308189:

[psm] Fix choosing wrong mode for synaptic device + trackpoint

With guest trackpoint present trackpoint probing switched synaptics
device to absolute mode with different protocol instead of keeping it
in relative mode.

PR: 213757
Submitted by: Vladimir Kondratyev <wulf@cicgroup.ru>
MFC after: 1 week

7 years agoMFC r308559:
dim [Mon, 14 Nov 2016 18:57:21 +0000 (18:57 +0000)]
MFC r308559:

Pull in r263169 from upstream llvm trunk (by Tim Northover):

  AArch64: only try to use scaled fcvt ops on legal vector types.

  Before we ended up calling getSimpleVectorType on a <3 x float>, which
  asserted.

This fixes an assertion when building the print/ghostscript9-agpl-base
port for AArch64.

PR: 213865

7 years agoMFC r308487:
dim [Mon, 14 Nov 2016 18:54:31 +0000 (18:54 +0000)]
MFC r308487:

Pull in r263301 from upstream llvm trunk (by Ahmed Bougacha):

  [AArch64] Don't blindly lower f16/f128 FCCMPs.

  Instead, extend f16 (like we do when lowering a standalone SETCC),
  and let f128 be legalized to the RT calls.

  Fixes PR26803.

This fixes a fatal "Cannot select" backend error when building the
net/freerdp port for AArch64.

PR: 214380

7 years agoMFC r308133, r308134: Fix wrong copy/paste in error message.
mav [Mon, 14 Nov 2016 18:41:34 +0000 (18:41 +0000)]
MFC r308133, r308134: Fix wrong copy/paste in error message.

7 years agoMFC 308201
sephe [Mon, 14 Nov 2016 06:37:04 +0000 (06:37 +0000)]
MFC 308201

    hyperv/kvp: Don't mix message status codes and function return values.

    While I'm here, move message status codes to hv_utilreg.h, since they
    will be used by the upcoming VSS stuffs.

    Submitted by:   Hongjiang Zhang <honzhan microsoft com>
    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8391

7 years agoMFC 308194
sephe [Mon, 14 Nov 2016 06:31:01 +0000 (06:31 +0000)]
MFC 308194

    hyperv: GC unused functions.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8406

7 years agoMFC 308168
sephe [Mon, 14 Nov 2016 06:28:29 +0000 (06:28 +0000)]
MFC 308168

    hyperv/vmbus: Avoid extra header copy.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8395

7 years agoMFC 308166,308167
sephe [Mon, 14 Nov 2016 06:25:22 +0000 (06:25 +0000)]
MFC 308166,308167

308166
    hyperv/hn: Move TSO packet fixup to an earlier place for if_transmit.

    While TSO packet header may be still cache-hot.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8393

308167
    hyperv/hn: Directly fill chimney sending buffer for small packets.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8394

7 years agoMFC 308164
sephe [Mon, 14 Nov 2016 06:03:29 +0000 (06:03 +0000)]
MFC 308164

    hyperv/hn: Regroup if_start related functions.

    And put them under HN_IFSTART_SUPPORT, which is by default on until
    we whack the if_start related bits from base system.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8392

7 years agoMFC 308163
sephe [Mon, 14 Nov 2016 06:00:30 +0000 (06:00 +0000)]
MFC 308163

    hyperv/hn: Rename cleaned up file.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8390

7 years agoMFC 308162
sephe [Mon, 14 Nov 2016 05:41:37 +0000 (05:41 +0000)]
MFC 308162

    hyperv/hn: Cosmetic cleanup; no functional changes.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8389

7 years agoMFC 308117-308120
sephe [Mon, 14 Nov 2016 05:37:34 +0000 (05:37 +0000)]
MFC 308117-308120

308117
    hyperv/hn: Rework temporary channel packet buffer expanding.

    And use large default temporary channel packer buffer; we really
    don't want it to be expanded at run time.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8367

308118
    hyperv/hn: Cleanup RXBUF ack processing.

    - Increase the # of retries.
    - Add comment.
    - Log error, if RXBUF ack fails.
    - Add stat for RXBUF ack failures.

    RXBUF ack really should _not_ fail...

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8368

308119
    hyperv/hn: Reset do_lro, if the hash types are not TCP related.

    Mainly because the host side only set TCPCS and IPCS even for
    UDP datagrams.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8369

308120
    hyperv/hn: Don't start shared TX taskq, if the hypervisor is not Hyper-V.

    - Move the SYSINIT to DRIVER/SECOND, i.e. after the vm_guest becomes
      determistic.
    - Minor style changes.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8370

7 years agoMFC 308018,308116
sephe [Mon, 14 Nov 2016 05:24:05 +0000 (05:24 +0000)]
MFC 308018,308116

308018
    hyeprv/hn: Rename cleaned up RNDIS header file.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8360

308116
    hyperv/hn: Rename cleaned up RNDIS source file.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8361

7 years agoMFC 308013-308017
sephe [Mon, 14 Nov 2016 03:49:28 +0000 (03:49 +0000)]
MFC 308013-308017

308013
    hyperv/hn: Nuke unnecessary indirection.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8355

308014
    hyperv/hn: Reorganize RX path; mainly pull non-control code path up

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8356

308015
    hyperv/hn: Pull data path code up.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8357

308016
    hyperv/hn: Cleanup RNDIS related files.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8358

308017
    hyperv/hn: Change header guardian; in preparation for the upcoming rename.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8359

7 years agoMFC 308011,308012
sephe [Mon, 14 Nov 2016 03:36:59 +0000 (03:36 +0000)]
MFC 308011,308012

308011
    hyperv/hn: Rename cleaned up NVS header file.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8353

308012
    hyperv/hn: Rename cleaned up NVS source file.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8354

7 years agoMFC 307989-307991,308010
sephe [Mon, 14 Nov 2016 03:19:17 +0000 (03:19 +0000)]
MFC 307989-307991,308010

307989
    hyperv/hn: Move hn_softc to if_hnvar.h

    While I'm here, use consistent macro names.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8345

307990
    hyperv/hn: Move send context to NVS domain.

    Since all sends are encapsulated in NVS messages.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8346

307991
    hyperv/hn: NVS inclusion cleanup and forward declare functions.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8347

308010
    hyperv/hn: Change header guardian; in preparation for the upcoming rename.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8352

7 years agoMFC 307985-307988
sephe [Mon, 14 Nov 2016 03:14:43 +0000 (03:14 +0000)]
MFC 307985-307988

307985
    hyperv/hn: Nuke unnecessary M_NETVSC

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8340

307986
    hyperv/hn: Move %b format string for capabilities near their definition.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8341

307987
    hyperv/hn: Define empty packet filter.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8342

307988
    hyperv/hn: Shuffle chimney sending buffer alloc/free around.

    This paves way for more chimney sending buffer reorganization.

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8343

7 years agoMFC 307983
sephe [Mon, 14 Nov 2016 03:07:48 +0000 (03:07 +0000)]
MFC 307983

    hyperv/hn: Properly configure RSS according to RSS capabilities

    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8338