]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
3 years agocontrib/tzdata: import tzdata 2020e
Philip Paeps [Fri, 25 Dec 2020 15:16:38 +0000 (23:16 +0800)]
contrib/tzdata: import tzdata 2020e

Changes: https://github.com/eggert/tz/blob/2020e/NEWS

MFC after:    insta-MFC

3 years agoPMC: remove now orphaned PMC for INTEL XScale processors.
Michal Meloun [Fri, 25 Dec 2020 10:41:34 +0000 (11:41 +0100)]
PMC: remove now orphaned PMC for INTEL XScale processors.
Support for XScale architecture has been deleted in FreeBSD 13.

3 years agoAdd modular fib lookup framework.
Alexander V. Chernikov [Fri, 25 Dec 2020 10:39:52 +0000 (10:39 +0000)]
Add modular fib lookup framework.

This change introduces framework that allows to dynamically
 attach or detach longest prefix match (lpm) lookup algorithms
 to speed up datapath route tables lookups.

Framework takes care of handling initial synchronisation,
 route subscription, nhop/nhop groups reference and indexing,
 dataplane attachments and fib instance algorithm setup/teardown.
Framework features automatic algorithm selection, allowing for
 picking the best matching algorithm on-the-fly based on the
 amount of routes in the routing table.

Currently framework code is guarded under FIB_ALGO config option.
An idea is to enable it by default in the next couple of weeks.

The following algorithms are provided by default:
IPv4:
* bsearch4 (lockless binary search in a special IP array), tailored for
  small-fib (<16 routes)
* radix4_lockless (lockless immutable radix, re-created on every rtable change),
  tailored for small-fib (<1000 routes)
* radix4 (base system radix backend)
* dpdk_lpm4 (DPDK DIR24-8-based lookups), lockless datastrucure, optimized
  for large-fib (D27412)
IPv6:
* radix6_lockless (lockless immutable radix, re-created on every rtable change),
  tailed for small-fib (<1000 routes)
* radix6 (base system radix backend)
* dpdk_lpm6 (DPDK DIR24-8-based lookups), lockless datastrucure, optimized
  for large-fib (D27412)

Performance changes:
Micro benchmarks (I7-7660U, single-core lookups, 2048k dst, code in D27604):
IPv4:
8 routes:
  radix4: ~20mpps
  radix4_lockless: ~24.8mpps
  bsearch4: ~69mpps
  dpdk_lpm4: ~67 mpps
700k routes:
  radix4_lockless: 3.3mpps
  dpdk_lpm4: 46mpps

IPv6:
8 routes:
  radix6_lockless: ~20mpps
  dpdk_lpm6: ~70mpps
100k routes:
  radix6_lockless: 13.9mpps
  dpdk_lpm6: 57mpps

Forwarding benchmarks:
+ 10-15% IPv4 forwarding performance (small-fib, bsearch4)
+ 25% IPv4 forwarding performance (full-view, dpdk_lpm4)
+ 20% IPv6 forwarding performance (full-view, dpdk_lpm6)

Control:
Framwork adds the following runtime sysctls:

List algos
* net.route.algo.inet.algo_list: bsearch4, radix4_lockless, radix4
* net.route.algo.inet6.algo_list: radix6_lockless, radix6, dpdk_lpm6
Debug level (7=LOG_DEBUG, per-route)
net.route.algo.debug_level: 5
Algo selection (currently only for fib 0):
net.route.algo.inet.algo: bsearch4
net.route.algo.inet6.algo: radix6_lockless

Support for manually changing algos in non-default fib will be added
soon. Some sysctl names will be changed in the near future.

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

3 years agoDon't set more_data which is never used.
Xin LI [Fri, 25 Dec 2020 02:49:12 +0000 (18:49 -0800)]
Don't set more_data which is never used.

MFC after: 2 weeks

3 years agomount_nfs(8): add a description for the new "tlscertname" option
Rick Macklem [Thu, 24 Dec 2020 22:20:06 +0000 (14:20 -0800)]
mount_nfs(8): add a description for the new "tlscertname" option

commit 665b1365fe8e added a new NFS mount option that is used to set a
non-default X.509 certificate, that can be used for nfs-over-tls NFS
mounts.
This patch adds a description for it to the man page.

Reviewed by: 0mp
Differential Revision: https://reviews.freebsd.org/D27733

3 years agoFix amd64 GENERIC-MMCCAM kernel build
Kristof Provost [Thu, 24 Dec 2020 21:30:52 +0000 (22:30 +0100)]
Fix amd64 GENERIC-MMCCAM kernel build

c4df8cbfde53c376d93f439eac3f45a7b4fc705e removed bvmconsole and
bvmdebug, but missed the bvmconsole entry in GENERIC-MMCCAM.

3 years agowmt: quiet gcc -Wparentheses
Ryan Libby [Thu, 24 Dec 2020 20:49:27 +0000 (12:49 -0800)]
wmt: quiet gcc -Wparentheses

Reviewed by: wulf
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D27767

3 years agortsock: quiet -Wunused-variable in LINT-NOIP kernels
Ryan Libby [Thu, 24 Dec 2020 20:34:18 +0000 (12:34 -0800)]
rtsock: quiet -Wunused-variable in LINT-NOIP kernels

Fixup after r368769 / d68fb8d978bbd3cf1b5db35f309aaeab30636d43.

Reported by: mjg
Reviewed by: melifaro
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D27730

3 years agoopenzfs: fix gcc in-kernel builds
Ryan Libby [Thu, 24 Dec 2020 20:34:18 +0000 (12:34 -0800)]
openzfs: fix gcc in-kernel builds

Fix gcc builds of in-kernel modules using CDDL_CFLAGS (e.g. options
ZFS).

 - Remove nonexistent include dirs for -Wmissing-include-dirs
 - Suppress -Wnested-externs, a useless warning
 - Sort and uniq warning flags while here

Reviewed by: markj
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D27684

