]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
4 years agoAvoid using non-portable dd conv=osync option
Alex Richardson [Mon, 11 May 2020 08:40:33 +0000 (08:40 +0000)]
Avoid using non-portable dd conv=osync option

The same thing can be achieved using the bs=$SIZE and conv=sync options.
Unlike conv=osync, conv=sync is support on both Linux and macOS.

Reviewed By: imp, jhb (earlier version)
Obtained from: CheriBSD
Differential Revision: https://reviews.freebsd.org/D24788

4 years agoRemove unused rnh_close callback from rtable & cleanup depends.
Alexander V. Chernikov [Mon, 11 May 2020 06:09:18 +0000 (06:09 +0000)]
Remove unused rnh_close callback from rtable & cleanup depends.

rnh_close callbackes was used by the in[6]_clsroute() handlers,
 doing cleanup in the route cloning code. Route cloning was eliminated
 somewhere around r186119. Last callback user was eliminated in r186215,
 11 years ago.

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

4 years ago[ar9300] Disable unconditionally reducing transmit power in the case of FCC.
Adrian Chadd [Mon, 11 May 2020 05:53:12 +0000 (05:53 +0000)]
[ar9300] Disable unconditionally reducing transmit power in the case of FCC.

Ok, yeah, the commit title is a bit misleading.

This has to do with CDD (cyclic delay diversity) - how this and later
wifi hardware transmits lower rates over more antennas.  Eg, if you're
transmitting legacy 11abg rates on 2 or 3 antennas, you COULD just
send them all at the same time or you could delay each by tens/hundreds
of nanoseconds to try and get some better diversity characteristics.

However, this has a fun side effect - the antenna pattern is no longer
a bunch of interacting dipoles, but are a bunch of interacting dipoles
plus a bunch of changing phases.  And it's frequency dependent - 50-200nS
is not exactly the same fraction of a wavelength across all of 2GHz or 5GHz!

Thus the power spectral density and maximum directional gain that you're
effectively getting is not .. well, as flat as it once was.

For more information, look up FCC/OET 13TR1003 in the FCC technical report
database.  It has pretty graphics and everything.

Anyway, the problem lies thusly - the CDD code just subtracts another 3dB
or 5dB for the lower rates based on transmit antenna configuration.
However, it's not done based on operating configuration and it doesn't
take into account how far from any regulatory limits the hardware is at.
It also doesn't let us do things like transmit legacy rates and frames
on a single antenna without losing up to 5dB when we absolutely don't
need to in that case (there's no CDD used when one antenna is used!)

This shows up as the hardware behaving even worse for longer distance links
at 20MHz because, well, those are the exact rates losing a bunch more
transmit power.

* For lower power NICs (ie the majority of what is out there!) it's highly
  unlikely we're going to hit anywhere near the PSD limits.
* It's doing it based on the existing limits from the CTL table (conformance
  testing limits) - this isn't the regulatory max!  It's what the NIC is
  allowed to put out in each frequency and rate configuration!  So things like
  band edges, power amplifier behaviour and maximum current draw apply here.
  Blindly subtracting 3 to 5dB from /this/ value is /very/ conservative..
* /and/ ath9k just plainly doesn't do any of this at all.

So, for now disable it and get the TX power back, thus matching what ath9k
in Linux is doing.  If/once I get some more cycles I'll look at making it
a bit more adaptive and really only kick in if we're a few dB away from
hard regulatory limits.

Tested:

* AR9344 (2GHz + SoC, 2x2 configuration) - AP and STA modes
* QCA9580 (5GHz 2x2 and 3x3 configurations) - AP and STA modes

4 years agopowerpc64: Implement Radix MMU for POWER9 CPUs
Justin Hibbits [Mon, 11 May 2020 02:33:37 +0000 (02:33 +0000)]
powerpc64: Implement Radix MMU for POWER9 CPUs

Summary:
POWER9 supports two MMU formats: traditional hashed page tables, and Radix
page tables, similar to what's presesnt on most other architectures.  The
PowerISA also specifies a process table -- a table of page table pointers--
which on the POWER9 is only available with the Radix MMU, so we can take
advantage of it with the Radix MMU driver.

Written by Matt Macy.

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

4 years agoEnsure that the SCTP iterator runs with an stcb and inp, which belong to
Michael Tuexen [Sun, 10 May 2020 22:54:30 +0000 (22:54 +0000)]
Ensure that the SCTP iterator runs with an stcb and inp, which belong to
each other.

Reported by: syzbot+82d39d14f2f765e38db0@syzkaller.appspotmail.com
MFC after: 3 days

4 years agobuildworld: add back in missing semicolon
Kyle Evans [Sun, 10 May 2020 20:28:38 +0000 (20:28 +0000)]
buildworld: add back in missing semicolon

if foo; then blah else blah; fi has a drastically different meaning than
if foo; then blah; else blah; fi. Fix it.

Reported by: 0mp
X-MFC-With: r360833

4 years agopowerpc: Add a CPU-custom machine check handler
Justin Hibbits [Sun, 10 May 2020 19:00:57 +0000 (19:00 +0000)]
powerpc: Add a CPU-custom machine check handler

Summary:
Some machine checks are process-recoverable, others are not.  Let a
CPU-specific handler decide what to do.

This works around a machine check error hit while building www/firefox
and mail/thunderbird, which would otherwise cause the build to fail.

More work is needed to handle all possible machine check conditions, but
this is sufficient to unblock some ports building.

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

4 years agoRemove trailing whitespace.
Michael Tuexen [Sun, 10 May 2020 17:43:42 +0000 (17:43 +0000)]
Remove trailing whitespace.

4 years agoEnsure that we have a path when starting the T3 RXT timer.
Michael Tuexen [Sun, 10 May 2020 17:19:19 +0000 (17:19 +0000)]
Ensure that we have a path when starting the T3 RXT timer.

Reported by: syzbot+f2321629047f89486fa3@syzkaller.appspotmail.com
MFC after: 3 days

4 years agoAdd pkgbase METALOG parse/check tool
Ed Maste [Sun, 10 May 2020 16:11:19 +0000 (16:11 +0000)]
Add pkgbase METALOG parse/check tool

`metalog.lua` is a script that reads METALOG file created by pkgbase
(make packages) and generates reports about the installed system
and issues.

This was developed as part of Yang's W2020 University of Waterloo co-
operative education term with the FreeBSD Foundation.  kevans provided
some initial review; we will iterate on it in the tree.

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

4 years agoqnlx: Do not redifines types.
Emmanuel Vadot [Sun, 10 May 2020 14:09:30 +0000 (14:09 +0000)]
qnlx: Do not redifines types.

