]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
6 years agosetfacl: style and break main() into manageable pieces
emaste [Fri, 27 Apr 2018 15:25:24 +0000 (15:25 +0000)]
setfacl: style and break main() into manageable pieces

Submitted by: Mitchell Horne
MFC with: r332396
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D15060

6 years agosystrace: track it like sdt probes
mjg [Fri, 27 Apr 2018 15:16:34 +0000 (15:16 +0000)]
systrace: track it like sdt probes

While here predict false.

Note the code is wrong (regardless of this change). Dereference of the
pointer can race with module unload. A fix would set the probe to a
nop stub instead of NULL.

6 years agoUpdate ELF Tool Chain to r3614
emaste [Fri, 27 Apr 2018 13:59:24 +0000 (13:59 +0000)]
Update ELF Tool Chain to r3614

MFC after: 1 week
Relnotes: Yes
Sponsored by: The FreeBSD Foundation

6 years agoelf_common.h: add DT_SUNW_ASLR tag
emaste [Fri, 27 Apr 2018 13:55:46 +0000 (13:55 +0000)]
elf_common.h: add DT_SUNW_ASLR tag

For upcoming ELF Tool Chain import (readelf).

6 years agoExpand the checks for UCR3 == PMAP_NO_CR3 to enable processes to be
tychon [Fri, 27 Apr 2018 12:44:20 +0000 (12:44 +0000)]
Expand the checks for UCR3 == PMAP_NO_CR3 to enable processes to be
excluded from PTI.

Reviewed by: kib
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D15100

6 years agoallwinner: clk: Add gate_shift to the clock definition
manu [Fri, 27 Apr 2018 09:25:27 +0000 (09:25 +0000)]
allwinner: clk: Add gate_shift to the clock definition

WHile gate_shift was present in the NM_CLK macro it wasn't set into the
clock definition structure resulting in NM clocks not being correctly
gated when they should.
If the module wasn't enabled by the bootloader it will have stayed ungated.

6 years agoallwinner: clk: Correct aw_clk_get_factor
manu [Fri, 27 Apr 2018 09:23:07 +0000 (09:23 +0000)]
allwinner: clk: Correct aw_clk_get_factor

Switch test between zero based factor and power of two one.
This resulted in a miscalculation of the factor if it was a power
of two one.
Some clocks frequencies were not calculated correctly because of that.

6 years agouma: whack main zone counter update in the slow path
mjg [Fri, 27 Apr 2018 05:37:35 +0000 (05:37 +0000)]
uma: whack main zone counter update in the slow path

Cached counters are typically zero at this point so it performs
avoidable atomics. Everything reading them also reads the cached
ones, thus there is really no point.

Reviewed by: jeff

6 years agovm: move vm_cnt to __read_mostly now that it is not written to
mjg [Fri, 27 Apr 2018 05:36:02 +0000 (05:36 +0000)]
vm: move vm_cnt to __read_mostly now that it is not written to

While here whack unused locking keys for the struct.

Discussed with: jeff

6 years agoRevert r333035 due broken booting on !Marvell GENERIC platforms
mw [Fri, 27 Apr 2018 05:32:09 +0000 (05:32 +0000)]
Revert r333035 due broken booting on !Marvell GENERIC platforms

Reported by: manu

6 years agoclk: Put the sysctls under hw.clock instead of clock
manu [Fri, 27 Apr 2018 00:12:00 +0000 (00:12 +0000)]
clk: Put the sysctls under hw.clock instead of clock

This is more consistant with hw.regulator and other hardware related
sysctls.

6 years agomove smartpqi(4) controller out of NOTES and into sys/amd64/NOTES to
sbruno [Thu, 26 Apr 2018 22:43:25 +0000 (22:43 +0000)]
move smartpqi(4) controller out of NOTES and into sys/amd64/NOTES to
appease LINT

Submitted by: rpokala
Reported by: npn

6 years agoarm64: rockchip: rk_gpio fix rk_gpio_pin_config32
manu [Thu, 26 Apr 2018 22:15:09 +0000 (22:15 +0000)]
arm64: rockchip: rk_gpio fix rk_gpio_pin_config32

Pointy Hat to:  me

6 years agocxgbe(4): Move release_tid to the base NIC driver for future consumers.
np [Thu, 26 Apr 2018 22:04:21 +0000 (22:04 +0000)]
cxgbe(4): Move release_tid to the base NIC driver for future consumers.

Sponsored by: Chelsio Communications.

6 years agoarm64: rockchip: Add gpio controller driver
manu [Thu, 26 Apr 2018 21:44:00 +0000 (21:44 +0000)]
arm64: rockchip: Add gpio controller driver

Add a driver that match on 'rockchip,gpio-bank', this compatible
string is found on almost all RockChip SoC so this driver is compatible
with almost all of the RockChip SoCs.

The only features missing for this driver are :
- Interrupts support
- Debouncing

6 years agoThis change re-arranges the fields within the tcp-pcb so that
rrs [Thu, 26 Apr 2018 21:41:16 +0000 (21:41 +0000)]
This change re-arranges the fields within the tcp-pcb so that
they are more in order of cache line use as one passes
through the tcp_input/output paths (non-errors most likely path). This
helps speed up cache line optimization so that the tcp stack runs
a bit more efficently.

Sponsored by: Netflix Inc.
Differential Revision: https://reviews.freebsd.org/D15136

6 years agoarm64: rockchip: RK3328 CRU Add gpio gates
manu [Thu, 26 Apr 2018 21:40:05 +0000 (21:40 +0000)]
arm64: rockchip: RK3328 CRU Add gpio gates

