]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years ago[bytgpio] Fix USB disconnect event after listsing pins on gpioc2
Oleksandr Tymoshenko [Sun, 20 Nov 2016 18:38:32 +0000 (18:38 +0000)]
[bytgpio] Fix USB disconnect event after listsing pins on gpioc2

- Do not set input flag when reading value from GPIO pin, it is not
  required and for gpioc2(S5 bank) setting both input and output flags
  leads to some kind of electric interference (curren drop?) that
  causes USB devices to disconnect

- Check pad configuration when attaching device and provide IN/OUT
  capabilities only for pads that are configured as GPIO. Do not let
  user code to configure or change value of non-GPIO pads. There is
  no information for NC bank in intel's datasheet so for now function
  check is ignored for pins in it

Reported by: Frank H.
MFC after: 3 days

7 years agoAdd spigen to the ARMv6 GENERIC kernel
Emmanuel Vadot [Sun, 20 Nov 2016 18:21:42 +0000 (18:21 +0000)]
Add spigen to the ARMv6 GENERIC kernel

7 years agorc.subr: $(ps -p $$ -o jid=) is always 0, so do not fork ps for it.
Jilles Tjoelker [Sun, 20 Nov 2016 18:21:05 +0000 (18:21 +0000)]
rc.subr: $(ps -p $$ -o jid=) is always 0, so do not fork ps for it.

The JID keyword writes 0 for a process also in the host system or in the
same jail.

7 years agoEnable the use of spigen on FDT platform
Emmanuel Vadot [Sun, 20 Nov 2016 18:20:28 +0000 (18:20 +0000)]
Enable the use of spigen on FDT platform

MFC after: 2 weeks

7 years agofix unsafe modification of zfs_vnodeops when DIAGNOSTIC is enabled
Andriy Gapon [Sun, 20 Nov 2016 14:00:50 +0000 (14:00 +0000)]
fix unsafe modification of zfs_vnodeops when DIAGNOSTIC is enabled

The idea was to avoid a false assertion in zfs_lock, but it was
implemented very dangerously and incorrectly.

Reported by: pho
Tested by: pho
MFC after: 1 week

7 years agoAttempt package build even if dependencies seems to be missing
Poul-Henning Kamp [Sun, 20 Nov 2016 10:01:21 +0000 (10:01 +0000)]
Attempt package build even if dependencies seems to be missing

7 years agoActually bump __FreeBSD_version
Justin Hibbits [Sun, 20 Nov 2016 06:11:30 +0000 (06:11 +0000)]
Actually bump __FreeBSD_version

7 years agoFix buildworld for powerpc.
Justin Hibbits [Sun, 20 Nov 2016 06:10:12 +0000 (06:10 +0000)]
Fix buildworld for powerpc.

vmpage requires struct pmap to exist and contain a pm_stats field.  As of
r308817, either AIM or BOOKE is required to be set in order to get their
respective pmap structs.  Rather than expose them both, or try to unify them
unnecessarily, add a third option which contains only a pm_stats field, and
change the two existing pmap structures to place the common fields at the
beginning of the struct.  This actually fixes the stats collection by libkvm on
AIM hardware, because before it was accessing a possibly different offset, which
would cause it to read garbage.

Bump __FreeBSD_version to denote this ABI change, so that ports which depend on
libkvm can be rebuilt.

7 years agoUse ofw_gpiobus instead of plain gpiobus for CI20
Alexander Kabaev [Sun, 20 Nov 2016 01:59:22 +0000 (01:59 +0000)]
Use ofw_gpiobus instead of plain gpiobus for CI20

Requesed by: mmel

7 years agoModify umount so that it does not do an Unmount RPC for NFSv4 mounts
Rick Macklem [Sat, 19 Nov 2016 23:58:50 +0000 (23:58 +0000)]
Modify umount so that it does not do an Unmount RPC for NFSv4 mounts
and uses TCP for the Unmount RPC if the mount is over TCP.
Without this patch, umount does an Unmount RPC over UDP for all NFS mounts.

Suggested by: cperciva
Reviewed by: cperciva
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D8503

7 years agoi386 turns out to not have __uint128_t. So confusingly use 64-bit math
Warner Losh [Sat, 19 Nov 2016 21:46:13 +0000 (21:46 +0000)]
i386 turns out to not have __uint128_t. So confusingly use 64-bit math
instead. Since we're little endian, we can get away with it. Also,
since the counters in quesitons would require billions of iops for
tens of billions of seconds to overflow, and since such data rates are
unlikely for people using i386 for a while, that's OK. The fastest
cards today can't do even a million IOPs.

Noticed by: dim@
Sponsored by: Netflix, Inc

7 years ago[dd] Revert the capsicum bits for now until it gets fixed.
Adrian Chadd [Sat, 19 Nov 2016 18:19:21 +0000 (18:19 +0000)]
[dd] Revert the capsicum bits for now until it gets fixed.

dd is a bootstrap tool and that header isn't installed as part of the
bootstrap environment for previous releases (eg freebsd-10.)

We'll figure it out in post and then re-commit it.