3 years agoukbd(4): Push LED events in ioctl handler rather than in xfer callback
Vladimir Kondratyev [Thu, 24 Dec 2020 19:08:04 +0000 (22:08 +0300)]
ukbd(4): Push LED events in ioctl handler rather than in xfer callback

If LED state is set through evdev interface, than asynchronous nature
of USB transfer callback can lead to change of order of events echoed
back to userland as it causes LED events to be echoed with some lag.

Fix that with echoing of LED events synchronously in ioctl handler.

Reviewed by: hselasky
Obtained from: sysutils/iichid
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D27750

3 years agoukbd(4): Do not serialize evdev key events
Vladimir Kondratyev [Thu, 24 Dec 2020 18:56:33 +0000 (21:56 +0300)]
ukbd(4): Do not serialize evdev key events

Unlike AT keyboards, HID devices are able to send all pc105 key
states within a single report. Let evdev to transmit all key state
changes within a single report too.

Reviewed by: hselasky
Obtained from: sysutils/iichid
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D27749

3 years agommap(2): Update .Dd missed in the last commit
Guangyuan Yang [Thu, 24 Dec 2020 14:14:56 +0000 (14:14 +0000)]
mmap(2): Update .Dd missed in the last commit

PR: 252097
MFC after: 1 week

3 years agommap(2): Fix a typo
Guangyuan Yang [Thu, 24 Dec 2020 14:08:34 +0000 (14:08 +0000)]
mmap(2): Fix a typo

PR:             252097
MFC after:      1 week
Reported by:    Nick Frampton <nick.frampton@akips.com>

3 years agoAdd support for USB-C and TB3 Gen2 to if_ure(4).
Hans Petter Selasky [Thu, 24 Dec 2020 11:59:19 +0000 (12:59 +0100)]
Add support for USB-C and TB3 Gen2 to if_ure(4).

Add support for LAN found on Thinkpad USB-C and Thunderbolt Gen 2
docking stations.

Submitted by: ali.abdallah@suse.com
MFC after: 1 week
Sponsored by: Mellanox Technologies // NVIDIA Networking

3 years agoImport tzdata 2020e
Philip Paeps [Thu, 24 Dec 2020 03:19:15 +0000 (11:19 +0800)]
Import tzdata 2020e

3 years agoSync ippool.8 man page synopsis with reality and the rest of the
Cy Schubert [Thu, 24 Dec 2020 01:02:14 +0000 (17:02 -0800)]
Sync ippool.8 man page synopsis with reality and the rest of the
man page..

MFC after: 3 days

3 years agoversion bump for commit 665b1365fe8e24d618d63b0d57b0b4ad39e97824
Rick Macklem [Wed, 23 Dec 2020 22:41:47 +0000 (14:41 -0800)]
version bump for commit 665b1365fe8e24d618d63b0d57b0b4ad39e97824

The commit changed the internal API between the NFS and kernel RPC
modules.  Bump the version so that all modules get rebuilt from
sources.

3 years agowmt(4): Use sys/param.h macroses to work with bit fields
Vladimir Kondratyev [Wed, 23 Dec 2020 22:18:18 +0000 (01:18 +0300)]
wmt(4): Use sys/param.h macroses to work with bit fields

Obtained from: sysutils/iichid

3 years agowmt(4): Refactor 'Contact Count Maximum' parsing
Vladimir Kondratyev [Wed, 23 Dec 2020 22:18:18 +0000 (01:18 +0300)]
wmt(4): Refactor 'Contact Count Maximum' parsing

That is done mainly to reduce diff with upstream.

Obtained from: sysutils/iichid

3 years agowmt(4): Add support for hardware timestamp reporting
Vladimir Kondratyev [Wed, 23 Dec 2020 22:18:18 +0000 (01:18 +0300)]
wmt(4): Add support for hardware timestamp reporting

Hardware timestamp reporting is disabled by default as it produces many
extra events which are not handled by consumers like libinput.
Add hw.usb.wmt.timestamps=1 tunable to loader.conf to enable it.

Obtained from: sysutils/iichid

3 years agowmt(4): Add support for touchpads
Vladimir Kondratyev [Wed, 23 Dec 2020 22:18:18 +0000 (01:18 +0300)]
wmt(4): Add support for touchpads

Obtained from: sysutils/iichid

3 years agowmt(4): Fetch and parse HID report descriptor only one time
Vladimir Kondratyev [Wed, 23 Dec 2020 22:18:18 +0000 (01:18 +0300)]
wmt(4): Fetch and parse HID report descriptor only one time

Do it at probe stage and reuse results during attach.

Obtained from: sysutils/iichid

3 years agowmt(4): Add support for hybrid mode
Vladimir Kondratyev [Wed, 23 Dec 2020 22:18:18 +0000 (01:18 +0300)]
wmt(4): Add support for hybrid mode

In Hybrid mode, the number of contacts that can be reported in one
report is less than the maximum number of contacts that the device
supports.  For example, a device that supports a maximum of 4
concurrent physical contacts, can set up its top-level collection to
deliver a maximum of two contacts in one report.  If four contact
points are present, the device can break these up into two serial
reports that deliver two contacts each.

Obtained from: sysutils/iichid

3 years agoAdd a new "tlscertname" NFS mount option.
Rick Macklem [Mon, 21 Dec 2020 23:14:53 +0000 (15:14 -0800)]
Add a new "tlscertname" NFS mount option.

When using NFS-over-TLS, an NFS client can optionally provide an X.509
certificate to the server during the TLS handshake.  For some situations,
such as different NFS servers or different certificates being mapped
to different user credentials on the NFS server, there may be a need
for different mounts to provide different certificates.

This new mount option called "tlscertname" may be used to specify a
non-default certificate be provided.  This alernate certificate will
be stored in /etc/rpc.tlsclntd in a file with a name based on what is
provided by this mount option.

