]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
5 years agoAdd ga_IE.UTF-8 locale.
yuripv [Mon, 26 Nov 2018 19:39:49 +0000 (19:39 +0000)]
Add ga_IE.UTF-8 locale.

PR: 228587
Submitted by: Micil <micheal.maclochlainn@oegaillimh.ie> (LC_TIME)
Reviewed by: bapt
Approved by: kib (mentor, implicit)
MFC after: 3 days
Differential revision: https://reviews.freebsd.org/D17997

5 years agostand/i386/libi386: rename .s file to .S to use Clang IAS
emaste [Mon, 26 Nov 2018 19:29:18 +0000 (19:29 +0000)]
stand/i386/libi386: rename .s file to .S to use Clang IAS

As part of the migration away from obsolete binutils we want to retire
GNU as.  Most assembly files used on amd64 have a .S extension and are
assembled with Clang's Integrated Assembler (IAS); rename pxetram.s to
.S to use IAS as well.

The generated .text is identical (the entire .o file is not, as Clang
adds debug info.)

PR: 205250, 233094
Sponsored by: The FreeBSD Foundation

5 years agobtx: rename .s files to .S to use Clang IAS
emaste [Mon, 26 Nov 2018 19:14:33 +0000 (19:14 +0000)]
btx: rename .s files to .S to use Clang IAS

As part of the migration away from obsolete binutils we want to retire
GNU as.  Most assembly files used on amd64 have a .S extension and are
assembled with Clang's integrated assembler; rename two files in
stand/i386/btx/lib to .S to use IAS as well.

The generated .text is identical (the entire .o files are not, as Clang
adds debug info).

PR: 205250, 233094
Discussed with: imp
Sponsored by: The FreeBSD Foundation

5 years agoregulator_fixed: Do not disable fixed regulator at probe
manu [Mon, 26 Nov 2018 18:46:15 +0000 (18:46 +0000)]
regulator_fixed: Do not disable fixed regulator at probe

If the regulator is unused it will be disabled by the regulator_shutdown sysinit.

Tested on pinebook where the backlight is controlled by a fixed-regulator.
The regulator doesn't have a regulator-boot-on param (I'm gonna upstream this) and so we disable it at probe.
We later enable it but this cause the screen to go black.
Linux doesn't disable regulator at boot (at least for fixed-regulator) so better match this to have the same UX.

MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D17978

5 years agovfs_aio.c: rename "physio" symbols to "bio".
asomers [Mon, 26 Nov 2018 18:31:00 +0000 (18:31 +0000)]
vfs_aio.c: rename "physio" symbols to "bio".

aio has two paths: an asynchronous "physio" path and a synchronous path.
Confusingly, physio(9) isn't actually used by the "physio" path, and never
has been.  In fact, it may even be called by the synchronous path!  Rename
the "physio" path to the "bio" path to reflect what it actually does:
directly compose BIOs and send them to character devices.

MFC after: 2 weeks

5 years agoarm64: Add evdev support to GENERIC
manu [Mon, 26 Nov 2018 17:59:25 +0000 (17:59 +0000)]
arm64: Add evdev support to GENERIC

5 years agoUPDATING: add note for r340984 (ld.bfd removal)
emaste [Mon, 26 Nov 2018 17:22:23 +0000 (17:22 +0000)]
UPDATING: add note for r340984 (ld.bfd removal)

Sponsored by: The FreeBSD Foundation

5 years agosrc.conf.5: regen after r340984 (and r340841)
emaste [Mon, 26 Nov 2018 17:11:50 +0000 (17:11 +0000)]
src.conf.5: regen after r340984 (and r340841)

5 years agoDo not install GNU ld if lld is /usr/bin/ld
emaste [Mon, 26 Nov 2018 17:07:35 +0000 (17:07 +0000)]
Do not install GNU ld if lld is /usr/bin/ld

GNU binutils ld.bfd 2.17.50 does not support ifuncs and produces broken
binaries when ifuncs are in use.  When LLD_IS_LD is default we have an
ifunc-capable system linker and can just avoid installing ld.bfd.

Reported by: theraven
Reviewed by: bz
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D18340

5 years agoFix NTP query on GCE due to unresolved hostname.
gjb [Mon, 26 Nov 2018 17:00:39 +0000 (17:00 +0000)]
Fix NTP query on GCE due to unresolved hostname.

PR: 232456
Submitted by: Lucas Kanashiro
MFC after: 3 days
Sponsored by: The FreeBSD Foundation

5 years agorelease: arm64: Add PINEBOOK config
manu [Mon, 26 Nov 2018 16:38:39 +0000 (16:38 +0000)]
release: arm64: Add PINEBOOK config

Add a configuration for PINEBOOK image.
Pinebook is a arm64 laptop based on a Pine64 board.

Since the usb trackpad need a quirk, add a common function for adding
quirk for arm board.
A default one is supplied as most board to not need quirks.

Reviewed by: gjb
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D18337

5 years agoSmall language fix after r340978.
eugen [Mon, 26 Nov 2018 16:10:20 +0000 (16:10 +0000)]
Small language fix after r340978.

MFC after: 3 days

