]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
3 years agoMFC r365360, r365370:
Konstantin Belousov [Fri, 11 Sep 2020 10:05:44 +0000 (10:05 +0000)]
MFC r365360, r365370:
rtld: Handle ELF dso with program headers outside the first page.

PR: 229708

3 years agoRename stable/12 to -STABLE, and bump __FreeBSD_version after
Glen Barber [Fri, 11 Sep 2020 00:04:23 +0000 (00:04 +0000)]
Rename stable/12 to -STABLE, and bump __FreeBSD_version after
releng/12.2 had been created.

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

3 years agoMFC r360229, r363255
Allan Jude [Thu, 10 Sep 2020 21:01:22 +0000 (21:01 +0000)]
MFC r360229, r363255

r360229:
Add VIRTIO_BLK_T_DISCARD (TRIM) support to the bhyve virtio-blk backend

This will advertise support for TRIM to the guest virtio-blk driver and
perform the DIOCGDELETE ioctl on the backing storage if it supports it.

Thanks to Jason King and others at Joyent and illumos for expanding on
my original patch, adding improvements including better error handling
and making sure to following the virtio spec.

r363255:
Add VIRTIO_BLK_T_DISCARD support to the virtio-blk driver

If the hypervisor advertises support for the DISCARD command then the
guest can perform TRIM commands, freeing space on the backing store.

If VIRTIO_BLK_F_DISCARD is enabled, advertise DISKFLAG_CANDELETE

Tested with FreeBSD guests on bhyve and KVM

Relnotes: yes
Sponsored by: Klara Inc.

3 years agoMFC r361541, r362038, r364240
Eric Joyner [Thu, 10 Sep 2020 20:46:16 +0000 (20:46 +0000)]
MFC r361541, r362038, r364240

These MFCs add the ice(4) driver to the kernel for Intel 800 Series
Ethernet adapters, a couple fixes for the ice_ddp module makefile, and
remove some redeclarations, respectively.

Relnotes: yes
Sponsored by: Intel Corporation

3 years agoMFC 363459:
John Baldwin [Thu, 10 Sep 2020 20:34:44 +0000 (20:34 +0000)]
MFC 363459:
Pass the right size to memcpy() when copying the array of FP registers.

The size of the containing structure was passed instead of the size of
the array.  This happened to be harmless as the extra word copied is
one we copy in the next line anyway.

3 years agoMFC r344749-344750,344841-344843,345284,346405,346470,347140-347141,348331,
Bjoern A. Zeeb [Thu, 10 Sep 2020 19:00:17 +0000 (19:00 +0000)]
MFC r344749-344750,344841-344843,345284,346405,346470,347140-347141,348331,
    349593,351868,353506-353507,353809,353853,353858,353860,356852,359063,
    359158,360819,360888,360950-360951,360953-360954,360998,361009,361025,
    361085,361087,361098,361106-361107,361115,361118,361319-361321,361486,
    361560,361566,361626,361636-361637,361687,361726,361737-361738,361768,
    361778,361811-361813,361819-361822,361825-361826,361834,361863-361864,
    361878,361885-361886,362016,362084-362085,362156-362157,362161-362162,
    362210-362213,362216,362256-362257,362671,362815-362816,363325,
    363327-363328,364011-364012,364299,364301,364303,364312,364315,
    364326-364327,364551,364553,364673,365097,365116,365125-365126,
    365130-365131,365198,365419
  by adrian(78), bcran(1), bz(13), cem(1), gavin(1), glebius(6),
     landonf(1), mjg(7)

Merge WiFi net80211, drivers, and management in order to support better 11n
and upcoming 11ac.

This includes an ath(4) update, some run(4) 11n support, 11n for otus(4),
A-MPDU, A-MSDU, A-MPDU+A-MSDU and Fast frames options, scanning fixes,
enahnced PRIV checks for jails, restored parent device name printing,
improvements for upcoming VHT support, lots of under-the-hood infrastructure
improvements, new device ID, debug tools updates, some whistespace changes
(to make future MFCs easier).

This does not include (nost) epoch(9) related changes as too much other
infrastructure was not merged for that.

Bump __FreeBSD_veresion as this changes the priv(9) names (not know to be
used externally), and net80211 structures.

Tested on: some ath(4) AP, run(4) STA, and rtwn(4) STA
Discussed with: adrian (extremly briefly)
Sponsored by: Rubicon Communications, LLC (d/b/a "Netgate") [partially]
Relnotes: yes

3 years agoMFC r350061:
Michael Tuexen [Thu, 10 Sep 2020 18:04:34 +0000 (18:04 +0000)]
MFC r350061:
Fix compilation on platforms using gcc.
When compiling RACK on platforms using gcc, a warning that tcp_outflags
is defined but not used is issued and terminates compilation on PPC64,
for example. So don't indicate that tcp_outflags is used.

3 years agoMFC r356417 (from rrs):
Michael Tuexen [Thu, 10 Sep 2020 17:49:21 +0000 (17:49 +0000)]
MFC r356417 (from rrs):
This catches rack up in the recent changes to ECN and
also commonizes the functions that both the freebsd and
rack stack uses.

3 years agoMFC r353490 (from rrs):
Michael Tuexen [Thu, 10 Sep 2020 17:44:27 +0000 (17:44 +0000)]
MFC r353490 (from rrs):
if_hw_tsomaxsegsize needs to be initialized to zero, just
like in bbr.c and tcp_output.c

3 years agoMFC r352661 (from rrs):
Michael Tuexen [Thu, 10 Sep 2020 17:41:23 +0000 (17:41 +0000)]
MFC r352661 (from rrs):
lets put (void) in a couple of functions to keep older platforms that
are stuck with gcc happy (ppc). The changes are needed in both bbr and
rack.

3 years agoMFC r351782:
Michael Tuexen [Thu, 10 Sep 2020 17:31:34 +0000 (17:31 +0000)]
MFC r351782:
Fix two TCP RACK issues:
* Convert the TCP delayed ACK timer from ms to ticks as required.
  This fixes the timer on platforms with hz != 1000.