r360870 added linux/slab.h into liunx/bitmap.h and this include linux/types.h
The qlnx driver is redefining some of those types so remove them and add an
explicit linux/types.h include.

Pointy hat: manu
Reported by: Austin Shafer <ashafer@badland.io>

4 years agolinuxkpi: Really add bitmap_alloc and bitmap_zalloc
Emmanuel Vadot [Sun, 10 May 2020 13:12:05 +0000 (13:12 +0000)]
linuxkpi: Really add bitmap_alloc and bitmap_zalloc

This was missing in r360870

Sponsored-by: The FreeBSD Foundation
4 years agolinuxkpi: Add bitmap_alloc and bitmap_free
Emmanuel Vadot [Sun, 10 May 2020 13:07:00 +0000 (13:07 +0000)]
linuxkpi: Add bitmap_alloc and bitmap_free

This is a simple call to kmallock_array/kfree, therefore include linux/slab.h as
this is where the kmalloc_array/kfree definition is.

Sponsored-by: The FreeBSD Foundation
Reviewed by: hselsasky
Differential Revision: https://reviews.freebsd.org/D24794

4 years agoOnly drop DATA chunk with lower priorities as specified in RFC 7496.
Michael Tuexen [Sun, 10 May 2020 10:03:10 +0000 (10:03 +0000)]
Only drop DATA chunk with lower priorities as specified in RFC 7496.
This issue was found by looking at a reproducer generated by syzkaller.

MFC after: 3 days

4 years agoRemove rtalloc1(_fib) KPI.
Alexander V. Chernikov [Sun, 10 May 2020 09:34:48 +0000 (09:34 +0000)]
Remove rtalloc1(_fib) KPI.

Last user of rtalloc1() KPI has been eliminated in rS360631.
As kernel is now fully switched to use new routing KPI defined in
rS359823, remove old lookup functions.

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

4 years ago[atheros] [if_arge] Various fixes to avoid TX stalls and bad sized packets
Adrian Chadd [Sun, 10 May 2020 03:36:11 +0000 (03:36 +0000)]
[atheros] [if_arge] Various fixes to avoid TX stalls and bad sized packets

This is stuff I've been running for a couple years.  It's inspired by changes
I found in the linux ag71xx ethernet driver.

* Delay between stopping DMA and checking to see if it's stopped; this gives
  the hardware time to do its thing.

* Non-final frames in the chain need to be a multiple of 4 bytes in size.
  Ensure this is the case when assembling a TX DMA list.

* Add counters for tx/rx underflow and too-short packets.

* Log if TX/RX DMA couldn't be stopped when resetting the MAC.

* Add some more debugging / logging around TX/RX ring bits.

Tested:

* AR7240, AR7241
* AR9344 (TL-WDR3600/TL-WDR4300 APs)
* AR9331 (Carambola 2)

4 years agoclang: Reject %n for __attribute__((format(__freebsd_kprintf__)))
Conrad Meyer [Sat, 9 May 2020 19:26:44 +0000 (19:26 +0000)]
clang: Reject %n for __attribute__((format(__freebsd_kprintf__)))

A follow-up to r360849.

Reported by: imp
Reviewed by: emaste, imp
X-MFC-With: r360849
Differential Revision: https://reviews.freebsd.org/D24786

4 years agolinuxkpi: Add bitmap_copy and bitmap_andnot
Emmanuel Vadot [Sat, 9 May 2020 17:52:50 +0000 (17:52 +0000)]
linuxkpi: Add bitmap_copy and bitmap_andnot

bitmap_copy simply copy the bitmaps, no idea why it exists.
bitmap_andnot is similar to bitmap_and but uses !src2.

Sponsored-by: The FreeBSD Foundation
Reviewed by: hselasky
Differential Revision: https://reviews.freebsd.org/D24782

4 years agoremove %n support from printf(9)
Ed Maste [Sat, 9 May 2020 15:56:02 +0000 (15:56 +0000)]
remove %n support from printf(9)

It can be dangerous and there is no need for it in the kernel.
Inspired by Kees Cook's change in Linux, and later OpenBSD.

Reviewed by: cem, gordon, philip
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D24760

4 years agortwn: Add a new USB ID.
Mark Johnston [Sat, 9 May 2020 14:49:56 +0000 (14:49 +0000)]
rtwn: Add a new USB ID.

PR: 246315
Submitted by: Idwer Vollering <vidwer+fbsdbugs@gmail.com>
MFC after: 1 week

4 years agoAdd ARM loader path to uefi(8) man page.
Edward Tomasz Napierala [Sat, 9 May 2020 14:19:29 +0000 (14:19 +0000)]
Add ARM loader path to uefi(8) man page.

MFC after: 2 weeks
Sponsored by: DARPA

4 years agoAdd space for RSSI in data member.
Takanori Watanabe [Sat, 9 May 2020 14:15:44 +0000 (14:15 +0000)]
Add space for RSSI in data member.
RSSI is put just after actual data.

Submitted by: Marc Veldman
PR: 245920

4 years agoAvoid spurious ENOMEMs from sysctl hw.pagesizes.
Konstantin Belousov [Sat, 9 May 2020 13:00:38 +0000 (13:00 +0000)]
Avoid spurious ENOMEMs from sysctl hw.pagesizes.

Reported by: Paul Floyd <paulf@free.fr>
PR: 246215
Reviewed by: emaste
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D24737

4 years agoDocument BUS_OOMERR.
Konstantin Belousov [Sat, 9 May 2020 12:58:27 +0000 (12:58 +0000)]
Document BUS_OOMERR.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Differential revision: https://reviews.freebsd.org/D24761

4 years agoDon't send clear screen until we are committed to run.
Poul-Henning Kamp [Sat, 9 May 2020 10:55:34 +0000 (10:55 +0000)]
Don't send clear screen until we are committed to run.

4 years agoMention the existence of /etc/defaults/vendor.conf
Benedict Reuschling [Sat, 9 May 2020 10:22:00 +0000 (10:22 +0000)]
Mention the existence of /etc/defaults/vendor.conf
for custom vendor-specific changes to FreeBSD's
default settings.

While here, fix a typo: perfomance -> performance

PR: 245404
Submitted by: Jose Luis Duran

4 years agobhyve: update man page to describe the virtio-net mtu option
Vincenzo Maffione [Sat, 9 May 2020 07:57:41 +0000 (07:57 +0000)]
bhyve: update man page to describe the virtio-net mtu option

r359704 introduced an 'mtu' option for the virtio-net device emulation.
Update the man page to describe the new option.

Reviewed by: bcr
Differential Revision: https://reviews.freebsd.org/D24723

4 years agoloader: vdev_read() can corrupt memory
Toomas Soome [Sat, 9 May 2020 06:25:20 +0000 (06:25 +0000)]
loader: vdev_read() can corrupt memory