5 years agoipfw.8: add new section to EXAMPLES:
eugen [Mon, 26 Nov 2018 16:02:17 +0000 (16:02 +0000)]
ipfw.8: add new section to EXAMPLES:

SELECTIVE MIRRORING
     If your network has network traffic analyzer connected to your host
     directly via dedicated interface or remotely via RSPAN vlan, you can
     selectively mirror some ethernet layer2 frames to the analyzer.
     ...

5 years agovi: fix UTF-8 detection.
yuripv [Mon, 26 Nov 2018 15:33:55 +0000 (15:33 +0000)]
vi: fix UTF-8 detection.

PR: 202290
Submitted by: lampa@fit.vutbr.cz
Reviewed by: bapt
Approved by: kib (mentor, implicit)
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D17950

5 years agollvm-objdump.1: fix igor / mandoc -Tlint warnings
emaste [Mon, 26 Nov 2018 15:12:58 +0000 (15:12 +0000)]
llvm-objdump.1: fix igor / mandoc -Tlint warnings

Accidentally omitted from r340972.

5 years agobectl: sync usage with man page, removing stray multibyte characters
yuripv [Mon, 26 Nov 2018 15:11:32 +0000 (15:11 +0000)]
bectl: sync usage with man page, removing stray multibyte characters
in the process.

PR: 233526
Submitted by: tigersharke@gmail.com (original version)
Reviewed by: kevans
Approved by: kib (mentor, implicit)
MFC after: 3 days
Differential revision: https://reviews.freebsd.org/D18335

5 years agollvm-objdump.1: remove invalid options
emaste [Mon, 26 Nov 2018 14:45:58 +0000 (14:45 +0000)]
llvm-objdump.1: remove invalid options

Some options appear in llvm-objdump's usage information as a side effect
of its option parsing implementation and are not actually llvm-objdump
options.  Reported in LLVM review https://reviews.llvm.org/D54864.

Reported by: Fangrui Song
Sponsored by: The FreeBSD Foundation

5 years agollvm-objdump: initial man page
emaste [Mon, 26 Nov 2018 14:34:30 +0000 (14:34 +0000)]
llvm-objdump: initial man page

Based on llvm-objdump's online documentation and usage information.
This serves as a starting point; additional detail and cleanup still
required.

Also being submitted upstream in LLVM review D54864.  I expect to use
this bespoke copy while we have LLVM 6.0 or 7.0 in FreeBSD; when we
update to LLVM 8.0 it should be upstream and we will switch to it.

PR: 233437
Reviewed by: bcr (man formatting)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D18309

5 years agoaw_usbphy: Do not error if it's not phy 0
manu [Mon, 26 Nov 2018 14:27:13 +0000 (14:27 +0000)]
aw_usbphy: Do not error if it's not phy 0

Only phy0 can switch between host/otg, do not error if we request
host mode on phy != 0.

MFC after: 1 month
X-MFC with: r340846

5 years agorevert r340640 "libc: forcibly disable BIND_NOW"
emaste [Mon, 26 Nov 2018 13:56:19 +0000 (13:56 +0000)]
revert r340640 "libc: forcibly disable BIND_NOW"

When immediate bind mode is requested, as of r340675 rtld processes
irelocs in PLT immediately after other PLT relocs.  That addresses the
libc + BIND_NOW startup crash the workaround is no longer needed.

PR: 233333

5 years agoPlug routing sysctl leaks.
markj [Mon, 26 Nov 2018 13:42:18 +0000 (13:42 +0000)]
Plug routing sysctl leaks.

Various structures exported by sysctl_rtsock() contain padding fields
which were not being zeroed.

Reported by: Thomas Barabosch, Fraunhofer FKIE
Reviewed by: ae
MFC after: 3 days
Security: kernel memory disclosure
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D18333

5 years agoMFV r340938:
mm [Mon, 26 Nov 2018 11:04:35 +0000 (11:04 +0000)]
MFV r340938:
Sync libarchive with vendor.

Relevant vendor changes:
  Issue #1096: Support extracting ACLs with in-entry comments (GNU tar)
  PR #1023: Support extracting extattrs as non-root on non-user-writeable
            files

MFC after: 1 week

5 years agolibedit: improve multibyte support
bapt [Mon, 26 Nov 2018 08:16:33 +0000 (08:16 +0000)]
libedit: improve multibyte support

Until this commit libedit only supported UTF-8 for multibyte charset
Improve it to support other multibyte charsets

Tested with eucJP and SJIS charsets.
Note that this change as been review and committed in upstream libedit
as well via christos@NetBSD

Submitted by: naito.yuichiro _at_ gmail.com
Reviewed by: bapt, pfg, yuripv, 0mp
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D17903

5 years agosfxge(4): add 3.3V and 12.0V current sensors
arybchik [Mon, 26 Nov 2018 07:42:52 +0000 (07:42 +0000)]
sfxge(4): add 3.3V and 12.0V current sensors

Automatically generated using mkconfig.py.

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18138

5 years agosfxge(4): fix incorrectly set svn properties
arybchik [Mon, 26 Nov 2018 07:30:47 +0000 (07:30 +0000)]
sfxge(4): fix incorrectly set svn properties