* Don't delay acknowledgements which report duplicate data using
  DSACKs.

3 years agoMFC r351328 (by rrs):
Michael Tuexen [Thu, 10 Sep 2020 17:29:20 +0000 (17:29 +0000)]
MFC r351328 (by rrs):
Fix an issue when TSO and Rack play together. Basically
an retransmission of the initial SYN (with data) would
cause us to strip the SYN and decrement/increase offset/len
which then caused us a -1 offset and a panic.

3 years agoMFC r350973 (from rrs):
Michael Tuexen [Thu, 10 Sep 2020 17:26:16 +0000 (17:26 +0000)]
MFC r350973 (from rrs):
Place back in the dependency on HPTS via module depends versus
a fatal error in compiling. This was taken out by mistake
when I mis-merged from the 18q22p2 sources of rack in NF. Opps.

3 years agoMFC r364754:
Michael Tuexen [Thu, 10 Sep 2020 17:12:42 +0000 (17:12 +0000)]
MFC r364754:

RFC 3465 defines a limit L used in TCP slow start for limiting the number
of acked bytes as described in Section 2.2 of that document.
This patch ensures that this limit is not also applied in congestion
avoidance. Applying this limit also in congestion avoidance can result in
using less bandwidth than allowed.

3 years agoMFC r357816 (from rrs)
Michael Tuexen [Thu, 10 Sep 2020 17:03:36 +0000 (17:03 +0000)]
MFC r357816 (from rrs)

This small fix makes it so we properly follow
the RFC and only enable ECN when both the
CWR and ECT bits our set within the SYN packet.

3 years agoMFC r357100:
Michael Tuexen [Thu, 10 Sep 2020 16:59:54 +0000 (16:59 +0000)]
MFC r357100:

The server side of TCP fast open relies on the delayed ACK timer to allow
including user data in the SYN-ACK. When DSACK support was added in
r347382, an immediate ACK was sent even for the received SYN with
user data. This patch fixes that and allows again to send user data with
the SYN-ACK.

3 years agoMFC r358023:
Michael Tuexen [Thu, 10 Sep 2020 16:47:08 +0000 (16:47 +0000)]
MFC r358023:

Don't use uninitialised stack memory if the sysctl variable
net.inet.tcp.hostcache.enable is set to 0.
The bug resulted in using possibly a too small MSS value or wrong
initial retransmission timer settings. Possibly the value used
for ssthresh was also wrong.

3 years agoMFC r357116:
Michael Tuexen [Thu, 10 Sep 2020 16:44:28 +0000 (16:44 +0000)]
MFC r357116:

Sending CWR after an RTO is according to RFC 3168 generally required
and not only for the DCTCP congestion control.

3 years agoMFC r357115:
Michael Tuexen [Thu, 10 Sep 2020 15:58:37 +0000 (15:58 +0000)]
MFC r357115:

Don't set the ECT codepoint on retransmitted packets during SACK loss
recovery. This is required by RFC 3168.

3 years agoMFC r357114:
Michael Tuexen [Thu, 10 Sep 2020 13:44:35 +0000 (13:44 +0000)]
MFC r357114:
As a TCP client only enable ECN when the corresponding sysctl variable
indicates that ECN should be negotiated for the client side.

3 years agoMFC r356235:
Michael Tuexen [Thu, 10 Sep 2020 13:27:53 +0000 (13:27 +0000)]
MFC r356235:
Fix delayed ACK generation for DCTCP.
Manually changed to use TF_ECN_SND_ECE.

3 years agoMFC r357101:
Michael Tuexen [Thu, 10 Sep 2020 13:17:23 +0000 (13:17 +0000)]
MFC r357101:

Don't delay the ACK for a TCP segment with the CWR flag set.
This allows the data sender to increase the CWND faster.

3 years agoMFC r358621:
Michael Tuexen [Thu, 10 Sep 2020 13:15:17 +0000 (13:15 +0000)]
MFC r358621:
When using automatically generated flow labels and using TCP SYN
cookies, use the same flow label for the segments sent during the
handshake and after the handshake.
This fixes a bug by making sure that sc_flowlabel is always stored in
network byte order.

3 years agoMFC r359926:
Michael Tuexen [Thu, 10 Sep 2020 12:54:46 +0000 (12:54 +0000)]
MFC r359926:

Improve the TCP blackhole detection. The principle is to reduce the
MSS in two steps and try each candidate two times. However, if two
candidates are the same (which is the case in TCP/IPv6), this candidate
was tested four times. This patch ensures that each candidate actually
reduced the MSS and is only tested 2 times. This reduces the time window
of missclassifying a temporary outage as an MTU issue.

3 years agoMFC r359487:
Michael Tuexen [Thu, 10 Sep 2020 12:52:50 +0000 (12:52 +0000)]
MFC r359487:

Allow the TCP backhole detection to be disabled at all, enabled only
for IPv4, enabled only for IPv6, and enabled for IPv4 and IPv6.
The current blackhole detection might classify a temporary outage as
an MTU issue and reduces permanently the MSS. Since the consequences of
such a reduction due to a misclassification are much more drastically
for IPv4 than for IPv6, allow the administrator to enable it for IPv6 only.

Manually resolve conflict for BBR, which does not exist in stable/12

3 years agoMFC 359422:
Michael Tuexen [Thu, 10 Sep 2020 12:49:16 +0000 (12:49 +0000)]
MFC 359422:
Be a bit more precisly in the description of the sysctl variable
net.inet.tcp.pmtud_blackhole_detection. Also remove three entries,
which are not sysctl variables but statistic counters for TCP.
Thanks to 0mp@ for suggesting an improvement.

3 years agoMFC r364438, r364440, r364483:
Mark Johnston [Thu, 10 Sep 2020 12:41:01 +0000 (12:41 +0000)]
MFC r364438, r364440, r364483:
Enable creation of static userspace probes in incremental builds.

3 years agoMFC r361081:
Michael Tuexen [Thu, 10 Sep 2020 12:01:35 +0000 (12:01 +0000)]
MFC r361081:

Allow only IPv4 addresses in sendto() for TCP on AF_INET sockets.

