]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
4 years agoMFC r355055: Fix gcc build for bitstring_test by specifying "-fno-strict-overflow"
Eric Joyner [Thu, 2 Jan 2020 23:18:43 +0000 (23:18 +0000)]
MFC r355055: Fix gcc build for bitstring_test by specifying "-fno-strict-overflow"

Sponsored by: Intel Corporation

4 years agoMFC r354977: bitstring: add functions to find contiguous set/unset bit sequences
Eric Joyner [Thu, 2 Jan 2020 23:16:27 +0000 (23:16 +0000)]
MFC r354977: bitstring: add functions to find contiguous set/unset bit sequences

This MFC also includes extra commits that improve on the original:
r355032: bitstring: Fix error messages in tests for area functions
r355377: Improve bit_ffc_area and bit_ffs_area_at implementation
r355400: bitstring: avoid gcc -Wsign-compare

Sponsored by: Intel Corporation

4 years agoMFC r354975: bitstring: exit early if _start is past size of the bitstring
Eric Joyner [Thu, 2 Jan 2020 23:05:48 +0000 (23:05 +0000)]
MFC r354975: bitstring: exit early if _start is past size of the bitstring

This fixes a possible buffer read overflow.

Sponsored by: Intel Corporation

4 years agoMFC isc_pause_frame field fixes to Intel ethernet drivers
Eric Joyner [Thu, 2 Jan 2020 22:57:21 +0000 (22:57 +0000)]
MFC isc_pause_frame field fixes to Intel ethernet drivers

This MFC includes: r353656, r353657, r353658, and r353661

Sponsored by: Intel Corporation

4 years agoMFC r354344: iflib: properly release memory allocated for DMA
Eric Joyner [Thu, 2 Jan 2020 22:47:10 +0000 (22:47 +0000)]
MFC r354344: iflib: properly release memory allocated for DMA

Prevents M_DEVBUF memory from leaking due to iflib DMA allocations.

Sponsored by: Intel Corporation

4 years agoMFC r354207: iflib: cleanup memory leaks on driver detach
Eric Joyner [Thu, 2 Jan 2020 22:44:38 +0000 (22:44 +0000)]
MFC r354207: iflib: cleanup memory leaks on driver detach

Sponsored by: Intel Corporation

4 years agoMFC r353967: iflib: call ether_ifdetach and netmap_detach before stop
Eric Joyner [Thu, 2 Jan 2020 22:42:18 +0000 (22:42 +0000)]
MFC r353967: iflib: call ether_ifdetach and netmap_detach before stop

This prevents a possible page fault resulting from a race condition.

Sponsored by: Intel Corporation

4 years agoMFC r351153: net: Update SFF-8024 definitions and strings with values from rev 4.6
Eric Joyner [Thu, 2 Jan 2020 21:58:34 +0000 (21:58 +0000)]
MFC r351153: net: Update SFF-8024 definitions and strings with values from rev 4.6

This will let ifconfig -v's SFF eeprom read functionality recognize more
module types.

Sponsored by: Intel Corporation

4 years agoMFC r349586 (by rlibby): g_eli_create: only dec g_access acw if we inc'd it
Alexander Motin [Thu, 2 Jan 2020 20:33:56 +0000 (20:33 +0000)]
MFC r349586 (by rlibby): g_eli_create: only dec g_access acw if we inc'd it

4 years agoMFC r355860:
Ian Lepore [Thu, 2 Jan 2020 19:55:09 +0000 (19:55 +0000)]
MFC r355860:

Remove unnecessary MODULE_DEPEND() from imx_i2c.c, and also from rk_i2c
where it got copied to.

4 years agoMFC r347828 (by cem):
Ian Lepore [Thu, 2 Jan 2020 19:52:01 +0000 (19:52 +0000)]
MFC r347828 (by cem):

xdma(4): Fix invalid pointer use (breaks arm.SOCFPGA build)

In xdma_handle_mem_node(), vmem_size_t and vmem_addr_t pointers were passed to
an FDT API that emits u_long values to the output parameter pointer.  This
broke on systems with both xdma and 32-bit vmem size/addr types (SOCFPGA).

Reported by: tinderbox
Sponsored by: Dell EMC Isilon

4 years agoMFC r356184:
Mark Johnston [Thu, 2 Jan 2020 14:39:37 +0000 (14:39 +0000)]
MFC r356184:
powerd(8): Fix a memory leak when we fail to read frequency levels.

PR: 242967

4 years agoMFC: r356066
Rick Macklem [Tue, 31 Dec 2019 18:10:34 +0000 (18:10 +0000)]
MFC: r356066
Fix nfsmount() so that it will return NFSERR_MINORVERMISMATCH.

If nfsrpc_getdirpath() returns NFSERR_MINORVERMISMATCH, it would erroneously
get mapped to EIO. This was not particularily harmful, but would make it
hard for sysadmins to diagnose why an NFSv4 mount is failing.

mount_nfs.c still needs to be fixed so that it does not report
NFSERR_MINORVERMISMATCH as an unknown error 10021.

4 years agoMFC r356230:
Glen Barber [Tue, 31 Dec 2019 16:04:16 +0000 (16:04 +0000)]
MFC r356230:
 Happy New Year 2020!

Sponsored by: Rubicon Communications, LLC (netgate.com)

4 years agoMFC r356039:
Konstantin Belousov [Mon, 30 Dec 2019 00:49:49 +0000 (00:49 +0000)]
MFC r356039:
Fix undefined behavior: left-shifting into the sign bit.

4 years agoMFC r356103: cron(8): use proper variable to determine mailer process status
Kyle Evans [Mon, 30 Dec 2019 00:16:58 +0000 (00:16 +0000)]
MFC r356103: cron(8): use proper variable to determine mailer process status

While the mailer is normally opened/set if the mailto is set, this is not
the case if the grandchild actually didn't produce any output. This change
corrects the situation to only attempt to kill/close the mail process if it
was actually opened in the first place.

The reporter initially stumbled on the -n (suppress mail on success) flag
leading to a SIGKILL of the process group, but simultaneously
discovered/reported the behavior with !-n jobs if MAILTO was set and no
output happened.

All of these places that are checking mailto should actually be checking
whether mail is set, so do that for consistency+correctness.

This set of bugs were introduced by r352668.

4 years agoMFC: r355530
Rick Macklem [Mon, 30 Dec 2019 00:04:17 +0000 (00:04 +0000)]
MFC: r355530
Delete an unused external declaration.

Since nfsv4_opflag is no longer used in nfs_clcomsubs.c, delete the
external declaration of it. Found during NFSv4.2 code merge.

4 years agoMFC: r355509
Rick Macklem [Sun, 29 Dec 2019 23:48:48 +0000 (23:48 +0000)]
MFC: r355509
Fix kernel handling of a NFSERR_MINORVERSMISMATCH NFSv4 server reply.