3 years ago[if_dwc] add support for multi-descriptor packets in TX path
Oleksandr Tymoshenko [Wed, 23 Dec 2020 19:43:46 +0000 (11:43 -0800)]
[if_dwc] add support for multi-descriptor packets in TX path

Original if_dwc driver used m_defrag as an implementation shortcut but on
1000Mb networks it affects performance. Implement multi-descriptor support for
TX path.

Tested on RK3399-Firefly, patch adds ~15% of network throughput.

Reviewed By: manu
Differential Revision: https://reviews.freebsd.org/D27520

3 years agogdb(4) fix x86 signal reporting
Mitchell Horne [Wed, 23 Dec 2020 19:36:17 +0000 (15:36 -0400)]
gdb(4) fix x86 signal reporting

The existing values correspond to x86 exception vector numbers, but the
trap numbers used in the kernel do not match these 1-to-1. Prefer the
definitions from x86/trap.h, as they are what actually get passed to
kdb_trap(). This is of little consequence, as gdb_cpu_signal() only
reports the trap reason (signal number) to the gdb client.

This is limited to the subset of trap values for which kdb_trap() is
reachable.

Reviewed by: kib
Discussed with: jhb
MFC after: 1 week
Sponsored by: NetApp, Inc.
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D27645

3 years agogdb(4): allow bulk write of registers
Mitchell Horne [Wed, 23 Dec 2020 18:37:05 +0000 (14:37 -0400)]
gdb(4): allow bulk write of registers

Add support for the remote 'G' packet. This is not widely used by gdb
when 'P' is supported, but is technically required by any remote gdb
stub implementation [1].

[1] https://sourceware.org/gdb/current/onlinedocs/gdb/Overview.html

Reviewed by: cem
MFC after: 1 week
Sponsored by: NetApp, Inc.
Sponsored by: Klara, Inc.
NetApp PR: 44
Differential Revision: https://reviews.freebsd.org/D27644

3 years agogdb(4): handle single register read packets
Mitchell Horne [Wed, 23 Dec 2020 18:36:08 +0000 (14:36 -0400)]
gdb(4): handle single register read packets

We support bulk reads of the register set, but not reading specific
registers via the 'p' packet. This is useful at least for the 'call'
command in gdb.

Reviewed by: cem
MFC after: 1 week
Sponsored by: NetApp, Inc.
Sponsored by: Klara, Inc.
NetApp PR: 44
Differential Revision: https://reviews.freebsd.org/D27644

3 years agoRemove bvmconsole and bvmdebug.
Robert Wing [Thu, 24 Dec 2020 01:15:33 +0000 (16:15 -0900)]
Remove bvmconsole and bvmdebug.

Now that bhyve(8) supports UART, bvmconsole and bvmdebug are no longer needed.

This also removes the '-b' and '-g' flag from bhyve(8). These two flags were
marked deprecated in r368519.

Reviewed by:    grehan, kevans
Approved by:    kevans (mentor)
Differential Revision:  https://reviews.freebsd.org/D27490

3 years agosbin/sysctl: Style fix
Ryan Moeller [Wed, 23 Dec 2020 17:45:11 +0000 (12:45 -0500)]
sbin/sysctl: Style fix

Remove parameter names from function prototype to match other
prototypes in the file.

Sponsored by: iXsystems, Inc.

3 years agosbin/sysctl: Always honor skip in sysctl_all
Ryan Moeller [Wed, 23 Dec 2020 17:42:38 +0000 (12:42 -0500)]
sbin/sysctl: Always honor skip in sysctl_all

Fix broken CTLFLAG_SKIP when present on the first child of the requested
node.

We don't need to ignore skip for the first node because in sysctl_all()
we've implicitly visited the first node already when oid is specified.
The first call to show_var() in here is after we have iterated to the
next node. When the command line specifically requests a non-node sysctl
we go straight into show_var() without calling sysctl_all().

Reported by: jhb
Reviewed by: jhb
Sponsored by: iXsystems, Inc.
Differential Revision: https://reviews.freebsd.org/D27674

3 years agoImprove input validation for parameters in ASCONF and ASCONF-ACK chunks
Michael Tuexen [Wed, 23 Dec 2020 17:03:47 +0000 (18:03 +0100)]
Improve input validation for parameters in ASCONF and ASCONF-ACK chunks

Thanks to Tolya Korniltsev for drawing my attention to this part of the
code by reporting an issue for the userland stack.

3 years agoUPDATING: Announce git transition
Warner Losh [Wed, 23 Dec 2020 16:40:45 +0000 (09:40 -0700)]
UPDATING: Announce git transition

Add an entry for the transition to git.

3 years agoqatfw: Fix firmware autoloading for qat_c2xxx devices
Mark Johnston [Wed, 23 Dec 2020 16:31:47 +0000 (11:31 -0500)]
qatfw: Fix firmware autoloading for qat_c2xxx devices

r368193 was suppsed to rename the MOF firmware image, but the
qat_c2xxxfw makefile defined the two images in the wrong order so the
MMP image was renamed instead.

MFC after: 3 days
Sponsored by: Rubicon Communications, LLC (Netgate)

3 years agortsock: Avoid copying uninitialized padding bytes
Mark Johnston [Wed, 23 Dec 2020 16:15:11 +0000 (11:15 -0500)]
rtsock: Avoid copying uninitialized padding bytes

When copying sockaddrs out to userspace, we pad them to a multiple of
the platform alignment (sizeof(long)).  However, some sockaddr sizes,
such as struct sockaddr_dl, are not an integer multiple of the
alignment, so we may end up copying out uninitialized bytes.

Fix this by always bouncing through a pre-zeroed sockaddr_storage.

Reported by: KASAN
Reviewed by: melifaro
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D27729

3 years agomd: Fix a read-after-free in BIO_GETATTR handling
Mark Johnston [Wed, 23 Dec 2020 16:13:31 +0000 (11:13 -0500)]
md: Fix a read-after-free in BIO_GETATTR handling

g_handleattr_int() consumes the bio if the attribute matches, so when we
check bp->bio_cmd bp may have been freed.