This problem was found by looking at syzkaller reproducers for some other
problems.

3 years agoMFC r361752:
Michael Tuexen [Thu, 10 Sep 2020 11:55:45 +0000 (11:55 +0000)]
MFC r361752:

We should never allow either the broadcast or IN_ADDR_ANY to be
connected to or sent to. This was fond when working with Michael
Tuexen and Skyzaller. Skyzaller seems to want to use either of
these two addresses to connect to at times. And it really is
an error to do so, so lets not allow that behavior.

MFC r363256:
(Re)-allow 0.0.0.0 to be used as an address in connect() for TCP
In r361752 an error handling was introduced for using 0.0.0.0 or
255.255.255.255 as the address in connect() for TCP, since both
addresses can't be used. However, the stack maps 0.0.0.0 implicitly
to a local address and at least two regressions were reported.
Therefore, re-allow the usage of 0.0.0.0.
While there, change the error indicated when using 255.255.255.255
from EAFNOSUPPORT to EACCES as mentioned in the man-page of connect().

3 years agoMFC r364089:
Michael Tuexen [Thu, 10 Sep 2020 11:46:36 +0000 (11:46 +0000)]
MFC r364089:

Fix the following issues related to the TCP SYN-cache:
* Let the accepted TCP/IPv4 socket inherit the configured TTL and
  TOS value.
* Let the accepted TCP/IPv6 socket inherit the configured Hop Limit.
* Use the configured Hop Limit and Traffic Class when sending
  IPv6 packets.

3 years agoMFC r364054:
Michael Tuexen [Thu, 10 Sep 2020 11:45:03 +0000 (11:45 +0000)]
MFC r364054:

Improve the ECN negotiation when the TCP SYN-cache is used by making
sure that
* ECN is disabled if the client sends an non-ECN-setup SYN segment.
* ECN is disabled is the ECN-setup SYN-ACK segment is retransmitted more
  than net.inet.tcp.ecn.maxretries times.

3 years agoMFC r361750:
Michael Tuexen [Thu, 10 Sep 2020 11:43:23 +0000 (11:43 +0000)]
MFC r361750:

Restrict enabling TCP-FASTOPEN to end-points in CLOSED or LISTEN state

Enabling TCP-FASTOPEN on an end-point which is in a state other than
CLOSED or LISTEN, is a bug in the application. So it should not work.
Also the TCP code does not (and needs not to) handle this.
While there, also simplify the setting of the TF_FASTOPEN flag.

3 years agoMFC r364340, r364343, r364656
Peter Grehan [Thu, 10 Sep 2020 10:49:59 +0000 (10:49 +0000)]
MFC r364340, r364343, r364656

  r364340    Support guest rdtscp and rdpid instructions on Intel VT-x

  Follow-on commits:
  r364343    Export a routine to provide the TSC_AUX MSR value and use this in vmm
  r364656    assert caller is preventing CPU migration

  Submitted by: adam_fenn.io
  Differential Revision: https://reviews.freebsd.org/D26003

3 years agoMFC r365288: twsi: replace a couple of errno codes with i2c error codes
Andriy Gapon [Thu, 10 Sep 2020 09:10:33 +0000 (09:10 +0000)]
MFC r365288: twsi: replace a couple of errno codes with i2c error codes

3 years agoMFC r365289: twsi: no need to compare boolean with boolean constant
Andriy Gapon [Thu, 10 Sep 2020 09:01:59 +0000 (09:01 +0000)]
MFC r365289: twsi: no need to compare boolean with boolean constant

3 years agoMFC r365403:
Li-Wen Hsu [Thu, 10 Sep 2020 04:17:05 +0000 (04:17 +0000)]
MFC r365403:

Slightly improve usb(4)

- Mention USB 3.0
- Update links
- Fix `mandoc -T lint` warnings

Reviewed by: bcr, hselasky
Differential Revision: https://reviews.freebsd.org/D26349

3 years agoMFC r365284:
Brooks Davis [Wed, 9 Sep 2020 23:11:55 +0000 (23:11 +0000)]
MFC r365284:

Always report ENOSYS in init

While rare, encountering an unimplemented system call early in init is
catastrophic and difficult to debug.  Even after a SIGSYS handler is
registered, such configurations are problematic.  As such, always report
such events for pid 1 (following kern.lognosys if non-zero).

Reviewed by: kevans, imp
Obtained from: CheriBSD (plus suggestions from kevans)
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D26288

3 years agoMFC r365016 | imp | 2020-08-31 17:48:23 -0600 (Mon, 31 Aug 2020) | 2 lines
Warner Losh [Wed, 9 Sep 2020 23:06:35 +0000 (23:06 +0000)]
MFC r365016 | imp | 2020-08-31 17:48:23 -0600 (Mon, 31 Aug 2020) | 2 lines

Add documentation for ETHERNET events.

3 years agoMFC r365015:
Warner Losh [Wed, 9 Sep 2020 23:05:47 +0000 (23:05 +0000)]
MFC r365015:
r365015 | imp | 2020-08-31 17:31:16 -0600 (Mon, 31 Aug 2020) | 12 lines

Warn for the non pccard attachments

These devices have non-pccard attachments. Warn for those as well. Both an and
wi don't do the modern cyrpto needed to use these cards on secure wifi networks.
an needs firmware from Cisco, which I don't think was ever produced. wi could
in theory do it with raw frames and on-host encryption, but nobody has written
that in the 15 years since WEP was cracked.

MFC After: 3 days
Noticed by: rgrimes
Differential Revision: https://reviews.freebsd.org/D26138

3 years agoMFC: r365009
Warner Losh [Wed, 9 Sep 2020 23:04:40 +0000 (23:04 +0000)]
MFC: r365009
r365009 | imp | 2020-08-31 15:04:00 -0600 (Mon, 31 Aug 2020) | 10 lines

Add deprecation notice for apm BIOS

Add deprecation notice for apm bios, aka the apm(4) device. The apm(8)
command will remain, at least for a while, since ACPI emulates the apm
ioctl interface.

Discussed on: arch@
Relnotes: yes
MFC After: 3 days