When an NFSv4 server replies NFSERR_MINORVERSMISMATCH, it does not generate
a status result for the first operation in the compound. Without this
patch, this will result in a bogus EBADXDR error return.
Returning EBADXDR is relatively harmless, but a correct reply of
NFSERR_MINORVERSMISMATCH is needed by the pNFS client to select the correct
minor version to use for a File Layout DS now that there can be NFSv4.2
DS servers.

mount_nfs.c still needs to be fixed for this, although how the mount fails
is only useful to help sysadmins isolate why a mount fails.

Found during testing of the NFSv4.2 client and server.

4 years agoMFC: r355194
Rick Macklem [Sat, 28 Dec 2019 22:24:16 +0000 (22:24 +0000)]
MFC: r355194
Fix two races while handling nfsuserd daemon start/stop.

A crash was reported where the nr_client field was NULL during an upcall
to the nfsuserd daemon. Since nr_client == NULL only occurs when the
nfsuserd daemon is being shut down, it appeared to be caused by a race
between doing an upcall and the daemon shutting down.
By inspection two races were identified:
1 - The nfsrv_nfsuserd variable is used to indicate whether or not the
    daemon is running. However it did not handle the intermediate phase
    where the daemon is starting or stopping.

    This was fixed by making nfsrv_nfsuserd tri-state and having the
    functions that are called during start/stop to obey the intermediate
    state.

2 - nfsrv_nfsuserd was checked to see that the daemon was running at
    the beginning of an upcall, but nothing prevented the daemon from
    being shut down while an upcall was still in progress.
    This race probably caused the crash.

    The patch fixes this by adding a count of upcalls in progress and
    having the shut down function delay until this count goes to zero
    before getting rid of nr_client and related data used by an upcall.

4 years agoMFC r355718: Fix $() handling, broken since the beginning at r108014.
Alexander Motin [Fri, 27 Dec 2019 18:52:43 +0000 (18:52 +0000)]
MFC r355718: Fix $() handling, broken since the beginning at r108014.

Due to off-by-one error in brackets counting it consumed the rest of the
string, preventing later variables expansions.

4 years agoMFC r355913
Doug Moore [Fri, 27 Dec 2019 17:41:41 +0000 (17:41 +0000)]
MFC r355913
Allow #include<sys/tmpfs.h> to compile when _KERNEL is not #defined.

4 years agoMFC r355936, r356045: remove unused kbd drivers
Kyle Evans [Fri, 27 Dec 2019 03:00:18 +0000 (03:00 +0000)]
MFC r355936, r356045: remove unused kbd drivers

r355936:
Kill off dummy kbd drivers

As far as I can tell, these are an artifact of times when linker sets
couldn't be empty, otherwise the kernel build would fail due to unresolved
symbols. hselasky fixed this in r268138, and I've audited the kbd portions
to make sure nothing would blow up due to the empty linker set and
successfully compiled+ran a kernel with no keyboard support at all.

Kill them off now since they're no longer required.

r356045:
terasic_mtl: kill off final dummy keyboard driver

The rest were removed in r355936, which speculated that the cause of this
phenomenon was due to an inability to have an empty linker set. The comment
included with this one shows that this was, in fact, not the reason.

Regardless, syscons no longer seems to have an issue with not having any
keyboard drivers and in-fact ignores the keyboard probe anyways.

4 years agoMFC r355941:
Mark Johnston [Fri, 27 Dec 2019 00:49:49 +0000 (00:49 +0000)]
MFC r355941:
mii(4): Fix ivars leak when the bus device or bus children detach.

PR: 242727

4 years agoMFC r355650:
Andrey V. Elsukov [Thu, 26 Dec 2019 18:05:38 +0000 (18:05 +0000)]
MFC r355650:
  Follow RFC 4443 p2.2 and always use own addresses for reflected ICMPv6
  datagrams.

  Previously destination address from original datagram was used. That
  looked confusing, especially in the traceroute6 output.
  Also honor IPSTEALTH kernel option and do TTL/HLIM decrementing only
  when stealth mode is disabled.

  Reported by: Marco van Tol <marco at tols org>
  Sponsored by: Yandex LLC
  Differential Revision: https://reviews.freebsd.org/D22631

4 years agoMFC r356047:
Mark Johnston [Thu, 26 Dec 2019 16:56:42 +0000 (16:56 +0000)]
MFC r356047:
oce: Disallow the passthrough ioctl for unprivileged users.

4 years agoMFC r352878:
Aleksandr Rybalko [Wed, 25 Dec 2019 22:19:23 +0000 (22:19 +0000)]
MFC r352878:

Initialize baseaddr to suppres warning.

4 years agoMFC r352875:
Aleksandr Rybalko [Wed, 25 Dec 2019 22:07:24 +0000 (22:07 +0000)]
MFC r352875:

Put sections into expected offset in binary format.
Calculate binary file offset using address field, bacause software know only offset to known data, not where to load segment.
With that patch, kernel .data section can have any alignment/offset - kernel boor fine.

PR: 235391
Reviewed by: markj
Differential Revision: D21827

4 years agoMFC r355447:
Hans Petter Selasky [Wed, 25 Dec 2019 09:32:55 +0000 (09:32 +0000)]
MFC r355447:
Fix compilation issue with mlx5core and sparc64 (gcc48):

sys/dev/mlx5/mlx5_en/mlx5_en_tx.c:335: error: requested alignment is not a constant

Sponsored by: Mellanox Technologies

4 years agoMFC r355800:
Hans Petter Selasky [Wed, 25 Dec 2019 09:28:06 +0000 (09:28 +0000)]
MFC r355800:
Install missing pcap(3) manual pages and add missing manpage
section substitutions.

Submitted by: Martin Beran <martin@mber.cz>
PR: 237893
Sponsored by: Mellanox Technologies

4 years agoMFC r355881:
Hans Petter Selasky [Wed, 25 Dec 2019 09:25:20 +0000 (09:25 +0000)]
MFC r355881:
Leave multicast group before reaping and committing state for both
IPv4 and IPv6.

This fixes a regression issue after r349369. When trying to exit a
multicast group before closing the socket, a multicast leave packet
should be sent.

Differential Revision: https://reviews.freebsd.org/D22848
PR: 242677
Reviewed by: bz (network)
Tested by: Aleksandr Fedorov <aleksandr.fedorov@itglobal.com>
Sponsored by: Mellanox Technologies

4 years agoMFC r356030:
Mark Johnston [Wed, 25 Dec 2019 05:51:47 +0000 (05:51 +0000)]
MFC r356030:
Compile uart_cpu_acpi.c, added in r348195, into uart.ko.

PR: 242771

4 years agoMFC of 355995
Kirk McKusick [Wed, 25 Dec 2019 05:00:50 +0000 (05:00 +0000)]
MFC of 355995