Add the gates for the gpio controller in order to properly support them.

6 years agoarm64: rockchip: Rk3328 CRU Fix some offset for gates
manu [Thu, 26 Apr 2018 21:38:59 +0000 (21:38 +0000)]
arm64: rockchip: Rk3328 CRU Fix some offset for gates

Some offset of some clock gates where wrong, correct them so we can
use thoses clocks.

Pointy Hat to: me

6 years agoarm64: rockchip: Add pinctrl driver
manu [Thu, 26 Apr 2018 21:37:38 +0000 (21:37 +0000)]
arm64: rockchip: Add pinctrl driver

Add pinctrl driver for RockChip SoCs. This device manage which function
to set on which pin and some other properties like pull up/down, drive
strength etc ...
For now the driver only support RK3328 but it is versatile enough to
add support for other RockChip SoC in the future.

6 years agoarm64: rockchip: Add GRF driver
manu [Thu, 26 Apr 2018 21:35:04 +0000 (21:35 +0000)]
arm64: rockchip: Add GRF driver

RockChip GRF (General Register Files) is present on almost all RockChip
SoC and is used to control some area of the system like iomuxing, gpio
or usb phy.
We need it to be probed and attached early in the boot process so
subclass syscon_generic and set the pass to BUS_PASS_BUS + BUS_PASS_ORDER_MIDDLE.

6 years agoFix move of the frame to the normal stack for interrupts occuring from
kib [Thu, 26 Apr 2018 21:07:45 +0000 (21:07 +0000)]
Fix move of the frame to the normal stack for interrupts occuring from
the vm86 mode.

Submitted by: jhb

6 years agoAdd Marvell ArmadaXP and Armada38X to GENERIC config
mw [Thu, 26 Apr 2018 19:23:37 +0000 (19:23 +0000)]
Add Marvell ArmadaXP and Armada38X to GENERIC config

Include source files and drivers for Marvell ArmadaXP and Armada38X
in GENERIC kernel config.

Submitted by: Michal Mazur <mkm@semihalf.com>
      Rafal Kozik <rk@semihalf.com>
Obtained from: Semihalf
Sponsored by: Stormshield
Differential Revision: https://reviews.freebsd.org/D14747

6 years agoFix spelling: Appolo -> Apollo [1].
kib [Thu, 26 Apr 2018 19:23:19 +0000 (19:23 +0000)]
Fix spelling: Appolo -> Apollo [1].
The APL31 NDA errata is APL30 public errata.  Add the reference and
provide the description [2].

Noted by: emaste [2], rpokala [1]
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

6 years agoAdd support for gpioled on ARMADA38X based boards
mw [Thu, 26 Apr 2018 19:15:39 +0000 (19:15 +0000)]
Add support for gpioled on ARMADA38X based boards

This patch adds support for gpio and gpioled into ARMADA38X kernel
config.

Reviewed by: andrew
Obtained from: Semihalf
Sponsored by: Stormshield
Differential Revision: https://reviews.freebsd.org/D14758

6 years agoReplace FDT tree parsing with gpio_map_gpios implementation in mv_gpio driver
mw [Thu, 26 Apr 2018 19:10:18 +0000 (19:10 +0000)]
Replace FDT tree parsing with gpio_map_gpios implementation in mv_gpio driver

This patch replaces in-driver FDT parsing, which was
needed for setting initial values on GPIO pins.
Now FDT is parsed by generic kernel code, pins are set
by invoking gpio_map_gpios method.

Submitted by: Patryk Duda <pdk@semihalf.com>
Obtained from: Semihalf
Sponsored by: Stormshield
Differential Revision: https://reviews.freebsd.org/D14757

6 years agoUpdate mv_gpio driver to new FreeBSD API
mw [Thu, 26 Apr 2018 19:00:48 +0000 (19:00 +0000)]
Update mv_gpio driver to new FreeBSD API

This patch implements and exports functions described
in gpio_if.m file. It also uses new gpiobus_attach_bus function
instead of adding gpioc and gpiobus as children. It removes
ulgy reading SoC ID and related if..else, so it depends only on
data read from FDT.

Submitted by: Patryk Duda <pdk@semihalf.com>
Reviewed by: manu
Obtained from: Semihalf
Sponsored by: Stormshield
Differential Revision: https://reviews.freebsd.org/D14756

6 years agocxgbe(4): Break up alloc_tid_tabs and move the atid routines to the base
np [Thu, 26 Apr 2018 19:00:35 +0000 (19:00 +0000)]
cxgbe(4): Break up alloc_tid_tabs and move the atid routines to the base
NIC driver.  The atid services will be used by new features (hashfilters
and inline TLS) that do not involve TOE.

Sponsored by: Chelsio Communications

6 years agolibsysdecode: support errno and syscalls for arm64 Linux
emaste [Thu, 26 Apr 2018 18:54:00 +0000 (18:54 +0000)]
libsysdecode: support errno and syscalls for arm64 Linux

Sponsored by: Turing Robotic Industries Inc.

6 years agoarm64 linuxulator: add generated sysent files
emaste [Thu, 26 Apr 2018 18:46:38 +0000 (18:46 +0000)]
arm64 linuxulator: add generated sysent files

From syscalls.master in r333027

Sponsored by: Turing Robotic Industries Inc.

6 years agoAdd arm64 Linux syscall table
emaste [Thu, 26 Apr 2018 18:38:59 +0000 (18:38 +0000)]
Add arm64 Linux syscall table

This is the first step (after the recent refactoring of some common
code) to supporting the Linuxulator on arm64.