3 years agoMFC r364824:
Warner Losh [Wed, 9 Sep 2020 23:01:55 +0000 (23:01 +0000)]
MFC r364824:

r364824 | imp | 2020-08-26 11:06:16 -0600 (Wed, 26 Aug 2020) | 8 lines

Make sbuf_setpos match the implementation.

sbuf_setpos can only be used to truncate the buffer, never to make it
longer. Update the documentation to reflect this.

Reviewed By: allanjude, phk
Differential Revision: https://reviews.freebsd.org/D26198

3 years agoMFC r364725, r364726
Warner Losh [Wed, 9 Sep 2020 22:59:47 +0000 (22:59 +0000)]
MFC r364725, r364726

r364725 | imp | 2020-08-24 13:35:15 -0600 (Mon, 24 Aug 2020) | 9 lines

Change the resume notification event from 'kern' to 'kernel'

We have both a system of 'kern' and of 'kernel'. Prefer the latter and
convert this notification to use 'kernel' instead of 'kern'. As a
transition period, continue to also generate the 'kern' notification
until sometime after FreeBSD 13 is branched.

r364726 | imp | 2020-08-24 13:35:27 -0600 (Mon, 24 Aug 2020) | 4 lines

Document the kern -> kernel name change for resume events.

Relnotes: YES

3 years agoMFC: 364430:
Warner Losh [Wed, 9 Sep 2020 22:54:09 +0000 (22:54 +0000)]
MFC: 364430:
r364430 | imp | 2020-08-20 11:19:40 -0600 (Thu, 20 Aug 2020) | 6 lines

Tag pccard drivers with gone in 13.

MFC After: 3 days
Reviewed by: emaste, brooks, adrian (on twitter)
Differential Revision: https://reviews.freebsd.org/D26095

3 years agoMFC r364424:
Warner Losh [Wed, 9 Sep 2020 22:51:58 +0000 (22:51 +0000)]
MFC r364424:
r364424 | imp | 2020-08-20 10:52:34 -0600 (Thu, 20 Aug 2020) | 5 lines

Fix function name in zone.9

uma_zone_prealloc -> uma_prealloc. There's no uma_zone_prealloc defined and the
docs for it describe uma_prealloc exactly.

3 years agoMFC r364359, r364360, r364361, r364362, r364364, r364370
Warner Losh [Wed, 9 Sep 2020 22:49:43 +0000 (22:49 +0000)]
MFC r364359, r364360, r364361, r364362, r364364, r364370

r364359 | imp | 2020-08-18 15:26:39 -0600 (Tue, 18 Aug 2020) | 9 lines

Move the possible event types into a column table to make it easier to read.

Sort system type alphabetically.
Remove some commas that aren't in the devd notification messages.

MFC After: 3 days
Reviewed by: 0mp (earlier versions), jhb (useful feedback on earlier versions)
Differential Revision: https://reviews.freebsd.org/D26105

r364360 | imp | 2020-08-18 15:26:45 -0600 (Tue, 18 Aug 2020) | 4 lines

GEOM::rotation_rate changes are also signaled via devctl.

MFC After: 3 days

r364361 | imp | 2020-08-18 15:26:50 -0600 (Tue, 18 Aug 2020) | 8 lines

Document the PMU system

The pmu(4) and adb(4) drivers on powerpc generate PMU events. Document them.

The allwinner power modules also generate these events. Document those as well.

MFC After: 3 days

r364362 | imp | 2020-08-18 15:26:54 -0600 (Tue, 18 Aug 2020) | 4 lines

Document the AEON subsystem for the Amiga's power button.

MFC After: 3 days

r364364 | imp | 2020-08-18 15:42:02 -0600 (Tue, 18 Aug 2020) | 5 lines

Fix two typos.

Submitted by: rpokala@
MFC After: 3 days

r364370 | imp | 2020-08-18 20:18:11 -0600 (Tue, 18 Aug 2020) | 8 lines

Three typos:
Amiga is a proper noun
Condition is traditionally spelled starting with 'c'
Some, but not all, of the over/under-voltage instances were hyphenated.
Since they are all adverb phrases, they all need to be hyphenated.

Pointy hat: imp

3 years agoMFC r364335,r364336,r364337,r364351
Warner Losh [Wed, 9 Sep 2020 22:45:11 +0000 (22:45 +0000)]
MFC r364335,r364336,r364337,r364351

r364335 | imp | 2020-08-18 00:07:34 -0600 (Tue, 18 Aug 2020) | 6 lines

Modernize a bit.

Remove PC Card specific information. It's of little value these days and on
the way out after most of its drivers have been removed.
Use iwn instead of wi device.

r364336 | imp | 2020-08-18 00:18:18 -0600 (Tue, 18 Aug 2020) | 9 lines

Document that PC Card will likely be removed before 13.

This was discussed in arch@ a while ago. Most of the 16-bit drivers that it
relied on have been removed. There's only a few other drivers remaining that
support it, and those are very rare the days (even the once ubiquitious wi(1)
is now quite rare).

Indvidual drivers will be handled separately before pccard itself is removed.

r364337 | imp | 2020-08-18 00:34:56 -0600 (Tue, 18 Aug 2020) | 2 lines

Use better gone_in_dev rather than just gone_in to print the device name.

r364351 | imp | 2020-08-18 11:29:01 -0600 (Tue, 18 Aug 2020) | 4 lines

bt(4) has already been removed. Add a deprecation notice.

MFC After: 1 day

3 years agoMFC r364291:
Warner Losh [Wed, 9 Sep 2020 22:42:14 +0000 (22:42 +0000)]
MFC r364291:
r364291 | imp | 2020-08-16 17:55:23 -0600 (Sun, 16 Aug 2020) | 33 lines

Remove heuristic for dealing with trailing newlines being truncated by mailers.
...

3 years agoMFC r363408:
Warner Losh [Wed, 9 Sep 2020 22:40:14 +0000 (22:40 +0000)]
MFC r363408:
r363408 | imp | 2020-07-21 18:44:47 -0600 (Tue, 21 Jul 2020) | 4 lines