Fix manual page typo.

4 years agoMFC r355935: vt: fix post-boot keyboard attachment
Kyle Evans [Mon, 23 Dec 2019 20:19:23 +0000 (20:19 +0000)]
MFC r355935: vt: fix post-boot keyboard attachment

With absolutely no keyboards attached and no kbdmux in kernel, we descend
down this error path. 0 is a valid keyboard index, so leaving
vd->vd_keyboard at 0 when there's no keyboard found is objectively wrong as
later attachment of a keyboard will fail -- it gets index 0, and vt thinks
it's already using that keyboard.

This is decidedly the corniest of corner cases, but it's easy enough to get
correct that we should do so.

Tested in a kernel without atkbdc, atkbd, psm, kbdmux, ukbd, hyperv then
loading ukbd post-boot and attaching a usb keyboard.

4 years agoMFC r355938:
Mark Johnston [Mon, 23 Dec 2019 16:34:39 +0000 (16:34 +0000)]
MFC r355938:
Fix a memory leak in if_delgroups() introduced in r334118.

PR: 242712

4 years agoMFC r355712:
Andrey V. Elsukov [Mon, 23 Dec 2019 10:02:55 +0000 (10:02 +0000)]
MFC r355712:
  Make TCP options parsing stricter.

  Rework tcpopts_parse() to be more strict. Use const pointer. Add length
  checks for specific TCP options. The main purpose of the change is
  avoiding of possible out of mbuf's data access.

  Reported by: Maxime Villard

4 years agoMFC r355844:
Toomas Soome [Sun, 22 Dec 2019 20:36:57 +0000 (20:36 +0000)]
MFC r355844:
loader.efi: efi_readkey_ex needs to key despite the shift status or toggle status

From UEFI specification 2.8, page 434:
"It should also be noted that certain input devices may not be able to produce
shift or toggle state information, and in those cases the high order bit in
the respective Toggle and Shift state fields should not be active."

But we still need to check for ScanCode and UnicodeChar.

PR:             242660

4 years agoMFC r355777:
Ian Lepore [Sun, 22 Dec 2019 20:34:15 +0000 (20:34 +0000)]
MFC r355777:

Support --all-repeats in uniq(1) for compatibility with gnu coreutils.

This adds a new -D/--all-repeats option to uniq(1), which outputs each copy
of any repeated lines (as opposed to a single copy of a repeated line). You
can specify a separator option to output a blank line before or after each
group of repeated lines. This adds compatibility with the GNU coreutils
version of uniq(1).

This change also re-groups the -c, -d, -D, -u options in the usage display
and man page to indicate that they are mutally exclusive of each other. This
matches the posix/opengroup definition of uniq(1) command line args. Note
that this change does NOT actually enforce the mutual exclusion in the code,
for now, it simply documents that the arguments should be considered
exclusive with each other.

Differential Revision: https://reviews.freebsd.org/D22262

4 years agoMFC r355685:
Ian Lepore [Sun, 22 Dec 2019 20:06:08 +0000 (20:06 +0000)]
MFC r355685:

Clean up some of my copyrights; add SPDX tag and remove All rights reserved.

4 years agoMFC r355688:
Ian Lepore [Sun, 22 Dec 2019 20:04:35 +0000 (20:04 +0000)]
MFC r355688:

If device_delete_children() returns an error, bail on the rest of the
detach work and return the error.  Especially don't call iicbus_reset()
since the most likely cause of failing to detach children is that one
of them has IO in progress.

4 years agoMFC r355598, r355727, r355735, r355858
Ian Lepore [Sun, 22 Dec 2019 19:30:13 +0000 (19:30 +0000)]
MFC r355598, r355727, r355735, r355858

r355598:
Do not attach children of owc_gpiobus until interrupts are working.

The children of the bus need to do IO on the bus to probe for hardware
presence.  Doing IO means timing the bus states using sbinuptime(), and
that requires working timecounters, which are not initialized until after
device attachment has completed.

PR: 242526

r355727 (by imp):
Create new wrapper function: bus_delayed_attach_children()

Delay the attachment of children, when requested, until after interrutps are
running. This is often needed to allow children to run transactions on i2c or
spi busses. It's a common enough idiom that it will be useful to have its own
wrapper.

Reviewed by: ian
Differential Revision: https://reviews.freebsd.org/D21465

r355735 (by imp):
Be consistent about checking return value from bus_delayed_attach_children.

Most places checked, but a couple last minute changes didn't. Make them all use
the return value.

Noticed by: rpokala@

r355858:
Update owc_gpiobus (one-wire over gpio) to the modern gpio_pin interface.

It used to be required that a device be a child of gpiobus(4) to manipulate
gpio pins. That requirement didn't work well for FDT-based systems with many
cross-hierarchy users of gpio, so a more modern framework was created that
removed the old hierarchy requirement.

These changes adapt the owc_gpiobus driver to use the newer gpio_pin_*
functions to acquire, release, and manipulate gpio pins. This allows a
single driver to work for both hinted-attachment and fdt-based systems, and
removes the requirement that any one-wire fdt nodes must appear at the root
of the devicetree.

Differential Revision: https://reviews.freebsd.org/D22710

4 years agoMFC r355932: VERSATILEPB: also use default get_fkeystr/diag
Kyle Evans [Sun, 22 Dec 2019 19:14:33 +0000 (19:14 +0000)]
MFC r355932: VERSATILEPB: also use default get_fkeystr/diag

In head/, this config was broken from the defaulting commits, but in stable
branches we left the genkbd_* defaults exposed. Do this anyways.

4 years agoMFC r355206, r355212, r355257, r355271: tty nits
Kyle Evans [Sun, 22 Dec 2019 19:06:45 +0000 (19:06 +0000)]
MFC r355206, r355212, r355257, r355271: tty nits

r355206: tty_pts: don't rely on tty header pollution for sys/mutex.h
r355212: tty_rel_gone: add locking assertion
r355257: usb: remove some extraneous tty.h includes
r355271: Remove more needless <sys/tty.h> includes

4 years agoMFC r355572:
Ian Lepore [Sun, 22 Dec 2019 18:55:09 +0000 (18:55 +0000)]
MFC r355572:

Allow baud rates of 1,228,800 and 1,843,200 on CP2101/2/3 usb-serial adapters.

The datasheets for these chips claim the maximum is 921,600, but testing
shows these two higher rates also work (but no rates above 921,600 other
than these two work; these represent dividing the base buad clock by 3 and 2
respectively).

4 years agoMFC r355467, r355499, r355531-r355533, r355535, r355540, r355548-r355551, r355565
Ian Lepore [Sun, 22 Dec 2019 18:51:05 +0000 (18:51 +0000)]
MFC r355467, r355499, r355531-r355533, r355535, r355540, r355548-r355551, r355565