When reading less than sector size but from sector boundary,
the vdev_read() will read full sector into the provided buffer
and therefore corrupting memory past buffer end.

MFC after: 2 days

4 years agoinstallworld: attempt a certctl rehash at the tail end
Kyle Evans [Sat, 9 May 2020 02:01:29 +0000 (02:01 +0000)]
installworld: attempt a certctl rehash at the tail end

This can be run as root or normal user with no problem; if they hadn't
twisted the WITHOUT_CAROOT knob, we'll attempt to use the host certctl to
rehash the DESTDIR. This would allow one to build systems WITHOUT_OPENSSL +
WITH_CAROOT with a populated /etc/ssl that they can then use with an
appropriate *ssl from somewhere else.

Cross-builds are fine because this will always use the host certctl, or just
nag if it's missing and it wasn't a WITHOUT_CAROOT build.

MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D24641

4 years agofusefs: fix two small bugs in the tests' expectations
Alan Somers [Fri, 8 May 2020 23:00:02 +0000 (23:00 +0000)]
fusefs: fix two small bugs in the tests' expectations

These two errors have been present since the tests' introduction.
Coincidentally every test (I think there's only one) that cares about that
field also works when the field's value is 0.

MFC after: 2 weeks

4 years agofusefs: better dtrace probes for asynchronous invalidation operations
Alan Somers [Fri, 8 May 2020 22:26:52 +0000 (22:26 +0000)]
fusefs: better dtrace probes for asynchronous invalidation operations

MFC after: 2 weeks

4 years ago[etherswitch] bump register width to 32 bits.
Adrian Chadd [Fri, 8 May 2020 22:22:12 +0000 (22:22 +0000)]
[etherswitch] bump register width to 32 bits.

Some ethernet switches have very large register windows; for example
the AR8316 switch MIB starts at 0x20000.

Submitted by: Mori Hiroki <yamori813@yahoo.co.jp>

4 years agoSync relocation definitions
Mitchell Horne [Fri, 8 May 2020 22:21:56 +0000 (22:21 +0000)]
Sync relocation definitions

Add the most recent relocation types from the RISC-V ELF psABI spec.

MFC after: 3 days

4 years agoEmbed dst sockaddr into rtentry and remove rte packet counter
Alexander V. Chernikov [Fri, 8 May 2020 21:06:10 +0000 (21:06 +0000)]
Embed dst sockaddr into rtentry and remove rte packet counter

Currently each rtentry has dst&gateway allocated separately from another zone,
 bloating cache accesses.

Current 'struct rtentry' has 12 "mandatory" radix pointers in the beginning,
 leaving 4 usable pointers/32 bytes in the first 2 cache lines (amd64).
Fields needed for the datapath are destination sockaddr and rt_nhop.

So far it doesn't look like there is other routable addressing protocol other
 than IPv4/IPv6/MPLS, which uses keys longer than 20 bytes.
With that in mind, embed dst into struct rtentry, making the first 24 bytes
 of rtentry within 128 bytes. That is enough to make IPv6 address within first
 128 bytes.

It is still pretty easy to add code for supporting separately-allocated dst,
 however it doesn't make a lot of sense in having such code without a use case.

As rS359823 moved the gateway to the nexthop structure, the dst embedding change
 removes the need for any additional allocations done by rt_setgate().

Lastly, as a part of cleanup, remove counter(9) allocation code, as this field
 is not used in packet processing anymore.

Reviewed by: ae
Differential Revision: https://reviews.freebsd.org/D24669

4 years agoAdd more obsolete files
Antoine Brodin [Fri, 8 May 2020 20:15:18 +0000 (20:15 +0000)]
Add more obsolete files

4 years agobhyve: Pass the full string of options to the network backends.
Aleksandr Fedorov [Fri, 8 May 2020 17:15:54 +0000 (17:15 +0000)]
bhyve: Pass the full string of options to the network backends.

Reviewed by: vmaffione
Approved by: vmaffione (mentor)
Sponsored by: vstack.com
Differential Revision: https://reviews.freebsd.org/D24735

4 years ago[net80211] Use the unicast key when transmitting DWDS AP multicast frames.
Adrian Chadd [Fri, 8 May 2020 17:01:33 +0000 (17:01 +0000)]
[net80211] Use the unicast key when transmitting DWDS AP multicast frames.

I'm still not sure whether this is the full solution, but here goes.

I have a two node DWDS setup - a main AP with the ethernet bridge uplink
and a satellite AP in the back of the house. They're both AR9344+AR9580
dual band 11n APs.

The problem was that multicast frames was not going from the DWDS AP to
the DWDS STA. Unicast frames are fine, and multicast frames from the
DWDS STA to AP are fine.

Now, multicast and unicast frames from the STA -> AP are just transmitted
using the unicast key.  That's fine.  However, the AP -> STA multicast
frames by default are transmitted using the current default / multicast
key, the shared one between all STAs in a BSS.  Now, the DWDS implementation
ignores non WDS frames - it only allows about 4 address frames outside
of management / EAPOL frames! - so the STA side ignores the normal multicast
frames.

Instead, the AP side uses ieee80211_dwds_mcast() to send multicast frames
to each WDS VAP that was created as part of the "dynamic" part of DWDS.
This should be queuing them individually to each node instead of using
the normal multicast send path; and this is how they should get turned into
4-addr WDS frames.

HOWEVER, ieee80211_encap() was trying to use the default TX key to queue
them rather than the unicast key that's already setup.  Since this synthetic
node doesn't have the default TX key setup, transmission fails.  Things
would be fine in WEP and in open mode because in both cases you would
have static keys (or no keys) setup.  It just fails in WPA mode.

This resolves the issue.  AP DWDS multicast is now sent using the unicast
key just like in STA mode and I'm pretty sure the STA mode side will stil
work fine (as it's a STA VAP with a DWDS flag..)

Tested:

* TL-WDR3600/4300 APs

4 years agoFix a memory leak for ENCIOC_GETSTRING I introduced in r360171.
John Baldwin [Fri, 8 May 2020 16:41:23 +0000 (16:41 +0000)]
Fix a memory leak for ENCIOC_GETSTRING I introduced in r360171.

MFC after: 1 week
Sponsored by: DARPA

4 years agosrc.conf.5: regen after BINUTILS changes
Ed Maste [Fri, 8 May 2020 15:03:28 +0000 (15:03 +0000)]
src.conf.5: regen after BINUTILS changes

4 years agosrc.opts.mk: update BINUTILS options and add comments
Ed Maste [Fri, 8 May 2020 14:54:40 +0000 (14:54 +0000)]
src.opts.mk: update BINUTILS options and add comments

BINUTILS is needed only for ports, and will be disabled once the failing
ports are addressed (likely by growing a binutils dependency).

BINUTILS_BOOTSTRAP is needed only on amd64, for skein_block_asm.s. There
is no need to enable it on i386.

This will all be removed before FreeBSD 13.0.

4 years agoRemove APPLEKEXT ifndefs
Ryan Moeller [Fri, 8 May 2020 14:39:38 +0000 (14:39 +0000)]
Remove APPLEKEXT ifndefs

They are no longer useful.

Reviewed by: rmacklem
Approved by: mav (mentor)
MFC after: 1 week
Sponsored by: iXsystems, Inc.
Differential Revision: https://reviews.freebsd.org/D24752

4 years agoReinitialize thread0's stack base after enabling XSAVE.
Mark Johnston [Fri, 8 May 2020 14:38:48 +0000 (14:38 +0000)]
Reinitialize thread0's stack base after enabling XSAVE.

Otherwise the initial call to set_top_of_stack(), which occurs before
fpuinit() sets the correct value for cpu_max_ext_state_size, leaves the
stack base at an incorrect location.  Then, when the full area is
zeroed, we end up erroneously zeroing part of the following page.

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

4 years agoFix the sys.geom.class.multipath.misc.fail_on_error test on stable/12
Alan Somers [Fri, 8 May 2020 02:42:15 +0000 (02:42 +0000)]
Fix the sys.geom.class.multipath.misc.fail_on_error test on stable/12

This test uses a gnop feature (delay probability) that isn't available on
stable/12.  But it's unnecessary; the test works fine without it.  Removing
it simplifies the test and, once MFCed, will allow it to pass on stable/12.

PR: 244158
Reported by: lwhsu
MFC after: 2 weeks

4 years agoDocument le_enable subcommand
Takanori Watanabe [Fri, 8 May 2020 01:19:29 +0000 (01:19 +0000)]
Document le_enable subcommand

4 years agoMerge commit 21e5e1724b75 from llvm git:
Ed Maste [Thu, 7 May 2020 21:18:37 +0000 (21:18 +0000)]
Merge commit 21e5e1724b75 from llvm git:

  getMainExecutable: Fix hand-rolled AT_EXECPATH for older FreeBSD

  Once we hit AT_NULL, we need to bail out of the loop; not just the
  enclosing switch.  This fixes basic usage (e.g. `cc --version`) when
  AT_EXECPATH isn't present on older branches (e.g. under
  emu-user-static, at the moment), where we would previously run off
  the end of ::environ.

  Patch By: kevans

  Reviewed By: arichardson

  Differential Revision:  https://reviews.llvm.org/D79239

MFC after: 3 days

4 years agoWhen in the SYN-SENT state bbr and rack will not properly send an ACK but instead...
Randall Stewart [Thu, 7 May 2020 20:29:38 +0000 (20:29 +0000)]
When in the SYN-SENT state bbr and rack will not properly send an ACK but instead start the D-ACK timer. This
causes so_reuseport_lb_test to fail since it slows down how quickly the program runs until the timeout occurs
and fails the test

Sponsored by: Netflix inc.
Differential Revision: https://reviews.freebsd.org/D24747

4 years agoBump __FreeBSD_version after linuxkpi changes
Emmanuel Vadot [Thu, 7 May 2020 19:51:53 +0000 (19:51 +0000)]
Bump __FreeBSD_version after linuxkpi changes

Requested by: zeising

4 years ago[PowerPC] kernel ifunc support for powerpc*, fix ppc64 relocation oddities.
Brandon Bergren [Thu, 7 May 2020 19:32:49 +0000 (19:32 +0000)]
[PowerPC] kernel ifunc support for powerpc*, fix ppc64 relocation oddities.

This is a general cleanup of the relocatable kernel support on powerpc,
needed to enable kernel ifuncs.

 * Fix some relocatable issues in the kernel linker, and change to using
   a RELOCATABLE_KERNEL #define instead of #ifdef __powerpc__ for parts that
   other platforms can use in the future if they wish to have ET_DYN kernels.

 * Get rid of the DB_STOFFS hack now that the kernel is relocated to the DMAP
   properly across the board on powerpc64.

 * Add powerpc64 and powerpc32 ifunc functionality.

 * Allow AIM64 virtual mode OF kernels to run from the DMAP like other AIM64
   by implementing a virtual mode restart. This fixes the runtime address on
   PowerMac G5.

 * Fix symbol relocation problems on post-relocation kernels by relocating
   the symbol table.

 * Add an undocumented method for supplying kernel symbols on powernv and
   other powerpc machines using linux-style kernel/initrd loading -- If
   you pass the kernel in as the initrd as well, the copy resident in initrd
   will be used as a source for symbols when initializing the debugger.
   This method is subject to removal once we have a better way of doing this.

Approved by: jhibbits
Relnotes: yes
Sponsored by: Tag1 Consulting, Inc.
Differential Revision: https://reviews.freebsd.org/D23156

4 years agoOptionalObsoleteFiles.inc: remove objdump
Ed Maste [Thu, 7 May 2020 18:24:32 +0000 (18:24 +0000)]
OptionalObsoleteFiles.inc: remove objdump

objdump is removed unconditionally in ObsoleteFiles.inc

4 years agoSet PCM_CAP_VIRTUAL for virtual DSP devices.
Hans Petter Selasky [Thu, 7 May 2020 18:15:35 +0000 (18:15 +0000)]
Set PCM_CAP_VIRTUAL for virtual DSP devices.

Submitted by: Kevin Zheng <kevinz5000@gmail.com>
PR: 246206
MFC after: 1 week
Sponsored by: Mellanox Technologies

4 years agovirtio_mmio: Add casts missing from r360722
Jessica Clarke [Thu, 7 May 2020 17:59:17 +0000 (17:59 +0000)]
virtio_mmio: Add casts missing from r360722

This fixes -Wshift-count-overflow warnings/errors on architectures using
32-bit physical addresses.

Reported by: lwhsu

4 years ago[PowerPC] Fix powerpcspe build failure after r360569
Brandon Bergren [Thu, 7 May 2020 17:58:07 +0000 (17:58 +0000)]
[PowerPC] Fix powerpcspe build failure after r360569

On powerpcspe, vm_paddr_t is 64 bit despite it being a 32 bit platform.
Adjust compile time assertion to compensate.

4 years agolinuxkpi: Add pci_iomap and pci_iounmap
Emmanuel Vadot [Thu, 7 May 2020 17:00:51 +0000 (17:00 +0000)]
linuxkpi: Add pci_iomap and pci_iounmap

Those function are use to map/unmap io region of a pci device.
Different resource can be mapped depending on the bar so use a
tailq to store them all.

Sponsored-by: The FreeBSD Foundation
Reviewed by: emaste, hselasky
Differential Revision: https://reviews.freebsd.org/D24696

4 years agops: extend the non-standard option -d (tree view) to work with -p
Piotr Pawel Stefaniak [Thu, 7 May 2020 16:56:18 +0000 (16:56 +0000)]
ps: extend the non-standard option -d (tree view) to work with -p

Initially it seemed that there were multiple possible ways to do it.

Processing option -p could conditionally add selected processes and
their descendants to the list for further work, but it is not guaranteed
to know whether the -d option has been used or not, and it also doesn't
have access to the process list just yet.

There is also descendant_sort() which has access to all possibly needed
information, but serves the purely post-processing purpose of sorting
output.

Then there is the loop that uses invocation information and full process
list to create a list of processes for final display. It seems the most
natural place to implement this, but indeterminate state of the process
list and volatility of the final list that is being created obstruct
adding an elegant search for all elements of process descendancy trees.

So I opted for adding another loop, just before the one I mentioned
above. For all selected processes it conditionally adds direct
descendants to the end of this list of selected processes.

Possible usage:
* ps -auxd -p $$
* ps -auxd -p 1
* while x=$(pgrep svnlite); do clear; ps auxd -p $x; sleep 2; done
* ps -auxd -p `pgrep make`

Reviewed by: kevans, kaktus (earlier version)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D24380

4 years agogpioiic_attach: fix a NULL pointer crash on hints-based systems
Andriy Gapon [Thu, 7 May 2020 13:11:32 +0000 (13:11 +0000)]
gpioiic_attach: fix a NULL pointer crash on hints-based systems

The attach method uses GPIO_GET_BUS() to get a "newbus" device
that provides a pin.  But on hints-based systems a GPIO controller
driver might not be fully initialized yet and it does not know gpiobus
hanging off it.  Thus, GPIO_GET_BUS() cannot be called yet.
The reason is that controller drivers typically create a child gpiobus
using gpiobus_attach_bus() and that leads to the following call chain:
gpiobus_attach_bus() -> gpiobus_attach() ->
bus_generic_attach(gpiobus) -> gpioiic_attach().
So, gpioiic_attach() is called before gpiobus_attach_bus() returns.

I observed this bug with nctgpio driver on amd64.
I think that the problem was introduced in r355276.

The fix is to avoid calling GPIO_GET_BUS() from the attach method.
Instead, we know that on hints-based systems only the parent gpiobus can
provide the pins.
Nothing is changed for FDT-based systems.

MFC after: 1 week

4 years agoUpdate the screen termcap entries
Baptiste Daroussin [Thu, 7 May 2020 12:43:28 +0000 (12:43 +0000)]
Update the screen termcap entries

Those updates have been obtained form converting the terminfo information
provided by the screen sources to termcap.

MFC after: 3 days

4 years agoOptimize ENA Rx refill for low memory conditions
Marcin Wojtas [Thu, 7 May 2020 11:28:39 +0000 (11:28 +0000)]
Optimize ENA Rx refill for low memory conditions

Sometimes, especially when there is not much memory in the system left,
allocating mbuf jumbo clusters (like 9KB or 16KB) can take a lot of time
and it is not guaranteed that it'll succeed. In that situation, the
fallback will work, but if the refill needs to take a place for a lot of
descriptors at once, the time spent in m_getjcl looking for memory can
cause system unresponsiveness due to high priority of the Rx task. This
can also lead to driver reset, because Tx cleanup routine is being
blocked and timer service could detect that Tx packets aren't cleaned
up. The reset routine can further create another unresponsiveness - Rx
rings are being refilled there, so m_getjcl will again burn the CPU.
This was causing NVMe driver timeouts and resets, because network driver
is having higher priority.

Instead of 16KB jumbo clusters for the Rx buffers, 9KB clusters are
enough - ENA MTU is being set to 9K anyway, so it's very unlikely that
more space than 9KB will be needed.

However, 9KB jumbo clusters can still cause issues, so by default the
page size mbuf cluster will be used for the Rx descriptors. This can have a
small (~2%) impact on the throughput of the device, so to restore
original behavior, one must change sysctl "hw.ena.enable_9k_mbufs" to
"1" in "/boot/loader.conf" file.

As a part of this patch (important fix), the version of the driver
was updated to v2.1.2.

Submitted by:   cperciva
Reviewed by:    Michal Krawczyk <mk@semihalf.com>
Reviewed by:    Ido Segev <idose@amazon.com>
Reviewed by:    Guy Tzalik <gtzalik@amazon.com>
MFC after:      3 days
PR:             225791, 234838, 235856, 236989, 243531
Differential Revision: https://reviews.freebsd.org/D24546

4 years agoNF has an internal option that changes the tcp_mcopy_m routine slightly (has
Randall Stewart [Thu, 7 May 2020 10:46:02 +0000 (10:46 +0000)]
NF has an internal option that changes the tcp_mcopy_m routine slightly (has
a few extra arguments). Recently that changed to only have one arg extra so
that two ifdefs around the call are no longer needed. Lets take out the
extra ifdef and arg.

Sponsored by: Netflix Inc
Differential Revision: https://reviews.freebsd.org/D24736

4 years agoFix indentation of the Kitty entry
Baptiste Daroussin [Thu, 7 May 2020 08:58:08 +0000 (08:58 +0000)]
Fix indentation of the Kitty entry

MFC after: 2 days

4 years agoAdd rib_lookup() sockaddr lookup wrapper and make ifa_ifwithroute use it.
Alexander V. Chernikov [Thu, 7 May 2020 08:11:36 +0000 (08:11 +0000)]
Add rib_lookup() sockaddr lookup wrapper and make ifa_ifwithroute use it.

Create rib_lookup() wrapper around per-af dataplane lookup functions.
This will help in the cases of having control plane af-agnostic code.

Switch ifa_ifwithroute() to use this function instead of rtalloc1().

Reviewed by: ae
Differential Revision: https://reviews.freebsd.org/D24731

4 years agovirtio: Support MMIO bus for all devices
Jessica Clarke [Wed, 6 May 2020 23:31:30 +0000 (23:31 +0000)]
virtio: Support MMIO bus for all devices

The bus is independent of the device, so all devices can be attached to
either a PCI bus or an MMIO bus. For example, QEMU's virtio-rng-device
gives the MMIO variant of virtio-rng-pci, and is now detected.

Reviewed by: andrew, br, brooks (mentor)
Approved by: andrew, br, brooks (mentor)
Differential Revision: https://reviews.freebsd.org/D24730

4 years agovirtio_mmio: Support non-transitional version 2 devices
Jessica Clarke [Wed, 6 May 2020 23:28:51 +0000 (23:28 +0000)]
virtio_mmio: Support non-transitional version 2 devices

The non-legacy virtio MMIO specification drops the use of PFNs and
replaces them with physical addresses. Whilst many implementations are
so-called transitional devices, also implementing the legacy
specification, TinyEMU[1] does not. Device-specific configuration
registers have also changed to being little-endian, and must be accessed
using a single aligned access for registers up to 32 bits, and two
32-bit aligned accesses for 64-bit registers.

[1] https://bellard.org/tinyemu/

Reviewed by: br, brooks (mentor)
Approved by: br, brooks (mentor)
Differential Revision: https://reviews.freebsd.org/D24681

4 years agoDeprecate ubsec(4) for FreeBSD 13.0.
John Baldwin [Wed, 6 May 2020 22:15:09 +0000 (22:15 +0000)]
Deprecate ubsec(4) for FreeBSD 13.0.

With the removal of in-tree consumers of DES, Triple DES, and
MD5-HMAC, the only algorithm this driver still supports is SHA1-HMAC.
This is not very useful as a standalone algorithm (IPsec AH-only with
SHA1 would be the only user).

This driver has also not been kept up to date with the original driver
in OpenBSD which supports a few more cards and AES-CBC on newer cards.
The newest card currently supported by this driver was released in
2005.

Reviewed by: cem
MFC after: 1 week
Relnotes: yes
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D24691

4 years agoMerge commit 4ca2cad94 from llvm git (by Justin Hibbits):
Dimitry Andric [Wed, 6 May 2020 19:10:39 +0000 (19:10 +0000)]
Merge commit 4ca2cad94 from llvm git (by Justin Hibbits):

  [PowerPC] Add clang -msvr4-struct-return for 32-bit ELF

  Summary:

  Change the default ABI to be compatible with GCC. For 32-bit ELF
  targets other than Linux, Clang now returns small structs in
  registers r3/r4. This affects FreeBSD, NetBSD, OpenBSD. There is no
  change for 32-bit Linux, where Clang continues to return all structs
  in memory.

  Add clang options -maix-struct-return (to return structs in memory)
  and -msvr4-struct-return (to return structs in registers) to be
  compatible with gcc. These options are only for PPC32; reject them on
  PPC64 and other targets. The options are like -fpcc-struct-return and
  -freg-struct-return for X86_32, and use similar code.

  To actually return a struct in registers, coerce it to an integer of
  the same size. LLVM may optimize the code to remove unnecessary
  accesses to memory, and will return i32 in r3 or i64 in r3:r4.

  Fixes PR#40736

  Patch by George Koehler!

  Reviewed By: jhibbits, nemanjai
  Differential Revision: https://reviews.llvm.org/D73290

Requested by: jhibbits
MFC after: 3 days

4 years agosrc.conf.5: regen after objdump removal
Ed Maste [Wed, 6 May 2020 18:43:27 +0000 (18:43 +0000)]
src.conf.5: regen after objdump removal

4 years agosrc.opts.mk: with BINUTILS limited to as it is used on i386 and amd64 only
Ed Maste [Wed, 6 May 2020 18:40:52 +0000 (18:40 +0000)]
src.opts.mk: with BINUTILS limited to as it is used on i386 and amd64 only

4 years agoupdate WITH_/WITHOUT_BINUTILS descriptions for objdump removal
Ed Maste [Wed, 6 May 2020 18:39:55 +0000 (18:39 +0000)]
update WITH_/WITHOUT_BINUTILS descriptions for objdump removal

4 years agobinutils: disconnect objdump from the build
Ed Maste [Wed, 6 May 2020 18:38:40 +0000 (18:38 +0000)]
binutils: disconnect objdump from the build

The in-tree binutils is old and will not be updated.  It does not support
all archs supported by FreeBSD, and for the archs it does support not all
CPU features are supported.

Other tools have migrated to copyfree alternatives.  Although llvm-objdump
is nearly a drop-in replacement for GNU objdump it is missing a few options
and has some differences in output format.  For now just remove GNU objdump;
ports and developers can use a contemporary, maintained version from ports
or packages.  We can revisit installing llvm-objdump as objdump in the
future.

PR: 212319 [exp-run]
Relnotes: Yes
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D7338

4 years agoIn r358396 I merged llvm upstream commit 2e24219d3, which fixed "error:
Dimitry Andric [Wed, 6 May 2020 18:13:00 +0000 (18:13 +0000)]
In r358396 I merged llvm upstream commit 2e24219d3, which fixed "error:
unsupported relocation on symbol" when assembling arm 'adr' pseudo
instructions. However, the upstream commit did not take big-endian arm
into account.

Applying the same changes to the big-endian handling is straightforward,
thanks to Andrew Turner and Peter Smith for the hint. This will also be
submitted upstream.

MFC after: immediately, since this fix is meant for stable/11

4 years agousbhid: add several missing usages from Digitizer page
Andriy Gapon [Wed, 6 May 2020 15:24:31 +0000 (15:24 +0000)]
usbhid: add several missing usages from Digitizer page

This is applicable to HID in general, not just USB HID.

Inspired by: wulf
MFC after: 1 week

4 years agoarm: Don't enable interrupts in init_secondary().
Mark Johnston [Wed, 6 May 2020 15:10:05 +0000 (15:10 +0000)]
arm: Don't enable interrupts in init_secondary().

This has the same reasoning as described in r357048.

Remove a stray declaration while here.

Reported and tested by: trasz
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

4 years agoSimplify arm64's pmap_bootstrap() a bit.
Mark Johnston [Wed, 6 May 2020 15:01:06 +0000 (15:01 +0000)]
Simplify arm64's pmap_bootstrap() a bit.

locore constructs an L2 page mapping the kernel and preloaded data
starting a KERNBASE (the same as VM_MIN_KERNEL_ADDRESS on arm64).
initarm() and pmap_bootstrap() use the preloaded metadata to
tell it where it can start allocating from.

pmap_bootstrap() currently iterates over the L2 page to find the last
valid entry, but doesn't do anything with the result.  Remove the loop
and zap some now-unused local variables.

MFC after: 2 weeks
Sponsored by: Juniper Networks, Klara Inc.
Differential Revision: https://reviews.freebsd.org/D24559

4 years agoAdd basic routing LPM tests.
Alexander V. Chernikov [Wed, 6 May 2020 07:48:37 +0000 (07:48 +0000)]
Add basic routing LPM tests.

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

4 years agoGNU as: print a deprecation warning on program start
Ed Maste [Wed, 6 May 2020 01:08:19 +0000 (01:08 +0000)]
GNU as: print a deprecation warning on program start

GNU as 2.17.50 will be removed before FreeBSD 13.

4 years agoDelete unused function newnfs_trimleading.
Rick Macklem [Wed, 6 May 2020 00:44:03 +0000 (00:44 +0000)]
Delete unused function newnfs_trimleading.

The NFS function called newnfs_trimleading() has not been used by the
code in long time. To give you a clue, it still had a K&R style function
declaration.
Delete it, since it is just cruft, as a part of the NFS mbuf handling
cleanup in preparation for adding ext_pgs mbuf support.
The ext_pgs mbuf support for the build/send side is needed by
nfs-over-tls.

4 years agoelfctl: update earliest FreeBSD revision to 12.2
Ed Maste [Tue, 5 May 2020 21:50:52 +0000 (21:50 +0000)]
elfctl: update earliest FreeBSD revision to 12.2

elfctl has been merged to stable/12, and so will appear in FreeBSD 12.2

Reported by: Dewayne Geraghty
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

4 years agoAvoid underflowing a variable, which would result in taking more
Michael Tuexen [Tue, 5 May 2020 19:54:30 +0000 (19:54 +0000)]
Avoid underflowing a variable, which would result in taking more
data from the stream queues then needed.

Thanks to Timo Voelker for finding this bug and providing a fix.

MFC after: 3 days

4 years agoAdd HISTORY sections to document when this
Benedict Reuschling [Tue, 5 May 2020 19:31:47 +0000 (19:31 +0000)]
Add HISTORY sections to document when this
functionality first appeared in FreeBSD.

Submitted by: Gordon Bergling gbergling_gmail.com
Approved by: bcr
Differential Revision: https://reviews.freebsd.org/D24677

4 years agoFix broken links in the man page by pointing to a
Benedict Reuschling [Tue, 5 May 2020 19:00:26 +0000 (19:00 +0000)]
Fix broken links in the man page by pointing to a
source that works or is the new location on the
same page.

Submitted by:     alfix86_gmail.com
Approved by:     bcr
Differential Revision: https://reviews.freebsd.org/D23769

4 years agols(1): Fix trivial SEGV due to NULL deref in OOM path
Conrad Meyer [Tue, 5 May 2020 18:06:32 +0000 (18:06 +0000)]
ls(1): Fix trivial SEGV due to NULL deref in OOM path

Reported by: Anton Rang <rang AT acm.org>
Sponsored by: Dell EMC Isilon

4 years agostrdup.3: Slightly canonicalize OOM return/error status
Conrad Meyer [Tue, 5 May 2020 17:57:04 +0000 (17:57 +0000)]
strdup.3: Slightly canonicalize OOM return/error status

Attempted to clean up the language around "this is a malloc'd object."  May be
passed as a parameter to free(3) is a bit obtuse.

Sponsored by: Dell EMC Isilon

4 years agopwcache.3: Explicitly document OOM condition
Conrad Meyer [Tue, 5 May 2020 17:55:45 +0000 (17:55 +0000)]
pwcache.3: Explicitly document OOM condition

The pwcache functions allocate memory, and may return NULL pointers if that
allocation fails and the corresponding uid or gid was not found in the local
password database.  Document this behavior.

Sponsored by: Dell EMC Isilon

4 years agoFix the computation of the numbers of entries of the mapping array to
Michael Tuexen [Tue, 5 May 2020 17:52:44 +0000 (17:52 +0000)]
Fix the computation of the numbers of entries of the mapping array to
look at when generating a SACK. This was wrong in case of sequence
numbers wrap arounds.

Thanks to Gwenael FOURRE for reporting the issue for the userland stack:
https://github.com/sctplab/usrsctp/issues/462
MFC after: 3 days

4 years agoacpi_video: try our best to work on systems without non-essential methods
Andriy Gapon [Tue, 5 May 2020 12:14:11 +0000 (12:14 +0000)]
acpi_video: try our best to work on systems without non-essential methods

Only _BCL and _BCM methods seem to be essential to the driver's
operation.  If _BQC is missing then we can assume that the current
brightness is whatever we set by the last _BCM invocation.  If _DCS or
_DGS is missing the we can make assumptions as well.

The change is based on a patch suggested by Anthony Jenkins
<Scoobi_doo@yahoo.com> in PR 207086.

PR: 207086
Submitted by: Anthony Jenkins <Scoobi_doo@yahoo.com (earlier version)
Reviewed by: manu
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D24653

4 years agoFix the EFI_DEBUG case, prio_str is only used when EFI_DEBUG is unset.
Andrew Turner [Tue, 5 May 2020 10:01:10 +0000 (10:01 +0000)]
Fix the EFI_DEBUG case, prio_str is only used when EFI_DEBUG is unset.

Sponsored by: Innovate UK

4 years agoAs with r352446 align blocks in boot1.efi
Andrew Turner [Tue, 5 May 2020 09:42:26 +0000 (09:42 +0000)]
As with r352446 align blocks in boot1.efi

We need to ensure the buffers are aligned before passing them to ReadBlocks.
Assume 512 bytes is enough for now.

Reviewed by: imp
MFC after: 1 month
Sponsored by: Innovate UK

4 years agoRevert r360514, to avoid unnecessary churn of the sources.
Rick Macklem [Tue, 5 May 2020 00:58:03 +0000 (00:58 +0000)]
Revert r360514, to avoid unnecessary churn of the sources.

r360514 prepared the NFS code for changes to handle ext_pgs mbufs on
the receive side. However, at this time, KERN_TLS does not pass
ext_pgs mbufs up through soreceive(). As such, as this time, only
the send/build side of the NFS mbuf code needs to handle ext_pgs mbufs.
Revert r360514 since the rather extensive changes required for receive
side ext_pgs mbufs are not yet needed.
This avoids unnecessary churn of the sources.

4 years agoInitial support for bhyve save and restore.
John Baldwin [Tue, 5 May 2020 00:02:04 +0000 (00:02 +0000)]
Initial support for bhyve save and restore.

Save and restore (also known as suspend and resume) permits a snapshot
to be taken of a guest's state that can later be resumed.  In the
current implementation, bhyve(8) creates a UNIX domain socket that is
used by bhyvectl(8) to send a request to save a snapshot (and
optionally exit after the snapshot has been taken).  A snapshot
currently consists of two files: the first holds a copy of guest RAM,
and the second file holds other guest state such as vCPU register
values and device model state.

To resume a guest, bhyve(8) must be started with a matching pair of
command line arguments to instantiate the same set of device models as
well as a pointer to the saved snapshot.

While the current implementation is useful for several uses cases, it
has a few limitations.  The file format for saving the guest state is
tied to the ABI of internal bhyve structures and is not
self-describing (in that it does not communicate the set of device
models present in the system).  In addition, the state saved for some
device models closely matches the internal data structures which might
prove a challenge for compatibility of snapshot files across a range
of bhyve versions.  The file format also does not currently support
versioning of individual chunks of state.  As a result, the current
file format is not a fixed binary format and future revisions to save
and restore will break binary compatiblity of snapshot files.  The
goal is to move to a more flexible format that adds versioning,
etc. and at that point to commit to providing a reasonable level of
compatibility.  As a result, the current implementation is not enabled
by default.  It can be enabled via the WITH_BHYVE_SNAPSHOT=yes option
for userland builds, and the kernel option BHYVE_SHAPSHOT.

Submitted by: Mihai Tiganus, Flavius Anton, Darius Mihai
Submitted by: Elena Mihailescu, Mihai Carabas, Sergiu Weisz
Relnotes: yes
Sponsored by: University Politehnica of Bucharest
Sponsored by: Matthew Grooms (student scholarships)
Sponsored by: iXsystems
Differential Revision: https://reviews.freebsd.org/D19495

4 years agoAdd net epoch support back, which was taken out by accident in
Michael Tuexen [Mon, 4 May 2020 23:05:11 +0000 (23:05 +0000)]
Add net epoch support back, which was taken out by accident in
https://svnweb.freebsd.org/changeset/base/360639

Reviewed by: rrs
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D24694

4 years agoThis fixes two issues found by ankitraheja09@gmail.com
Randall Stewart [Mon, 4 May 2020 23:02:58 +0000 (23:02 +0000)]
This fixes two issues found by ankitraheja09@gmail.com
1) When BBR retransmits the syn it was messing up the snd_max
2) When we need to send a RST we might not send it when we should