7 years agoEnable SMP on Ingenic JZ4780.
Ruslan Bukin [Sat, 19 Nov 2016 18:03:46 +0000 (18:03 +0000)]
Enable SMP on Ingenic JZ4780.

It is required to proceed full cache flush before we can use wait
instruction on multicore, so use nop instead for now.

Submitted by: kan
Sponsored by: DARPA, AFRL

7 years agoRestore dd changes included accidentally in r308857.
Ruslan Bukin [Sat, 19 Nov 2016 17:51:02 +0000 (17:51 +0000)]
Restore dd changes included accidentally in r308857.

7 years agoBring in support for Ingenic XBurst JZ4780 and
Ruslan Bukin [Sat, 19 Nov 2016 17:46:18 +0000 (17:46 +0000)]
Bring in support for Ingenic XBurst JZ4780 and
X1000 systems on chips.

Imgtec CI20 and Ingenic CANNA boards supported.

Submitted by: Alexander Kabaev <kan@FreeBSD.org>
Reviewed by: Ruslan Bukin <br@FreeBSD.org>
Sponsored by: DARPA, AFRL

7 years agoDecode the Intel-specific Additional SMART data page (0xca) and print
Warner Losh [Sat, 19 Nov 2016 17:13:12 +0000 (17:13 +0000)]
Decode the Intel-specific Additional SMART data page (0xca) and print
it in human readable form. Include a pointer to the public spec that
was followed to implement this in the code. Samsung also implements
page 0xca on some of their drives, but the format is slighly
different, so the code skips printing zero keys. Samsung's log page
has additional, unknown data after the end of Intel defined data which
isn't displayed.

Supported by: Netfix, Inc

7 years agoImplement HGST Log page 0xc1, as documented in the HGST SN100 and
Warner Losh [Sat, 19 Nov 2016 17:13:08 +0000 (17:13 +0000)]
Implement HGST Log page 0xc1, as documented in the HGST SN100 and
SN150 product manuals. Subpage 0x32 is documented, but not implemented.

Sponsored by: Netflix, Inc

7 years agoPrint Intel's expanded Temperature log page.
Warner Losh [Sat, 19 Nov 2016 17:13:03 +0000 (17:13 +0000)]
Print Intel's expanded Temperature log page.

Sponsored by: Netflix, Inc

7 years agoAdd log pages that Intel SSDs provide. It turns out that many of these
Warner Losh [Sat, 19 Nov 2016 17:12:58 +0000 (17:12 +0000)]
Add log pages that Intel SSDs provide. It turns out that many of these
are widely implemented beyond just Intel drives.

Sponsored by: Netflix, Inc

7 years agoAdd log pages defined through NVM Express 1.2.1.
Warner Losh [Sat, 19 Nov 2016 17:12:53 +0000 (17:12 +0000)]
Add log pages defined through NVM Express 1.2.1.

Sponsored by: Netflix, Inc

7 years agoExpand the SMART / Health Information Log Page (Page 02) printout
Warner Losh [Sat, 19 Nov 2016 17:12:49 +0000 (17:12 +0000)]
Expand the SMART / Health Information Log Page (Page 02) printout
based on NVM Express 1.2.1 Standard.

Sponsored by: Netflix, Inc

7 years agoPrint numbers instead of hex values for smart data. The full 128-bit
Warner Losh [Sat, 19 Nov 2016 17:12:44 +0000 (17:12 +0000)]
Print numbers instead of hex values for smart data. The full 128-bit
number is printed, even though you'd need like a billion IOPs for a 10
billion seconds to overflow the 64-bit counters (~300 years).

Sponsored by: Netflix, Inc

7 years agoUse a table for pages we know the size of. We have a special case for
Warner Losh [Sat, 19 Nov 2016 17:12:39 +0000 (17:12 +0000)]
Use a table for pages we know the size of. We have a special case for
the error log since it isn't a fixed size.

Sponsored by: Netflix, Inc

7 years agoRemove check for valid log pages. Let the drive tell us which pages
Warner Losh [Sat, 19 Nov 2016 17:12:28 +0000 (17:12 +0000)]
Remove check for valid log pages. Let the drive tell us which pages
are valid or not. While many pages are reserved in the standard, that
doesn't make them invalid and future versions of the standard may
define then.

Sponsored by: Netflix, Inc

7 years agoAdd XBurst CPU option.
Ruslan Bukin [Sat, 19 Nov 2016 17:12:24 +0000 (17:12 +0000)]
Add XBurst CPU option.

Submitted by: kan
Sponsored by: DARPA, AFRL

7 years agoMove intrng includes to the main MIPS includes file.
Ruslan Bukin [Sat, 19 Nov 2016 17:01:06 +0000 (17:01 +0000)]
Move intrng includes to the main MIPS includes file.

Sponsored by: DARPA, AFRL

7 years agoAccount for bigger secondary data cache line size.
Ruslan Bukin [Sat, 19 Nov 2016 16:36:38 +0000 (16:36 +0000)]
Account for bigger secondary data cache line size.

Secondary data cache line size can be bigger than
primary data cache line size, so use biggest value
as a minimum alignment.