Move GETATTR handling to a separate function to avoid the problem.  We
do not need to set bio_completed for such bios, g_handleattr_int() will
handle it.  Also remove the setting of bio_resid before the
devstat_end_transaction_bio() call.  All of the md(4) bio handlers set
bio_resid already.

Reported by: KASAN
Reviewed by: kib
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D27724

3 years agoffs: Avoid out-of-bounds accesses in the fs_active bitmap
Mark Johnston [Wed, 23 Dec 2020 16:13:00 +0000 (11:13 -0500)]
ffs: Avoid out-of-bounds accesses in the fs_active bitmap

We use a bitmap to track which cylinder groups have changed between
snapshot creation and filesystem suspension.  The "legs" of the bitmap
are four bytes wide (see ACTIVESET()) so we must round up the allocation
size to a multiple of four bytes.

I believe this bug is harmless since UMA/kmem_* will both pad the
allocation and zero the full allocation.  Note that malloc() does inline
zeroing when the allocation size is known at compile-time.

Reported by: pho (using KASAN)
Reviewed by: kib, mckusick
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D27731

3 years agoAIO: remove the kaiocb->bio linkage
Alan Somers [Mon, 21 Dec 2020 21:48:29 +0000 (21:48 +0000)]
AIO: remove the kaiocb->bio linkage

Vectored aio will require each aiocb to be associated with multiple
bios, so we can't store a link to the latter from the former.  But we
don't really need to.  aio_biowakeup already knows the bio it's using,
and the other fields can be stored within the bio and/or buf itself.

Also, remove the unused kaiocb.backend2 field.

Reviewed By: kib
Differential Revision: https://reviews.freebsd.org/D27682

3 years agoMove the literal pool to the end of asm functions
Andrew Turner [Wed, 23 Dec 2020 13:42:09 +0000 (13:42 +0000)]
Move the literal pool to the end of asm functions

This keeps the data at the end of a function, near to where it's used.
Sponsored by: Innovate UK

3 years agoMark all arm64 locore functions with ENTRY/LENTRY
Andrew Turner [Wed, 23 Dec 2020 13:24:52 +0000 (13:24 +0000)]
Mark all arm64 locore functions with ENTRY/LENTRY

It is useful to know where these are within the code, and will be
needed by later changes.

Sponsored by: Innovate UK

3 years agoAdd LENTRY and LEND to arm64
Andrew Turner [Wed, 23 Dec 2020 13:17:56 +0000 (13:17 +0000)]
Add LENTRY and LEND to arm64

These allow us to mark local asm functions as a function

Sponsored by: Innovate UK

3 years agomake the git commit message template more compact
Ed Maste [Wed, 23 Dec 2020 13:58:17 +0000 (08:58 -0500)]
make the git commit message template more compact

git's default commit message includes the list of staged, unstaged, and
untracked files; adding our metadata tags and then their descriptions
made for a very long template.

Move the descriptions to the metadata lines themselves.

Reviewed by: bcr
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D27664

3 years agoUse the new PAGE_SIZE_4K in the GICv3 driver
Andrew Turner [Wed, 23 Dec 2020 09:49:53 +0000 (09:49 +0000)]
Use the new PAGE_SIZE_4K in the GICv3 driver

Stop assuming PAGE_SIZE is 4k in the GICv3 ITS driver. We could use
a 16k or 64k page in the future.

Sponsored by: Innovate UK

3 years agoRename the arm64 4k PAGE_* macros
Andrew Turner [Wed, 23 Dec 2020 09:46:13 +0000 (09:46 +0000)]
Rename the arm64 4k PAGE_* macros

These now have a _4K suffix to allow us to be explicit when we mean
to use a 4k page rather than assuming PAGE_SIZE is 4k.

Sponsored by: Innovate UK

3 years agoStop redefining PAGE_SHIFT in virtio-mmio
Andrew Turner [Wed, 23 Dec 2020 10:59:38 +0000 (10:59 +0000)]
Stop redefining PAGE_SHIFT in virtio-mmio

This is alreaady defined by each architecture as that is the only place
we can know what the correct page shift should be.

Sponsored by: Innovate UK

3 years agoMore the arm64 early page tables and stack to .bss
Andrew Turner [Wed, 23 Dec 2020 08:05:21 +0000 (08:05 +0000)]
More the arm64 early page tables and stack to .bss

This removes 806k from the kernel ELF file that is only needed while
the kernel is running, not in the static file.

Sponsored by: Innovate UK

3 years agotools/tools/locale: skip control character widths
Yuri Pankov [Wed, 23 Dec 2020 12:49:25 +0000 (15:49 +0300)]
tools/tools/locale: skip control character widths

Do not explicitly encode control characters widths as 0
allowing wcwidth() to return the proper implicit value for
non-printable characters (-1).

Reported by: naddy

3 years agopf: Use counter(9) for pf_state byte/packet tracking
Kristof Provost [Wed, 23 Dec 2020 08:37:59 +0000 (09:37 +0100)]
pf: Use counter(9) for pf_state byte/packet tracking

This improves cache behaviour by not writing to the same variable from
multiple cores simultaneously.

pf_state is only used in the kernel, so can be safely modified.

Reviewed by: Lutz Donnerhacke, philip
MFC after: 1 week
Sponsed by: Orange Business Services
Differential Revision: https://reviews.freebsd.org/D27661

3 years agopf tests: Verify (tcp) checksum modification on unaligned options
Kristof Provost [Sat, 19 Dec 2020 15:06:03 +0000 (16:06 +0100)]
pf tests: Verify (tcp) checksum modification on unaligned options

It turns out pf incorrectly updates the TCP checksum if the TCP option
we're modifying is not 2-byte algined with respect to the start of the
packet.

Create a TCP packet with such an option and throw it through a scrub
rule, which will update timestamps and modify the packet.

PR: 240416
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D27688