Reported by: ankitraheja09@gmail.com
Sponsored by:  Netflix.com
Differential Revision: https://reviews.freebsd.org/D24693

4 years agoUse a lookup table of algorithm types for alg_is_* helpers.
John Baldwin [Mon, 4 May 2020 22:31:38 +0000 (22:31 +0000)]
Use a lookup table of algorithm types for alg_is_* helpers.

This makes it easier to maintain these functions as algorithms are
added or removed.

Reviewed by: cem
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D24668

4 years agoEnter the net epoch before calling the output routine in TCP BBR.
Michael Tuexen [Mon, 4 May 2020 22:02:49 +0000 (22:02 +0000)]
Enter the net epoch before calling the output routine in TCP BBR.
This was only triggered when setting the IPPROTO_TCP level socket
option TCP_DELACK.
This issue was found by runnning an instance of SYZKALLER.
Reviewed by: rrs
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D24690

4 years agoThis commit brings things into sync with the advancements that
Randall Stewart [Mon, 4 May 2020 20:28:53 +0000 (20:28 +0000)]
This commit brings things into sync with the advancements that
have been made in rack and adds a few fixes in BBR. This also
removes any possibility of incorrectly doing OOB data the stacks
do not support it. Should fix the skyzaller crashes seen in the
past. Still to fix is the BBR issue just reported this weekend
with the SYN and on sending a RST. Note that this version of
rack can now do pacing as well.

