]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
4 years agoAdd tcberner as co-mentor for salvadore
salvadore [Mon, 16 Mar 2020 23:37:57 +0000 (23:37 +0000)]
Add tcberner as co-mentor for salvadore

Approved by: gerald (mentor)

4 years agoRemove misleading / redundant bzero in callout_callwheel_init
cem [Mon, 16 Mar 2020 22:25:25 +0000 (22:25 +0000)]
Remove misleading / redundant bzero in callout_callwheel_init

The intent seems to be zeroing all of the cc_cpu array, or its singleton on
such platforms.  The assumption made is that the BSP is always zero.  The
code smell was introduced in r326218, which changed the prior explicit zero
to 'curcpu'.  The change is only valid if curcpu continues to be zero,
contrary to the aim expressed in that commit message.

So, more succinctly, the expression could be: memset(cc_cpu,0,sizeof(cc_cpu)).

However, there's no point.  cc_cpu lives in the data section and has a zero
initial value already.  So this revision just removes the problematic
statement.

No functional change.  Appeases a (false positive, ish) Coverity CID.

CID: 1383567
Reported by: Puneeth Jothaiah <puneethkumar.jothaia AT dell.com>
Reviewed by: kib
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D24089

4 years agoFix infinite scan on a pool with only special allocations
mav [Mon, 16 Mar 2020 19:03:10 +0000 (19:03 +0000)]
Fix infinite scan on a pool with only special allocations

Attempt to run scrub or resilver on a new pool containing only special
allocations (special vdev added on creation) caused infinite loop
because of dsl_scan_should_clear() limiting memory usage to 5% of pool
size, which it calculated accounting only normal allocation class.

Addition of special and just in case dedup classes fixes the issue.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Alexander Motin <mav@FreeBSD.org>
Sponsored-By: iXsystems, Inc.
Closes #10106
Closes #8694
openzfs/zfs@fa130e010c2ff9b33aba11d2699b667e454b3ccb

4 years agoMake autofs(5) timeout messages include affected process name and PID.
trasz [Mon, 16 Mar 2020 16:17:58 +0000 (16:17 +0000)]
Make autofs(5) timeout messages include affected process name and PID.

MFC after: 2 weeks
Sponsored by: DARPA, AFRL

4 years agoAvoid a cache miss accessing an mbuf ext_pgs pointer when doing SW kTLS.
gallatin [Mon, 16 Mar 2020 14:03:27 +0000 (14:03 +0000)]
Avoid a cache miss accessing an mbuf ext_pgs pointer when doing SW kTLS.

For a Netflix 90Gb/s 100% TLS software kTLS workload, this reduces
the CPI of tcp_m_copym() from ~3.5 to ~2.5 as reported by vtune.

Reviewed by: jtl, rrs
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D23998

4 years agoatp: fix mouse attachment on PowerBook5,6 (G4)
alfredo [Mon, 16 Mar 2020 13:53:29 +0000 (13:53 +0000)]
atp: fix mouse attachment on PowerBook5,6 (G4)

Skip device mode switch step on Fountain-based devices as they don't
support RAW_SENSOR_MODE command, so failing to attach.

This was reproduced on PowerBook G4 (model PowerBook5,6) equipped with
product ID 0x020e

Reviewed by: hselasky
Approved by: jhibbits (mentor)
Differential Revision: https://reviews.freebsd.org/D24005

4 years agoFix for double unlock in ipoib.
hselasky [Mon, 16 Mar 2020 12:33:57 +0000 (12:33 +0000)]
Fix for double unlock in ipoib.

The ipoib_unicast_send() function is not supposed to unlock the priv lock.

MFC after: 3 days
Sponsored by: Mellanox Technologies

4 years agobridge tests: Basic span test
kp [Mon, 16 Mar 2020 08:44:46 +0000 (08:44 +0000)]
bridge tests: Basic span test

Reviewed by: philip, emaste (previous version)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D23961

4 years agoif_muge: whitespace and style cleanup
emaste [Sun, 15 Mar 2020 21:47:16 +0000 (21:47 +0000)]
if_muge: whitespace and style cleanup

Submitted by: clang-format (in part)
Sponsored by: The FreeBSD Foundation

4 years agoWe don't need $M/$M in the path anymore.
imp [Sun, 15 Mar 2020 17:40:14 +0000 (17:40 +0000)]
We don't need $M/$M in the path anymore.

Now that machdep files are gone, we don't need $S/$M/$M in the path to find
them.

4 years agomuge: drop CSUM from MUGE_DEFAULT_TSO_CSUM_ENABLE
emaste [Sun, 15 Mar 2020 03:32:39 +0000 (03:32 +0000)]
muge: drop CSUM from MUGE_DEFAULT_TSO_CSUM_ENABLE

TSO is independent of checksum offload

4 years agomuge: enable RXCSUM as it now works
emaste [Sun, 15 Mar 2020 03:03:01 +0000 (03:03 +0000)]
muge: enable RXCSUM as it now works

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

4 years agocalendar(1): Updates and corrections for some calendar files.
pfg [Sun, 15 Mar 2020 00:49:06 +0000 (00:49 +0000)]
calendar(1): Updates and corrections for some calendar files.

These have an educational value and are, no doubt, an integral part of the fun
behind running the BSDs.

PR: 242909, 242918
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D23581