3 years agopf tests: Sort Makefile entries
Kristof Provost [Sat, 19 Dec 2020 14:27:33 +0000 (15:27 +0100)]
pf tests: Sort Makefile entries

MFC after: 1 week

3 years agopf: Fix unaligned checksum updates
Kristof Provost [Sun, 20 Dec 2020 20:06:32 +0000 (21:06 +0100)]
pf: Fix unaligned checksum updates

The algorithm we use to update checksums only works correctly if the
updated data is aligned on 16-bit boundaries (relative to the start of
the packet).

Import the OpenBSD fix for this issue.

PR: 240416
Obtained from: OpenBSD
MFC after: 1 week
Reviewed by: tuexen (previous version)
Differential Revision: https://reviews.freebsd.org/D27696

3 years agoNo need to stop XHCI endpoints in disabled state.
Hans Petter Selasky [Wed, 23 Dec 2020 10:54:42 +0000 (11:54 +0100)]
No need to stop XHCI endpoints in disabled state.

Some AMD XHCI implementations apparently assert a permanent
internal failure if this happens.

Submitted by: ali.abdallah@suse.com
PR: 251503
MFC after: 1 week
Sponsored by: Mellanox Technologies // NVIDIA Networking

3 years agoRemove not needed variable initialization.
Hans Petter Selasky [Wed, 23 Dec 2020 10:37:44 +0000 (11:37 +0100)]
Remove not needed variable initialization.
And switch from int to bool while at it.

Reviewed by: melifaro@
Differential Revision: https://reviews.freebsd.org/D27725
MFC after: 1 week
Sponsored by: Mellanox Technologies // NVIDIA Networking

3 years agox86: stop punishing VMs with low priority for TSC timecounter
Konstantin Belousov [Mon, 21 Dec 2020 17:02:31 +0000 (19:02 +0200)]
x86: stop punishing VMs with low priority for TSC timecounter

I suspect that virtualization techniques improved from the time when we
have to effectively disable TSC use in VM.  For instance, it was reported
(complained) in https://github.com/JuliaLang/julia/issues/38877 that
FreeBSD is groundlessly slow on AWS with some loads.

Remove the check and start watching for complaints.

Reviewed by: emaste, grehan
Discussed with: cperciva
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D27629

3 years agovxlan: stop checking CSUM_ENCAP_VXLAN when converting inner CSUM flags into normal...
Konstantin Belousov [Mon, 21 Dec 2020 16:59:26 +0000 (18:59 +0200)]
vxlan: stop checking CSUM_ENCAP_VXLAN when converting inner CSUM flags into normal, for decapsulation.

The packet, if processed at this point, was already parsed to be UDP
directed to a vxlan port.

Connect-X 4+ does not provide easy method to infer which parser
processed the packet, so driver cannot set the flag without a lot of
efforts which are only to satisfy the formal requirements.

Reviewed by: bryanv, np
Sponsored by: Mellanox Technologies/NVidia Networking
Differential revision: https://reviews.freebsd.org/D27449
MFC after: 1 week

3 years agopsm(4): Always initialize Synaptics touchpad report range with defaults
Vladimir Kondratyev [Tue, 22 Dec 2020 20:44:42 +0000 (23:44 +0300)]
psm(4): Always initialize Synaptics touchpad report range with defaults

Otherwise libinput refuses to recoginize some Synaptics touchpads with
"kernel bug: device has min == max on ABS_X" message in Xorg.log.

PR: 251149
Reported-by: Jens Grassel <freebsd-ports@jan0sch.de>
Tested-by: Jens Grassel <freebsd-ports@jan0sch.de>
MFC-after: 2 weeks

3 years agoacpi_wmi(4): Allow attachment to ACPI node if EC is not found
Vladimir Kondratyev [Mon, 21 Dec 2020 15:48:50 +0000 (18:48 +0300)]
acpi_wmi(4): Allow attachment to ACPI node if EC is not found

Conducted tests showed that Embedded Controller is not mandatory for
WMI extensions to work.

Reported-by: yuripv
Reviewed-by: avg
MFC-after: 2 weeks
Differential-Revision: https://reviews.freebsd.org/D27653

3 years agocyapa(4): Add support for evdev protocol
Vladimir Kondratyev [Mon, 21 Dec 2020 15:44:28 +0000 (18:44 +0300)]
cyapa(4): Add support for evdev protocol

Tested-by: Matthias Apitz <guru@unixarea.de>
MFC-after: 2 weeks

3 years agocyapa(4): Make button detection matching ChromeOS driver
Vladimir Kondratyev [Mon, 21 Dec 2020 15:24:09 +0000 (18:24 +0300)]
cyapa(4): Make button detection matching ChromeOS driver

Tested-by: Matthias Apitz <guru@unixarea.de>
MFC-after: 2 weeks

3 years agoImprove address generation in the early arm64 boot
Andrew Turner [Wed, 23 Dec 2020 07:24:07 +0000 (07:24 +0000)]
Improve address generation in the early arm64 boot

The adr instruction allows for an address of +-1M from the instruction.
If we replace these with an adrp and an add instruction we can generate
an address +-4G. The adrp will get an address of the 4k page the label
is within, and the add uses the :lo12: prefix to add just the low bits
to this address.

This will allow us to move things around with fewer issues than if we
needed to keep them within the +-1MB range.

Sponsored by: Innovate UK

3 years agocache: fix up cache_hold_vnode comment
Mateusz Guzik [Wed, 23 Dec 2020 07:23:08 +0000 (07:23 +0000)]
cache: fix up cache_hold_vnode comment

3 years agonetgraph: Fix ng_ether's shutdown handing
Mark Johnston [Wed, 23 Dec 2020 05:11:16 +0000 (00:11 -0500)]
netgraph: Fix ng_ether's shutdown handing

When tearing down a VNET, netgraph sends shutdown messages to all of the
nodes before detaching interfaces (SI_SUB_NETGRAPH comes before
SI_SUB_INIT_IF in teardown order).  ng_ether nodes handle this by
destroying themselves without detaching from the parent ifnet.  Then,
when ifnets go away they detach their ng_ether nodes again, triggering a
use-after-free.