Submitted by: kan
Sponsored by: DARPA, AFRL

7 years agoloader: smbios version check is not correct
Toomas Soome [Sat, 19 Nov 2016 16:08:40 +0000 (16:08 +0000)]
loader: smbios version check is not correct

The version check for sku and family values is not correct, as this data is
valid for version 2.4+, that also includes version 3.0 and above.

Reported by: Dan McDonald
Reviewed by: allanjude
Approved by: allanjude (mentor)
Differential Revision: https://reviews.freebsd.org/D8578

7 years agoAdd receiver timeout interrupt enable bit implemented in some
Ruslan Bukin [Sat, 19 Nov 2016 16:00:05 +0000 (16:00 +0000)]
Add receiver timeout interrupt enable bit implemented in some
system on chips.

Submitted by: kan
Sponsored by: DARPA, AFRL

7 years agoThe only remaining offender that used ti_chip() without checking for
Olivier Houchard [Sat, 19 Nov 2016 15:43:22 +0000 (15:43 +0000)]
The only remaining offender that used ti_chip() without checking for
compatibility first was the gpio code, so change that, and re-assert
that the TI chip is a known chip

7 years agoAdd Ingenic XBurst coprocessor 0 extra bits.
Ruslan Bukin [Sat, 19 Nov 2016 15:38:13 +0000 (15:38 +0000)]
Add Ingenic XBurst coprocessor 0 extra bits.

Submitted by: kan
Sponsored by: DARPA, AFRL

7 years agoDon't panic if it's not a TI chip, this code can be called when it is not.
Olivier Houchard [Sat, 19 Nov 2016 15:35:40 +0000 (15:35 +0000)]
Don't panic if it's not a TI chip, this code can be called when it is not.

7 years agoDon't attempt to get the chip revision if it's not a supported TI chip
Olivier Houchard [Sat, 19 Nov 2016 15:35:10 +0000 (15:35 +0000)]
Don't attempt to get the chip revision if it's not a supported TI chip

7 years agoIdentify Ingenic CPUs.
Ruslan Bukin [Sat, 19 Nov 2016 15:10:10 +0000 (15:10 +0000)]
Identify Ingenic CPUs.

Submitted by: kan
Sponsored by: DARPA, AFRL

7 years agoAdd Ingenic X1000 DTS files (unofficial).
Ruslan Bukin [Sat, 19 Nov 2016 15:03:49 +0000 (15:03 +0000)]
Add Ingenic X1000 DTS files (unofficial).

This is based on JZ4780 due to missing original X1000 parts.

Sponsored by: DARPA, AFRL

7 years agoOn H3, initialize alarm and shutdown trip points and do temperature
Jared McNeill [Sat, 19 Nov 2016 14:56:22 +0000 (14:56 +0000)]
On H3, initialize alarm and shutdown trip points and do temperature
conversion as it is done in the BSP.

7 years agoEnsure that TCP state changes to state-closing are reported via dtrace.
Michael Tuexen [Sat, 19 Nov 2016 14:45:08 +0000 (14:45 +0000)]
Ensure that TCP state changes to state-closing are reported via dtrace.
This does not cover state changes from TIME-WAIT.

Reviewed by: gnn
MFC after: 3 weeks
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D8443

7 years agoMake fdt_is_compatible a static function. It's only used in fdt_common.c.
Andrew Turner [Sat, 19 Nov 2016 13:57:21 +0000 (13:57 +0000)]
Make fdt_is_compatible a static function. It's only used in fdt_common.c.

Sponsored by: ABT Systems Ltd

7 years agoMove the pandaboard initialization from the probe to the attach method.
Olivier Houchard [Sat, 19 Nov 2016 13:11:03 +0000 (13:11 +0000)]
Move the pandaboard initialization from the probe to the attach method.
Use ofw_bus_node_is_compatible instead of fdt_is_compatible, as the
later is deprecated.

Suggested by: andrew

7 years agolsdev device name section headers should be printed by dv_print callback.
Toomas Soome [Sat, 19 Nov 2016 08:54:21 +0000 (08:54 +0000)]
lsdev device name section headers should be printed by dv_print callback.

lsdev command does walk over devsw list, prints list element name and
will use dv_print() callback to print the device list.
Unfortunately this approach will add unneeded noise when there are no
particular devices detected.

To remove "empty" device section headers, the dv_print() callback
should print the header instead.

In addition, fixed dv_print callback for md module.

Reviewed by: imp
Approved by: imp (mentor)
Differential Revision: https://reviews.freebsd.org/D8551

7 years agozfs: fix up after the removal of PG_CACHED pages in r308691
Andriy Gapon [Sat, 19 Nov 2016 08:12:57 +0000 (08:12 +0000)]
zfs: fix up after the removal of PG_CACHED pages in r308691

PR: 214629
Reported by: mshirk@daemon-security.com
Reviewed by: alc
Tested by: Shawn Webb <shawn.webb@hardenedbsd.org>
X-MFC with: 308691