getty appears to date from 3rd edition research unix. That's the oldest man page
on TUHS and its 'unix 1972' restoration effort has assembler sources that look
like simpler version of what's in the 5th edition.

3 years agoMFC r362664, r362665:
Warner Losh [Wed, 9 Sep 2020 22:38:18 +0000 (22:38 +0000)]
MFC r362664, r362665:

r362664 | imp | 2020-06-26 16:05:23 -0600 (Fri, 26 Jun 2020) | 21 lines
Chroot(2) actually appeared in 7th Edition Unix. ...

r362665 | imp | 2020-06-26 16:23:15 -0600 (Fri, 26 Jun 2020) | 10 lines
Chroot(8) first appeared in 4.3-Reno, not in 4.4 in the BSD world,
but in System III in the AT&T world.

Examination of the TUHS archives shows this was present in 4.3-Reno
and System III.

Reviewed by: 0mp@, allanjude@
MFC After: 3 days
Differential Revision: https://reviews.freebsd.org/D25479

3 years agoMFC r362420:
Warner Losh [Wed, 9 Sep 2020 22:35:39 +0000 (22:35 +0000)]
MFC r362420:

r362420 | imp | 2020-06-19 22:07:44 -0600 (Fri, 19 Jun 2020) | 13 lines

Correct 1BSD release date.

The Quarter Century of Unix book said that 1BSD was released March 1979.
However, the 1BSD tape image that's on Kirk's historical unix collection has an
earlier date.

It was common practice, at the time, to create a new copy of the tape from the
master system when a new tape was to go out, so several different versions of
1BSD, etc were shipped from Berkerely. The date on the 1BSD tape in the Berkeley
archives on Kirk's DVD is dated in January 16 1979 on the label, and has dates
as late as Jan 29 (there's an UPDATE file that says this includes updates
through this date). Note this date as well.

3 years agoMFC: r361882:
Warner Losh [Wed, 9 Sep 2020 22:33:11 +0000 (22:33 +0000)]
MFC: r361882:

r361882 | imp | 2020-06-06 20:40:21 -0600 (Sat, 06 Jun 2020) | 2 lines

Mention nda where we mention nvd.

3 years agoMFC: r361868:
Warner Losh [Wed, 9 Sep 2020 22:30:43 +0000 (22:30 +0000)]
MFC: r361868:
r361868 | imp | 2020-06-06 00:49:06 -0600 (Sat, 06 Jun 2020) | 4 lines

Fix typo

Submitted by: Yuri Pankov

3 years agoMFC r361867:
Warner Losh [Wed, 9 Sep 2020 22:29:44 +0000 (22:29 +0000)]
MFC r361867:
r361867 | imp | 2020-06-06 00:21:20 -0600 (Sat, 06 Jun 2020) | 4 lines

Document all the sysctl values for the nda devices. Include some minimal
documentation on namespace support for nda devices. Fix a few typos
and formatting nits to apease igor.

3 years agoMFC r361673:
Warner Losh [Wed, 9 Sep 2020 22:24:09 +0000 (22:24 +0000)]
MFC r361673:
r361673 | imp | 2020-05-31 15:38:33 -0600 (Sun, 31 May 2020) | 14 lines

Correct the release date for 2.11BSD

2.11BSD was announced on March 14, 1991 in comp.bugs.2bsd by
Steven M. Schultz. The document has a 'revised January 1991'
date at the top.

Patch/1 in the official repo is dated March 31, 1991, and an identical copy of
it was posted to comp.bugs.2bsd on May 5, 1991. Patch 2 in 22 parts was likewise
posted May 18, 1991. This makes the Feb 1992 date too late. It's possible it's a
typo for Feb 1991 since that lines up with the announcement being 2 weeks
later. Without an extant copy of the 2.11 tape, however, it's hard to say for
sure. Go with the date we have the most independent, direct evidence for, which
is the announcement date.

3 years agoMFC r360993:
Warner Losh [Wed, 9 Sep 2020 22:22:38 +0000 (22:22 +0000)]
MFC r360993:
r360993 | imp | 2020-05-12 16:44:51 -0600 (Tue, 12 May 2020) | 6 lines

Refine the history of uname. It appeared in 4.4BSD. It was not in v7 unix. It
was one of the additions in PWB, and appeared in System III and later commercial
versions of Unix. The different args to uname weren't aded until System III. Add
a quick note to note the late entry into the BSD fork of Unix since PWB
otherwise implies a pre-fork date.

3 years agoMFC r365279:
Brooks Davis [Wed, 9 Sep 2020 21:57:55 +0000 (21:57 +0000)]
MFC r365279:

Remove risky compatability with old kernels

The badsys() handler for SIGSYS was added as a transtion aid for kernels
lacking sysctl() in 1993.  It is unsafe and unsound so remove it rather
than running the risk of a privilege-dropping system call being silently
omitted.

This partially reverts SCCSID 6.12 (Berkeley) 03/03/93 "add code to
change the system security level".

Reviewed by: mckusick, imp, kevans
Obtained from: CheriBSD
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D26289

3 years agoMFC r365262:
Alan Somers [Wed, 9 Sep 2020 13:16:20 +0000 (13:16 +0000)]
MFC r365262:

Fix output of nfsstat -cE in json or xml mode

Due to a copy/paste error, the "getacl" field was duplicated, but only in
XML or JSON mode, not in txt mode.

Discussed with: rmacklem
Sponsored by: Axcient

3 years agoMFC 362123: Fix AES-CCM requests with an AAD size smaller than a single block.
John Baldwin [Tue, 8 Sep 2020 23:19:59 +0000 (23:19 +0000)]
MFC 362123: Fix AES-CCM requests with an AAD size smaller than a single block.

The amount to copy for the first block is the minimum of the size of
the AAD region or the remaining space in the first block.

3 years agoMFC 359900: Export a sysctl count of RX FIFO overrun events.
John Baldwin [Tue, 8 Sep 2020 22:50:24 +0000 (22:50 +0000)]
MFC 359900: Export a sysctl count of RX FIFO overrun events.