Handle this by modifying ng_ether_shutdown() to detach from the ifnet.
If the shutdown was triggered by an ifnet being destroyed, we will clear
priv->ifp in the ng_ether detach callback, so priv->ifp may be NULL.

Also get rid of the printf in vnet_netgraph_uninit().  It can be
triggered trivially by ng_ether since ng_ether_shutdown() persists the
node unless NG_REALLY_DIE is set.

PR: 233622
Reviewed by: afedorov, kp, Lutz Donnerhacke
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D27662

3 years agoRemove unused includes.
Xin LI [Wed, 23 Dec 2020 05:04:36 +0000 (21:04 -0800)]
Remove unused includes.

3 years agonewvers.sh: fix sense of git dirty check
Ed Maste [Wed, 23 Dec 2020 04:31:15 +0000 (23:31 -0500)]
newvers.sh: fix sense of git dirty check

Previously we reported -dirty for an unmodified tree, and no -dirty if
there were changes.

PR: 252028
Reported by: John Kennedy

3 years agoMark the repository has been converted to Git
Li-Wen Hsu [Wed, 23 Dec 2020 04:27:27 +0000 (12:27 +0800)]
Mark the repository has been converted to Git

This is the first Git commit to src.

Sponsored by: The FreeBSD Foundation

3 years agoMark the repository as being converted to Git.
Li-Wen Hsu [Sun, 20 Dec 2020 02:59:44 +0000 (02:59 +0000)]
Mark the repository as being converted to Git.

This is the last Subversion commit to src.

Sponsored by: The FreeBSD Foundation

3 years agoFilter TCP connections to SO_REUSEPORT_LB listen sockets by NUMA domain
Andrew Gallatin [Sat, 19 Dec 2020 22:04:46 +0000 (22:04 +0000)]
Filter TCP connections to SO_REUSEPORT_LB listen sockets by NUMA domain

In order to efficiently serve web traffic on a NUMA
machine, one must avoid as many NUMA domain crossings as
possible. With SO_REUSEPORT_LB, a number of workers can share a
listen socket. However, even if a worker sets affinity to a core
or set of cores on a NUMA domain, it will receive connections
associated with all NUMA domains in the system. This will lead to
cross-domain traffic when the server writes to the socket or
calls sendfile(), and memory is allocated on the server's local
NUMA node, but transmitted on the NUMA node associated with the
TCP connection. Similarly, when the server reads from the socket,
he will likely be reading memory allocated on the NUMA domain
associated with the TCP connection.

This change provides a new socket ioctl, TCP_REUSPORT_LB_NUMA. A
server can now tell the kernel to filter traffic so that only
incoming connections associated with the desired NUMA domain are
given to the server. (Of course, in the case where there are no
servers sharing the listen socket on some domain, then as a
fallback, traffic will be hashed as normal to all servers sharing
the listen socket regardless of domain). This allows a server to
deal only with traffic that is local to its NUMA domain, and
avoids cross-domain traffic in most cases.

This patch, and a corresponding small patch to nginx to use
TCP_REUSPORT_LB_NUMA allows us to serve 190Gb/s of kTLS encrypted
https media content from dual-socket Xeons with only 13% (as
measured by pcm.x) cross domain traffic on the memory controller.

Reviewed by: jhb, bz (earlier version), bcr (man page)
Tested by: gonzo
Sponsored by: Netfix
Differential Revision: https://reviews.freebsd.org/D21636

3 years agoOptionally bind ktls threads to NUMA domains
Andrew Gallatin [Sat, 19 Dec 2020 21:46:09 +0000 (21:46 +0000)]
Optionally bind ktls threads to NUMA domains

When ktls_bind_thread is 2, we pick a ktls worker thread that is
bound to the same domain as the TCP connection associated with
the socket. We use roughly the same code as netinet/tcp_hpts.c to
do this. This allows crypto to run on the same domain as the TCP
connection is associated with. Assuming TCP_REUSPORT_LB_NUMA
(D21636) is in place & in use, this ensures that the crypto source
and destination buffers are local to the same NUMA domain as we're
running crypto on.

This change (when TCP_REUSPORT_LB_NUMA, D21636, is used) reduces
cross-domain traffic from over 37% down to about 13% as measured
by pcm.x on a dual-socket Xeon using nginx and a Netflix workload.

Reviewed by: jhb
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D21648

3 years agolibc: Fix most issues reported by mandoc
Gordon Bergling [Sat, 19 Dec 2020 14:54:28 +0000 (14:54 +0000)]
libc: Fix most issues reported by mandoc

- varios "new sentence, new line" warnings
- varios "sections out of conventional order" warnings
- varios "unusual Xr order" warnings
- varios "missing section argument" warnings
- varios "no blank before trailing delimiter" warnings
- varios "normalizing date format" warnings

MFC after: 1 month

3 years agotrim(8): Fix a few issues reported by mandoc
Gordon Bergling [Sat, 19 Dec 2020 13:56:19 +0000 (13:56 +0000)]
trim(8): Fix a few issues reported by mandoc

- new sentence, new line
- unusual Xr order: ioctl(2) after da(4)
- unusual Xr order: sysexits(3) after nda(4)

MFC after: 1 week

3 years agozonectl(8): Fix a few issues reported by mandoc
Gordon Bergling [Sat, 19 Dec 2020 13:51:46 +0000 (13:51 +0000)]
zonectl(8): Fix a few issues reported by mandoc

- Add missing quotation mark for a comment above the .Dd
- inserting missing end of block: Sh breaks Bd
- skipping paragraph macro: Pp before Bl
- skipping paragraph macro: Pp before Bd
- empty block: Bd

MFC after: 1 week

3 years agonfsv4(4): Fix a few issues reported by mandoc
Gordon Bergling [Sat, 19 Dec 2020 13:45:39 +0000 (13:45 +0000)]
nfsv4(4): Fix a few issues reported by mandoc