Reviewed by: andrew
Sponsored by: Turing Robotic Industries Inc.
Differential Revision: https://reviews.freebsd.org/D15187

6 years agoHandle Appolo Lake errata APL31.
kib [Thu, 26 Apr 2018 18:24:31 +0000 (18:24 +0000)]
Handle Appolo Lake errata APL31.

If the workaround is activated, always send IPI for wake up, not rely
on the write to the monitor line.  This fixes Appolo Lake machines
early hang in sched_bind(), without requiring user to manually select
idle method.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

6 years agoSome style and minor code improvements for idle selection.
kib [Thu, 26 Apr 2018 18:12:40 +0000 (18:12 +0000)]
Some style and minor code improvements for idle selection.

Use designated initializers for the idlt_tlb elements.
Remove strstr() use, add flag field to detect supported MWAIT.
Use nitems() instead of the terminating NULL entry for idle_tlb.
Move several functions into cpu_idle_* namespace.

Based on the discussion with: bde
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

6 years agoErm, fix typo.
trasz [Thu, 26 Apr 2018 17:36:48 +0000 (17:36 +0000)]
Erm, fix typo.

MFC after: 2 weeks

6 years agoBump .Dd.
trasz [Thu, 26 Apr 2018 17:36:31 +0000 (17:36 +0000)]
Bump .Dd.

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

6 years agoClarify which USB specs are supported by cdce(4) and umodem(4).
trasz [Thu, 26 Apr 2018 17:34:53 +0000 (17:34 +0000)]
Clarify which USB specs are supported by cdce(4) and umodem(4).

Discussed with: hselasky@
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

6 years agoTigthen up kern_prefetch.h includes. The DMAP check was not committed in
sbruno [Thu, 26 Apr 2018 17:32:35 +0000 (17:32 +0000)]
Tigthen up kern_prefetch.h includes.  The DMAP check was not committed in
here with HPTS so these includes aren't necessary.

Comments from rrs:
Yeah I had those in there in our version so I could
validate the range in amd64 with the DMAP_VM but for
some reason those don't work in head anymore.. Forgot
to purge the headers :)

Submitted by: Kevin Bowling
Reviewed by: rrs
Differential Revision: https://reviews.freebsd.org/D15164

6 years agoAdd myself back to the ranks of being mentored
seanc [Thu, 26 Apr 2018 17:13:58 +0000 (17:13 +0000)]
Add myself back to the ranks of being mentored

Approved by: swills (mentor)

6 years agomartpqi(4):
sbruno [Thu, 26 Apr 2018 16:59:06 +0000 (16:59 +0000)]
martpqi(4):
- Microsemi SCSI driver for PQI controllers.
- Found on newer model HP servers.
- Restrict to AMD64 only as per developer request.

The driver provides support for the new generation of PQI controllers
from Microsemi. This driver is the first SCSI driver to implement the PQI
queuing model and it will replace the aacraid driver for Adaptec Series 9
controllers.  HARDWARE Controllers supported by the driver include:

    HPE Gen10 Smart Array Controller Family
    OEM Controllers based on the Microsemi Chipset.

Submitted by:   deepak.ukey@microsemi.com
Relnotes:       yes
Sponsored by:   Microsemi
Differential Revision:   https://reviews.freebsd.org/D14514
> Description of fields to fill in above:                     76 columns --|
> PR:                       If and which Problem Report is related.
> Submitted by:             If someone else sent in the change.
> Reported by:              If someone else reported the issue.
> Reviewed by:              If someone else reviewed your modification.
> Approved by:              If you needed approval for this commit.
> Obtained from:            If the change is from a third party.
> MFC after:                N [day[s]|week[s]|month[s]].  Request a reminder email.
> MFH:                      Ports tree branch name.  Request approval for merge.
> Relnotes:                 Set to 'yes' for mention in release notes.
> Security:                 Vulnerability reference (one per line) or description.
> Sponsored by:             If the change was sponsored by an organization.
> Pull Request:             https://github.com/freebsd/freebsd/pull/### (*full* GitHub URL needed).
> Differential Revision:    https://reviews.freebsd.org/D### (*full* phabric URL needed).
> Empty fields above will be automatically removed.

M    share/man/man4/Makefile
AM   share/man/man4/smartpqi.4
M    sys/amd64/conf/GENERIC
M    sys/conf/NOTES
M    sys/conf/files.amd64
A    sys/dev/smartpqi
AM   sys/dev/smartpqi/smartpqi_cam.c
AM   sys/dev/smartpqi/smartpqi_cmd.c
AM   sys/dev/smartpqi/smartpqi_defines.h
AM   sys/dev/smartpqi/smartpqi_discovery.c
AM   sys/dev/smartpqi/smartpqi_event.c
AM   sys/dev/smartpqi/smartpqi_helper.c
AM   sys/dev/smartpqi/smartpqi_includes.h
AM   sys/dev/smartpqi/smartpqi_init.c
AM   sys/dev/smartpqi/smartpqi_intr.c
AM   sys/dev/smartpqi/smartpqi_ioctl.c
AM   sys/dev/smartpqi/smartpqi_ioctl.h
AM   sys/dev/smartpqi/smartpqi_main.c
AM   sys/dev/smartpqi/smartpqi_mem.c
AM   sys/dev/smartpqi/smartpqi_misc.c
AM   sys/dev/smartpqi/smartpqi_prototypes.h
AM   sys/dev/smartpqi/smartpqi_queue.c
AM   sys/dev/smartpqi/smartpqi_request.c
AM   sys/dev/smartpqi/smartpqi_response.c
AM   sys/dev/smartpqi/smartpqi_sis.c
AM   sys/dev/smartpqi/smartpqi_structures.h
AM   sys/dev/smartpqi/smartpqi_tag.c
M    sys/modules/Makefile
A    sys/modules/smartpqi
AM   sys/modules/smartpqi/Makefile