7 years agoFor RTL8812AU:
Kevin Lo [Sat, 19 Nov 2016 07:28:00 +0000 (07:28 +0000)]
For RTL8812AU:
- The Tx power (diff) values should be signed
- Fix an off by one error when reading Tx power (diff) values

Reviewed by: avos, adrian
Differential Revision: https://reviews.freebsd.org/D8571

7 years agolocale: fix display of "grouping" and "mon_grouping" values
Eric van Gyzen [Sat, 19 Nov 2016 02:09:58 +0000 (02:09 +0000)]
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.

MFC after: 3 days
Sponsored by: Dell EMC

7 years ago[net80211] handle hardware encryption offload in the receive path
Adrian Chadd [Sat, 19 Nov 2016 02:00:24 +0000 (02:00 +0000)]
[net80211] handle hardware encryption offload in the receive path

* teach the crypto modules about receive offload - although I have
  to do some further reviewing in places where we /can't/ have an RX key
* teach the RX data path about receive offload encryption - check the flag,
  handle NULL key, do decap and checking as appropriate.

Tested:

* iwn(4), STA mode
* ath(4), STA and AP mode
* ath10k port, STA mode (hardware encryption)

Reviewed by: avos
Differential Revision: https://reviews.freebsd.org/D8533

7 years agoResolv the remaining conflicting symbols between omap4 and am335x, and
Olivier Houchard [Sat, 19 Nov 2016 01:51:56 +0000 (01:51 +0000)]
Resolv the remaining conflicting symbols between omap4 and am335x, and
add omap4/pandaboard into the GENERIC kernel.

7 years agoMFamd64: Various fatal page fault fixes.
John Baldwin [Sat, 19 Nov 2016 01:36:44 +0000 (01:36 +0000)]
MFamd64: Various fatal page fault fixes.

- If a page fault is triggered due to reserved bits in a PTE, treat it
  as a fatal fault and panic.
- If PG_NX is in use, report whether a fatal page fault is due to an
  instruction fetch or a data access.
- If a fatal page fault is due to reserved bits in a PTE, report that as
  the page fault type rather than a protection violation.

MFC after: 1 month

7 years agoReport page faults due to reserved bits in PTEs as a separate fault type.
John Baldwin [Sat, 19 Nov 2016 01:34:12 +0000 (01:34 +0000)]
Report page faults due to reserved bits in PTEs as a separate fault type.

Rather than reporting a page fault due to a bad PTE as a protection
violation with the "rsv" flag, treat these faults as a separate type of
fault altogether.

MFC after: 1 month

7 years agoDon't assume we're running on a pandaboard if the pandaboard-specific
Olivier Houchard [Sat, 19 Nov 2016 00:55:46 +0000 (00:55 +0000)]
Don't assume we're running on a pandaboard if the pandaboard-specific
code is compiled in, use FDT to detect it instead.

7 years agoGuess the TI chip based on the PLATFORM infos, instead of relying on the
Olivier Houchard [Fri, 18 Nov 2016 23:48:20 +0000 (23:48 +0000)]
Guess the TI chip based on the PLATFORM infos, instead of relying on the
kernel config file.

7 years agoFix buildworld
Justin Hibbits [Fri, 18 Nov 2016 22:59:33 +0000 (22:59 +0000)]
Fix buildworld

Change the pv_tracked flag to an int, just in case userspace decides to include
this file and defines BOOKE.

Guard this block from unintentional inclusion with ifdef BOOKE.

Reported by: emaste

7 years agoConvert the omap4 code to use PLATFORM_SMP.
Olivier Houchard [Fri, 18 Nov 2016 22:58:47 +0000 (22:58 +0000)]
Convert the omap4 code to use PLATFORM_SMP.

7 years agoCheck link status after init
Stephen Hurd [Fri, 18 Nov 2016 21:18:51 +0000 (21:18 +0000)]
Check link status after init

Because link state change events aren't enabled until the end of init(),
the initial link up event could be missed.  Check the current media status
immediately after enabling the default completion ring interrupt.

Approved by: sbruno
MFC after: 12 days
Sponsored by: Broadcom Limited

7 years ago[ifconfig] remove now duplicate IEEE80211_C_BITS definition; it's now in _ieee80211.h .
Adrian Chadd [Fri, 18 Nov 2016 21:12:36 +0000 (21:12 +0000)]
[ifconfig] remove now duplicate IEEE80211_C_BITS definition; it's now in _ieee80211.h .

Reviewed by: avos
Differential Revision: https://reviews.freebsd.org/D8553

7 years ago[net80211] shuffle IEEE80211_C and HTC bits over to _ieee80211.h so userland can...
Adrian Chadd [Fri, 18 Nov 2016 21:12:13 +0000 (21:12 +0000)]
[net80211] shuffle IEEE80211_C and HTC bits over to _ieee80211.h so userland can use this.

Reviewed by: avos
Differential Revision: https://reviews.freebsd.org/D8553

7 years agoCapsicum support for dd(1)
Bartek Rutkowski [Fri, 18 Nov 2016 21:09:57 +0000 (21:09 +0000)]
Capsicum support for dd(1)

Adds Capsicum sandboxing to dd utility.