Sponsored by:Netflix Inc
Differential Revision:https://reviews.freebsd.org/D24576

4 years agoAdjust the fb to have a way to ask the underlying stack
Randall Stewart [Mon, 4 May 2020 20:19:57 +0000 (20:19 +0000)]
Adjust the fb to have a way to ask the underlying stack
if it can support the PRUS option (OOB). And then have
the new function call that to validate and give the
correct error response if needed to the user (rack
and bbr do not support obsoleted OOB data).

Sponsoered by: Netflix Inc.
Differential Revision:  https://reviews.freebsd.org/D24574

4 years agoSet LG_VADDR to 48 on RISC-V.
Brooks Davis [Mon, 4 May 2020 17:16:30 +0000 (17:16 +0000)]
Set LG_VADDR to 48 on RISC-V.

The Sv48 PTE format is the largest currently defined address space for
RISC-V. It makes no sense to define a larger size and doing so (at
least for 64-bits) forces rtrees down a slow path.

Reviewed by: vangyzen, jhb, mhorne
Obtained from: CheriBSD
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D24658

4 years agoAdd RFC reference for AES-CTR with IPsec.
John Baldwin [Mon, 4 May 2020 16:50:01 +0000 (16:50 +0000)]
Add RFC reference for AES-CTR with IPsec.