6 years agoCorrect r307825 BOOTSTRAPPING test for unsupported upgrade
emaste [Thu, 26 Apr 2018 13:18:24 +0000 (13:18 +0000)]
Correct r307825 BOOTSTRAPPING test for unsupported upgrade

__FreeBSD_version has five digits after the major number, but the min
versions in the test had an extra 0 (so the test was always false).

6 years agoMerge r1.22-1.23 from NetBSD:
ae [Thu, 26 Apr 2018 12:23:31 +0000 (12:23 +0000)]
Merge r1.22-1.23 from NetBSD:
  Don't assume M_PKTHDR is set only on the first mbuf of the chain.
  The check is replaced by (m1 != m), which is equivalent to the previous
  code: we want to modify m->m_pkthdr.len only when 'm' was not passed in
  m_adj().

  Fix a pretty bad mistake, that has always been there:
   m_adj(m1, -(m1->m_len - roff));
   if (m1 != m)
m->m_pkthdr.len -= (m1->m_len - roff);

  This is wrong: m_adj() will modify m1->m_len, so we're using a wrong
  value when manually adjusting m->m_pkthdr.len.

Reported by: Maxime Villard <max at m00nbsd dot net>
Obtained from: NetBSD
MFC after: 1 week

6 years agoAdd network device event for priority code point, PCP, changes.
hselasky [Thu, 26 Apr 2018 08:58:27 +0000 (08:58 +0000)]
Add network device event for priority code point, PCP, changes.

When the PCP is changed for either a VLAN network interface or when
prio tagging is enabled for a regular ethernet network interface,
broadcast the IFNET_EVENT_PCP event so applications like ibcore can
update its GID tables accordingly.

MFC after: 3 days
Reviewed by: ae, kib
Differential Revision: https://reviews.freebsd.org/D15040
Sponsored by: Mellanox Technologies

6 years agozgrep.sh: Add forgotten ';' and remove set -e which prevents looping over files
bapt [Wed, 25 Apr 2018 21:01:02 +0000 (21:01 +0000)]
zgrep.sh: Add forgotten ';' and remove set -e which prevents looping over files
not matching

6 years agozgrep.sh: remove now useless shift
bapt [Wed, 25 Apr 2018 20:55:18 +0000 (20:55 +0000)]
zgrep.sh: remove now useless shift

6 years agozgrep: small improvements
bapt [Wed, 25 Apr 2018 20:52:17 +0000 (20:52 +0000)]
zgrep: small improvements

* Use slightly more efficient method to determine the name of the program
called [1]
* Use nicer form to loop over arguments [1]
* add special support for --version along with -V previously added by kevans

Reported by: jilles@ [1]

6 years agoFix mips32 build after r332951.
lwhsu [Wed, 25 Apr 2018 19:46:39 +0000 (19:46 +0000)]
Fix mips32 build after r332951.

Approved by: jhb

6 years ago<compress>grep: Special case the -V flag
kevans [Wed, 25 Apr 2018 18:59:29 +0000 (18:59 +0000)]
<compress>grep: Special case the -V flag

In case we need version information of the ultimately chosen grep, allowing
`zgrep -V` to operate would be most helpful.

6 years agoUpdate release version of FreeBSD.
benno [Wed, 25 Apr 2018 18:56:27 +0000 (18:56 +0000)]
Update release version of FreeBSD.

Sponsored by: iXsystems, Inc.

6 years agoAllow etdump, makefs and mkimg to be overridden.
benno [Wed, 25 Apr 2018 18:47:52 +0000 (18:47 +0000)]
Allow etdump, makefs and mkimg to be overridden.

Recent changes to makefs and mkimg have led to situations where the
disconnect between this script and the versions installed on the host cause
failures. Provide a way to work around this that doesn't require the
installation of new versions to the host system if that's not desired.

With this change mkisoimages.sh will honour the $ETDUMP, $MAKEFS and $MKIMG
environment variables but fall back to the previous behaviour of finding them
within $PATH.

Reviewed by: gjb
Sponsored by: iXsystems, Inc.
Differential Revision: https://reviews.freebsd.org/D15181

6 years agoFix Issue with adding MUltiCast Addresses. When multicast addresses are
davidcs [Wed, 25 Apr 2018 18:06:22 +0000 (18:06 +0000)]
Fix Issue with adding MUltiCast Addresses. When multicast addresses are
added/deleted, the delete the multicast addresses previously programmed
in HW and reprogram the new set of multicast addresses.

Submitted by:Vaishali.Kulkarni@cavium.com
MFC after:5 days

6 years agoUpgraded FW Related Files to version 5.4.67
davidcs [Wed, 25 Apr 2018 17:51:17 +0000 (17:51 +0000)]
Upgraded FW Related Files to version 5.4.67

MFC after:5 days

6 years agoUse CPUID leaf 0x15 to get TSC frequency when the calibration is
kib [Wed, 25 Apr 2018 16:43:45 +0000 (16:43 +0000)]
Use CPUID leaf 0x15 to get TSC frequency when the calibration is
disabled.

Intel finally added this information, which allows us to not parse CPU
identification string looking for the nominal frequency.  The leaf is
present e.g. on Appolo Lake Atom CPUs.  It is only used if the TSC
calibration is disabled by user.

Also, report the TSC frequency in bootverbose mode always, regardless
of the way it was obtained.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