uart(4) backends currently detect RX FIFO overrun errors and report
them to the uart(4) core layer.  They are then reported to the generic
TTY layer which promptly ignores them.  As a result, there is
currently no good way to determine if a uart is experiencing RX FIFO
overruns.  One could add a generic per-tty counter, but there did not
appear to be a good way to export those.  Instead, add a sysctl under
the uart(4) sysctl tree to export the count of overruns.

3 years agoMFC 359899: Correct baud rate error calculation.
John Baldwin [Tue, 8 Sep 2020 22:19:06 +0000 (22:19 +0000)]
MFC 359899: Correct baud rate error calculation.

Shifting right by 1 is not the same as dividing by 2 for signed
values.  In particular, dividing a signed value by 2 gives the integer
ceiling of the (e.g. -5 / 2 == -2) whereas shifting right by 1 always
gives the floor (-5 >> 1 == -3).

An embedded board with a 25 Mhz base clock results in an error of
-30.5% when used with a baud rate of 115200.  Using division, this
truncates to -30% and is permitted.  Using the shift, this fails and
is rejected causing TIOCSETA requests to fail with EINVAL and breaking
getty(8).

Using division gives the same error range for both over and under baud
rates and also makes the code match the behavior documented in the
existing comment about supporting boards with 25 Mhz clocks.

3 years agoMFC 359467: Trim some duplicate EIO descriptions.
John Baldwin [Tue, 8 Sep 2020 20:53:44 +0000 (20:53 +0000)]
MFC 359467: Trim some duplicate EIO descriptions.

While here, drop an extra conjunction from the list of error
conditions for the remaining EIO description in symlink(2).

3 years agoMFC 359465: Document EINTEGRITY errors for many system calls.
John Baldwin [Tue, 8 Sep 2020 20:51:19 +0000 (20:51 +0000)]
MFC 359465: Document EINTEGRITY errors for many system calls.

EINTEGRITY was previously documented as a UFS-specific error for
mount(2).  This documents EINTEGRITY as a filesystem-independent error
that may be reported by the backing store of a filesystem.

While here, document EIO as a filesystem-independent error for both
mount(2) and posix_fadvise(2).  EIO was previously only documented for
UFS for mount(2).

3 years agoRevert r365471 as it is breaking with old gcc on various arches:
Dimitry Andric [Tue, 8 Sep 2020 20:28:39 +0000 (20:28 +0000)]
Revert r365471 as it is breaking with old gcc on various arches:

MFC r364753:

Add atomic and bswap functions to libcompiler_rt

There have been several mentions on our mailing lists about missing
atomic functions in our system libraries (e.g. __atomic_load_8 and
friends), and recently I saw __bswapdi2 and __bswapsi2 mentioned too.

To address this, add implementations for the functions from compiler-rt
to the system compiler support libraries, e.g. libcompiler_rt.a and and
libgcc_s.so.

This also needs a small fixup in compiler-rt's atomic.c, to ensure that
32-bit mips can build correctly.

Bump __FreeBSD_version to make it easier for port maintainers to detect
when these functions were added.

PR: 230888
Differential Revision: https://reviews.freebsd.org/D26159

MFC r364782:

After r364753, there should be no need to suppress -Watomic-alignment
warnings anymore for compiler-rt's atomic.c. This occurred because the
IS_LOCK_FREE_8 macro was not correctly defined to 0 for mips, and this
caused the compiler to emit a runtime call to __atomic_is_lock_free(),
and that triggers the warning.

3 years agoMFC r364753:
Dimitry Andric [Tue, 8 Sep 2020 20:02:08 +0000 (20:02 +0000)]
MFC r364753:

Add atomic and bswap functions to libcompiler_rt

There have been several mentions on our mailing lists about missing
atomic functions in our system libraries (e.g. __atomic_load_8 and
friends), and recently I saw __bswapdi2 and __bswapsi2 mentioned too.

To address this, add implementations for the functions from compiler-rt
to the system compiler support libraries, e.g. libcompiler_rt.a and and
libgcc_s.so.

This also needs a small fixup in compiler-rt's atomic.c, to ensure that
32-bit mips can build correctly.

Bump __FreeBSD_version to make it easier for port maintainers to detect
when these functions were added.

PR: 230888
Differential Revision: https://reviews.freebsd.org/D26159

MFC r364782:

After r364753, there should be no need to suppress -Watomic-alignment
warnings anymore for compiler-rt's atomic.c. This occurred because the
IS_LOCK_FREE_8 macro was not correctly defined to 0 for mips, and this
caused the compiler to emit a runtime call to __atomic_is_lock_free(),
and that triggers the warning.

3 years agoMFC 361764: Revise r361712 to disable tcpmd5.ko for 'options TCP_SIGNATURE'
John Baldwin [Tue, 8 Sep 2020 18:58:38 +0000 (18:58 +0000)]
MFC 361764: Revise r361712 to disable tcpmd5.ko for 'options TCP_SIGNATURE'

3 years agoUse kmod.opts.mk in sys/modules/tcp/Makefile to fix standalone builds.
John Baldwin [Tue, 8 Sep 2020 18:49:58 +0000 (18:49 +0000)]
Use kmod.opts.mk in sys/modules/tcp/Makefile to fix standalone builds.

This was included in the original commit to head that added use of
KERN_OPTS (r361638) but was left out of the MFC since kmod.opts.mk
hadn't been MFC'd at the time.  It has since been merged.

This is a direct commit to stable/11 and stable/12.

Reported by: Eugene Grosbein <eugen@grosbein.net>

3 years agoPartial MFC 357275: if_vlan grew a dependency on opt_inet6.h in r356993
John Baldwin [Tue, 8 Sep 2020 18:33:41 +0000 (18:33 +0000)]
Partial MFC 357275: if_vlan grew a dependency on opt_inet6.h in r356993

3 years agoMFC 361634: Add opt_ipsec.h to fix standalone builds after r361633.
John Baldwin [Tue, 8 Sep 2020 18:29:20 +0000 (18:29 +0000)]
MFC 361634: Add opt_ipsec.h to fix standalone builds after r361633.