4 years agoRemove extraneous code from iflib
pkelsey [Sat, 14 Mar 2020 20:13:42 +0000 (20:13 +0000)]
Remove extraneous code from iflib

ifsd_cidx is never used, and the line removed from rxd_frag_to_sd() is
just dead code.

Reviewed by: erj, gallatin
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D23951

4 years agoAdjust if_vmx default receive parameters for better out-of-box performance
pkelsey [Sat, 14 Mar 2020 20:11:46 +0000 (20:11 +0000)]
Adjust if_vmx default receive parameters for better out-of-box performance

These adjustments improve performance with jumbo frames and/or LRO
enabled (i.e., when there may be multiple descriptors per packet) by
increasing the default size of the receive queues and by always using
page-sized buffers for the body type receive ring.

This patch also adjust the initialization of the max frame size to
remove cases where certain configuration sequences would result in 2K
receive buffers being used instead of 4K ones when jumbo frames were
enabled.

Reviewed by: gallatin
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D23950

4 years agoFix if_vmx receive checksum offload bug and harden against the device skipping receiv...
pkelsey [Sat, 14 Mar 2020 20:08:04 +0000 (20:08 +0000)]
Fix if_vmx receive checksum offload bug and harden against the device skipping receive descriptors

This fixes a bug where the checksum offload status of received packets
was being taken from the first descriptor instead of the last, which
affected LRO packets.

The driver has been hardened against the device skipping receive
descriptors, although it is not believed that this can occur given the
way this implementation configures the receive rings.

Additionally, for packets received with the error indicator set, the
driver now forces the length of all fragments in that packet to zero
prior to passing it to iflib.  Such packets should wind up being
discarded at some point in the stack anyway, but this removes any
questions by killing them in the driver.

Counters have been added (and exposed via sysctls) for skipped receive
descriptors, zero-length packets received, and packets received with
the error indicator set so that these conditions can be easily
observed in the field.

PR: 243126, 243392, 240628
Reported by: avg, alexandr.oleynikov@gmail.com, Harald Schmalzbauer
Reviewed by: gallatin
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D23949

4 years agoRemove refill budget from iflib
pkelsey [Sat, 14 Mar 2020 19:58:50 +0000 (19:58 +0000)]
Remove refill budget from iflib

Reviewed by: gallatin
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D23948

4 years agoAllow iflib drivers to specify the buffer size used for each receive queue
pkelsey [Sat, 14 Mar 2020 19:56:46 +0000 (19:56 +0000)]
Allow iflib drivers to specify the buffer size used for each receive queue

Reviewed by: erj, gallatin
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D23947

4 years agoRemove freelist contiguous-indexes assertion from rxd_frag_to_sd()
pkelsey [Sat, 14 Mar 2020 19:55:05 +0000 (19:55 +0000)]
Remove freelist contiguous-indexes assertion from rxd_frag_to_sd()

The vmx driver is an example of an iflib driver that might report
packets using non-contiguous descriptors (with unused descriptors
either between received packets or between the fragments of a received
packet), so this assertion needs to be removed.

For such drivers, the freelist producer and consumer indexes don't
relate directly to driver ring slots (the driver deals directly with
freelist buffer indexes supplied by iflib during refill, and reports
them with each fragment during packet reception), but do continue to
be used by iflib for accounting, such as determining the number of
ring slots that are refillable.

PR: 243126, 243392, 240628
Reported by: avg, alexandr.oleynikov@gmail.com, Harald Schmalzbauer
Reviewed by: gallatin
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D23946

4 years agoFix iflib zero-length fragment handling
pkelsey [Sat, 14 Mar 2020 19:51:55 +0000 (19:51 +0000)]
Fix iflib zero-length fragment handling

The dmamap for zero-length fragments should not be unloaded, as doing
so breaks the the cluster-reuse logic in _iflib_fl_refill().

All zero-length fragments are now handled by the assemble_segments()
path so that the cluster-reuse logic there does not have to be
replicated in the small-single-fragment-packet path of
iflib_rxd_pkt_get().

Packets consisting entirely of zero-length fragments (which result in
a NULL mbuf pointer) are now properly tolerated.  This allows drivers
(such as the vmx driver) to pass such packets to iflib when a
descriptor error occurs during packet reception, the advantage being
that the refill of descriptors associated with the error packet are
handled via the existing iflib machinery without having to duplicate
parts of that machinery in the driver to handle that error case.

Reviewed by: avg, erj, gallatin
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D23945

4 years agoFix iflib freelist state corruption
pkelsey [Sat, 14 Mar 2020 19:43:44 +0000 (19:43 +0000)]
Fix iflib freelist state corruption

This fixes a bug in iflib freelist management that breaks the required
correspondence between freelist indexes and driver ring slots.

PR: 243126, 243392, 240628
Reported by: avg, alexandr.oleynikov@gmail.com, Harald Schmalzbauer
Reviewed by: avg, gallatin
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D23943

4 years agoSparc64 and pc98 needed cam_machdep and/or ata_machdep for various
imp [Sat, 14 Mar 2020 18:35:44 +0000 (18:35 +0000)]
Sparc64 and pc98 needed cam_machdep and/or ata_machdep for various
reasons. Those have now left the tree, and with them the need to have machdep
files. Places that called the routines in quesiton have been removed
previously. Remove these files from the Makefile to tidy up.