6 years agobsdgrep(1): Sneak in some man page updates
kevans [Wed, 25 Apr 2018 16:28:51 +0000 (16:28 +0000)]
bsdgrep(1): Sneak in some man page updates

- The --exclude{,-dir} and --include{,-dir} directives now match GNU
  behavior of being processed in order and latest matching directive wins

- --label was previously not really documented, and -L and -l did not
  indicate that --label applied to them

- The flags listed as being extensions to POSIX spec were not updated with
  the removal of compression-related flags

MFC after: 1 week

6 years agobsdgrep: Update NLS catalogs after r332995
kevans [Wed, 25 Apr 2018 15:41:50 +0000 (15:41 +0000)]
bsdgrep: Update NLS catalogs after r332995

Compression was removed so #2 goes away and everything else needs renumbered
to match, and the usage string was also updated due to removed options.

X-MFC-With: r332995

6 years agoClean up .Xrs in man(1).
trasz [Wed, 25 Apr 2018 15:39:36 +0000 (15:39 +0000)]
Clean up .Xrs in man(1).

MFC after: 2 weeks

6 years agoAdd some .Xrs to USB template descriptions.
trasz [Wed, 25 Apr 2018 15:32:12 +0000 (15:32 +0000)]
Add some .Xrs to USB template descriptions.

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

6 years agoTranslate 32-bit ifmedia requests into native ones.
brooks [Wed, 25 Apr 2018 15:30:42 +0000 (15:30 +0000)]
Translate 32-bit ifmedia requests into native ones.

We use transformation rather than accessors as virtually ever driver
implements SIOCGIFMEDIA and all would have to be touched.

Keep the code readable by always performing copies and (possiably no-op)
transforms.

Reviewed by: jhb, kib
Obtained from: CheriBSD
MFC after: 1 week
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D14996

6 years agoMake it possible (controlled via sysctl, enabled by default) to mark
trasz [Wed, 25 Apr 2018 15:28:46 +0000 (15:28 +0000)]
Make it possible (controlled via sysctl, enabled by default) to mark
device-side (and only device-side) "virtual USB serial adapters" - the
ones you can get with an OTG-capable board - as consoles.  It boils down
to adding the device name to kern.console sysctl, although doing that
requires jumping through some hoops.  It doesn't change the actual
operation of those virtual devices.  The point is to make it possible
for init(8) to recognize them as console devices and to launch getty(8)
for them, when configured as "onifconsole" in ttys(5).  The point of
that, in turn, is to add such entries to the default ttys(5), so that
init(8) will launch gettys for device-side "virtual serial adapters",
but not for actual USB serial dongles.

Reviewed by: hselasky@
No objections: imp@
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

6 years agoRemove compression support from bsdgrep
bapt [Wed, 25 Apr 2018 14:40:15 +0000 (14:40 +0000)]
Remove compression support from bsdgrep

Compression support is now handled by an external script, remove it from the
bsdgrep(1) utility.
This removes the support for -Z -J -X and -M

Note: that it matches the changes in newer GNU grep

Reviewed by: kevans
Approved by: kevans
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D15197

6 years agoIf a trap is encountered upon executing iretq from within doreti() the
tychon [Wed, 25 Apr 2018 14:21:13 +0000 (14:21 +0000)]
If a trap is encountered upon executing iretq from within doreti() the
hardware will ensure the stack pointer is aligned to a 16-byte
boundary before saving the fault state on the stack.

In the PTI case, handle this potential alignment adjustment by copying
both frames independently while unwinding the stack in between.

Reviewed by: kib
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D15183

6 years agoUse a script wrapper for <compress>grep
bapt [Wed, 25 Apr 2018 13:23:58 +0000 (13:23 +0000)]
Use a script wrapper for <compress>grep

Import the wrapper script from zstdgrep (written by wiz@netbsd.org)

Modify it to support more than just zstd (adding support for gzip,
lzma, xz and bzip2)

Write a simple manpage dedicated for it.

Only use that new wrapper both for gnu grep and bsd grep

Next step will be removing code related to compression format from bsdgrep

Reviewed by: kevans
Approved by: kevans
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D15193

6 years agopci_vendors: update to 2018.04.06
eadler [Wed, 25 Apr 2018 07:51:45 +0000 (07:51 +0000)]
pci_vendors: update to 2018.04.06

Obtained from: https://pci-ids.ucw.cz/v2.2/pci.ids
MFC After: 3 days

6 years agoFix i386 build after r332970 by adding IS_BSP() definition.
lwhsu [Wed, 25 Apr 2018 07:51:41 +0000 (07:51 +0000)]
Fix i386 build after r332970 by adding IS_BSP() definition.

Approved by: kib

6 years agomakefs: Use ENODATA instead of ENOMSG as a translation for missing ENOATTR.
pfg [Wed, 25 Apr 2018 02:43:53 +0000 (02:43 +0000)]
makefs: Use ENODATA instead of ENOMSG as a translation for missing ENOATTR.

This is consistent with what some linux filesystems do and has been
adopted in our linuxulator.

MFC after: 3 days

6 years agoforthloader: Remove "EFI boot environment message"
kevans [Wed, 25 Apr 2018 02:42:57 +0000 (02:42 +0000)]
forthloader: Remove "EFI boot environment message"

Contrary to what the message says, this is not only executed in an EFI
context- it provides functions for use in an EFI environment. I don't think
there's much reason to broadcast this fact when we haven't in the past, so
just remove it.

Reported by: emaste (a while ago), cperciva

6 years agoIncrease the fdtmemreserv array limit to boot on POWER9
jhibbits [Wed, 25 Apr 2018 02:42:11 +0000 (02:42 +0000)]
Increase the fdtmemreserv array limit to boot on POWER9