File name was used by the svn property value since
real value was lost in the command.

5 years agosfxge(4): update autogenerated headers from firmwaresrc
arybchik [Mon, 26 Nov 2018 07:23:02 +0000 (07:23 +0000)]
sfxge(4): update autogenerated headers from firmwaresrc

Pick up Medford2 interfaces.

Split AOE operations out into own header.

Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18137

5 years agosfxge(4): regenerate files with genfwdef after ID update
arybchik [Mon, 26 Nov 2018 07:15:19 +0000 (07:15 +0000)]
sfxge(4): regenerate files with genfwdef after ID update

Add security level to image boot header.

Submitted by:   Andrew Jackson <ajackson at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18289

5 years agosfxge(4): add API to control UDP tunnel ports
arybchik [Mon, 26 Nov 2018 06:20:13 +0000 (06:20 +0000)]
sfxge(4): add API to control UDP tunnel ports

HW needs to know which UDP packets should be treated as tunnel
encapsulation to do inner packet recognition, classification and
offloads.

Submitted by:   Ivan Malov <ivan.malov at oktetlabs.ru>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18134

5 years agoMove the check for the filesystem having been run on a kernel that
mckusick [Mon, 26 Nov 2018 00:58:07 +0000 (00:58 +0000)]
Move the check for the filesystem having been run on a kernel that
predates metadata check hashes so that it is done before deciding
whether to compute a check-hash of the superblock.

Reported by:  Rick Macklem <rmacklem@uoguelph.ca>
Sponsored by: Netflix

5 years agoevdev: Fix pause key release event in AT keyboard set 1 to evdev xlat-or.
wulf [Sun, 25 Nov 2018 19:37:00 +0000 (19:37 +0000)]
evdev: Fix pause key release event in AT keyboard set 1 to evdev xlat-or.

MFC after: 2 weeks

5 years agoProperly recover from superblock check-hash failures. Specifically,
mckusick [Sun, 25 Nov 2018 18:09:39 +0000 (18:09 +0000)]
Properly recover from superblock check-hash failures. Specifically,
report the check-hash failure and offer to search for and use
alternate superblocks.  Prior to this fix fsck_ffs would simply
report the check-hash failure and exit.

Reported by:  Julian H. Stacey <jhs@berklix.com>
Tested by:    Peter Holm
Sponsored by: Netflix

5 years agoCalculate updated superblock check-hash before writing it into the snapshot.
mckusick [Sun, 25 Nov 2018 18:01:15 +0000 (18:01 +0000)]
Calculate updated superblock check-hash before writing it into the snapshot.
This corrects a bug that prevented snapshots from being mounted due to a
superblock check-hash failure.

Reported by:  Brennan Vincent <brennan@umanwizard.com>
Tested by:    Peter Holm (pho@)
Sponsored by: Netflix

5 years agoAvoid unneeded check in vmspace_alloc().
kib [Sun, 25 Nov 2018 17:56:49 +0000 (17:56 +0000)]
Avoid unneeded check in vmspace_alloc().

All vmspace_alloc() callers know which kind of pmap they allocate.

Reviewed by: alc, markj (previous version)
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D18329

5 years agoUpdate pxeboot(8) manual page to reflect the next-server change in the ISC DHCP v3...
ygy [Sun, 25 Nov 2018 09:37:57 +0000 (09:37 +0000)]
Update pxeboot(8) manual page to reflect the next-server change in the ISC DHCP v3 server.

PR: 123484
Submitted by: edwin@mavetju.org
Reviewed by: AllanJude
MFC after: 1 week

5 years agoblist_meta_alloc assumes that mask=scan->bm_bitmap is nonzero. But if the
alc [Sat, 24 Nov 2018 21:52:10 +0000 (21:52 +0000)]
blist_meta_alloc assumes that mask=scan->bm_bitmap is nonzero.  But if the
cursor lies in the middle of the space that the meta node represents, then
blanking the low bits of mask may make it zero, and break later code that
expects a nonzero value.  Add a test that returns failure if the mask has
been cleared.

Submitted by: Doug Moore <dougm@rice.edu>
Reported by: pho
Tested by: pho
X-MFC with: r340402
Differential Revision: https://reviews.freebsd.org/D18058

5 years agopsm(4): Add minimal support for active AUX port multiplexers
wulf [Sat, 24 Nov 2018 21:23:12 +0000 (21:23 +0000)]
psm(4): Add minimal support for active AUX port multiplexers

Active PS/2 multiplexing is a method for attaching up to four PS/2
pointing devices to a computer. Enabling of multiplexed mode allows
commands to be directed to individual devices using routing prefixes.
Multiplexed mode reports input with each byte tagged to identify
its source. This method differs from one currently supported by psm(4)
where so called guest device (trackpoint) is attached to special
interface located on the host device (touchpad) and latter performs
guest protocol conversion to special encapsulation packet format.

At present time active PS/2 multiplexing is used in some models of
HP laptops e.g. EliteBook 8560w, 9470m. Enabling of absolute operation
mode on such touchpads is connected with following problems:
1. Touchpad's port priority is lower than trackpoint's. That blocks
   information queries thus prevents touchpad detection and configuration.
