]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
5 years agobectl: sync usage with man page, removing stray multibyte characters
Yuri Pankov [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
Ed Maste [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
Ed Maste [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
Emmanuel Vadot [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"
Ed Maste [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.
Mark Johnston [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:
Martin Matuska [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 agoUpdate vendor/libarchive/dist to git 2c5e9bdbb62eeb56a37776f796c15ed16727193e
Martin Matuska [Mon, 26 Nov 2018 11:01:51 +0000 (11:01 +0000)]
Update vendor/libarchive/dist to git 2c5e9bdbb62eeb56a37776f796c15ed16727193e
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-writable files

5 years agolibedit: improve multibyte support
Baptiste Daroussin [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
Andrew Rybchenko [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
Andrew Rybchenko [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
Andrew Rybchenko [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
Andrew Rybchenko [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
Andrew Rybchenko [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
Kirk 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.
Vladimir Kondratyev [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,
Kirk 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.
Kirk 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().
Konstantin Belousov [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...
Guangyuan Yang [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
Alan Cox [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
Vladimir Kondratyev [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.
Vladimir Kondratyev [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 Turner [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 Turner [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 Schubert [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
Andrew Rybchenko [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
Andrew Rybchenko [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
Andrew Rybchenko [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.
Mark Johnston [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).
Mark Johnston [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.
Mark Johnston [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().
Mark Johnston [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
Andrew Rybchenko [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
Andrew Rybchenko [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)
Andrew Rybchenko [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
Andrew Rybchenko [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
Andrew Rybchenko [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)
Andrew Rybchenko [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)
Andrew Rybchenko [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)
Andrew Rybchenko [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)
Andrew Rybchenko [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)
Andrew Rybchenko [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)
Andrew Rybchenko [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)
Andrew Rybchenko [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
Andrew Rybchenko [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
Andrew Rybchenko [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
Andrew Rybchenko [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 Turner [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
Andrew Rybchenko [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
Andrew Rybchenko [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
Andrew Rybchenko [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
Andrew Rybchenko [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
Andrew Rybchenko [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
Andrew Rybchenko [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
Andrew Rybchenko [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
Andrew Rybchenko [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
Andrew Rybchenko [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
Andrew Rybchenko [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 Schubert [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 Schubert [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:
Martin Matuska [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 agoUpdate vendor/libarchive/dist to git 0e416f2fe757ad6841dbb3386a17d88b5c9f5533
Martin Matuska [Sat, 24 Nov 2018 01:15:08 +0000 (01:15 +0000)]
Update vendor/libarchive/dist to git 0e416f2fe757ad6841dbb3386a17d88b5c9f5533
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

5 years agoParse FreeBSD Feature Control note on the ELF image activation.
Konstantin Belousov [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().
Konstantin Belousov [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.
Konstantin Belousov [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().
Mark Johnston [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.
Konstantin Belousov [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.
Mark Johnston [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.
Konstantin Belousov [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
Maxim Sobolev [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.
Mark Johnston [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
Emmanuel Vadot [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
Emmanuel Vadot [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
Emmanuel Vadot [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.
Emmanuel Vadot [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!
Conrad Meyer [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
Conrad Meyer [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.
Konstantin Belousov [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 Turner [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 Turner [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
Andrew Rybchenko [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
Andrew Rybchenko [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
Andrew Rybchenko [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.
Yuri Pankov [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
Ed Maste [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
Andrew Rybchenko [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

5 years agoAdd support for none ACPI battery method batteries
Tom Jones [Fri, 23 Nov 2018 12:03:01 +0000 (12:03 +0000)]
Add support for none ACPI battery method batteries

Remove the requirement that a device be a ACPI method battery to be supported
as a battery.

Require now that the device be in the battery devclass and implement the
get_status and get_info functions. This allows batteries which are not ACPI
method batteries to be supported.

Reviewed by: jtl
Approved by: jtl (mentor)
MFC after: 1 Month
Differential Revision: https://reviews.freebsd.org/D17434

5 years agosfxge(4): make MAC naming consistent with other modules
Andrew Rybchenko [Fri, 23 Nov 2018 11:39:24 +0000 (11:39 +0000)]
sfxge(4): make MAC naming consistent with other modules

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

5 years agosfxge(4): enforce packed stream fake buffer size
Andrew Rybchenko [Fri, 23 Nov 2018 11:39:13 +0000 (11:39 +0000)]
sfxge(4): enforce packed stream fake buffer size

In the case of packed stream real size of the buffer does not fit in
Rx descriptor byte count. Real size is specified on Rx queue setup.
Non-zero fake should be used to bypass hardware checks.

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

5 years agosfxge(4): provide simple access to RxQ state in EvQ
Andrew Rybchenko [Fri, 23 Nov 2018 11:39:02 +0000 (11:39 +0000)]
sfxge(4): provide simple access to RxQ state in EvQ

Packed stream Rx datapath requires access to packed stream state
stored in event queue. Number of credits is upstead in event handler
on a new buffer, packets parsing on 64k boundary crossing and
Rx doorbell push to give credits back.

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

5 years agosfxge(4): improve RxQ label init prototype
Andrew Rybchenko [Fri, 23 Nov 2018 11:38:50 +0000 (11:38 +0000)]
sfxge(4): improve RxQ label init prototype

RxQ type provides more information which may be useful to
setup event queue appropriately.

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

5 years agosfxge(4): support MUM/SUC firmware partitions
Andrew Rybchenko [Fri, 23 Nov 2018 11:31:57 +0000 (11:31 +0000)]
sfxge(4): support MUM/SUC firmware partitions

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

5 years agosfxge(4): fix ignoring function return value
Andrew Rybchenko [Fri, 23 Nov 2018 11:31:45 +0000 (11:31 +0000)]
sfxge(4): fix ignoring function return value

fix PreFAST issue, add missing annotation that function return value
should not be ignored. Fix alignment.

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

5 years agosfxge(4): quieten get version methods
Andrew Rybchenko [Fri, 23 Nov 2018 10:22:01 +0000 (10:22 +0000)]
sfxge(4): quieten get version methods

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

5 years agosfxge(4): remove duplicate NVRAM asserts
Andrew Rybchenko [Fri, 23 Nov 2018 10:21:50 +0000 (10:21 +0000)]
sfxge(4): remove duplicate NVRAM asserts

The checking performed in the ->envo_type_to_partn
internal method make these assertions unnecessary.

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

5 years agosfxge(4): precheck and verify flash writes
Andrew Rybchenko [Fri, 23 Nov 2018 10:21:36 +0000 (10:21 +0000)]
sfxge(4): precheck and verify flash writes

Read existing flash content before writing, so the flash write can be
avoided if the existing partition content matches the new image. This
avoids unnecessary write cycles for the flash device, and may also be
faster. If the flash does need to be updated, verify the content after
writing.

Note that reading the flash content after writing but before calling
efx_nvram-rw_finish() avoids firmware bug68170, which can lead to
signed image updates failing on Medford.

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

5 years agosfxge(4): fix check in NVRAM validate
Andrew Rybchenko [Fri, 23 Nov 2018 10:21:28 +0000 (10:21 +0000)]
sfxge(4): fix check in NVRAM validate

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

5 years agosfxge(4): report correct partition write chunk size
Andrew Rybchenko [Fri, 23 Nov 2018 10:21:17 +0000 (10:21 +0000)]
sfxge(4): report correct partition write chunk size

If the firmware reports a non-zero write chunk size then nvram writes
may fail if a different granularity is used (e.g. for MUM firmware on
Sorrento).

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

5 years agosfxge(4): check NVRAM locking by partition ID
Andrew Rybchenko [Fri, 23 Nov 2018 10:21:06 +0000 (10:21 +0000)]
sfxge(4): check NVRAM locking by partition ID

Tracking which partition is locked avoids being overly conservative
when EFX_NVRAM_xxx maps to more than one partition (depnding on the
current port number).

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