Discussing with others, this needs to be at least 20 to boot on some POWER9
nodes.  Linux made a similar change for the same reason, so increase to 32
to give us some extra breathing room as well.  The input and output arrays
are sized at 256, so much greater than the increase in the property array
size.

6 years agoShorten some recently-added lines that are an extra indent over 80 columns.
jhb [Tue, 24 Apr 2018 23:22:45 +0000 (23:22 +0000)]
Shorten some recently-added lines that are an extra indent over 80 columns.

6 years agoDocument the TRAP_CAP code for SIGTRAP.
jhb [Tue, 24 Apr 2018 23:20:15 +0000 (23:20 +0000)]
Document the TRAP_CAP code for SIGTRAP.

MFC after: 3 days

6 years agoImprove VM page queue scalability.
markj [Tue, 24 Apr 2018 21:15:54 +0000 (21:15 +0000)]
Improve VM page queue scalability.

Currently both the page lock and a page queue lock must be held in
order to enqueue, dequeue or requeue a page in a given page queue.
The queue locks are a scalability bottleneck in many workloads. This
change reduces page queue lock contention by batching queue operations.
To detangle the page and page queue locks, per-CPU batch queues are
used to reference pages with pending queue operations. The requested
operation is encoded in the page's aflags field with the page lock
held, after which the page is enqueued for a deferred batch operation.
Page queue scans are similarly optimized to minimize the amount of
work performed with a page queue lock held.

Reviewed by: kib, jeff (previous versions)
Tested by: pho
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D14893

6 years agoMake the sysctl machdep.idle also a tunable.
kib [Tue, 24 Apr 2018 20:49:16 +0000 (20:49 +0000)]
Make the sysctl machdep.idle also a tunable.

It is applied before it is possible for idle threads to execute on any
CPU, allowing to work around against some bugs.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

6 years agoExtend ap_boot_mtx scope to also cover mca_init().
kib [Tue, 24 Apr 2018 20:33:08 +0000 (20:33 +0000)]
Extend ap_boot_mtx scope to also cover mca_init().

Otherwise, under bootverbose, the lapic_enable_cmc() banner 'lapicX:
CMCI unmasked' is printed by several CPUs in parallel, causing garbled
output for the LAPIC dumps.

Reported by: royger
Reviewed by: jhb
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D15157

6 years agoEnsure that cmci_monitor() is not executed in parallel, since shared
kib [Tue, 24 Apr 2018 20:29:40 +0000 (20:29 +0000)]
Ensure that cmci_monitor() is not executed in parallel, since shared
machine check banks must be only monitored by single CPU.

Noted and reviewed by: jhb
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D15157

6 years agoUse IS_BSP() macro.
kib [Tue, 24 Apr 2018 20:22:30 +0000 (20:22 +0000)]
Use IS_BSP() macro.

Noted and reviewed by: jhb
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Differential revision: https://reviews.freebsd.org/D15157

6 years agoAdd a UMA zone flag to disable the use of buckets.
markj [Tue, 24 Apr 2018 20:05:45 +0000 (20:05 +0000)]
Add a UMA zone flag to disable the use of buckets.

This allows the creation of zones which don't do any caching in front of
the keg. If the zone is a cache zone, this means that UMA will not
attempt any memory allocations when allocating an item from the backend.
This is intended for use after a panic by netdump, but likely has other
applications.

Reviewed by: kib
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D15184

6 years agoRevert r332894 at the request of the submitter.
sbruno [Tue, 24 Apr 2018 19:55:12 +0000 (19:55 +0000)]
Revert r332894 at the request of the submitter.

Submitted by: Johannes Lundberg <johalun0_gmail.com>
Sponsored by: Limelight Networks

6 years agoAdd deprecation notice for lmc(4)
emaste [Tue, 24 Apr 2018 19:51:05 +0000 (19:51 +0000)]
Add deprecation notice for lmc(4)

We intend to remove support before FreeBSD 12 is branched.  These are
available only as 32-bit PCI devices.  The driver has an ambiguous
license and I have not been successful in contacting the driver's author
in order to address this.

The planned deprecation has been announced on -current and -stable; if
we receive feedback that the driver is still useful and we are able to
resolve the license issue this deprecation notice can be reverted.

Reviewed by: bapt, brooks, imp, rgrimes
MFC after: 2 weeks
Relnotes: Yes
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D15182

6 years agolldb: remove assertion that target_arch is FreeBSD
emaste [Tue, 24 Apr 2018 19:26:58 +0000 (19:26 +0000)]
lldb: remove assertion that target_arch is FreeBSD

The target is not necessarily a FreeBSD binary - for example, it may be
a Linux binary running under the linuxulator.  Basic ptrace (live)
debugging already worked in this case, except for the assertion.

Sponsored by: Turing Robotic Industries Inc.

6 years agokdump: simplify/remove per-arch #ifdefs
emaste [Tue, 24 Apr 2018 19:23:26 +0000 (19:23 +0000)]
kdump: simplify/remove per-arch #ifdefs

It is acceptable for syscallabi to map SV_ABI to SYSDECODE_ABI on all
architectures; libsysdecode will return not-found sentinel values if
it does not have a syscall name or errno mapping for a given
architecture.

Also, use __LP64__ for the SV_ILP32 -> SYSDECODE_ABI_LINUX32 mapping,
for any future 32- on 64-bit linuxulator implementation.

Reviewed by: jhb
Sponsored by: Turing Robotic Industries Inc.