2. Touchpad and trackpoint have different protocol packet sizes and
   sync bytes.

As PS/2 usage is on decline only minimal possible set of changes to
support Synaptics touchpad and generic mouses is implemented.
Active multiplexing mode is enabled only at probe stage to scan through
attached PS/2 devices to query and configure Synaptics touchpad.
After touchpad has been configured, mux is switched back to legacy
(hidden multiplexing) mode to perform normal interrupt-driven input
data processing. Overflow bit values rather than tags are used to
separate packets produced by different devices. Switching back to
legacy mode allows to avoid psm(4) and atkbd(4) rework to support
4 instances of mouse driver.

Note: While in hidden multiplexing mode KBC does some editing of the
packet stream. It remembers the button bits from the last packet
received from each device, and replaces the button bits of every
packet with the logical OR of all devices’ most recent button bits.
This sort of button crosstalk results in spurious button events
which are inhibitted with various tricks. E.g. trackpoint middle
button events are suppressed while trackpad surface is touched and
touchpad left and right button events are suppressed if corresponding
trackpoint buttons are pressed.

PR: 231058
Reported by: Michael Figiel <mifigiel@gmail.com>
Tested by: Michael Figiel <mifigiel@gmail.com>
MFC after: 2 weeks

5 years agoRevert r328640: Add kludge for 0x46 identity middle byte Synaptics touchpads.
wulf [Sat, 24 Nov 2018 21:17:51 +0000 (21:17 +0000)]
Revert r328640: Add kludge for 0x46 identity middle byte Synaptics touchpads.

It appeared that "0x46 identity middle byte" response is caused by so called
"Active PS/2 multiplexing controller" presence. Support for it will be added
in next commit.

5 years agoRe-enable the dynamiclib tests. These should be fixed by r340910.
andrew [Sat, 24 Nov 2018 18:25:00 +0000 (18:25 +0000)]
Re-enable the dynamiclib tests. These should be fixed by r340910.

5 years agoAdd the missing 0 at the end of the .jcr section.
andrew [Sat, 24 Nov 2018 18:23:53 +0000 (18:23 +0000)]
Add the missing 0 at the end of the .jcr section.

Without this the dynamic library test was failing as it was calling
_Jv_RegisterClasses multiple times.

5 years agoCombine two lines into one following unifdef for r255332.
cy [Sat, 24 Nov 2018 18:23:05 +0000 (18:23 +0000)]
Combine two lines into one following unifdef for r255332.

MFC after: 1 week

5 years agosfxge(4): allow to request inner classes for Rx packets
arybchik [Sat, 24 Nov 2018 18:13:34 +0000 (18:13 +0000)]
sfxge(4): allow to request inner classes for Rx packets

If HW/FW supports tunnel encapsulations, Rx event may contain
either inner or outer packet classes. By default outer classes
are requested. Make it possible to request inner classes to
have more information about packet type and allow to interpret
inner frame checksum validation results correctly.

Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18133

5 years agosfxge(4): add function to create packed stream RxQ
arybchik [Sat, 24 Nov 2018 18:13:21 +0000 (18:13 +0000)]
sfxge(4): add function to create packed stream RxQ

Encoding packed stream buffer size in RxQ type is not a future-proof
idea taking into account a new RxQ types with extra parameters.
To be consistent make packet stream buffer size a separate parameter.
In order to avoid blowing of the default RxQ create function prototype
add a dedicated function to create packed stream RxQ without not
applicable paramters.

Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18132

5 years agosfxge(4): control RxQ scatter using flag instead of type
arybchik [Sat, 24 Nov 2018 18:13:07 +0000 (18:13 +0000)]
sfxge(4): control RxQ scatter using flag instead of type

Rx scatter may be applicable to different Rx queue types.

Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18131

5 years agoPass malloc flags directly through kevent(2) subroutines.
markj [Sat, 24 Nov 2018 17:06:01 +0000 (17:06 +0000)]
Pass malloc flags directly through kevent(2) subroutines.

Some kevent functions have a boolean "waitok" parameter for use when
calling malloc(9).  Replace them with the corresponding malloc() flags:
the desired behaviour is known at compile-time, so this eliminates a
couple of conditional branches, and makes the code easier to read.

No functional change intended.

Reviewed by: kib
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D18318

5 years agoPlug some kernel memory disclosures via kevent(2).
markj [Sat, 24 Nov 2018 17:02:31 +0000 (17:02 +0000)]
Plug some kernel memory disclosures via kevent(2).

The kernel may register for events on behalf of a userspace process,
in which case it must be careful to zero the kevent struct that will be
copied out to userspace.

Reviewed by: kib
MFC after: 3 days
Security: kernel stack memory disclosure
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D18317

5 years agoEnsure that knotes do not get registered when KQ_CLOSING is set.
markj [Sat, 24 Nov 2018 16:58:34 +0000 (16:58 +0000)]
Ensure that knotes do not get registered when KQ_CLOSING is set.

KQ_CLOSING is set before draining the knotes associated with a kqueue,
so we must ensure that new knotes are not added after that point.  In
particular, some kernel facilities may register for events on behalf
of a userspace process and race with a close of the kqueue.