Submitted by: Pawel Biernacki <pawel.biernacki@gmail.com>
Reviewed by: allanjude, emaste, oshogbo
Approved by: oshogbo
Sponsored by: Mysterious Code Ltd.
Differential Revision: https://reviews.freebsd.org/D8543

7 years agoWe need to lookup locale when command line arguments
Hajimu UMEMOTO [Fri, 18 Nov 2016 17:18:05 +0000 (17:18 +0000)]
We need to lookup locale when command line arguments
are specified, as well.
MFC after: 1 week

7 years agoLookup locale when print all keywords as well.
Hajimu UMEMOTO [Fri, 18 Nov 2016 16:48:37 +0000 (16:48 +0000)]
Lookup locale when print all keywords as well.

Reported by: dumbbell
Reviewed by: dumbbell
MFC after: 1 week

7 years agoSubject: [PATCH] Pass MACHINE_ARCH on command line for MIPS kernels.
Alexander Kabaev [Fri, 18 Nov 2016 16:23:31 +0000 (16:23 +0000)]
Subject: [PATCH] Pass MACHINE_ARCH on command line for MIPS kernels.

While there, make param.h guess proper MACHINE_ARCH on hardfloat targets
correctly as well, so tools like bmake can get their defaults right.
This does not help the kernel case, since we compile them with forced
-msoft-float and need to override an incorrect guess by param.h.

Reviewed by: br
Differential Revision: https://reviews.freebsd.org/D8574

7 years agoSpeed up pw operations that edit /etc/group or /etc/passwd
Alan Somers [Fri, 18 Nov 2016 16:07:08 +0000 (16:07 +0000)]
Speed up pw operations that edit /etc/group or /etc/passwd

r285050 fixed a bug in pw that could lead to /etc/passwd or /etc/group
corruption on power loss. However, it fixed it by opening those files with
O_SYNC, which is very slow, especially on ZFS. This change replaces O_SYNC
with appropriately placed fsync()s instead, which is much faster. Using a
ZFS tmpdir, the time to run pw's kyua tests drops from 245s to 35s.

Reviewed by: allanjude, bapt, vangyzen, garga
Tested on pfSense by: garga
MFC after: 4 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D8319

7 years ago[mips/ar531x] code cleanup, non-INTRNG support
Michael Zhilin [Fri, 18 Nov 2016 14:06:29 +0000 (14:06 +0000)]
[mips/ar531x] code cleanup, non-INTRNG support

This commit improves code styles like:
 - removing commented code
 - format comments as C-style
 - add spaces after #define-s

It also bring ability to build kernel without INTRNG and remove RedBoot dependency.

Tested on FON2201

Submitted by: Hiroki Sato <yamori813@yahoo.co.jp>
Reviewed by: adrian, mizhka
Approved by: adrian(mentor)
Differential Revision: https://reviews.freebsd.org/D8557

7 years agofix share/man/man4/Makefile for hv_ata_pci_disengage.4
Dexuan Cui [Fri, 18 Nov 2016 08:15:45 +0000 (08:15 +0000)]
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)
MFC after: 1 week
Sponsored by: Microsoft

7 years agoremove the hv_ata_pci_disengage(4) manual
Dexuan Cui [Fri, 18 Nov 2016 07:36:00 +0000 (07:36 +0000)]
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)
MFC after: 1 week
Sponsored by: Microsoft

7 years agoupdate the hv_vmbus(4) manual by adding a dependency on pci
Dexuan Cui [Fri, 18 Nov 2016 07:27:41 +0000 (07:27 +0000)]
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)
MFC after: 1 week
Sponsored by: Microsoft

7 years agohyperv/pcib: change the file name: pcib.c -> vmbus_pcib.c
Dexuan Cui [Fri, 18 Nov 2016 06:44:18 +0000 (06:44 +0000)]
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)
MFC after: 1 week
Sponsored by: Microsoft

7 years agohyperv/vmbus,pcib: Add MODULE_DEPEND on pci
Dexuan Cui [Fri, 18 Nov 2016 06:24:22 +0000 (06:24 +0000)]
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)
MFC after: 1 week
Sponsored by: Microsoft

7 years agohyperv/pcib: Fix the build for some kernel configs
Dexuan Cui [Fri, 18 Nov 2016 05:33:01 +0000 (05:33 +0000)]
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)
MFC after: 1 week
Sponsored by: Microsoft

7 years agoiflib updates and fixes:
Sean Bruno [Fri, 18 Nov 2016 04:19:21 +0000 (04:19 +0000)]
iflib updates and fixes:
-    reset gen on down
-    initialize admin task statically
-    drain mp_ring on down
-    don't drop context lock on stop
-    reset error stats on down
-    fix typo in min_latency sysctl
-    return ENOBUFS from if_transmit if the driver isn't running or the link is down

Submitted by: mmacy@nextbsd.org
Reviewed by: shurd
MFC after: 2 days
Sponsored by: Isilon and Limelight Networks
Differential Revision: https://reviews.freebsd.org/D8558

7 years agoSupport fetching RFLAGS in fasttrap_getreg().
Mark Johnston [Fri, 18 Nov 2016 03:11:11 +0000 (03:11 +0000)]
Support fetching RFLAGS in fasttrap_getreg().