3 years agoMFC 354970: Add a kmod.opts.mk.
John Baldwin [Tue, 8 Sep 2020 16:43:32 +0000 (16:43 +0000)]
MFC 354970: Add a kmod.opts.mk.

This Makefile sets KERN_OPTS.  This permits kernel module Makefiles to
use KERN_OPTS to control the value of variables such as SRCS that are
used by bsd.kmod.mk for KERN_OPTS values that honor WITH/WITHOUT
options for standalone builds.

3 years agoMFC r365043-r365046:
Mark Johnston [Tue, 8 Sep 2020 12:38:34 +0000 (12:38 +0000)]
MFC r365043-r365046:
pw: Coverity fixes.

3 years agoMFC r365048:
Mark Johnston [Tue, 8 Sep 2020 12:37:46 +0000 (12:37 +0000)]
MFC r365048:
Tighten frame pointer checking in DTrace's amd64 stack unwinder.

3 years agoMFC r365047:
Mark Johnston [Tue, 8 Sep 2020 12:37:18 +0000 (12:37 +0000)]
MFC r365047:
Correct the D definition for EINTEGRITY.

3 years agoMFC r364369:
Robert Wing [Tue, 8 Sep 2020 07:37:45 +0000 (07:37 +0000)]
MFC r364369:

bectl(8): Fix output of 'bectl list' for the 'Mountpoint' column.

PR: 241064

3 years agoMFC 364339
Peter Grehan [Tue, 8 Sep 2020 03:55:49 +0000 (03:55 +0000)]
MFC 364339
   Allow guest device MMIO access from bootmem memory segments.

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

3 years agoMFC r364995:
Mark Johnston [Mon, 7 Sep 2020 23:22:16 +0000 (23:22 +0000)]
MFC r364995:
ggated(8): Avoid doubly opening the requested disk device.

PR: 132845

3 years agoMFC r364993:
Mark Johnston [Mon, 7 Sep 2020 23:21:53 +0000 (23:21 +0000)]
MFC r364993:
rtwn(4): Add support for the Belkin N300.

PR: 249034

3 years agoMFC r364982: ipv6: quit dropping packets looping back on p2p interfaces
Kyle Evans [Mon, 7 Sep 2020 23:20:02 +0000 (23:20 +0000)]
MFC r364982: ipv6: quit dropping packets looping back on p2p interfaces

PR: 247718

3 years agoMFC r365429:
Dimitry Andric [Mon, 7 Sep 2020 20:17:13 +0000 (20:17 +0000)]
MFC r365429:

Merge commit 47b0262d3 from llvm git (by me):

  Add <stdarg.h> include to kmp_os.h, to get the va_list type, required
  after cde8f4c164a2. Sort system includes, while here.

The original merged commit works fine by itself on head, but fails to
compile on stable branches because stdarg.h is not implicitly pulled in.

PR: 248864

3 years agoMFC r364732:
Dimitry Andric [Mon, 7 Sep 2020 19:35:30 +0000 (19:35 +0000)]
MFC r364732:

Merge commit cde8f4c16 from llvm git (by me):

  Move special va_list handling to kmp_os.h

  Instead of copying and pasting the same #ifdef expressions in
  multiple places, define a type and a pair of macros in kmp_os.h, to
  handle whether va_list is pointer-like or not:

  * kmp_va_list is the type to use for __kmp_fork_call()
  * kmp_va_deref() dereferences a va_list, if necessary
  * kmp_va_addr_of() takes the address of a va_list, if necessary

  Also add FreeBSD to the list of OSes that has a non pointer-like
  va_list. This can now be easily extended to other OSes too.

  Reviewed By: AndreyChurbanov

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

This should enable building of LLVM's OpenMP on AArch64. Addition to
share/mk will follow in a subsequent commit.

PR: 248864

MFC r364733:

After r364732, we can now enable MK_OPENMP for aarch64 by default.

PR: 248864

3 years agoMFC r364081:
Dimitry Andric [Mon, 7 Sep 2020 19:29:06 +0000 (19:29 +0000)]
MFC r364081:

Follow-up to r358851 (llvm-project 10.0.0-rc3 import), where I added
subdirectories for compiler-rt's internal fuzzer, profile and xray
headers, but forgot to add installing those headers themselves.

3 years agoRevert r364939 and add a stable/12 approach for populating the ESP
Oleksandr Tymoshenko [Mon, 7 Sep 2020 18:47:25 +0000 (18:47 +0000)]
Revert r364939 and add a stable/12 approach for populating the ESP

make_esp_file is not available in stable/12 so r364939 broke VM-related targets.
Revert offending commit and use pre-r342283 approach to populate ESP partition.

PR: 249168
Tested on: VirtualBox, Hyper-V v2 VM

3 years agoTPC rack: use #error rather than syntax error
Ed Maste [Mon, 7 Sep 2020 17:31:58 +0000 (17:31 +0000)]
TPC rack: use #error rather than syntax error

Until the changes to make this a proper dependency are merged, avoid using
a syntax error for a user-facing error report.

PR: 249037
Suggested by: avg

3 years agoMFC r364684:
Marc Fonvieille [Mon, 7 Sep 2020 16:11:49 +0000 (16:11 +0000)]
MFC r364684:

s/redundacy/redundancy

3 years agoMFC r364682:
Marc Fonvieille [Mon, 7 Sep 2020 16:09:37 +0000 (16:09 +0000)]
MFC r364682:

Add missing Korean doc package entry, remove non-existent Serbian doc
package entry.

Approved by: re (gjb)

3 years agoMFC r365328: fortune(6): Grammar fix for a hint on searching ports
Gordon Bergling [Mon, 7 Sep 2020 14:40:33 +0000 (14:40 +0000)]
MFC r365328: fortune(6): Grammar fix for a hint on searching ports

PR: 249078
Submitted by: PauAmma <pauamma at gundo dot com>
Reported by: PauAmma <pauamma at gundo dot com>

3 years agoMFC r365008: vtnet(4): improve the wording
Gordon Bergling [Mon, 7 Sep 2020 14:38:38 +0000 (14:38 +0000)]
MFC r365008: vtnet(4): improve the wording