r355467:
Implement bus_rescan for gpiobus(4).  This allows on-the-fly reconfiguration
of gpio devices by using kenv to add hints for a new device and then do
'devctl rescan gpiobus4' to make the new device(s) attach.

It's not particularly easy to detect whether the 'at' hint has been deleted
for a child device that's currently attached, so this doesn't handle that.
But the user can use devctl commands to manually detach an existing device.

r355499:
Add module build stuff for gpioths(4), a driver for DHT11/DHT22 sensors.

r355531:
Several small fixes for the gpioths (temp/humidity sensor) driver.

At the end of a read cycle, set the gpio pin to INPUT rather than OUTPUT.
The state of the single-wire "bus" when idle should be high; setting the
pin to input allows the external pullup to pull the line high.  Setting it
to output (and leaving it driving low) was leading a good read cycle followed
by one that would fail, and it just continued like that forever, effectively
reading the sensor once every 10 seconds instead of 5.

In the attach function, do an initial read from the device before registering
the sysctls for accessing the last-read values, to prevent reading spurious
values for the first 5 seconds after the driver attaches.

Do a callout_drain() in the detach function to prevent crashes after
unloading the module.

r355532:
Simplify sysctl stuff in the gpioths driver.  There is no need to use local
functions to handle the sysctls, they all just access simple readonly
integer variables.  There's no need to track the oids of the ones we add,
since the teardown is done by newbus code, not the driver itself.

Also remove the DDB code, because it just provides access to the same data
that the sysctls already provide.

r355533:
Add support for more chips to the gpioths driver.

Previously the driver supported the DHT11 sensor.  Now it supports

 DHT11, DHT12, DHT21, DHT22, AM3201, AM3202.