MFC after: 1 week

7 years agoAdd a dtrace script for collecting schedgraph data
Ryan Stone [Fri, 18 Nov 2016 02:29:09 +0000 (02:29 +0000)]
Add a dtrace script for collecting schedgraph data

7 years agoIf FreeBSD source tree is a subproject of a bigger project, then .git or
Gleb Smirnoff [Fri, 18 Nov 2016 00:13:30 +0000 (00:13 +0000)]
If FreeBSD source tree is a subproject of a bigger project, then .git or
.hg may reside above FreeBSD sources root.  Provide function findvcs()
that will climb up and seek for presence of a VCS directory.

Reviewed by: imp (earlier version of the patch)

7 years agoCleanup some leftovers from '-s' removal in r302792.
Bryan Drewery [Thu, 17 Nov 2016 23:16:56 +0000 (23:16 +0000)]
Cleanup some leftovers from '-s' removal in r302792.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

7 years agoAdd missing newline in error mesage
Stephen Hurd [Thu, 17 Nov 2016 23:05:34 +0000 (23:05 +0000)]
Add missing newline in error mesage

Approved by: davidch
MFC after: 13 days
Sponsored by: Broadcom Corporation

7 years agorc.subr: Swap checks so we only fork sysctl if *_oomprotect is set.
Jilles Tjoelker [Thu, 17 Nov 2016 22:49:51 +0000 (22:49 +0000)]
rc.subr: Swap checks so we only fork sysctl if *_oomprotect is set.

7 years ago[net80211] Don't check bgscanidle setting in net80211 for full-offload scan.
Imre Vadász [Thu, 17 Nov 2016 21:52:00 +0000 (21:52 +0000)]
[net80211] Don't check bgscanidle setting in net80211 for full-offload scan.

If full-offload scan is used, the NIC driver (or rather the firmware of
the NIC) should take care of interrupting and continuing the background
scan. So net80211 should ignore the vap->iv_bgscanidle setting then, instead
the NIC driver might look at this setting and pass it on to the firmware
in some way if possible.

Since full-offload scans won't be explicitly interrupted by net80211, it
also doesn't really make sense to check the vap->iv_bgscanidle condition
in that case, before starting a background scan. If the NIC driver
advertises background scan support and full-offload scanning, the firmware
should be able to execute that scan without interfering too much with our
data traffic.

Reviewed by: adrian, avos
Approved by: adrian (mentor)
Differential Revision: https://reviews.freebsd.org/D8539

7 years agoAdd flag SF_USER_READAHEAD to sendfile(2). When specified, the syscall won't
Gleb Smirnoff [Thu, 17 Nov 2016 21:36:18 +0000 (21:36 +0000)]
Add flag SF_USER_READAHEAD to sendfile(2).  When specified, the syscall won't
do any speculations about readahead, and use exactly the amount of readahead
specified by user.  E.g. setting SF_FLAGS(0, SF_USER_READAHEAD) will guarantee
that no readahead at all will be performed.

7 years agoUse bogus_page to properly reduce number of I/Os in sendfile(2). The new
Gleb Smirnoff [Thu, 17 Nov 2016 21:02:55 +0000 (21:02 +0000)]
Use bogus_page to properly reduce number of I/Os in sendfile(2).  The new
sendfile_swapin() loop works this way:

- Find first invalid page in the request.
- Do vm_pager_has_page() and get count of pages, that can be taken in
  single I/O.
- Trim valid pages from the end of the request.
- Cycle through the request and substitute to bogus_page all valid
  pages that are in the middle of the request.