4 years agolibssp: don't compile with -fstack-protector*
kevans [Sat, 14 Mar 2020 15:15:27 +0000 (15:15 +0000)]
libssp: don't compile with -fstack-protector*

This similarly matches what we do in libc; compiling libssp with
-fstack-protector* is actively harmful.  For instance, if the canary ctor
ends up with a stack protector then it will trivially trigger a false
positive as the canary's being initialized.

This was noted by the reporter as irc/ircd-hybrid started crashing at start
after our libssp was MFC'd to stable/11, as its build will explicitly link
in libssp. On FreeBSD, this isn't necessary as SSP bits are included in
libc, but it should absolutely not trigger runtime breakage -- it does mean
that the canary will get initialized twice, but as this is happening early
on in application startup it should just be redundant work.

Reported by: Tod McQuillin <devin@sevenlayer.studio>
MFC after: 3 days

4 years agokern_jail: missing \0 termination check on osrelease parameter
bz [Sat, 14 Mar 2020 14:04:55 +0000 (14:04 +0000)]
kern_jail: missing \0 termination check on osrelease parameter

If a user spplies a non-\0 terminated osrelease parameter reading it back
may disclose kernel memory.
This is a problem in case of nested jails (children.max > 0, which is not
the default).  Otherwise root outside the jail has access to kernel memory
by other means and root inside a jail cannot create a child jail.

Add the proper \0 check at the end of a supplied osrelease parameter and
make sure any copies of the field will be \0-terminated.

Submitted by: Hans Christian Woithe (chwoithe yahoo.com)
MFC after: 3 days

4 years agoloader: add comconsole implementation on top of SIO protocol
tsoome [Sat, 14 Mar 2020 06:36:03 +0000 (06:36 +0000)]
loader: add comconsole implementation on top of SIO protocol

Provide comconsole on top of SIO for arm platforms (x86 does use bios version).

4 years agoRemove unneeded checks for prelen.
delphij [Sat, 14 Mar 2020 05:57:22 +0000 (05:57 +0000)]
Remove unneeded checks for prelen.

In order to determine the type of a compressed file, we have to read
in the first four bytes which may also be important for decompression
purposes, to do that we would pass the buffer that we have already
read in, along with the size of it.

Rename header1 to fourbytes to make that explicit, and remove all
checks for prelen.

Reported by: cem
Reviewed by: cem
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D24034

4 years agoAdd comment about how the deferred callback for AC_FOUND_DEVICE we
imp [Sat, 14 Mar 2020 02:36:45 +0000 (02:36 +0000)]
Add comment about how the deferred callback for AC_FOUND_DEVICE we
generate for a race where a device goes away, we start to tear down
the periph state for the device, and then the device suddently
reappears. The key that makes it work is removal of periph from the
drv list before calling the deferred callback.

Hat tip to: mav@

4 years agomuge: correct RX checksum offload
emaste [Sat, 14 Mar 2020 01:52:38 +0000 (01:52 +0000)]
muge: correct RX checksum offload

Submitted by: Johannes <iz-rpi04@hs-karlsruhe.de>
MFC after: 1 week

4 years agoTODO DONE: Use sx_xholder in SPL rwlock.h
freqlabs [Sat, 14 Mar 2020 00:16:15 +0000 (00:16 +0000)]
TODO DONE: Use sx_xholder in SPL rwlock.h

Approved by: mav (mentor)
MFC after: 1 week
Sponsored by: iXsystems, Inc.

4 years agoGive some indication of the CCB that's in flight when we panic.
imp [Fri, 13 Mar 2020 18:45:36 +0000 (18:45 +0000)]
Give some indication of the CCB that's in flight when we panic.

Print the pointer to ccb so we can find it (for what good it does)
as well as the type of operation in flight when the cam_path has
been freed out from under us. This helps both core analysis as well
as automated systems that collect panic strings but little else.

4 years agosendfile() does currently not support SCTP sockets.
tuexen [Fri, 13 Mar 2020 18:38:28 +0000 (18:38 +0000)]
sendfile() does currently not support SCTP sockets.
Therefore, fail the call.

Reviewed by: markj@
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D24059

4 years agoSkip sys.netpfil.pf.nat.exhaust on all platforms as it not only fails on amd64
lwhsu [Fri, 13 Mar 2020 16:44:48 +0000 (16:44 +0000)]
Skip sys.netpfil.pf.nat.exhaust on all platforms as it not only fails on amd64

PR: 244703
Sponsored by: The FreeBSD Foundation

4 years agoflua: implement chmod
emaste [Fri, 13 Mar 2020 15:40:35 +0000 (15:40 +0000)]
flua: implement chmod

Lua does not provide a native way to change the permission of a file.

Submitted by: Yang Wang <2333@outlook.jp>
Reviewed by: kevans
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D24036

4 years agoIncrease buffer in mprsas_log_command() from 192 to 224 bytes.
mav [Fri, 13 Mar 2020 14:51:11 +0000 (14:51 +0000)]
Increase buffer in mprsas_log_command() from 192 to 224 bytes.

192 bytes are not enough to print long commands, such as ATA COMMAND PASS
THROUGH(16), that makes debug output difficult to read.

MFC after: 2 weeks
Sponsored by: iXsystems, Inc.