PR: 247936
Submitted by: PauAmma <pauamma at gundo dot com>
Reported by: PauAmma <pauamma at gundo dot com>
Differential Revision: https://reviews.freebsd.org/D26244

3 years agoMFC r364466:
Bjoern A. Zeeb [Mon, 7 Sep 2020 14:22:27 +0000 (14:22 +0000)]
MFC r364466:

  After the clang/llvm version 11 import LLD_VERSION is no longer used
  upstream so Version.inc now only defines LLD_VERSION_STRING.

  This breaks the WANT_LINKER_VERSION magic and might lead to us building
  more than needed (e.g., for croos-tools).

  Change the awk script to parse LLD_VERSION_STRING instead of LLD_VERSION,
  which not only unbreaks the current situation but should also be backwards
  compatible as dim points out.

  Merging this before r364284 will ensure that stable/12 won't break.

  PR: 248818
  Reviewed by: emaste, dim (seems right and the way to go)

3 years agoMFC r365003:
Konstantin Belousov [Mon, 7 Sep 2020 10:37:44 +0000 (10:37 +0000)]
MFC r365003:
mlx5 sriov: Add controls for VFs to set port/node GUIDs.

3 years agoMFC r365002:
Konstantin Belousov [Mon, 7 Sep 2020 10:36:53 +0000 (10:36 +0000)]
MFC r365002:
mlx5 sriov: add error message for failed MAC programming on VF.

3 years agoMFC r365001:
Konstantin Belousov [Mon, 7 Sep 2020 10:36:07 +0000 (10:36 +0000)]
MFC r365001:
mlx5en: Implement SIOCGIFDOWNREASON.

3 years agoMFC r365000:
Konstantin Belousov [Mon, 7 Sep 2020 10:35:22 +0000 (10:35 +0000)]
MFC r365000:
mlx5_core: add mlx5_query_pddr().

3 years agoMFC r364999:
Konstantin Belousov [Mon, 7 Sep 2020 10:34:22 +0000 (10:34 +0000)]
MFC r364999:
mlx5_core: Import PDDR register definitions

3 years agoMFC r364149: aw_cir: in pulse encoding actual length is one greater than value
Andriy Gapon [Mon, 7 Sep 2020 06:22:30 +0000 (06:22 +0000)]
MFC r364149: aw_cir: in pulse encoding actual length is one greater than value

3 years agoMFC r364148: aw_cir: lower activation threshold to support NECx protocol
Andriy Gapon [Mon, 7 Sep 2020 06:21:01 +0000 (06:21 +0000)]
MFC r364148: aw_cir: lower activation threshold to support NECx protocol

3 years agoMFC r364145: gpiokeys: add evdev support
Andriy Gapon [Mon, 7 Sep 2020 06:14:42 +0000 (06:14 +0000)]
MFC r364145: gpiokeys: add evdev support

Only linux,code is supported as it maps 1:1 to evdev key codes.
No reverse mapping for freebsd,code yet.

3 years agoMFC r364098 by lwhsu:
Oleksandr Tymoshenko [Sun, 6 Sep 2020 20:03:13 +0000 (20:03 +0000)]
MFC r364098 by lwhsu:

Fix armv{6,7} build after r364088

Sponsored by: The FreeBSD Foundation

3 years agoMFC r362736, r364088
Oleksandr Tymoshenko [Sun, 6 Sep 2020 19:03:19 +0000 (19:03 +0000)]
MFC r362736, r364088

r362736:
Configure rx_delay/tx_delay values for RK3399/RK3328 GMAC

For 1000Mb mode to work reliably TX/RX delays need to be configured
between the TX/RX clock and the respective signals on the PHY
to compensate for differing trace lengths on the PCB.

Reviewed by: manu

r364088:
Improve Rockchip's integration of if_dwc

- Do not rely on U-Boot for clocks configuration, enable and set frequencies
    in the driver's attach method.
- Adjust MAC settings according to detected linespeed on RK3399 and RK3328.
- Add support for RMII PHY mode on RK3328.

Reviewed by: manu
Differential Revision: https://reviews.freebsd.org/D26006

3 years agoMFC r360467, r362399, r362405, r362415
Oleksandr Tymoshenko [Sun, 6 Sep 2020 18:48:50 +0000 (18:48 +0000)]
MFC r360467, r362399, r362405, r362415

r360467 by mmel:
Fix style(9). Strip write only variables.
Not a functional change.

r362399 by mmel:
Use naming nomenclature used in DesignWare TRM.
Use naming nomenclature used in DesignWare TRM.
This driver was written by using Altera (now Intel) documentation for Arria
FPGA manual. Unfortunately this manual used very different (and in some cases
opposite naming) for registers and descriptor fields. Unfortunately,
this makes future expansion extremely hard.

Should not been functional change.

r362405 by mmel:
Finish renaming in if_dwc.
By using DWC TRM terminology, normal descriptor format should be named
extended and alternate descriptor format should be named normal.

Should not been functional change.

r362415 by mmel:
Improve if_dwc:
 - refactorize packet receive path. Make sure that we don't leak mbufs
   and/or that we don't create holes in RX descriptor ring
 - slightly simplify handling with TX descriptors

3 years agoMFC r353843 by glebius:
Oleksandr Tymoshenko [Sun, 6 Sep 2020 18:27:36 +0000 (18:27 +0000)]
MFC r353843 by glebius:

Convert to if_foreach_llmaddr() KPI.

3 years agoMFC r350418 by br:
Oleksandr Tymoshenko [Sun, 6 Sep 2020 18:25:50 +0000 (18:25 +0000)]
MFC r350418 by br:

Add glue driver for Altera SOCFPGA Ethernet MAC (EMAC) found in
Terasic DE10-Pro (an Intel Stratix 10 GX/SX FPGA Development Kit).

The Altera EMAC is an instance of Synopsys DesignWare Gigabit MAC.

This driver sets correct clock range for MDIO interface on Intel Stratix 10
platform.

This is required due to lack of support for clock manager device for
this platform that could tell us the clock frequency value for ethernet
clock domain.

Sponsored by: DARPA, AFRL