- new sentence, new line
- function name without markup: rtalloc()
- function name without markup: VOP_RECLAIM()

MFC after: 1 week

3 years agobluetooth: Fix a mandoc related issues
Gordon Bergling [Sat, 19 Dec 2020 13:36:59 +0000 (13:36 +0000)]
bluetooth: Fix a mandoc related issues

- new sentence, new line
- sections out of conventional order: Sh FILES
- unusual Xr order: bthost(1) after bthidd(8)
- no blank before trailing delimiter
- whitespace at end of input line
- sections out of conventional order: Sh EXIT STATUS

MFC after: 1 week

3 years agompsutil(8): Remove trailing whitespace
Gordon Bergling [Sat, 19 Dec 2020 13:23:26 +0000 (13:23 +0000)]
mpsutil(8): Remove trailing whitespace

MFC after: 1 week

3 years agobhyvectl(8): Normalize the man page date
Gordon Bergling [Sat, 19 Dec 2020 13:21:40 +0000 (13:21 +0000)]
bhyvectl(8): Normalize the man page date

MFC after: 1 week

3 years agocamdd(8): Fix the man page date
Gordon Bergling [Sat, 19 Dec 2020 13:17:25 +0000 (13:17 +0000)]
camdd(8): Fix the man page date

The comment before the .Dd macro was missing a quotation mark, so that
the date of the man page was always today.

MFC after: 3 days

3 years agoconfig: Fix a few mandoc related errors
Gordon Bergling [Sat, 19 Dec 2020 13:11:44 +0000 (13:11 +0000)]
config: Fix a few mandoc related errors

- new sentence, new line
- no blank before trailing delimiter

MFC after: 1 week

3 years agodevctl(8): Correct "sections out of conventional order" error
Gordon Bergling [Sat, 19 Dec 2020 13:05:54 +0000 (13:05 +0000)]
devctl(8): Correct "sections out of conventional order" error

MFC after: 1 week

3 years agopatch(1): Fix a few mandoc related issues
Gordon Bergling [Sat, 19 Dec 2020 13:00:17 +0000 (13:00 +0000)]
patch(1): Fix a few mandoc related issues

- no blank before trailing delimiter

MFC after: 1 week

3 years agouname(1): Fix a typo in the man page date
Gordon Bergling [Sat, 19 Dec 2020 12:55:27 +0000 (12:55 +0000)]
uname(1): Fix a typo in the man page date

MFC after: 3 days

3 years agoident(1): Normalizing date format
Gordon Bergling [Sat, 19 Dec 2020 12:54:00 +0000 (12:54 +0000)]
ident(1): Normalizing date format

MFC after: 3 days

3 years agoipfw(8): Fix a few mandoc related issues
Gordon Bergling [Sat, 19 Dec 2020 12:47:40 +0000 (12:47 +0000)]
ipfw(8): Fix a few mandoc related issues

- no blank before trailing delimiter
- missing section argument: Xr inet_pton
- skipping paragraph macro: Pp before Ss
- unusual Xr order: syslogd after sysrc
- tab in filled text

There were a few multiline NAT examples which used the .Dl macro with
tabs. I converted them to .Bd, which is a more suitable macro for that case.

MFC after: 1 week

3 years agoping(8): Fix a mandoc related issue
Gordon Bergling [Sat, 19 Dec 2020 11:57:47 +0000 (11:57 +0000)]
ping(8): Fix a mandoc related issue

- unusual Xr punctuation: none before traceroute6(8)

3 years agonvmecontrol(8): Fix a few mandoc related issues and add a SEE ALSO section
Gordon Bergling [Sat, 19 Dec 2020 11:47:38 +0000 (11:47 +0000)]
nvmecontrol(8): Fix a few mandoc related issues and add a SEE ALSO section

- inserting missing end of block: Ss breaks Bl
- skipping paragraph macro: Pp before Ss
- referenced manual not found: Xr nvme 4 (2 times)
- unknown standard specifier: St The

The macro .St can only be used for standards known by mdoc(7). So add a
SEE ALSO section and add a reference to the NVM Express Base Specification.

MFC after: 2 weeks

3 years agoEnsure a minimum packet length before creating a mbuf in if_ure.
Hans Petter Selasky [Sat, 19 Dec 2020 11:03:54 +0000 (11:03 +0000)]
Ensure a minimum packet length before creating a mbuf in if_ure.

Sponsored by: Mellanox Technologies // NVIDIA Networking

3 years agodevd.conf(5): Fix a mandoc related issue
Gordon Bergling [Sat, 19 Dec 2020 11:03:04 +0000 (11:03 +0000)]
devd.conf(5): Fix a mandoc related issue

- sections out of conventional order: Sh SEE ALSO

MFC after: 1 week

3 years agoMove SYSCTL_ADD_PROC() to unlocked context in if_ure to avoid lock order reversal.
Hans Petter Selasky [Sat, 19 Dec 2020 11:00:11 +0000 (11:00 +0000)]
Move SYSCTL_ADD_PROC() to unlocked context in if_ure to avoid lock order reversal.

MFC after: 1 week
Reported by: Mark Millard <marklmi@yahoo.com>
Sponsored by: Mellanox Technologies // NVIDIA Networking

3 years agosysctl(9): Fix a few mandoc related issues
Gordon Bergling [Sat, 19 Dec 2020 10:31:25 +0000 (10:31 +0000)]
sysctl(9): Fix a few mandoc related issues

- missing comma before name: Nm SYSCTL_UQUAD
- bad NAME section content: text

MFC after: 1 week

3 years agoofw_bus_status_okay(9): Fix a few mandoc related issues
Gordon Bergling [Sat, 19 Dec 2020 10:26:40 +0000 (10:26 +0000)]
ofw_bus_status_okay(9): Fix a few mandoc related issues