6 years agouslcom: Both CP2104 and CP2105 can support up to 2Mbps baudrate
manu [Tue, 24 Apr 2018 19:11:05 +0000 (19:11 +0000)]
uslcom: Both CP2104 and CP2105 can support up to 2Mbps baudrate

MFC after: 1 week

6 years agoDo not totally silence suppressed secondary kasserts unless debug.kassert.do_log...
cem [Tue, 24 Apr 2018 19:10:51 +0000 (19:10 +0000)]
Do not totally silence suppressed secondary kasserts unless debug.kassert.do_log is disabled

To totally silence and ignore secondary kassert violations after a primary
panic, set debug.kassert.do_log=0 and debug.kassert.suppress_in_panic=1.

Additional assertion warnings shouldn't block core dump and may alert the
developer to another erroneous condition.  Secondary stack traces may be
printed, identically to the unsuppressed case where panic() is reentered --
controlled via debug.trace_all_panics.

Sponsored by: Dell EMC Isilon

6 years agouslcom: Apply style(9) and be consistant with function names
manu [Tue, 24 Apr 2018 19:09:53 +0000 (19:09 +0000)]
uslcom: Apply style(9) and be consistant with function names

MFC after: 1 week

6 years agoFix debug.kassert.do_log description text
cem [Tue, 24 Apr 2018 18:59:40 +0000 (18:59 +0000)]
Fix debug.kassert.do_log description text

This has been an (incorrect) copy-paste duplicate of debug.kassert.warn_only
since it was originally committed in r243980.

Sponsored by: Dell EMC Isilon

6 years agopanic: Optionally, trace secondary panics
cem [Tue, 24 Apr 2018 18:54:20 +0000 (18:54 +0000)]
panic: Optionally, trace secondary panics

To diagnose and fix secondary panics, it is useful to have a stack trace.
When panic tracing is enabled, optionally trace secondary panics as well.

The option is configured with the tunable/sysctl debug.trace_all_panics.

(The original concern that inspired only tracing the primary panic was
likely that the secondary trace may scroll the original panic message or trace
off the screen.  This is less of a concern for serial consoles with logging.
Not everything has a serial console, though, so the behavior is optional.)

Discussed with: jhb
Sponsored by: Dell EMC Isilon

6 years agoUpdate r332860 by changing the default from suppressing post-panic
jtl [Tue, 24 Apr 2018 18:47:35 +0000 (18:47 +0000)]
Update r332860 by changing the default from suppressing post-panic
assertions to not suppressing post-panic assertions.

There are some post-panic assertions that are valuable and we shouldn't
default to disabling them.  However, when a user trips over them, the
user can still adjust the tunable/sysctl to suppress them temporarily to
get conduct troubleshooting (e.g. get a core dump).

Reported by: cem, markj

6 years agolockmgr: Add missed neutering during panic
cem [Tue, 24 Apr 2018 18:41:14 +0000 (18:41 +0000)]
lockmgr: Add missed neutering during panic

r313683 introduced new lockmgr APIs that missed the panic-time neutering
present in the rest of our locks.  Correct that by adding the usual check.

Additionally, move the __lockmgr_args neutering above the assertions at the
top of the function.  Drop the interlock unlock because we shouldn't have
an unneutered interlock either.  No point trying to unlock it.

PR: 227749
Reported by: jtl
Sponsored by: Dell EMC Isilon

6 years agoFix PT_STEP single-stepping for mips.
jhb [Tue, 24 Apr 2018 17:53:16 +0000 (17:53 +0000)]
Fix PT_STEP single-stepping for mips.

Note that GDB at least implements single stepping for MIPS using software
breakpoints explicitly rather than using PT_STEP, so this has only been
tested via tests in ptrace_test which now pass rather than fail.

- Fix several places to use uintptr_t instead of int for virtual addresses.
- Check for errors from ptrace_read_int() when setting a breakpoint for a
  step.
- Properly check for errors from ptrace_write_int() as it returns non-zero,
  not negative values on failure.
- Change the error returns for ptrace_read_int() and ptrace_write_int() from
  ENOMEM to EFAULT.
- Clear a single step breakpoint when it traps rather than waiting for it
  to be cleared from ptrace().  This matches the behavior of the arm port
  and in general seems a bit more reliable than waiting for ptrace() to
  clear it via FIX_SSTEP.
- Drop the PROC_LOCK around ptrace_write_int() in ptrace_clear_single_step()
  since it can sleep.
- Reorder the breakpoint handler in trap() to only read the instruction if
  the address matches the current thread's breakpoint address.
- Replace various #if 0'd debugging printfs with KTR_PTRACE traces.

Tested on: mips64

6 years agoUse more common format for sysctls/tunables descriptions in USB man pages.
trasz [Tue, 24 Apr 2018 17:46:33 +0000 (17:46 +0000)]
Use more common format for sysctls/tunables descriptions in USB man pages.

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

6 years agoUse dead_bpf_if instead of bp_null.
markj [Tue, 24 Apr 2018 17:42:25 +0000 (17:42 +0000)]
Use dead_bpf_if instead of bp_null.

This fixes a -Wunused error when DEV_BPF and NETGRAPH_BPF are not
defined.

Also remove a stray semicolon added in r332812.

X-MFC with: r332812

6 years agoDon't fetch the current instruction for faults on user "trap" instructions.
jhb [Tue, 24 Apr 2018 17:31:20 +0000 (17:31 +0000)]
Don't fetch the current instruction for faults on user "trap" instructions.

The value of 'instr' was not used to handle the fault.

Reported by: GCC's -Wunused-but-set-variable