PR: 228858
Reviewed by: kib
Tested by: pho
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D18316

5 years agoLock the knlist before releasing the in-flux state in knote_fork().
markj [Sat, 24 Nov 2018 16:41:29 +0000 (16:41 +0000)]
Lock the knlist before releasing the in-flux state in knote_fork().

Otherwise there is a window, before iteration is resumed, during which
the knote may be freed.  The in-flux state ensures that the knote will
not be removed from the knlist while locks are dropped.

PR: 228858
Reviewed by: kib
Tested by: pho
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D18316

5 years agosfxge(4): remove Falcon-specific concurrency check
arybchik [Sat, 24 Nov 2018 16:31:43 +0000 (16:31 +0000)]
sfxge(4): remove Falcon-specific concurrency check

Falcon support has been withdrawn from libefx, however, there is still
an obsolete Falcon-specific assertion that efx_mac_stats_upload()
and efx_port_poll() aren't concurrent. To be consistent with an overall
Falcon support revocation it's desirable to remove it.

Fix debug build invalid assertion failure.

Submitted by:   Ivan Malov <ivan.malov at oktetlabs.ru>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D18130

5 years agosfxge(4): move BIU test code into Siena-specific file
arybchik [Sat, 24 Nov 2018 16:31:31 +0000 (16:31 +0000)]
sfxge(4): move BIU test code into Siena-specific file

Submitted by:   Mark Spender <mspender at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18129

5 years agosfxge(4): fix PreFAST static analysis warning (C6001)
arybchik [Sat, 24 Nov 2018 16:31:20 +0000 (16:31 +0000)]
sfxge(4): fix PreFAST static analysis warning (C6001)

Fix warning
"C6001: Using uninitialized memory '*sensor_maskp'"
which could occur when the npages argument to efx_mcdi_sensor_info()
is less than or equal to zero.

Submitted by:   Andrew Lee <alee at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D18128

5 years agosfxge(4): expand on comment on number of queues field
arybchik [Sat, 24 Nov 2018 16:31:08 +0000 (16:31 +0000)]
sfxge(4): expand on comment on number of queues field

Expand on comment on RSS_CONTEXT_ALLOC_IN_NUM_QUEUES field.

Submitted by:   Mark Spender <mspender at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18127

5 years agosfxge(4): remove obsolete check for pre-Siena hardware
arybchik [Sat, 24 Nov 2018 16:30:57 +0000 (16:30 +0000)]
sfxge(4): remove obsolete check for pre-Siena hardware

The fail4 label was used twice, so it doesn't need removing.

Submitted by:   Mark Spender <mspender at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18126

5 years agosfxge(4): fix warnings from VS2015 C compiler (C4214)
arybchik [Sat, 24 Nov 2018 16:30:46 +0000 (16:30 +0000)]
sfxge(4): fix warnings from VS2015 C compiler (C4214)

Fix multiple level 4 warnings
"C4214: nonstandard extension used: bit field types other than int";
no functional changes.

Submitted by:   Andrew Lee <alee at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D18125

5 years agosfxge(4): fix warnings from VS2015 C compiler (C4057)
arybchik [Sat, 24 Nov 2018 16:30:34 +0000 (16:30 +0000)]
sfxge(4): fix warnings from VS2015 C compiler (C4057)

Fix two level 4 warnings
"C4057: 'function': 'const uint8_t *' differs in indirection to
slightly different base types from 'caddr_t'"; no functional changes.

Submitted by:   Andrew Lee <alee at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D18124

5 years agosfxge(4): fix warnings from VS2015 C compiler (C4189)
arybchik [Sat, 24 Nov 2018 16:30:22 +0000 (16:30 +0000)]
sfxge(4): fix warnings from VS2015 C compiler (C4189)

Fix multiple level 4 warnings
"C4189: 'xxx': local variable is initialized but not referenced";
no functional changes.

Submitted by:   Andrew Lee <alee at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D18123

5 years agosfxge(4): fix warnings from VS2015 C compiler (C4100)
arybchik [Sat, 24 Nov 2018 16:30:09 +0000 (16:30 +0000)]
sfxge(4): fix warnings from VS2015 C compiler (C4100)

Fix multiple level 4 warnings
"C4100: 'xxx': unreferenced formal parameter"
no functional changes.

The _NOTE(ARGUNUSED(xxx)) annotations are being exposed to the Visual
Studio 2015 C compiler with the following:

    #define _NOTE_ARGUNUSED(...) UNREFERENCED_PARAMETER((__VA_ARGS__));
    #define _NOTE(_annotation)   _NOTE_ ## _annotation

Submitted by:   Andrew Lee <alee at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D18122

5 years agosfxge(4): fix warnings from VS2015 C compiler (C4245)
arybchik [Sat, 24 Nov 2018 16:29:58 +0000 (16:29 +0000)]
sfxge(4): fix warnings from VS2015 C compiler (C4245)

Fix level 4 warning
"C4245: 'initializing': conversion from 'int' to 'uint32_t',
signed/unsigned mismatch" warning; no functional changes.

Submitted by:   Andrew Lee <alee at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D18121