- missing comma before name: Nm ofw_bus_status_okay
- missing comma before name: Nm ofw_bus_node_status_okay
- skipping paragraph macro: Pp after Sh

MFC after: 1 week

3 years agoofw_bus_is_compatible(9): Fix a few mandoc related issues
Gordon Bergling [Sat, 19 Dec 2020 10:24:36 +0000 (10:24 +0000)]
ofw_bus_is_compatible(9): Fix a few mandoc related issues

- missing comma before name: Nm ofw_bus_is_compatible_strict
- missing comma before name: Nm ofw_bus_node_is_compatible
- missing comma before name: Nm ofw_bus_search_compatible
- skipping paragraph macro: Pp after Sh

MFC after: 1 week

3 years agofail(9): Fix a few mandoc related issues
Gordon Bergling [Sat, 19 Dec 2020 10:20:22 +0000 (10:20 +0000)]
fail(9): Fix a few mandoc related issues

- function name without markup: return()
- function name without markup: print()

MFC after: 1 week

3 years agodriver(9): Fix a mandoc related issue
Gordon Bergling [Sat, 19 Dec 2020 10:18:21 +0000 (10:18 +0000)]
driver(9): Fix a mandoc related issue

- sections out of conventional order: Sh SEE ALSO

MFC after: 1 week

3 years agobhnd_erom(9): Fix a few mandoc related issues
Gordon Bergling [Sat, 19 Dec 2020 10:15:58 +0000 (10:15 +0000)]
bhnd_erom(9): Fix a few mandoc related issues

- skipping paragraph macro: Pp before Bl
- skipping paragraph macro: Pp after Ss
- skipping paragraph macro: Pp at the end of Ss
- unusual Xr punctuation: none before bhnd_driver_get_erom_class(9)
- unusual Xr punctuation: none before bus_space(9)

MFC after: 1 week

3 years agobhnd(9): Fix a few mandoc related issues
Gordon Bergling [Sat, 19 Dec 2020 10:11:37 +0000 (10:11 +0000)]
bhnd(9): Fix a few mandoc related issues

- skipping paragraph macro: Pp before Bl
- skipping paragraph macro: Pp at the end of Ss
- missing section argument: Xr device_set_desc
- unusual Xr punctuation: none before bhnd_erom(9)

MFC after: 1 week

3 years agodisk(9): Fix a few mandoc related errors
Gordon Bergling [Sat, 19 Dec 2020 09:55:02 +0000 (09:55 +0000)]
disk(9): Fix a few mandoc related errors

- function name without markup: g_io_deliver()
- function name without markup: disk_gone()
- sections out of conventional order: Sh SEE ALSO
- referenced manual not found: Xr MAKE_DEV 9

Actually the man page of MAKE_DEV has never existed.

MFC after: 3 days

3 years agoaccept_filter(9): Fix a mandoc related error
Gordon Bergling [Sat, 19 Dec 2020 09:40:05 +0000 (09:40 +0000)]
accept_filter(9): Fix a mandoc related error

- no blank before trailing delimiter

3 years agortld-elf: link udivmoddi4 from compiler_rt
Ryan Libby [Sat, 19 Dec 2020 08:38:31 +0000 (08:38 +0000)]
rtld-elf: link udivmoddi4 from compiler_rt

This fixes the gcc9 build of rtld-elf32 on amd64, which needed an
implementation of udivmoddi4.

rtld-elf uses certain functions normally found in libc, and so it
includes certain files from libc in its own build.  It has two
mechanisms to include files from libc: one that rebuilds source files in
the rtld-elf environment, and one that extracts object files from a
purpose-built no-SSP PIC archive.

In addition to libc functions, rtld-elf may need to link functions
normally found in libcompiler_rt (formerly libgcc).  Now, add an ability
to rebuild libcompiler_rt source files in the rtld-elf environment.  We
don't yet have a need for an object file extraction mechanism.

libcompiler_rt could also supply udivdi3 and umoddi3, but leave them
alone for now.

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

3 years agortld-libc: fix incremental build
Ryan Libby [Sat, 19 Dec 2020 08:38:27 +0000 (08:38 +0000)]
rtld-libc: fix incremental build

ar cr is an update of an archive, not a creation of a new one.  During
incremental builds (e.g. with meta mode) the archive was not getting
cleaned, and so could retain now-deleted objects from previous builds.
Now, delete the archive before creating/updating it.

Reviewed by: arichardson, bdrewery, kib
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D27663

3 years agokern: cpuset: allow jails to modify child jails' roots
Kyle Evans [Sat, 19 Dec 2020 03:30:06 +0000 (03:30 +0000)]
kern: cpuset: allow jails to modify child jails' roots

This partially lifts a restriction imposed by r191639 ("Prevent a superuser
inside a jail from modifying the dedicated root cpuset of that jail") that's
perhaps beneficial after r192895 ("Add hierarchical jails."). Jails still
cannot modify their own cpuset, but they can modify child jails' roots to
further restrict them or widen them back to the modifying jails' own mask.

As a side effect of this, the system root may once again widen the mask of
jails as long as they're still using a subset of the parent jails' mask.
This was previously prevented by the fact that cpuset_getroot of a root set
will return that root, rather than the root's parent -- cpuset_modify uses
cpuset_getroot since it was introduced in r327895, previously it was just
validating against set->cs_parent which allowed the system root to widen
jail masks.

Reviewed by: jamie
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D27352

3 years agologin(1): when exporting variables check the result of setenv(3)
Pedro F. Giffuni [Sat, 19 Dec 2020 03:07:38 +0000 (03:07 +0000)]
login(1): when exporting variables check the result of setenv(3)

When exporting a variable we correctly check all the preconditions that
could make setenv(3) fail. Checking the setenv(3) return value seems
redundant, but given that login(1) is critical, it doesn't hurt to have
a post-check.

This change is based on the "Principles of Secure Coding" course by
Matthew Bishop, PhD., which specifically discusses this code in FreeBSD.

(This change redoes r368776 due to a silly mistake)