- After I/O launched (pager copies array of pages into buf(9), it
  is important to restore proper page pointers with help vm_page_lookup().

Count bogus pages used and report them in sendfile stats.

7 years agoAfter some ZIL changes 6 years ago zil_slog_limit got partially broken
Alexander Motin [Thu, 17 Nov 2016 21:01:27 +0000 (21:01 +0000)]
After some ZIL changes 6 years ago zil_slog_limit got partially broken
due to zl_itx_list_sz not updated when async itx'es upgraded to sync.
Actually because of other changes about that time zl_itx_list_sz is not
really required to implement the functionality, so this patch removes
some unneeded broken code and variables.

Original idea of zil_slog_limit was to reduce chance of SLOG abuse by
single heavy logger, that increased latency for other (more latency critical)
loggers, by pushing heavy log out into the main pool instead of SLOG. Beside
huge latency increase for heavy writers, this implementation caused double
write of all data, since the log records were explicitly prepared for SLOG.
Since we now have I/O scheduler, I've found it can be much more efficient
to reduce priority of heavy logger SLOG writes from ZIO_PRIORITY_SYNC_WRITE
to ZIO_PRIORITY_ASYNC_WRITE, while still leave them on SLOG.

Existing ZIL implementation had problem with space efficiency when it
has to write large chunks of data into log blocks of limited size. In some
cases efficiency stopped to almost as low as 50%. In case of ZIL stored on
spinning rust, that also reduced log write speed in half, since head had to
uselessly fly over allocated but not written areas. This change improves
the situation by offloading problematic operations from z*_log_write() to
zil_lwb_commit(), which knows real situation of log blocks allocation and
can split large requests into pieces much more efficiently. Also as side
effect it removes one of two data copy operations done by ZIL code WR_COPIED
case.

While there, untangle and unify code of z*_log_write() functions.
Also zfs_log_write() alike to zvol_log_write() can now handle writes crossing
block boundary, that may also improve efficiency if ZPL is made to do that.

Sponsored by: iXsystems, Inc.

7 years agoRevert r307392: I've found a way to avoid big allocations completely.
Alexander Motin [Thu, 17 Nov 2016 20:44:51 +0000 (20:44 +0000)]
Revert r307392:  I've found a way to avoid big allocations completely.

7 years agoFix "camcontrol rescan" with SATA drives behind a SAS controller
Alan Somers [Thu, 17 Nov 2016 20:42:56 +0000 (20:42 +0000)]
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.

PR: 212914
Submitted by: kadesai
Reported by: kadesai
Reviewed by: asomers, ken
MFC after: 4 weeks
Sponsored by: Spectra Logic Corp

7 years agoPass SWAPSIZE in env(1) when invoking mk-vmimage.sh for the
Glen Barber [Thu, 17 Nov 2016 20:34:08 +0000 (20:34 +0000)]
Pass SWAPSIZE in env(1) when invoking mk-vmimage.sh for the
vm-image target, missed in r308737.

Sponsored by: The FreeBSD Foundation

7 years ago- If caller specifies readbehind and readahead that together with count
Gleb Smirnoff [Thu, 17 Nov 2016 20:32:32 +0000 (20:32 +0000)]
- If caller specifies readbehind and readahead that together with count
  doesn't fit into a buf, then trim readbehind and readahead evenly.  If
  rbehind was limited by the previous BMAP, then roundup its trim to
  block size.
- Add KASSERT to check that b_blkno has proper offset from original
  blkno returned by BMAP. [1]
- Add KASSERT to check that pages in buf are consecutive.

Reviewed by: kib
Submitted by: kib [1]

7 years ago[iwm] Sync iwm_nvm_read_chunk() function with Linux iwlwifi.
Imre Vadász [Thu, 17 Nov 2016 20:00:20 +0000 (20:00 +0000)]
[iwm] Sync iwm_nvm_read_chunk() function with Linux iwlwifi.

This fixes an error handling detail in iwm_nvm_read_chunk(), where an
error response from the firmware for an NVM read shouldn't be fatal if
the offset was non-zero.

Approved by: adrian (mentor)
Obtained from: DragonFlyBSD git 250a1c33fca1725121fe499f9cebc90267d209f9
Differential Revision: https://reviews.freebsd.org/D8542

7 years agoloader: zfs toplevel vdev must have spa set.
Toomas Soome [Thu, 17 Nov 2016 19:38:30 +0000 (19:38 +0000)]
loader: zfs toplevel vdev must have spa set.

The salt based checksum mechanisms, such as skein, are storing the seed
in spa structure, and need to access the spa to use the seed. The current
mechanism for quick access to correct spa is via pointer provided by
vdev structure, but unfortunately the current code does set spa only
for the leaf vdev. This patch will fix the issue by making sure the
loader zfs reader will set spa also for top-level vdevs.

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

7 years agoZero etherswitch_vlangroup structure before doing partial assignments.
Luiz Otavio O Souza [Thu, 17 Nov 2016 19:02:25 +0000 (19:02 +0000)]
Zero etherswitch_vlangroup structure before doing partial assignments.

MFC after: 3 days
Sponsored by: Rubicon Communications, LLC (Netgate)

7 years agoloader: beri_sdcard_disk_print() needs to return int.
Toomas Soome [Thu, 17 Nov 2016 18:38:35 +0000 (18:38 +0000)]
loader: beri_sdcard_disk_print() needs to return int.

The https://reviews.freebsd.org/rS308434 did change the return type for
dv_print callbacks, but the return type for beri_sdcard_disk_print()
was left unchanged, causing compile errors.

Reported by: cy
Reviewed by: brooks, rstone, allanjude
Approved by: allanjude (mentor)
Differential Revision: https://reviews.freebsd.org/D8515

7 years agoDefine dependencies for some auto-generated source files in libdtrace.
Mark Johnston [Thu, 17 Nov 2016 18:13:42 +0000 (18:13 +0000)]
Define dependencies for some auto-generated source files in libdtrace.

Remove an unneeded beforedepend rule.

Reported by: emaste, jhb
Reviewed by: bdrewery
MFC after: 1 week

7 years agocrunchide: report explicit error for combined string table
Ed Maste [Thu, 17 Nov 2016 18:12:17 +0000 (18:12 +0000)]
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).

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

7 years agoFix build when no INET and INET6 in kernel config.
Ruslan Bukin [Thu, 17 Nov 2016 16:13:30 +0000 (16:13 +0000)]
Fix build when no INET and INET6 in kernel config.

Submitted by: kan
Sponsored by: DARPA, AFRL