5 years agosfxge(4): fix warnings from VS2015 C compiler (C4244)
arybchik [Sat, 24 Nov 2018 16:29:46 +0000 (16:29 +0000)]
sfxge(4): fix warnings from VS2015 C compiler (C4244)

Fix level 4 warning
"C4244: '+=': conversion from 'unsigned int' to 'uint16_t', possible loss
of data"; no functional changes.

Submitted by:   Andrew Lee <alee at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D18120

5 years agosfxge(4): fix warnings from VS2015 C compiler (C4310)
arybchik [Sat, 24 Nov 2018 16:29:35 +0000 (16:29 +0000)]
sfxge(4): fix warnings from VS2015 C compiler (C4310)

Fix level 4 warning
"C4310: cast truncates constant value";
no functional changes.

Submitted by:   Andrew Lee <alee at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D18119

5 years agosfxge(4): fix probes in licensing support
arybchik [Sat, 24 Nov 2018 16:29:23 +0000 (16:29 +0000)]
sfxge(4): fix probes in licensing support

EFSYS_PROBE1 takes one typed value (in addition to the probe name),
whereas EFSYS_PROBE has just the probe name.

Which to use is determined by the probe name - "fail1" probes are
expected to include the function result.

Submitted by:   Mark Spender <mspender at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D18118

5 years agosfxge(4): fix diagnostics support build without Siena
arybchik [Sat, 24 Nov 2018 16:29:11 +0000 (16:29 +0000)]
sfxge(4): fix diagnostics support build without Siena

The compilation failed because __efx_sram_pattern_fns was used in
efx_nic.c, but defined in efx_sram.c which is only needed when
supporting Siena.

To fix it move all the code using __efx_sram_pattern_fns into
Siena-specific files (except for the definition in efx_sram.c itself,
as that file only needs to be included in Siena-supporting builds
anyway).

The functions to test registers and tables are unlikely to apply to any
new hardware and so can be moved into Siena files. Since Huntington
such tests have been implemented in firmware.

Submitted by:   Mark Spender <mspender at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D18117

5 years agosfxge(4): allow to use PHY stats on Huntington/Medford
arybchik [Sat, 24 Nov 2018 16:28:58 +0000 (16:28 +0000)]
sfxge(4): allow to use PHY stats on Huntington/Medford

EFSYS_OPT_PHY_STATS can be used with Huntington or Medford, not just Siena.

Submitted by:   Mark Spender <mspender at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18116

5 years agoDisable the dynamiclib test until a failure can be debugged
andrew [Sat, 24 Nov 2018 16:05:40 +0000 (16:05 +0000)]
Disable the dynamiclib test until a failure can be debugged

5 years agosfxge(4): fix coding style
arybchik [Sat, 24 Nov 2018 15:24:47 +0000 (15:24 +0000)]
sfxge(4): fix coding style

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18115

5 years agosfxge(4): remove unused defined for WPTR alignment
arybchik [Sat, 24 Nov 2018 15:24:35 +0000 (15:24 +0000)]
sfxge(4): remove unused defined for WPTR alignment

MEDFORD_RX_WPTR_ALIGN is not used.

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18114

5 years agosfxge(4): support new sensors
arybchik [Sat, 24 Nov 2018 15:24:23 +0000 (15:24 +0000)]
sfxge(4): support new sensors

Submitted by:   Andrew Jackson <ajackson at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18113

5 years agosfxge(4): add new sensors
arybchik [Sat, 24 Nov 2018 15:24:12 +0000 (15:24 +0000)]
sfxge(4): add new sensors

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18112

5 years agosfxge(4): move Siena-specific defs to right header
arybchik [Sat, 24 Nov 2018 15:23:58 +0000 (15:23 +0000)]
sfxge(4): move Siena-specific defs to right header

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18111

5 years agosfxge(4): fix build issue with PHY LED control enabled
arybchik [Sat, 24 Nov 2018 15:23:46 +0000 (15:23 +0000)]
sfxge(4): fix build issue with PHY LED control enabled

Fixed build issue with the EFSYS_OPT_PHY_LED_CONTROL for Huntigton and
Medford.

Submitted by:   Vijay Srivastava <vijays at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D18110

5 years agosfxge(4): improve names for TXQ descriptor counts
arybchik [Sat, 24 Nov 2018 15:23:34 +0000 (15:23 +0000)]
sfxge(4): improve names for TXQ descriptor counts

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18109

5 years agosfxge(4): improve names for RXQ descriptor counts
arybchik [Sat, 24 Nov 2018 15:23:22 +0000 (15:23 +0000)]
sfxge(4): improve names for RXQ descriptor counts

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18108

5 years agosfxge(4): improve names for EVQ descriptor counts
arybchik [Sat, 24 Nov 2018 15:23:09 +0000 (15:23 +0000)]
sfxge(4): improve names for EVQ descriptor counts

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18107

5 years agosfxge(4): remove assertion on no longer used define
arybchik [Sat, 24 Nov 2018 15:22:57 +0000 (15:22 +0000)]
sfxge(4): remove assertion on no longer used define

MC_CMD_INIT_RXQ_OUT_LEN is not used any more.

Submitted by:   Mark Spender <mspender at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18106