All these chips are similar, differing primarily in supported temperature
and humidity ranges and accuracy (and, presumably, cost).  There are two
basic data formats reported by the various chips, and it is possible to
figure out at runtime which format to use for decoding the data based on
the range of values in a single byte of the humidity measurement. (which
is detailed in a comment block, so I won't recapitulate it here).

r355535:
Add a MODULE_DEPEND() for the gpioths driver. Also, note that the prior commit
changed the sysctl format for the temperature from "I" to "IK", and
correspondingly changed the units from integer degrees C to decikelvin.
For access via sysctl(8) the output will be the same except that now
decimal fractions will be shown when available.

r355540:
Add FDT support to the gpioths driver.  It now uses the newer gpio_pin_*()
API and can attach based on either hints or fdt data.

r355548:
Add a man page for the gpioths(4) driver.

r355549:
Add myself to the copyright list.  Also add an SPDX tag.  And finally, fix
a missing word and a spelling error in a comment.

r355550:
Paste things correctly so that I'm added to the *end* of the copyright list.

r355551:
Connect the gpioths(4) manpage to the build.

r355565:
Switch gpioths(4) from using a callout to a taskqueue for periodic polling
of the sensor hardware.  Part of the polling process involves signalling
the chip then waiting 20 milliseconds.  This was being done with DELAY(),
which is a pretty rude thing to do in a callout.  Now a taskqueue_thread
task is scheduled to do the polling, and because sleeping is allowed in
the task context, pause_sbt() replaces DELAY() for the 20ms wait.

4 years agoMFC r355738:
Ian Lepore [Sun, 22 Dec 2019 18:11:57 +0000 (18:11 +0000)]
MFC r355738:

Include ofw_bus_if.h in SRCS only on systems configured with the FDT option.

4 years agoMFC r355547: Fix a typo: the sysctl command is in chapter 8 of the manual.
Ian Lepore [Sun, 22 Dec 2019 18:10:01 +0000 (18:10 +0000)]
MFC r355547: Fix a typo: the sysctl command is in chapter 8 of the manual.

4 years agoMFC r355411:
Ian Lepore [Sun, 22 Dec 2019 17:59:24 +0000 (17:59 +0000)]
MFC r355411:

Fix a trivial typo and add a missing word.

4 years agoMFC r355100:
Ian Lepore [Sun, 22 Dec 2019 17:57:59 +0000 (17:57 +0000)]
MFC r355100:

Allow opt-out of automatic ntpd leapfile checking/fetching.

When a system has no internet connection, or when it is configured to obtain
ntpd leapfiles from some source other than the internet, or even when the
sysadmin has decided for some reason to customize ntp.conf to eliminate use
of the leapfile, the rc.d/ntpd script emits various error messages related
to the file.

This change allows setting the rc var ntp_db_leapfile to NONE to disable all
automatic processing related to that file in rc.d/ntpd.

Differential Revision: https://reviews.freebsd.org/D22461

4 years agoMFC r355796-r355797, r355799: kbd: defaults for get_fkeystr/diag
Kyle Evans [Sun, 22 Dec 2019 17:15:48 +0000 (17:15 +0000)]
MFC r355796-r355797, r355799: kbd: defaults for get_fkeystr/diag

The genkbd version of these remains exposed for stable branches, but
keyboard drivers that just want to use the defaults can simply not provide
their own. There shouldn't be any unset in the wild.

r355796:
kbd: provide default implementations of get_fkeystr/diag

Most keyboard drivers are using the genkbd implementations as it is;
formally use them for any that aren't set.

r355797:
chrome_kb: remove default get_fkeystr/diag implementations

This file was missed in r355796, but no harm would have come from this.

r355799:
kbd: patch linker set methods, too

This is needed after r355796. Some double-registration of kbd drivers needs
to be sorted out, then this sysinit will simply add these drivers into the
normal list and kill off any other bits in the driver that are aware of the
linker set, for simplicity.

4 years agoMFC r355793: kbd drivers: use kbdd_* indirection for diag invocation
Kyle Evans [Sun, 22 Dec 2019 17:06:56 +0000 (17:06 +0000)]
MFC r355793: kbd drivers: use kbdd_* indirection for diag invocation

4 years agoFix kbdd_diag definition
Kyle Evans [Sun, 22 Dec 2019 17:04:16 +0000 (17:04 +0000)]
Fix kbdd_diag definition

This is a direct commit to stable branches as these have been converted to
inline functions in head, which will likely not get MFC'd due to limited
utility -- follow up locking assertions likely cannot be done in stable
branches.

The use of 'level' in the macro definition was truncated to 'leve', which
makes the macro unusable.

4 years agoMFC r355788: Properly detect ATA sanitize errors.
Alexander Motin [Sun, 22 Dec 2019 17:00:53 +0000 (17:00 +0000)]
MFC r355788: Properly detect ATA sanitize errors.

It seems I read specifications not careful enough.  There are devices not
setting successful completion bit, causing previous code report false error.

4 years agoMFC r355842: kbd: const'ify a couple of keyboard_driver fields
Kyle Evans [Sun, 22 Dec 2019 16:57:19 +0000 (16:57 +0000)]
MFC r355842: kbd: const'ify a couple of keyboard_driver fields

4 years agoMFC r355794: keyboard switch definitions: standardize on c99 initializers
Kyle Evans [Sun, 22 Dec 2019 16:04:12 +0000 (16:04 +0000)]
MFC r355794: keyboard switch definitions: standardize on c99 initializers

4 years agoMFC r355867, r355875: rpi mapping detection fixes
Kyle Evans [Sun, 22 Dec 2019 15:55:52 +0000 (15:55 +0000)]
MFC r355867, r355875: rpi mapping detection fixes

r355867: arm: add SOC_BRCM_BCM2837 option, include it in GENERIC
r355875: bcm2835_vcbus: add legacy compat mappings

4 years agoMFC r354283, r354323, r354363, r354364, r354593, r355773, r355786:
Toomas Soome [Sun, 22 Dec 2019 08:22:02 +0000 (08:22 +0000)]
MFC r354283, r354323, r354363, r354364, r354593, r355773, r355786:

loader: we do not support booting from pool with log device
loader: factor out label and uberblock load from vdev_probe, add MMP checks
loader: populate nvl with data even when label_txg is 0
loader: clean up the noise around log device
loader: memory leak in vdev_label_read_config()
loader: zfsimpl.c cstyle cleanup
loader: rewrite zfs vdev initialization

In some cases the pool discovery will get stuck in infinite loop while setting
up the vdev children.

To fix, we split the vdev setup into two parts, first we create vdevs based on
configuration we do get from pool label, then, we process pool config from MOS
and update the pool config if needed.

This patch bundle is work leading to and including fix for issue when
in some cases the pool configuration build does end up in infinite loop.

PR: 241118
Reported by: Ryan Moeller

4 years agoMFC r355318, r355513
Xin LI [Sun, 22 Dec 2019 05:39:26 +0000 (05:39 +0000)]
MFC r355318, r355513

r355318:
Explicitly exit() instead of return in main().

r355513:
Fix a couple of minor issues with newfs_msdos:

 - Do not unnecessarily strdup().
 - Check return value of getdiskinfo(), if it failed, bail out.

4 years agoMFC r354291 - r354322, r354327, r355596
Vladimir Kondratyev [Sun, 22 Dec 2019 00:46:07 +0000 (00:46 +0000)]
MFC r354291 - r354322, r354327, r355596

r354291:
[ig4] Give common name to PCI and ACPI device drivers

r354292:
[ig4] Handle controller startup errors

Obtained from: DragonflyBSD (509820b)

r354293:
[ig4] Only enable interrupts when we want them. Otherwise keep mask at 0.

Obtained from: DragonflyBSD (d7c8555)

r354294:
[ig4] Drop driver's internal RX FIFO

r354295:
[ig4] Do not wait for interrupts in set_controller() routine

r354296:
[ig4] Reduce scope of io_lock

r354297:
[ig4] Ignore stray interrupts

r354298:
[ig4] We actually need to set the Rx threshold register one smaller.

Obtained from: DragonflyBSD (02f0bf2)

r354299:

[ig4] Stop I2C controller after checking that it's kind of functional.

Obtained from: DragonfliBSD (0b3eedb)

r354300:
[ig4] disable controller before initialization of clock counters

r354301:
[ig4] Add support for polled mode

r354302:
[ig4] Allow enabling of polled mode from iicbus allocation callback

r354303:
[ig4] Do not wait until interrupts are enabled at attach stage

r354304:
[cyapa] Postpone start of the polling thread until sleep is available

r354305:
[ig4] dump IG4_REG_COMP_PARAM1 and IG4_REG_COMP_VER registers unconditionally

r354306:
[ig4] Set clock registers based on controller model

r354307:
[ig4] Implement burst mode for data reads

r354308:
[ig4] Add suspend/resume support

PR: 238037

r354309:
[ig4] Remove dead code inherited from DragonflyBSD

r354310:
[ig4] Rewrite ig4iic_write routine to use TX_EMPTY status flag

r354311:
[ig4] Convert last remaining usage of TX_NOTFULL status to TX_EMPTY

r354312:
[ig4] Use interrupts for waiting for empty TX FIFO

r354313:
[ig4] Convert polling loop from status-based to interrupt-based

r354314:
[ig4] Improve error detection

r354315:
[ig4] Set STOP condition and flush TX/RX FIFOs on error

r354316:
[ig4] On SkyLake controllers issue reset on attach unconditionally.

r354317:
[ig4] wait for bus stop condition after stop command issued

r354318:
[ig4] Minor improvement of write pipelining

r354319:
[ig4] Add generic resource methods to bus interface

r354320:
[ig4] Add support for CannonLake controllers

PR: 240485
Submitted by: Neel Chauhan <neel@neelc.org>

r354321:
[ig4] Enable additional registers support on Appolo Lake controllers

r354322:
[ig4] Convert ithread interrupt handler to filter based one.

r354327:
[ig4] Try to workaround MIPS namespace pollution issue

r355596:
[ig4] Remove unused methods from bus interface

Suggested by: jhb

Reviewed by: imp (previous version)
Differential Revision: https://reviews.freebsd.org/D22016

4 years agoMFC r355885:
Mark Johnston [Sat, 21 Dec 2019 18:50:25 +0000 (18:50 +0000)]
MFC r355885:
oce: Tighten input validation in the SIOCGI2C handler.

4 years agoMFC r355887:
Mark Johnston [Sat, 21 Dec 2019 16:16:43 +0000 (16:16 +0000)]
MFC r355887:
vnic: Relax PHY node matching after r336281.

PR: 242654

4 years agoMFC r354824:
Mark Johnston [Sat, 21 Dec 2019 16:08:34 +0000 (16:08 +0000)]
MFC r354824:
Fix grammar in gpart.8.

PR: 241973

4 years agoMFC r355500:
Konstantin Belousov [Sat, 21 Dec 2019 15:33:19 +0000 (15:33 +0000)]
MFC r355500:
Only return EPERM from kill(-pid) when no process was signalled.

4 years agoMFC r355828:
Pedro F. Giffuni [Sat, 21 Dec 2019 02:40:40 +0000 (02:40 +0000)]
MFC r355828:
Double the size of ARG_MAX on LP64 platforms.

As modern software keeps growing in size, we get requests to update the
value of ARG_MAX in order to link the resulting object files. Other OSs
have much higher values but increasiong ARG_MAX has a multiplied effect on
KVA, so just bumping this value is dangerous in some archs like ARM32 that
can exhaust KVA rather easily.

While it would be better to have a unique value for all archs, other OSs
(Illumos in particular) can have different ARG_MAX limits depending on the
platform,  For now we want to be really conservative so we are avoidng
the change on ILP32 and in the alternative case we only double it since that
seems to work well enough for recent Code Aster.

Bump the _FreeBSD_version for this change.

PR: 241710

4 years agoMFC: r355157, r355161
Rick Macklem [Fri, 20 Dec 2019 22:53:23 +0000 (22:53 +0000)]
MFC: r355157, r355161
Add a cap on credential lifetime for Kerberized NFS.

The kernel RPCSEC_GSS code sets the credential (called a client) lifetime
to the lifetime of the Kerberos ticket, which is typically several hours.
As such, when a user's credentials change such as being added to a new group,
it can take several hours for this change to be recognized by the NFS server.
This patch adds a sysctl called kern.rpc.gss.lifetime_max which can be set
by a sysadmin to put a cap on the time to expire for the credentials, so that
a sysadmin can reduce the timeout.
It also fixes a bug, where time_uptime is added twice when GSS_C_INDEFINITE
is returned for a lifetime. This has no effect in practice, since Kerberos
never does this.

4 years agoMFC r355830:
Brooks Davis [Fri, 20 Dec 2019 22:07:05 +0000 (22:07 +0000)]
MFC r355830:

Avoid a tautological bitwise compare.

This looks like a bit of debugging code that sliped into the initial
import of the sos@ ATA framework.  This changes the behavior to omit a
line of output that appears to have been intended for omission.

Reviewed by: mav
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D22845

4 years agoMFC r355864:
Mark Johnston [Fri, 20 Dec 2019 16:04:26 +0000 (16:04 +0000)]
MFC r355864:
an(4): Require privileges for all SIOCGAIRONET requests.

4 years agoMFC r355702:
Toomas Soome [Fri, 20 Dec 2019 08:15:55 +0000 (08:15 +0000)]
MFC r355702:
loader: vdisk dereference after free

print out the information and then free the memory used.

4 years agoMFC r355703:
Toomas Soome [Fri, 20 Dec 2019 08:12:44 +0000 (08:12 +0000)]
MFC r355703:
loader: clean up devopen and devclose a bit

devopen should undo setup of f->f_dev in case of error.
devclose can just call free().

4 years agoMFC r355713:
Toomas Soome [Fri, 20 Dec 2019 07:40:28 +0000 (07:40 +0000)]
MFC r355713:
loader: cd9660_open() warn: is 'buf' large enough for 'struct iso_primary_descriptor'?

We do allocate amount of memory (void * or char *), and then assign this
buffer to struct iso_primary_descriptor *vd. Make sure we do
allocate enough bytes.

In fact we do allocate enough, but it is good idea to make sure this really
is so.

4 years agoMFC r355676:
Konstantin Belousov [Fri, 20 Dec 2019 01:00:18 +0000 (01:00 +0000)]
MFC r355676:
rtld: make checks for mmap(2) failures compliant with documentation.

4 years agoMFC r355457: Make devstat_end_transaction_bio() count BIO_ORDERED.
Alexander Motin [Fri, 20 Dec 2019 00:25:56 +0000 (00:25 +0000)]
MFC r355457: Make devstat_end_transaction_bio() count BIO_ORDERED.

4 years agoAdd Makefile.depend.options
Simon J. Gerraty [Thu, 19 Dec 2019 04:58:11 +0000 (04:58 +0000)]
Add Makefile.depend.options

Leaf directories that have dependencies impacted
by options need a Makefile.depend.options file
to avoid churn in Makefile.depend

DIRDEPS for cases such as OPENSSL, TCP_WRAPPERS etc
can be set in local.dirdeps-options.mk
which can add to those set in Makefile.depend.options

See share/mk/dirdeps-options.mk

Also update affected Makefile.depend files.

MFC of r355616 and r355617

Reviewed by:  bdrewery
Sponsored by:   Juniper Networks
Differential Revision:  https://reviews.freebsd.org/D22469

4 years agoUpdate dirdeps.mk and gendirdeps.mk
Simon J. Gerraty [Thu, 19 Dec 2019 04:49:34 +0000 (04:49 +0000)]
Update dirdeps.mk and gendirdeps.mk

The env space consumed by exporting all libc's .meta files
left little room for command line,
so unexport when done.

Update dirdeps.mk to latest and add
dirdeps-targets.mk to simplify/update targets/Makefile

Makefile changes to go with Makefile.depend changes in D22494

MFC of r355618

Reviewed by:  bdrewery
Sponsored by:   Juniper Networks
Differential Revision:  https://reviews.freebsd.org/D22495

4 years agoMFC r339955, r355590: sed test fix + \r, \n, \t
Kyle Evans [Thu, 19 Dec 2019 02:29:15 +0000 (02:29 +0000)]
MFC r339955, r355590: sed test fix + \r, \n, \t

r339955:
usr.bin/sed/tests: fix one of the regression test cases by adding its
results file to the build.

r355590:
sed: process \r, \n, and \t

This is both reasonable and a common GNUism that a lot of ported software
expects.

Universally process \r, \n, and \t into carriage return, newline, and tab
respectively. Newline still doesn't function in contexts where it can't
(e.g. BRE), but we process it anyways rather than passing
UB \n (escaped ordinary) through to the underlying regex engine.

Adding a --posix flag to disable these was considered, but sed.1 already
declares this version of sed a super-set of POSIX specification and this
behavior is the most likely expected when one attempts to use one of these
escape sequences in pattern space.

This differs from pre-r197362 behavior in that we now honor the three
arguably most common escape sequences used with sed(1) and we do so outside
of character classes, too.

Other escape sequences, like \s and \S, will come later when GNU extensions
are added to libregex; sed will likely link against libregex by default,
since the GNU extensions tend to be fairly un-intrusive.

4 years agoMFC r355761: <unistd.h>: remove redundant __BSD_VISIBLE
Kyle Evans [Thu, 19 Dec 2019 02:19:04 +0000 (02:19 +0000)]
MFC r355761: <unistd.h>: remove redundant __BSD_VISIBLE

This bit is already inside of a larger __BSD_VISIBLE block.

4 years agoMFC r355643: __FreeBSD__version bumps for sigsetops
Kyle Evans [Thu, 19 Dec 2019 02:14:49 +0000 (02:14 +0000)]
MFC r355643: __FreeBSD__version bumps for sigsetops

4 years agoAdd sigsetop extensions commonly found in musl libc and glibc
Kyle Evans [Thu, 19 Dec 2019 02:09:16 +0000 (02:09 +0000)]
Add sigsetop extensions commonly found in musl libc and glibc

These functions (sigandset, sigisemptyset, sigorset) are commonly available
in at least musl libc and glibc; sigorset, at least, has proven quite useful
in qemu-bsd-user work for tracking the current process signal mask in a more
self-documenting/aesthetically pleasing manner.

4 years agostand: liblua: drop default buffer size to 128
Kyle Evans [Thu, 19 Dec 2019 02:05:48 +0000 (02:05 +0000)]
stand: liblua: drop default buffer size to 128

Lua allocates LUAL_BUFFERSIZE buffers on the stack for various string
functions (string.format, string.gsub) -- this works out to be somewhat
significant and not necessary, based on how we use string operations.
Dropping it risks having to allocate per call to format/gsub, but this is
not the case for our usage. This simply stops allocating 8K buffers on the
stack when luaL_Buffer is used.

4 years agousr.sbin/ntp: don't emit versions w/ make -s
Kyle Evans [Thu, 19 Dec 2019 02:04:40 +0000 (02:04 +0000)]
usr.sbin/ntp: don't emit versions w/ make -s

<sys.mk> defines ECHO=echo when not using make -s, and ECHO=true when using
make -s.

export ECHO for ntp products and use it in the mkver script to echo the
version. This suppresses the output as appropriate. ECHO is given a default
value to make sure things still work as expected for anyone that isn't
redefining ECHO.

4 years agoMFC r355451: Remove some branching from GEOM_DISK hot path.
Alexander Motin [Thu, 19 Dec 2019 01:34:34 +0000 (01:34 +0000)]
MFC r355451: Remove some branching from GEOM_DISK hot path.

pp->private just can not be NULL in those places.

In g_disk_start() and g_disk_ioctl() both dp != NULL and !dp->d_destroyed
should always be true if disk_gone() and disk_destroy() are used properly,
since GEOM does not send requests to errored providers.  If the protocol is
not followed, then no amount of additional checks here give real safety.

In g_disk_access() though the checks are useful, since GEOM blocks only
new opens for errored providers, but allows closes.  It should not happen
if disk_gone() and disk_destroy() are used properly, but may otherwise.

To improve cases when disk_gone() is not used, call it from disk_destroy().
It does not give full guaranties, but it errors the provider and makes
GEOM block unwanted requests at least after some race.

4 years agoMFC r355438: Block ioctls for dying GEOM_DEV instances.
Alexander Motin [Thu, 19 Dec 2019 01:32:15 +0000 (01:32 +0000)]
MFC r355438: Block ioctls for dying GEOM_DEV instances.

For normal I/Os consumer and provider statuses are checked by g_io_check().
But ioctl calls often do not go through it, being dispatched directly. This
change makes their semantics more alike, protecting lower levels.

4 years agoMFC r355437: Make GEOM_DEV code slightly more compact.
Alexander Motin [Thu, 19 Dec 2019 01:30:29 +0000 (01:30 +0000)]
MFC r355437: Make GEOM_DEV code slightly more compact.

Should be no functional change.

4 years agoMFC r355412, r355420: Wrap g_trace() into a macro to avoid unneeded calls.
Alexander Motin [Thu, 19 Dec 2019 01:28:05 +0000 (01:28 +0000)]
MFC r355412, r355420: Wrap g_trace() into a macro to avoid unneeded calls.

In most cases with debug disabled this function does nothing, but argument
passing and the call still cost measurable time due to cache misses, etc.

While there, define G_F_FOOTSHOOTING instead of numeric constants.

4 years agoMFC r355410: Switch GEOM_DEV from make_dev_p() to make_dev_s().
Alexander Motin [Thu, 19 Dec 2019 01:25:44 +0000 (01:25 +0000)]
MFC r355410: Switch GEOM_DEV from make_dev_p() to make_dev_s().

It closes the race condition and so allows to remove few NULL checks.

Also while there, use dev->si_drv1 in addition to cp->private to store
softc pointer.  For calls coming from the dev side it gives reliable cache
hit instead of often miss before.

4 years agoMFC r350532-350536,350559,350584-350585,350746-350747:
Bjoern A. Zeeb [Wed, 18 Dec 2019 11:48:50 +0000 (11:48 +0000)]
MFC r350532-350536,350559,350584-350585,350746-350747:

Merge the first part of frag6.c changes from HEAD.  Apart from moving the
sysctls into the local file these are mostly non-functional changes.

  frag6.c: sort includes
  frag6.c: move variables and sysctls into local file
  frag6.c: remove dead code
  frag6.c: rename malloc type
  frag6.c: make compile with gcc
  frag6.c: fix includes
  frag6.c: re-order functions within file
  frag6.c: rename ip6q[] to ipq6b[] and consistently use "bucket"
  frag6.c: initial comment and whitespace cleanup.
  frag6.c: cleanup varaibles and return statements.

  Sponsored by: Netflix

4 years agoMFC r355317:
Xin LI [Wed, 18 Dec 2019 08:08:51 +0000 (08:08 +0000)]
MFC r355317:

newfs_msdos: -A is incompatible with -r, not -o.

PR: 242314
Submitted by: Guy Yur <guyyur gmail com>

4 years agoMFC r350531:
Bjoern A. Zeeb [Wed, 18 Dec 2019 00:12:30 +0000 (00:12 +0000)]
MFC r350531:
  IPv6 cleanup: kernel

  Finish what was started a few years ago and harmonize IPv6 and IPv4
  kernel names.  We are down to very few places now that it is feasible
  to do the change for everything remaining with causing too much disturbance.

  Remove "aliases" for IPv6 names which confusingly could indicate
  that we are talking about a different data structure or field or
  have two fields, one for each address family.
  Try to follow common conventions used in FreeBSD.

  * Rename sin6p to sin6 as that is how it is spelt in most places.
  * Remove "aliases" (#defines) for:
    - in6pcb which really is an inpcb and nothing separate
    - sotoin6pcb which is sotoinpcb (as per above)
    - in6p_sp which is inp_sp
    - in6p_flowinfo which is inp_flow
  * Try to use ia6 for in6_addr rather than in6p.
  * With all these gone  also rename the in6p variables to inp as
    that is what we call it in most of the network stack including
    parts of netinet6.

  The reasons behind this cleanup are that we try to further
  unify netinet and netinet6 code where possible and that people
  will less ignore one or the other protocol family when doing
  code changes as they may not have spotted places due to different
  names for the same thing.

  No functional changes inteded.

  Sponsored by: Netflix

  Do not MFC the in_pcb.h changes for the stable branch.
  This MFC is mostly only done in order to be able to MFC other changes
  with less conflicts.

4 years agoMFC r350522:
Bjoern A. Zeeb [Tue, 17 Dec 2019 23:45:34 +0000 (23:45 +0000)]
MFC r350522:

  IPv6 cleanup: netstat

  Rename the variable for the in6_addr from in6p to ia6 to follow the
  convention generally used in FreeBSD.

  No functional changes.

  Sponsored by: Netflix

4 years agoMFC r355299:
Kenneth D. Merry [Tue, 17 Dec 2019 20:29:47 +0000 (20:29 +0000)]
MFC r355299:

  ------------------------------------------------------------------------
  r355299 | ken | 2019-12-02 14:57:39 -0500 (Mon, 02 Dec 2019) | 52 lines

  Fix a hang introduced in r351599.

  My changes in 351599 (kindly committed by avg) made the cd(4) media check
  asynchronous to avoid a sleep while holding a mutex.

  There was a difficult to reproduce bug with those changes that caused a
  hang on boot on some single processor machines/VMs.  Leandro Lupori
  managed to reproduce the bug, diagnose it, and supplied a patch!  Here is
  his analysis, from the PR:

  ======
  I was able to reproduce the problem described in comment#14.

  Actually, I wasn't trying to reproduce it, I just started seeing it a few
  weeks ago, in CURRENT.

  I can reproduce it consistently, by using QEMU to run a PowerPC64 VM with a
  single core/thread (-smp 1).

  It happens only when there is no media in the emulated CD-ROM, a device
  that QEMU adds by default, unless -nodefaults is specified in command line.

  I've debugged it and this is what I've found:

  1- After the CD probe is successful, GEOM will try to open the device,
  which will end up calling cdcheckmedia(), that sets CD state to
  CD_STATE_MEDIA_PREVENT.
  2- Next, scsi_prevent() is executed and succeeds, the CD_FLAG_DISC_LOCKED
  flag is set and CD state moves to CD_STATE_MEDIA_SIZE.
  3- Next, scsi_read_capacity() is executed and fails, state is set to
  CD_STATE_MEDIA_ALLOW, cdmediaprobedone() is called and wakes up
  cdcheckmedia().
  4- Then, when cdstart() is invoked to process CD_STATE_MEDIA_ALLOW, it
  first checks if CD_FLAG_DISC_LOCKED is set, and if so skips directly to
  CD_STATE_MEDIA_SIZE state. This will repeat the steps of bullet 3, entering
  an infinite MEDIA_SIZE command loop.

  When there is a least another core/thread, the GEOM thread that performed
  the initial cdopen() will get scheduled again, closing the CD device, that
  will call cdprevent(PR_ALLOW) that clears the CD_FLAG_DISC_LOCKED flag and
  breaks the loop.

  So, apparently, the problem is CD_STATE_MEDIA_ALLOW being skipped when
  CD_FLAG_DISC_LOCKED is set. If I understand correctly, in this case, the
  state should be advanced to CD_STATE_MEDIA size only when the current state
  is CD_STATE_MEDIA_PREVENT.
  =====
  ------------------------------------------------------------------------

PR: kern/219857
Submitted by: Leandro Lupori <leandro.lupori@gmail.com>

4 years agoMFC r355575: Add missing language specifier for Hebrew il.kbd description
Ed Maste [Tue, 17 Dec 2019 15:02:29 +0000 (15:02 +0000)]
MFC r355575: Add missing language specifier for Hebrew il.kbd description

PR: 235094 (related)
Sponsored by: The FreeBSD Foundation

4 years agoMFC r355581:
Andrey V. Elsukov [Tue, 17 Dec 2019 10:00:19 +0000 (10:00 +0000)]
MFC r355581:
  Avoid access to stale ip pointer and call UPDATE_POINTERS() after
  PULLUP_LEN_LOCKED().

  PULLUP_LEN_LOCKED() could update mbuf and thus we need to update related
  pointers that can be used in next opcodes.

  Reported by: Maxime Villard <max at m00nbsd net>

NOTE: this commit also adds UPDATE_POINTERS() stub macro, that originally
is part of r345166 commit that was not merged.

4 years agoMFC r350413:
Andrey V. Elsukov [Tue, 17 Dec 2019 09:46:00 +0000 (09:46 +0000)]
MFC r350413:
  Avoid possible lock leaking.

  After r343619 ipfw uses own locking for packets flow. PULLUP_LEN() macro
  is used in ipfw_chk() to make m_pullup(). When m_pullup() fails, it just
  returns via `goto pullup_failed`. There are two places where PULLUP_LEN()
  is called with IPFW_PF_RLOCK() held.

  Add PULLUP_LEN_LOCKED() macro to use in these places to be able release
  the lock, when m_pullup() fails.

  Sponsored by: Yandex LLC

  NOTE: since r343619 was not merged, this commit is mostly NOP, but
  it is needed to reduce code difference between stable and head/.

4 years agoMFC r355648-r355649
Emmanuel Vadot [Mon, 16 Dec 2019 18:05:28 +0000 (18:05 +0000)]
MFC r355648-r355649

r355648:
arm64: rockchip: rk_pinctrl: Add bias parsing based on the SoC type

Not all rockchip have the same value for pullup/pulldown so add a function
per SoC and call the right one to have the proper value.

r355649:
arm64: rockchip: rk_pinctrl: Fix parse_bias for RK3399

Only bank 0 and bank 2 are different than other rockchip SoC, fix this.
While here remove some debug printfs that where added in r355648

X-MFC-With: r355648

4 years agoMFC r354407:
Emmanuel Vadot [Mon, 16 Dec 2019 18:02:48 +0000 (18:02 +0000)]
MFC r354407:

arm64: allwinner: a64: Do not init the video related clocks

This should be handled by the video drivers and this break EFIFB
as this changes clock setup by the bootloader.

4 years agoMFC r354115:
Emmanuel Vadot [Mon, 16 Dec 2019 18:00:05 +0000 (18:00 +0000)]
MFC r354115:

dtc: Allow multiple dts-v1 tag

Some dts are including dtsi that also contain a /dts-v1/ tag at the
top. GNU DTC doesn't seems to have a problem with that so fix our
dtc to behave the same.

Reviewed by: kevans

4 years agoMFC r354086:
Emmanuel Vadot [Mon, 16 Dec 2019 17:59:02 +0000 (17:59 +0000)]
MFC r354086:

flash: Add GigaDevice gd25q128 flash

Add this flash chip which is a 128Mb spi flash.

4 years agoMFC r355570:
Mark Johnston [Mon, 16 Dec 2019 15:41:32 +0000 (15:41 +0000)]
MFC r355570:
Configure headphone redirection for the Dell L780 and X1 Carbon 7th gen.

4 years agoMFC r353682 (by emaste):
Mark Johnston [Mon, 16 Dec 2019 15:41:13 +0000 (15:41 +0000)]
MFC r353682 (by emaste):
snd_hda: style(9) whitespace fixup

PR: 241299

4 years agoMFC r355670:
Cy Schubert [Mon, 16 Dec 2019 02:38:47 +0000 (02:38 +0000)]
MFC r355670:

Rather than pass the address of the packet information control block to
ipf_pcksum6(), directly pass the adddress of the mbuf to it. This reduces
one pointer dereference. ipf_pcksum6() doesn't use the packet information
control block except to obtain the mbuf address.

4 years agoMFC r355669:
Cy Schubert [Sun, 15 Dec 2019 21:28:08 +0000 (21:28 +0000)]
MFC r355669:

in6_cksum() returns zero when checksums are good.