MFC after: 1 week
Sponsored by: Chelsio Communications

4 years agoSwitch DDB show route to direct rnh_matchaddr() call instead of rtalloc1().
Alexander V. Chernikov [Mon, 4 May 2020 15:07:57 +0000 (15:07 +0000)]
Switch DDB show route to direct rnh_matchaddr() call instead of rtalloc1().

Eliminate the last rtalloc1() call to finish transition to the new routing
KPI defined in r359823.

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

4 years agoSimplify address parsing in DDB show route command.
Alexander V. Chernikov [Mon, 4 May 2020 15:00:19 +0000 (15:00 +0000)]
Simplify address parsing in DDB show route command.

Use db_get_line() to overcome parser limitation.

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

4 years agoRemove now-unused rt_ifp,rt_ifa,rt_gateway,rt_mtu rte fields.
Alexander V. Chernikov [Mon, 4 May 2020 14:31:45 +0000 (14:31 +0000)]
Remove now-unused rt_ifp,rt_ifa,rt_gateway,rt_mtu rte fields.

After converting routing subsystem customers to use nexthop objects
 defined in r359823, some fields in struct rtentry became unused.

This commit removes rt_ifp, rt_ifa, rt_gateway and rt_mtu from struct rtentry
 along with the code initializing and updating these fields.

Cleanup of the remaining fields will be addressed by D24669.

This commit also changes the implementation of the RTM_CHANGE handling.
Old implementation tried to perform the whole operation under radix WLOCK,
 resulting in slow performance and hacks like using RTF_RNH_LOCKED flag.
New implementation looks up the route nexthop under radix RLOCK, creates new
 nexthop and tries to update rte nhop pointer. Only last part is done under
 WLOCK.
In the hypothetical scenarious where multiple rtsock clients
 repeatedly issue RTM_CHANGE requests for the same route, route may get
 updated between read and update operation. This is addressed by retrying
 the operation multiple (3) times before returning failure back to the
 caller.

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

4 years agoRevert r360204, sys.netipsec.tunnel.empty.v{4,6} are fixed by r360560
Li-Wen Hsu [Mon, 4 May 2020 11:23:55 +0000 (11:23 +0000)]
Revert r360204, sys.netipsec.tunnel.empty.v{4,6} are fixed by r360560

PR: 245832
Sponsored by: The FreeBSD Foundation