5 years agoAn OSF/1 ifdef makes absolutley no sense in a FreeBSD specific source
cy [Sat, 24 Nov 2018 07:16:44 +0000 (07:16 +0000)]
An OSF/1 ifdef makes absolutley no sense in a FreeBSD specific source
file.
MFC after: 1 week

5 years agoFreeBSD 7 has been history for many moons. Remove some dead code.
cy [Sat, 24 Nov 2018 06:49:41 +0000 (06:49 +0000)]
FreeBSD 7 has been history for many moons. Remove some dead code.

MFC after: 1 week

5 years agoMFV r340865:
mm [Sat, 24 Nov 2018 01:25:45 +0000 (01:25 +0000)]
MFV r340865:
Sync libarchive with vendor.

Relevant vendor changes:
  PR #1080: Spelling fixes
  PR #1084: RAR5 reader bugfixes
  PR #1091: fix use-after-free in delayed newc link processing
  PR #1092: Fix a few obvious resource leaks and strcpy() misuses

MFC after: 1 week

5 years agoParse FreeBSD Feature Control note on the ELF image activation.
kib [Fri, 23 Nov 2018 23:33:55 +0000 (23:33 +0000)]
Parse FreeBSD Feature Control note on the ELF image activation.

Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

5 years agoGeneralize ELF parse_notes().
kib [Fri, 23 Nov 2018 23:29:14 +0000 (23:29 +0000)]
Generalize ELF parse_notes().

Remove the knowledge of the ABI note type and brandnote from it,
instead provide it with a callback to do note-specific matching and
data fetching.  Implement callback to match against ELF brand.

Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

5 years agoTrivial reduction of the code duplication, reuse the return FALSE code.
kib [Fri, 23 Nov 2018 23:16:01 +0000 (23:16 +0000)]
Trivial reduction of the code duplication, reuse the return FALSE code.

Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

5 years agoHonour the waitok parameter in kevent_expand().
markj [Fri, 23 Nov 2018 23:10:03 +0000 (23:10 +0000)]
Honour the waitok parameter in kevent_expand().

Reviewed by: kib
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D18316

5 years agoProvide storage for the process feature control flags in struct proc.
kib [Fri, 23 Nov 2018 23:07:57 +0000 (23:07 +0000)]
Provide storage for the process feature control flags in struct proc.

The flags are cleared on exec, it is up to the image activator to set
them.

Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

5 years agoEnsure the dirent remains initialized when dirent.d_fileno is unset.
markj [Fri, 23 Nov 2018 23:07:49 +0000 (23:07 +0000)]
Ensure the dirent remains initialized when dirent.d_fileno is unset.

Reported by: rmacklem
MFC with: r340856
Sponsored by: The FreeBSD Foundation

5 years agortld: parse FreeBSD Feature Control note on the object load.
kib [Fri, 23 Nov 2018 22:37:35 +0000 (22:37 +0000)]
rtld: parse FreeBSD Feature Control note on the object load.

Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

5 years agoNuke out buffer overflow safety marker code, it duplicates similar code in
sobomax [Fri, 23 Nov 2018 22:36:56 +0000 (22:36 +0000)]
Nuke out buffer overflow safety marker code, it duplicates similar code in
the malloc()/free() as well as having potential of softening the handling
in case error is detected down to a mere warning as compared to hard panic
in free().

Submitted by: tsoome
Differential Revision: https://reviews.freebsd.org/D18299

5 years agoEnsure that directory entry padding bytes are zeroed.
markj [Fri, 23 Nov 2018 22:24:59 +0000 (22:24 +0000)]
Ensure that directory entry padding bytes are zeroed.

Directory entries must be padded to maintain alignment; in many
filesystems the padding was not initialized, resulting in stack
memory being copied out to userspace.  With the ino64 work there
are also some explicit pad fields in struct dirent.  Add a subroutine
to clear these bytes and use it in the in-tree filesystems.  The
NFS client is omitted for now as it was fixed separately in r340787.

Reported by: Thomas Barabosch, Fraunhofer FKIE
Reviewed by: kib
MFC after: 3 days
Sponsored by: The FreeBSD Foundation

5 years agoaxp8xx: Rework the enable part and add the GPIOXLDO regulators
manu [Fri, 23 Nov 2018 19:45:57 +0000 (19:45 +0000)]
axp8xx: Rework the enable part and add the GPIOXLDO regulators

MFC after: 1 month

5 years agoa10_ehci: Always set the phy to host mode
manu [Fri, 23 Nov 2018 19:45:11 +0000 (19:45 +0000)]
a10_ehci: Always set the phy to host mode

MFC after: 1 month

5 years agoaw_usbphy: Convert to usbphy subclass
manu [Fri, 23 Nov 2018 19:44:26 +0000 (19:44 +0000)]
aw_usbphy: Convert to usbphy subclass

Instead of routing the phy when enabling it, do the configuration
and routing in the phynode_usb_set_mode function.
While here, if we don't have a vbus detection method, enable the phy
if requested.

MFC after: 1 month

5 years agoDerive PHY class to new one specialized for USB PHY functions.
manu [Fri, 23 Nov 2018 19:43:18 +0000 (19:43 +0000)]
Derive PHY class to new one specialized for USB PHY functions.