7 years agoDo not reallocate driver softc for uart unnecessarily.
Ruslan Bukin [Thu, 17 Nov 2016 16:06:53 +0000 (16:06 +0000)]
Do not reallocate driver softc for uart unnecessarily.

Do not assume that all uart drivers use uart_softc structure as is.
Some do a sensible thing and do declare their uart class and driver
properly and arrive into uart_bus_attach with suitably sized softc.

Submitted by: kan
Sponsored by: DARPA, AFRL

7 years agoMake gpiobus early driver at BUS_PAS_BUS.
Ruslan Bukin [Thu, 17 Nov 2016 15:37:44 +0000 (15:37 +0000)]
Make gpiobus early driver at BUS_PAS_BUS.

The gpiobus driver is attached explicitly and generally should be
at the same pass as its parent. Making it use BUS_PAS_BUS ensures
that it attaches immediately after parent adds it (assuming the
parent itself attached at BUS_PAS_BUS and above).

Submitted by: kan
Sponsored by: DARPA, AFRL

7 years agoMore robust handling of whois referrals from RIRs.
Tony Finch [Thu, 17 Nov 2016 15:19:06 +0000 (15:19 +0000)]
More robust handling of whois referrals from RIRs.

An example problem case is 163.1.0.0 (University of Oxford)
which is in an APNIC ERX address range. Previously we assumed
that ARIN has the correct information for all ERX allocations,
but in this case ARIN refers back to APNIC, rather than referring
to RIPE. This caused whois to loop.

Whois will no longer loop back and forth forever between two RIRs
that don't have an answer, but instead try the other RIRs in turn.

7 years agoDeclare dwc_otg_detach as non-static (same as dwc_otg_attach),
Ruslan Bukin [Thu, 17 Nov 2016 15:12:03 +0000 (15:12 +0000)]
Declare dwc_otg_detach as non-static (same as dwc_otg_attach),
so it can be called from fdt-glue drivers.

Submitted by: kan
Sponsored by: DARPA, AFRL

7 years agoAllow operation with UTMI+ phy.
Ruslan Bukin [Thu, 17 Nov 2016 15:08:30 +0000 (15:08 +0000)]
Allow operation with UTMI+ phy.

Submitted by: kan
Sponsored by: DARPA, AFRL

7 years agoRemove outdated comment.
Ruslan Bukin [Thu, 17 Nov 2016 14:43:13 +0000 (14:43 +0000)]
Remove outdated comment.

Pointed out by: andrew (original author)
Sponsored by: DARPA, AFRL

7 years agoAdd support for UART found in the Ingenic XBurst system on chips.
Ruslan Bukin [Thu, 17 Nov 2016 14:41:22 +0000 (14:41 +0000)]
Add support for UART found in the Ingenic XBurst system on chips.

These CPUs has non-standard UART enable bit hidden in the UART FIFO
Control Register.

Sponsored by: DARPA, AFRL

7 years agoWriting out the L2TP control packet requires 12 bytes of
Bjoern A. Zeeb [Thu, 17 Nov 2016 14:03:44 +0000 (14:03 +0000)]
Writing out the L2TP control packet requires 12 bytes of
contiguous memory but in one path we did not always guarantee this,
thus do a m_pullup() there.

PR: 214385
Submitted by: Joe Jones (joeknockando googlemail.com)
MFC after: 3 days

7 years agoAdd driver for DM9000 Ethernet MAC Controller.
Ruslan Bukin [Thu, 17 Nov 2016 11:48:07 +0000 (11:48 +0000)]
Add driver for DM9000 Ethernet MAC Controller.

This device found in the Ingenic jz4780 SoC.

Submitted by: kan
Sponsored by: DARPA, AFRL

7 years agoImport Ingenic CI20 (jz4780) DTS files.
Ruslan Bukin [Thu, 17 Nov 2016 11:31:13 +0000 (11:31 +0000)]
Import Ingenic CI20 (jz4780) DTS files.

Submitted by: kan
Sponsored by: DARPA, AFRL

7 years agoNotify the use via setting errno when a TCP RST segment is received
Michael Tuexen [Thu, 17 Nov 2016 08:15:02 +0000 (08:15 +0000)]
Notify the use via setting errno when a TCP RST segment is received
either in the CLOSING or LAST-ACK state.

Reviewed by: hiren
MFC after: 3 weeks
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D8371

7 years ago[etherswitch] add infineon adm6996fc support on etherswitch
Michael Zhilin [Thu, 17 Nov 2016 07:33:37 +0000 (07:33 +0000)]
[etherswitch] add infineon adm6996fc support on etherswitch

This is Infineon ADM6996FC/M/MX driver code on etherswitch framework.
Support PORT and DOT1Q VLAN.
This code suppose ADM6996FC SDC/SDIO connect to SOC network interface
MDC/MDIO.
This code tested on Netgear WGR614Cv7.

Submitted by: Hiroki Mori <yamori813@yahoo.co.jp>
Reviewed by: adrian, mizhka
Approved by: adrian(mentor)
Differential Revision: https://reviews.freebsd.org/D8495