6 years agoUse a cleaner test for the branch delay (BD) bit in DELAYBRANCH.
jhb [Tue, 24 Apr 2018 17:22:17 +0000 (17:22 +0000)]
Use a cleaner test for the branch delay (BD) bit in DELAYBRANCH.

Rather than casting the value of cause to int and checking for a negative
value to determine if bit 31 is set, use a binary and with MIPS_CR_BR_DELAY.

6 years agoCarefully update stack guard bytes inside __guard_setup().
kib [Tue, 24 Apr 2018 15:59:39 +0000 (15:59 +0000)]
Carefully update stack guard bytes inside __guard_setup().

This is necessary to make sure that functions that can have stack
protection are not used to update the stack guard. If not, the stack
guard check would fail when it shouldn't.

guard_setup() calls elf_aux_info(), which, in turn, calls memcpy() to
update stack_chk_guard.  If either elf_aux_info() or memcpy() have
stack protection enabled, __stack_chk_guard will be modified before
returning from them, causing the stack protection check to fail.

This change uses a temporary buffer to delay changing
__stack_chk_guard until elf_aux_info() returns.

Submitted by: Luis Pires
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D15173

6 years ago[procfs] Split procfs_attr into multiple functions
eadler [Tue, 24 Apr 2018 14:49:09 +0000 (14:49 +0000)]
[procfs] Split procfs_attr into multiple functions

Reviewed by: des, kib
Discussed with: mmacy
Differential Revision: https://reviews.freebsd.org/D15150

6 years agoUse relaxed atomics to access the monitor line.
kib [Tue, 24 Apr 2018 14:02:46 +0000 (14:02 +0000)]
Use relaxed atomics to access the monitor line.

We must ensure that accesses occur, they do not have any other
compiler-visible effects.  Bruce found some situations where
optimization could remove an access, and provided a patch to use
volatile qualifier for the state variables.  Since volatile behaviour
there is the compiler-specific interpretation of the keyword, use
relaxed atomics instead, which gives exactly the desired semantic.

Noted by and discussed with: bde
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

6 years agoCorrect undesirable interaction between caching of %cr4 in bhyve and
kib [Tue, 24 Apr 2018 13:44:19 +0000 (13:44 +0000)]
Correct undesirable interaction between caching of %cr4 in bhyve and
invltlb_glob().

Reviewed by: grehan, jhb
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D15138

6 years ago[amdsbwd] teach amdsbwd that it has options
eadler [Tue, 24 Apr 2018 13:07:17 +0000 (13:07 +0000)]
[amdsbwd] teach amdsbwd that it has options

AMDSBWD_DEBUG was previously checked for as a #define but it was not
possible to define it

Reviewed by: kevans
Discussed with: kenm

6 years agoFix futexes on i386 after the 4/4G split.
kib [Tue, 24 Apr 2018 12:50:21 +0000 (12:50 +0000)]
Fix futexes on i386 after the 4/4G split.

Use proper method to access userspace.  For now, only the slow copyout
path is implemented.

Reported and tested by: tijl (previous version)
Sponsored by: The FreeBSD Foundation

6 years agoadd a new ACPI suspend debugging knob, debug.acpi.suspend_deep_bounce
avg [Tue, 24 Apr 2018 09:42:58 +0000 (09:42 +0000)]
add a new ACPI suspend debugging knob, debug.acpi.suspend_deep_bounce

This sysctl allows a deeper dive into the sleep abyss comparing to
debug.acpi.suspend_bounce.  When the new sysctl is set the system will
execute the suspend sequence up to the call to AcpiEnterSleepState().
That includes saving processor contexts and parking APs.  Then, instead
of actually entering the sleep state, the BSP will call resumectx() to
emulate the wakeup.  The APs should get restarted by the sequence of
Init and Startup IPIs that BSP sends to them.

MFC after: 8 days

6 years agolockf: change the owner hash from pid to vnode-based
mjg [Tue, 24 Apr 2018 06:10:36 +0000 (06:10 +0000)]
lockf: change the owner hash from pid to vnode-based

This adds a bit missed due to the patch split, see r332882

Tested by: pho

6 years agoRelock PROC_LOCK before one failure case in ptrace_single_step().
jhb [Tue, 24 Apr 2018 05:42:10 +0000 (05:42 +0000)]
Relock PROC_LOCK before one failure case in ptrace_single_step().

The MIPS ptrace_single_step() unlocks the PROC_LOCK while reading and
writing instructions from userland.  One failure case was not reacquiring
the lock before returning.

6 years agoReport proper signal codes for SIGTRAP traps on MIPS.
jhb [Tue, 24 Apr 2018 05:33:17 +0000 (05:33 +0000)]
Report proper signal codes for SIGTRAP traps on MIPS.

- Use TRAP_TRACE for traps after stepping via PT_STEP.
- Use TRAP_BRKPT for software breakpoint traps and watchpoint traps.

This was tested via the recently added siginfo ptrace() tests.  PT_STEP on
MIPS has several bugs that prevent it from working yet, but this does fix
the ptrace__breakpoint_siginfo test on MIPS.

6 years agoAdd two tests for TRAP_* signal codes for SIGTRAP.
jhb [Tue, 24 Apr 2018 05:30:05 +0000 (05:30 +0000)]
Add two tests for TRAP_* signal codes for SIGTRAP.

- ptrace__breakpoint_siginfo tests that a SIGTRAP for a software breakpoint
  in userland triggers a SIGTRAP with a signal code of TRAP_BRKPT.
- ptrace__step_siginfo tests that a SIGTRAP reported for a step after
  stepping via PT_STEP or PT_SETSTEP has a signal code of TRAP_TRACE.