Submitted by: mmel

5 years agoRevert r340843 - addressed independently in r340842!
cem [Fri, 23 Nov 2018 18:27:16 +0000 (18:27 +0000)]
Revert r340843 - addressed independently in r340842!

5 years agortld: Silence a false positive GCC 6.4.0 warning
cem [Fri, 23 Nov 2018 18:23:29 +0000 (18:23 +0000)]
rtld: Silence a false positive GCC 6.4.0 warning

The function reloc_non_plt has complicated variable lifetimes that GCC 6.4.0
(the version currently used by amd64-xtoolchain-gcc) misunderstands and
produces an erroneous warning about.  Silence it to allow the -Werror build
to proceed.

Reviewed by: emaste

5 years agoSilence gcc warnings.
kib [Fri, 23 Nov 2018 18:15:23 +0000 (18:15 +0000)]
Silence gcc warnings.

Reported by: emaste
Sponsored by: The FreeBSD Foundation
MFC after: 3 days

5 years agoEnable the BSD crtbegin/crtend by default.
andrew [Fri, 23 Nov 2018 16:45:07 +0000 (16:45 +0000)]
Enable the BSD crtbegin/crtend by default.

It has passed an exp run on amd64 and i386, and has testing on arm64. On
other architectures it is expected to run, however it can be disabled by
building world with -DWITHOUT_BSD_CRTBEGIN.

Sponsored by: DARPA, AFRL

5 years agoMark the function called by the MIPS .init/.fini sequence with .local.
andrew [Fri, 23 Nov 2018 16:33:03 +0000 (16:33 +0000)]
Mark the function called by the MIPS .init/.fini sequence with .local.

As with r328939 we need to mark local symbols as such. Without this the
assembly parser treats the symbols as global and created relocations
against these private symbols.

MFC with: r339738
Sponsored by: DARPA, AFRL

5 years agosfxge(4): request info about outer frame in Rx events
arybchik [Fri, 23 Nov 2018 16:18:36 +0000 (16:18 +0000)]
sfxge(4): request info about outer frame in Rx events

For encapsulated packets, the firmware gives info about the inner frame
fields by default. When not using encapsulation offload, ask for info
about the outer frame instead.

On SFN8xxx with firmware version before v6.4.2.1007 driver reload is
needed after switching from full-feature to low-latency firmware
variant since the driver still thinks that firmware supports
encapsulation, but firmware does not tolerate request to provide info
about outer frame in Rx events.

Submitted by:   Mark Spender <mspender at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18105

5 years agosfxge(4): ignore error in completion event on MCDIv2 HW
arybchik [Fri, 23 Nov 2018 15:59:49 +0000 (15:59 +0000)]
sfxge(4): ignore error in completion event on MCDIv2 HW

With MCDIv2, the reponse length can be to big to fit into the
CMDDONE_DATALEN field in the MCDI completion event. But rather that
the length being truncated, it can overflow into the CMDDONE_ERRNO
field (this is a longstanding firmware bug). Hence the CMDDONE_ERRNO
field may not be valid.

It isn't necessary to use the value in the CMDDONE_ERRNO field though,
so it can be ignored. The actual error code is already read from the
response header on MCDIv2 capable hardware and stored in emr_rc, so
that can be used instead.

Submitted by:   Mark Spender <mspender at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18104

5 years agosfxge(4): use MCDIv2 for requests with too long response
arybchik [Fri, 23 Nov 2018 15:59:37 +0000 (15:59 +0000)]
sfxge(4): use MCDIv2 for requests with too long response

Use MCDIv2 for requests with a response size too long for MCDIv1.

Required for MC_CMD_MAC_STATS to reports the stats without using DMA.

Submitted by:   Mark Spender <mspender at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18103

5 years agoregexec: fix processing multibyte strings.
yuripv [Fri, 23 Nov 2018 15:49:18 +0000 (15:49 +0000)]
regexec: fix processing multibyte strings.

Matcher function incorrectly assumed that moffset that we get from
findmust is in bytes. Fix this by introducing a stepback function,
taking short path if MB_CUR_MAX is 1, and going back byte-by-byte,
checking if we have a legal character sequence otherwise.

PR: 153502
Reviewed by: pfg, kevans
Approved by: kib (mentor, implicit)
Differential revision: https://reviews.freebsd.org/D18297

5 years agoDisable build-id in i386 binary boot components
emaste [Fri, 23 Nov 2018 13:50:18 +0000 (13:50 +0000)]
Disable build-id in i386 binary boot components

A user may enable build-id for all builds by adding
LDFLAGS=-Wl,--build-id=sha1 to /etc/make.conf.  In this case the build-id
note ends added up to mbr and pmbr's .text, which makes it too large (it
ends up being 532 bytes). To avoid this explicitly turn off build-id for
these components.

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

5 years agosfxge(4): support inner checksum offload on transmit
arybchik [Fri, 23 Nov 2018 13:12:04 +0000 (13:12 +0000)]
sfxge(4): support inner checksum offload on transmit

Inner checksum offloads may be used only if firmware supports
these tunnels.

Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18102