4 years agoCMSG_DATA.3: Fix formatting of printf escape sequences
0mp [Fri, 13 Mar 2020 11:07:48 +0000 (11:07 +0000)]
CMSG_DATA.3: Fix formatting of printf escape sequences

Escape sequences like "\n" have to be escaped twice in examples in our
mdoc(7)-based manual pages in order to be displayed properly. The problem
is that otherwise they are interpreted by mdoc(7), which results in:

    printf("parent: received '%s'0, buf);

being shown to the user instead of:

    printf("parent: received '%s'\n", buf);

Approved by: bcr (mentor)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D24056

4 years agopowerpc: Simplify _nodrop variants of FPU and vector register saves
jhibbits [Fri, 13 Mar 2020 01:27:37 +0000 (01:27 +0000)]
powerpc: Simplify _nodrop variants of FPU and vector register saves

No need for an extra temporary.  It doesn't even help with readability.

Suggested by: kib (almost 2 years ago)

4 years agocxgbe(4): Do not display error messages related to the CLIP table if
np [Fri, 13 Mar 2020 00:12:15 +0000 (00:12 +0000)]
cxgbe(4): Do not display error messages related to the CLIP table if
it's not in use by TOE or KTLS.

Reviewed by: jhb@
MFC after: 1 week
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D24046

4 years agolibpmcstat: Try /boot/modules if module not found
freqlabs [Thu, 12 Mar 2020 23:04:40 +0000 (23:04 +0000)]
libpmcstat: Try /boot/modules if module not found

Modules from ports/pkg are commonly installed to /boot/modules rather than to
the same directory the kernel resides in.  Look there if a module is not found
next to the kernel.

Submitted by: mmacy
Reported by: Nick Principe <nap@iXsystems.com>
Approved by: mmacy (mentor)
MFC after: 2 weeks
Sponsored by: iXsystems, Inc.

4 years agokern_shutdown: Add missing EKCD ifdef
cem [Thu, 12 Mar 2020 21:26:36 +0000 (21:26 +0000)]
kern_shutdown: Add missing EKCD ifdef

Submitted by: Puneeth Jothaiah <puneethkumar.jothaia AT dell.com>
Reviewed by: bdrewery
Sponsored by: Dell EMC Isilon

4 years agologger: capsicumize
oshogbo [Thu, 12 Mar 2020 19:55:51 +0000 (19:55 +0000)]
logger: capsicumize

Submitted by: Tiger Gao <tig@freebsdfoundation.org>
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D23744

4 years agoftw.3: Follow style(9) in the example
0mp [Thu, 12 Mar 2020 18:28:23 +0000 (18:28 +0000)]
ftw.3: Follow style(9) in the example

Reported by: oshogbo
Approved by: bcr (mentor)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D24043

4 years agoRemove /usr/share/snmp/defs/tc.def with delete-old if MK_BSNMP == no
ngie [Thu, 12 Mar 2020 16:06:26 +0000 (16:06 +0000)]
Remove /usr/share/snmp/defs/tc.def with delete-old if MK_BSNMP == no

This removes a lingering file on new installs of CURRENT, originally
added in r345797.

MFC after: 1 week
MFC with: r345797

4 years agoUse KMOD_TCPSTAT_INC instead of TCPSTAT_INC for RACK and BBR, since
tuexen [Thu, 12 Mar 2020 15:37:41 +0000 (15:37 +0000)]
Use KMOD_TCPSTAT_INC instead of TCPSTAT_INC for RACK and BBR, since
these are kernel modules. Also add a KMOD_TCPSTAT_ADD and use that
instead of TCPSTAT_ADD.

Reviewed by: jtl@, rrs@
MFC after: 1 week
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D23904

4 years agoMakefile.inc1: move dependency hack comment to the block it applies to
emaste [Thu, 12 Mar 2020 14:01:17 +0000 (14:01 +0000)]
Makefile.inc1: move dependency hack comment to the block it applies to

4 years agoExtend r358907 to explicitly remove stale lib32 dependency
emaste [Thu, 12 Mar 2020 13:42:08 +0000 (13:42 +0000)]
Extend r358907 to explicitly remove stale lib32 dependency

After r325072 stale lib32 dependencies were not remooved.  A more
holistic approach is needed to address this but for the immediate issue
(-DNO_CLEAN builds across r358851) just readd the explicit lib32 path.

Reported by: dim
Sponsored by: The FreeBSD Foundation

4 years agoEnable ixl device on PowerPC64
luporl [Thu, 12 Mar 2020 12:47:10 +0000 (12:47 +0000)]
Enable ixl device on PowerPC64

The ixl driver now works on PowerPC64 and may be compiled in-kernel and
as a module.

Reviewed by: alfredo, erj
Sponsored by: Eldorado Research Institute (eldorado.org.br)
Differential Revision: https://reviews.freebsd.org/D23974

4 years agoAllow -DNO_CLEAN build across r358851.
dim [Thu, 12 Mar 2020 11:39:04 +0000 (11:39 +0000)]
Allow -DNO_CLEAN build across r358851.

The openmp 10.0.0 import renamed one .c file to .cpp, and this is
something our dependency system does not handle correctly.  Add another
ad-hoc cleanup to get rid of the stale dependency.

PR: 244251
MFC after: 6 weeks
X-MFC-With: 358851

4 years agotest if port does exist via using scratch register
tsoome [Thu, 12 Mar 2020 06:45:08 +0000 (06:45 +0000)]
test if port does exist via using scratch register

The SCR, scratch register was not present on the 8250 and 8250B UART, so we
can use to test if we actually do have serial port.

We need this test because some systems will get long delays while attempting
to write to non-existing port and this will slow down the console IO
to extreme.

MFC after: 1 week

4 years agostyle(9): Fix space after #define.
pfg [Thu, 12 Mar 2020 03:56:54 +0000 (03:56 +0000)]
style(9): Fix space after #define.

No functional change.

4 years agoFix r358688 -- Remember to actually save r3 before processing.
bdragon [Wed, 11 Mar 2020 23:34:44 +0000 (23:34 +0000)]
Fix r358688 -- Remember to actually save r3 before processing.

Crash was noticed by pkubaj building gcc9.

Apparently non dword-aligned char pointers are somewhat rare in the wild.

Reported by: pkubaj
Sponsored by: Tag1 Consulting, Inc.

4 years agoCheck for busy or wired in vm_page_relookup(). Some callers will only keep
jeff [Wed, 11 Mar 2020 22:25:45 +0000 (22:25 +0000)]
Check for busy or wired in vm_page_relookup().  Some callers will only keep
a page wired and expect it to still be present.

Reported by: delphij@FreeBSD.org
Reviewed by: kib

4 years agoWhen mounting a UFS filesystem, return EINTEGRITY rather than EIO
mckusick [Wed, 11 Mar 2020 21:00:40 +0000 (21:00 +0000)]
When mounting a UFS filesystem, return EINTEGRITY rather than EIO
when a superblock check-hash error is detected. This change clarifies
a mount that failed due to media hardware failures (EIO) from a mount
that failed due to media errors (EINTEGRITY) that can be corrected by
running fsck(8).

Sponsored by: Netflix

4 years agoarch.7: remove extraneous markup from header table sizing
emaste [Wed, 11 Mar 2020 20:40:24 +0000 (20:40 +0000)]
arch.7: remove extraneous markup from header table sizing

Reported by: 0mp (in response to r358891)

4 years agoCorrectly spell TUNABLES.
bz [Wed, 11 Mar 2020 20:23:36 +0000 (20:23 +0000)]
Correctly spell TUNABLES.

4 years agowmt(4): Reapply r358872 (by hselasky) modified to use
wulf [Wed, 11 Mar 2020 20:05:49 +0000 (20:05 +0000)]
wmt(4): Reapply r358872 (by hselasky) modified to use
maximal input report size instead of wMaxPacketSize.

If the USB frame length is set to 1024 bytes, WMT_BSIZE, the EETI controller
will pack multiple touch events in the packet and the current code will only
process the first touch event.

As a result some important events are lost like releasing the finger from the
touchscreen.

Use the maximal input report size as buffer size instead.

PR: 244718
Tested by: Oskar Holmlund <oskar.holmlund@ohdata.se>, wulf
MFC after: 3 days
Discussed with: hselasky

4 years agoRemove extra Sy from table header
emaste [Wed, 11 Mar 2020 20:05:06 +0000 (20:05 +0000)]
Remove extra Sy from table header

Reported by: 0mp

4 years agowmt(4): revert r358872 (by hselasky)
wulf [Wed, 11 Mar 2020 19:57:43 +0000 (19:57 +0000)]
wmt(4): revert r358872 (by hselasky)

Limiting frame size to maximum packet size breaks devices which have input
report size larger than wMaxPacketSize. Maximal input report size should be
used instead.
Revert the commit as it have not been MFC-ed yet.

Discussed with: hselasky

4 years agoelf.5: start documenting ELF note sections
emaste [Wed, 11 Mar 2020 18:15:18 +0000 (18:15 +0000)]
elf.5: start documenting ELF note sections

I intend to document FreeBSD's ELF notes (see review D23982), but start
with a section documenting the format of the note section itself.

Sponsored by: The FreeBSD Foundation

4 years agoRemove redundantly repetitive static __inline forward function
imp [Wed, 11 Mar 2020 15:12:31 +0000 (15:12 +0000)]
Remove redundantly repetitive static __inline forward function
declarations.

We typically don't use them elsewhere in the kernel, and they aren't
needed here: the actual functions are a few lines away and aren't
mutually recursive.

4 years agoelfctl: remove memory leak
emaste [Wed, 11 Mar 2020 13:51:01 +0000 (13:51 +0000)]
elfctl: remove memory leak

CID: 1420356
Reported by: Coverity Scan
Sponsored by: The FreeBSD Foundation

4 years agoTemporarily skip 2 failing tests after llvm10 import
lwhsu [Wed, 11 Mar 2020 12:43:54 +0000 (12:43 +0000)]
Temporarily skip 2 failing tests after llvm10 import

PR: 244732
Sponsored by: The FreeBSD Foundation

4 years agoTemporarily skip sys.geom.class.gate.ggate_test.ggated in CI
lwhsu [Wed, 11 Mar 2020 10:42:05 +0000 (10:42 +0000)]
Temporarily skip sys.geom.class.gate.ggate_test.ggated in CI

PR: 244737
Sponsored by: The FreeBSD Foundation

4 years agoIf the USB frame length is set to 1024 bytes, WMT_BSIZE, the EETI controller
hselasky [Wed, 11 Mar 2020 08:16:13 +0000 (08:16 +0000)]
If the USB frame length is set to 1024 bytes, WMT_BSIZE, the EETI controller
will pack multiple touch events in the packet and the current code will only
process the first touch event.

As a result some important events are lost like releasing the finger from the
touchscreen.

Use the maximum maximum packet size as buffer size instead.

Submitted by: Oskar Holmlund <oskar.holmlund@ohdata.se>
PR: 244718
MFC after: 3 days
Sponsored by: Mellanox Technologies

4 years agoRevert r358858 as it breaks some ipfw(8) setups.
melifaro [Wed, 11 Mar 2020 08:08:53 +0000 (08:08 +0000)]
Revert r358858 as it breaks some ipfw(8) setups.

Reported by: O. Hartmann <o.hartmann@walstatt.org>

4 years agofusefs: avoid cache corruption with buggy fuse servers
asomers [Wed, 11 Mar 2020 04:29:45 +0000 (04:29 +0000)]
fusefs: avoid cache corruption with buggy fuse servers

The FUSE protocol allows the client (kernel) to cache a file's size, if the
server (userspace daemon) allows it. A well-behaved daemon obviously should
not change a file's size while a client has it cached. But a buggy daemon
might. If the kernel ever detects that that has happened, then it should
invalidate the entire cache for that file. Previously, we would not only
cache stale data, but in the case of a file extension while we had the size
cached, we accidentally extended the cache with zeros.

PR: 244178
Reported by: Ben RUBSON <ben.rubson@gmx.com>
Reviewed by: cem
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D24012

4 years agoEliminate camq_alloc() and camq_free()
imp [Wed, 11 Mar 2020 00:00:03 +0000 (00:00 +0000)]
Eliminate camq_alloc() and camq_free()

These are no longer needed now that it's embedded in cam_ccbq. They are also
unused.

Reviewed by: ken, chuck
Differential Revision: https://reviews.freebsd.org/D24008

4 years agoEliminate xpt_copy_path.
imp [Tue, 10 Mar 2020 23:59:58 +0000 (23:59 +0000)]
Eliminate xpt_copy_path.

It's used in exactly one place. In that place it's used so we can hold the lock
on the device associated with the path (since we do a xpt_path_lock and unlock
pair around the callback). Instead, inline taking and dropping the reference to
the device so we can ensure we can unlock the mutex after the callback finishes
if the path in the ccb that's queued to be processed by xpt_scanner_thread is
destroyed while being processed. We don't actually need the path itself for
anything other than dereferencing it to get the device to do the lock and
unlock.

This also makes the locking / use model for cam_path a little cleaner by
eliminating a case where we needlessly copy the object.

Reviewed by: chuck, chs, ken
Differential Revision: https://reviews.freebsd.org/D24008

4 years agoRemove unused cam ccb flags
imp [Tue, 10 Mar 2020 23:58:41 +0000 (23:58 +0000)]
Remove unused cam ccb flags

These flags have been unused for some time. Some of them were in the
CAM2 specification, but CAM has moved on a bit from that. Some were
used in the old Pluto VideoSpace (and AirSpace) systems which had the
video playback I/O scheduler in userspace, but have been unused since
then.

Reviewed by: chuck, ken
Differential Revision:  https://reviews.freebsd.org/D24008

4 years agoAdd "tigerlake" CPUTYPE for x86 to catch up with Clang 10.0.
jkim [Tue, 10 Mar 2020 23:12:55 +0000 (23:12 +0000)]
Add "tigerlake" CPUTYPE for x86 to catch up with Clang 10.0.

4 years ago- Remove CPUTYPE examples for sparc64. It is not supported since r358345.
jkim [Tue, 10 Mar 2020 22:59:01 +0000 (22:59 +0000)]
- Remove CPUTYPE examples for sparc64.  It is not supported since r358345.
- Clean up CPUTYPE examples for x86.  GCC 4.2.1 was removed by r358454.

4 years agocxgbe/t4_tom: The MSS in a FLOWC work request must not be 0.
np [Tue, 10 Mar 2020 21:49:56 +0000 (21:49 +0000)]
cxgbe/t4_tom: The MSS in a FLOWC work request must not be 0.

Submitted by: jhb@
MFC after: 1 week
Sponsored by: Chelsio Communications

4 years agocxgbe(4): Do not try to use 0 as an rx buffer address when the driver is
np [Tue, 10 Mar 2020 21:44:20 +0000 (21:44 +0000)]
cxgbe(4): Do not try to use 0 as an rx buffer address when the driver is
already allocating from the safe zone and the allocation fails.

This bug was introduced in r357481.

MFC after: 3 days
Sponsored by: Chelsio Communications

4 years agoDon't assume !IPv6 is IPv4 in ipfw(8) add_src() and add_dst().
melifaro [Tue, 10 Mar 2020 20:30:21 +0000 (20:30 +0000)]
Don't assume !IPv6 is IPv4 in ipfw(8) add_src() and add_dst().

Submitted by: Neel Chauhan <neel AT neelc DOT org>
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D21812

4 years agoMove another file in libllvm from sources required for world, to sources
dim [Tue, 10 Mar 2020 20:25:36 +0000 (20:25 +0000)]
Move another file in libllvm from sources required for world, to sources
required for bootstrap, as the PowerPC builds need this.

Reported by: bdragon
PR: 244251
MFC after: 6 weeks
X-MFC-With: 358851

4 years agoFix signal delivery might be on sigfastblock clearing.
kib [Tue, 10 Mar 2020 20:25:03 +0000 (20:25 +0000)]
Fix signal delivery might be on sigfastblock clearing.

When clearing sigfastblock, either by sigfastblock(UNSETPTR) call or
implicitly on execve(2), kernel must check for pending signals and
reschedule them if needed.

E.g. on execve, all other threads are terminated, and current thread
fast block pointer is cleaned.  If any signal was left pending, it can
now be delivered to the current thread, and we should prepare for
ast() on return to userspace to notice the signals.

Reported and tested by: pho
Sponsored by: The FreeBSD Foundation

4 years agoReturn reschedule_signals() to being static again.
kib [Tue, 10 Mar 2020 20:04:38 +0000 (20:04 +0000)]
Return reschedule_signals() to being static again.

It was used after sigfastblock_setpend() call in in ast() when current
thread fast-blocks signals.  Add a flag to sigfastblock_setpend() to
request reschedule, and remove the direct use of the function from
subr_trap.c

Tested by: pho
Sponsored by: The FreeBSD Foundation

4 years agoAdd one additional file to libllvmminimal, to help the ppc64 bootstrap.
dim [Tue, 10 Mar 2020 20:01:52 +0000 (20:01 +0000)]
Add one additional file to libllvmminimal, to help the ppc64 bootstrap.

Reported by: bdragon
PR: 244251
MFC after: 6 weeks
X-MFC-With: 358851

4 years agoAdd basic IPv4/IPv6 forwarding tests.
melifaro [Tue, 10 Mar 2020 19:52:19 +0000 (19:52 +0000)]
Add basic IPv4/IPv6 forwarding tests.

MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D24002

4 years agoSkip sys.netpfil.pf.nat.exhaust on amd64 in CI as it sometimes panics kernel
lwhsu [Tue, 10 Mar 2020 19:18:24 +0000 (19:18 +0000)]
Skip sys.netpfil.pf.nat.exhaust on amd64 in CI as it sometimes panics kernel

PR: 244703
Sponsored by: The FreeBSD Foundation

4 years agoMerge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp
dim [Tue, 10 Mar 2020 18:17:17 +0000 (18:17 +0000)]
Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp
10.0.0-rc3 c290cb61fdc.

Release notes for llvm, clang, lld and libc++ 10.0.0 will become
available here:

https://releases.llvm.org/10.0.0/docs/ReleaseNotes.html
https://releases.llvm.org/10.0.0/tools/clang/docs/ReleaseNotes.html
https://releases.llvm.org/10.0.0/tools/lld/docs/ReleaseNotes.html
https://releases.llvm.org/10.0.0/projects/libcxx/docs/ReleaseNotes.html

PR: 244251
MFC after: 6 weeks

4 years agoMerge ^/head r358832 through r358848.
dim [Tue, 10 Mar 2020 17:49:09 +0000 (17:49 +0000)]
Merge ^/head r358832 through r358848.

4 years agoUntangle TPR shadowing and APIC virtualization.
mr [Tue, 10 Mar 2020 16:53:49 +0000 (16:53 +0000)]
Untangle TPR shadowing and APIC virtualization.
This speeds up Windows guests tremendously.

The patch does:
Add a new tuneable 'hw.vmm.vmx.use_tpr_shadowing' to disable TLP shadowing.
Also add 'hw.vmm.vmx.cap.tpr_shadowing' to be able to query if TPR shadowing is used.

Detach the initialization of TPR shadowing from the initialization of APIC virtualization.
APIC virtualization still needs TPR shadowing, but not vice versa.
Any CPU that supports APIC virtualization should also support TPR shadowing.

When TPR shadowing is used, the APIC page of each vCPU is written to the VMCS_VIRTUAL_APIC field of the VMCS
so that the CPU can write directly to the page without intercept.

On vm exit, vlapic_update_ppr() is called to update the PPR.

Submitted by: Yamagi Burmeister
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D22942

4 years agoFix for building libusb under Linux.
hselasky [Tue, 10 Mar 2020 15:59:20 +0000 (15:59 +0000)]
Fix for building libusb under Linux.

MFC after: 3 days
Sponsored by: Mellanox Technologies

4 years agoAdd support for the device statistics IOCTL, needed by the coming
hselasky [Tue, 10 Mar 2020 15:56:49 +0000 (15:56 +0000)]
Add support for the device statistics IOCTL, needed by the coming
linux_libusb upgrade.

MFC after: 3 days
Sponsored by: Mellanox Technologies

4 years agoBump __FreeBSD_version after amd(8) removal, r358821
emaste [Tue, 10 Mar 2020 13:39:05 +0000 (13:39 +0000)]
Bump __FreeBSD_version after amd(8) removal, r358821

Reported by: cy

4 years agoSet tentative dates.
dim [Tue, 10 Mar 2020 07:05:04 +0000 (07:05 +0000)]
Set tentative dates.

4 years agoMerge ^/head r358731 through r358831.
dim [Tue, 10 Mar 2020 07:04:05 +0000 (07:04 +0000)]
Merge ^/head r358731 through r358831.

4 years agoRemove -mlong-calls vhen building arm libraries and llvm.
dim [Tue, 10 Mar 2020 06:49:43 +0000 (06:49 +0000)]
Remove -mlong-calls vhen building arm libraries and llvm.

Clang from 9.0.0 onwards already has the necessary relocation range
extenders, so this workaround is no longer needed (it produces longer
and slower code). Tested on real hardware, and in cross-compile
environment.

Submitted by: mmel

4 years agobridge test: adding and removing static addresses
kp [Tue, 10 Mar 2020 06:29:59 +0000 (06:29 +0000)]
bridge test: adding and removing static addresses

Reviewed by: philip
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D23960

4 years agobridge test: spanning tree
kp [Tue, 10 Mar 2020 06:28:45 +0000 (06:28 +0000)]
bridge test: spanning tree

Basic test case where we create a bridge loop, verify that we really are
looping and then enable spanning tree to resolve the loop.

Reviewed by: philip
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D23959

4 years agopowerpc/booke: Split out 32- and 64- bit pmap details from main body
jhibbits [Tue, 10 Mar 2020 03:30:11 +0000 (03:30 +0000)]
powerpc/booke: Split out 32- and 64- bit pmap details from main body

Summary:
This is largely a straight-forward cleave of the 32-bit and 64-bit page
table specifics, along with the mmu_booke_*() functions that are wholely
different between the two implementations.

The ultimate goal of this is to make it easier to reason about and
update a specific implementation without wading through the other
implementation details.  This is in support of further changes to the 64-bit
pmap.

Reviewed by: bdragon
Differential Revision: https://reviews.freebsd.org/D23983

4 years agopipe: explain why not deallocating inode number is fine.
kib [Mon, 9 Mar 2020 23:40:25 +0000 (23:40 +0000)]
pipe: explain why not deallocating inode number is fine.

Suggested and reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D24009

4 years agoposixshmcontrol: add an undocumented alias 'list' for the 'ls' command.
kib [Mon, 9 Mar 2020 23:08:24 +0000 (23:08 +0000)]
posixshmcontrol: add an undocumented alias 'list' for the 'ls' command.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

4 years agoPreallocate pipe buffers on pipe creation.
kib [Mon, 9 Mar 2020 21:55:26 +0000 (21:55 +0000)]
Preallocate pipe buffers on pipe creation.

Return ENOMEM if one of the buffer cannot be created even with the
minimal size.  This should avoid subsequent spurious ENOMEM errors
from write(2) when buffer cannot be allocated on the fly, after we
reported that the pipe was create succesfully.

Reported by: Keno Fischer <keno@juliacomputing.com>
Reviewed by: markj (previous version)
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D23993

4 years agowmt(4): Fix Synaptics Touch Digitizer V04 attachment
wulf [Mon, 9 Mar 2020 21:01:22 +0000 (21:01 +0000)]
wmt(4): Fix Synaptics Touch Digitizer V04 attachment

Touch Digitizer V04 report descriptor declares 'Contact Count Maximum' usage
as constant. That was not supported by descriptor parser.

PR: 232040
Reported by: Sergei Akhmatdinov <sakhmatd@darkn.space>
MFC after: 1 week

4 years agoregen src.conf.5 after r358821, AMD option removal
emaste [Mon, 9 Mar 2020 20:49:59 +0000 (20:49 +0000)]
regen src.conf.5 after r358821, AMD option removal

Also pick up LOADER_VERIEXEC_VECTX change.

4 years agoRemove WITH_AMD option, missed in r358821
emaste [Mon, 9 Mar 2020 20:49:06 +0000 (20:49 +0000)]
Remove WITH_AMD option, missed in r358821

4 years agoretire amd(8)
emaste [Mon, 9 Mar 2020 20:46:43 +0000 (20:46 +0000)]
retire amd(8)

autofs was introduced with FreeBSD 10.1 and is the supported method for
automounting filesystems.  As of r296194 the amd man page claimed that it
is deprecated.  Remove it from base now; the sysutils/am-utils port is
still available if necessary.

Discussed with: cy
Relnotes: Yes
Sponsored by: The FreeBSD Foundation

4 years agoiicbus(4): Add support for ACPI-based children enumeration
wulf [Mon, 9 Mar 2020 20:31:38 +0000 (20:31 +0000)]
iicbus(4): Add support for ACPI-based children enumeration

When iicbus is attached as child of Designware I2C controller it scans all
ACPI nodes for "I2C Serial Bus Connection Resource Descriptor" described
in section 19.6.57 of ACPI specs.
If such a descriptor is found, I2C child is added to iicbus, it's I2C
address, IRQ resource and ACPI handle are added to ivars. Existing
ACPI bus-hosted child is deleted afterwards.

The driver also installs so called "I2C address space handler" which is
disabled by default as nontested.
Set hw.iicbus.enable_acpi_space_handler loader tunable to 1 to enable it.

Reviewed by: markj
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D22901

4 years agoacpi: Export functions required by upcoming acpi_iicbus driver.
wulf [Mon, 9 Mar 2020 20:28:45 +0000 (20:28 +0000)]
acpi: Export functions required by upcoming acpi_iicbus driver.