Commit Graph

250489 Commits

Author SHA1 Message Date
Ed Maste
694034e227 Makefile.inc1: remove BINUTILS_BOOTSTRAP linker support
As of r359347 BINUTILS_BOOTSTRAP does not include the bfd linker.
2020-05-30 16:20:18 +00:00
Ed Maste
af689d1b59 Add deprecation notice to WITH_BINUTILS option description 2020-05-30 16:13:21 +00:00
Ed Maste
4e2264e435 Add deprecation notice to WITH_BINUTILS option description 2020-05-30 16:12:50 +00:00
Ed Maste
fd71da37d4 Disable BINUTILS by default on amd64
The retirement of obsolete binutils 2.17.50 has been in progress for
quite some time.  All tools other than GNU as were removed prior to this
commit, and it was built only on amd64 - installed as /usr/bin/as, and
used as a bootstrap tool.

The amd64 exp-run has completed and failures have now been addressed in
the individual ports, so disable it by default.

PR:		233611, 205250 [exp-run]
Sponsored by:	The FreeBSD Foundation
2020-05-30 16:12:00 +00:00
Jilles Tjoelker
e0f5c1387d sh: Allow more scripts without #!
Austin Group bugs #1226 and #1250 changed the requirements for shell scripts
without #! (POSIX does not specify #!; this is about the shell execution
when execve(2) returns an [ENOEXEC] error).

POSIX says we shall allow execution if the initial part intended to be
parsed by the shell consists of characters and does not contain the NUL
character.  This allows concatenating a shell script (ending with exec or
exit) and a binary payload.

In order to reject common binary files such as PNG images, check that there
is a lowercase letter or expansion before the last newline before the NUL
character, in addition to the check for the newline character suggested by
POSIX.
2020-05-30 16:00:49 +00:00
Mike Karels
51cefda170 genet: workaround for problem with ICMPv6 echo replies
The ICMPv6 echo reply is constructed with the IPv6 header too close to
the beginning of a packet for an Ethernet header to be prepended, so we
end up with an mbuf containing just the Ethernet header.  The GENET
controller doesn't seem to handle this, with or without transmit checksum
offload.  At least until we have chip documentation, do a pullup to
satisfy the chip.  Hopefully this can be fixed properly in the future.
2020-05-30 02:09:36 +00:00
Mike Karels
0add2a5229 genet: fix issues with transmit checksum offload
Fix problem with ICMP echo replies: check only deferred data checksum
flags, and not the received checksum status bits, when checking whether
a packet has a deferred checksum; otherwise echo replies are corrupted
because the received checksum status bits are still present.

Fix some unhandled cases in packet shuffling for checksum offload.
2020-05-30 02:02:34 +00:00
Doug Moore
9628f49377 RB_REMOVE invokes RB_REMOVE_COLOR either when child is red or child is
null. In the first case, RB_REMOVE_COLOR just changes the child to
black and returns. With this change, RB_REMOVE handles that case, and
drops the child argument to RB_REMOVE_COLOR, since that value is
always null.

RB_REMOVE_COLOR is changed to remove a couple of unneeded tests, and
to eliminate some deep indentation.

RB_ISRED is defined to combine a null check with a test for redness,
to replace that combination in several places.

Reviewed by:	markj
Tested by:	pho
Differential Revision:	https://reviews.freebsd.org/D25032
2020-05-30 01:48:12 +00:00
John Baldwin
1319a76179 Only build ipsec modules if the kernel includes IPSEC_SUPPORT.
Honoring the kernel-supplied opt_ipsec.h in r361632 causes builds of
ipsec modules to fail if the kernel doesn't include IPSEC_SUPPORT.
However, the module can never be loaded into such a kernel, so only
build the modules if the kernel includes IPSEC_SUPPORT.

Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D25059
2020-05-30 00:47:03 +00:00
Adrian Chadd
c775d4ac42 [run] Don't add 11ng channels (2GHz) for RF2020
Don't also add the 11ng channels if we're not in 11n mode or net80211 will
get super weird.
2020-05-30 00:07:42 +00:00
Adrian Chadd
700af579c5 [run] Set ampdu rxmax same as linux; RF2020 isn't an 11n NIC
This is from the linux driver:

* set the ampdu rx max to 32k for 1 stream devics like mine, and
  64k for larger ones
* Don't enable 11n bits for RF2020
2020-05-30 00:06:26 +00:00
Conrad Meyer
b71dc87559 geom_part: Dispatch to partitions to create providers and aliases
This allows partitions to create additional aliases of their own.  The
default method implementations preserve the existing behavior.

No functional change.

Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D24938
2020-05-29 19:44:18 +00:00
John Baldwin
6f9454895c Add opt_ipsec.h to fix standalone builds after r361633. 2020-05-29 19:29:10 +00:00
John Baldwin
28d2a72bbf Consistently include opt_ipsec.h for consumers of <netipsec/ipsec.h>.
This fixes ipsec.ko to include all of IPSEC_DEBUG.

Reviewed by:	imp
MFC after:	2 weeks
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D25046
2020-05-29 19:22:40 +00:00
John Baldwin
4bcbd26ff8 Honor opt_ipsec.h from kernel builds.
To make this simpler, set the default contents of opt_ipsec.h
for standalone modules in sys/conf/config.mk.

Reviewed by:	imp
MFC after:	2 weeks
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D25046
2020-05-29 19:21:35 +00:00
Alexander Motin
ec18cf79e6 Remove session locking from cfiscsi_pdu_update_cmdsn().
cs_cmdsn can be incremented with single atomic.  expcmdsn/maxcmdsn set in
cfiscsi_pdu_prepare() based on cs_cmdsn are not required to be updated
synchronously, only monotonically, that is achieved with lock there.

MFC after:	2 weeks
Sponsored by:	iXsystems, Inc.
2020-05-29 17:52:20 +00:00
Ed Maste
b22a6bb954 regen src.conf.5 after BINUTILS changes 2020-05-29 17:39:25 +00:00
Ed Maste
24930a2b4a Disable BINUTILS by default on i386
The retirement of obsolete binutils 2.17.50 has been in progress for
quite some time.  All tools other than GNU as were removed prior to this
commit, and it was built only on two archs:

i386, installed as /usr/bin/as
amd64, installed as /usr/bin/as and as a bootstrap tool

The i386 exp-run has completed and failures have been addressed in the
individual ports, so disable it there.

PR:		233611, 205250 [exp-run]
Sponsored by:	The FreeBSD Foundation
2020-05-29 17:36:54 +00:00
Adrian Chadd
f520d76129 [run] Add initial 802.11n support.
* Enable self-generated 11n frames
* add MCS rates for 1-stream and 2-stream rates; will do 3-stream
  once the rest of this tests out OK with other people.
* Hard-code 1 stream for now
* Add A-MPDU RX mbuf tagging
* RTS/CTS if doing RTSCTS in HT protmode as well as legacy; they're
  separate configuration flags
* Update the amrr rate index stuff - walk the rates array like others
  to find the right one - this now works for MCS and CCK/OFDM rates
* Add support for atheros fast frames/AMSDU support as we can generate
  those in net80211.

TODO:

* HT40 isn't enabled yet
* No A-MPDU support just yet; that requires some more firmware research
  and maybe porting some ath(4) A-MPDU support/tracking into net80211
* Short preamble flags aren't set yet for MCS; need to check the linux
  driver and see what's going on there
* Add 3x3 rates and set tx/rx stream configuration appropriately
* More 5GHz testing; I have a 3x3 dual band USB NIC coming soon that'll
  let me test this.
* Figure out why the RX path isn't performing as fast as it could -
  there's only a single buffer loaded at a time for the receive path
  in the USB bulk handler and this may not be super useful.

Tested:

* RT5390 usb, 1x1, RF5370 (2GHz radio), STA mode - A-MSDU TX, A-MPDU RX

Submitted by:	Ashish Gupta <ashishgu@andrew.cmu.edu>
Differential Revision:	https://reviews.freebsd.org/D22840
2020-05-29 15:56:44 +00:00
Alexander Motin
dbcf7598b0 Report STATUS_QUEUED/SENT in ctladm dumpooa output.
MFC after:	2 weeks
Sponsored by:	iXsystems, Inc.
2020-05-29 13:07:52 +00:00
Andrey V. Elsukov
e43ae8dcb5 Fix O_IP_FLOW_LOOKUP opcode handling.
Do not check table value matching when table lookup has failed.

Reported by:	Sergey Lobanov
MFC after:	1 week
2020-05-29 10:37:42 +00:00
Li-Wen Hsu
4d3aef0780 Revert r361497, these cases are fixed by r361617.
PR:		246737
Sponsored by:	The FreeBSD Foundation
2020-05-29 10:09:47 +00:00
Mateusz Guzik
1c58c09f5a uma: hide item_domain under ifdef NUMA
Fixes build warnings on mips.
2020-05-29 08:30:35 +00:00
Andriy Gapon
cffd37da23 do not enable pci bridge decoding on resume until I/O windows are restored
PCI bus driver restores most but not all of a child PCI-PCI bridge
configuration.  The bridge's I/O windows are restored by pcib driver and
that happens later in time.  This can be problematic because the Command
register is restored before the windows are restored.  If the firmware
programs the windows incorrectly or even does not program them at all,
then the bridge can start claiming I/O cycles that are not intended for
it.  This will continue until the correct windows are restored.

I have observed this problem with a buggy BIOS where after resuming from
S3 an I/O port window of a PCI-PCI bridge was configured with zero base
and limit causing the bridge to claim 0x0 - 0xFFF port range.  That
interfered with ACPI port access including ACPI PM Timer at port 0x808,
thus wreaking havoc in the time keeping.

The solution is to restore the Command register of PCI-PCI bridges after
the windows are restored in pcib driver.  While here, I decided that for
other PCI device types (normal and cardbus) it's better to restore the
Command register after their BARs are restored.

To do: per jhb's suggestion, move the window handling to pci driver.

Reviewed by:	imp, jhb, kib
MFC after:	2 weeks
Differential Revision: https://reviews.freebsd.org/D25028
2020-05-29 07:50:55 +00:00
Andriy Gapon
e298466ee2 corefile_open_last: don't keep a locked vnode while locking other ones
Consider this scenario:
- kern.corefile=/var/coredumps/%N.%U.%I.core
- multiple processes with the same name crash at the same time

It's possible that one process selects existing file N as oldvp while it
keeps looking for an unused file number.  Another process scans through
files and stumbles upon N.  That process would be blocked on the vnode
lock while holding the directory vnode exclusively locked.  The first
process would, thus, get blocked on the directory's vnode lock.

More generally, holding a file's vnode lock (oldvp) while trying to lock
its directory (for the next lookup) is a violation of the vnode locking
order.

I have observed this deadlock in the wild.

So, the change to keep oldvp "opened" but unlocked and to lock it again
only if it's to be returned as the result.
As kib noted, an alternative would be to keep the directory locked and
to use VOP_LOOKUP directly for scanning through existing core files.

Reviewed by:	kib
MFC after:	2 weeks
Differential Revision: https://reviews.freebsd.org/D25027
2020-05-29 07:44:02 +00:00
John Baldwin
4542cd9379 Increment the correct pointer when a crypto buffer spans an mbuf or iovec.
When a crypto_cursor_copyback() request spanned multiple mbufs or
iovecs, the pointer into the mbuf/iovec was incremented instead of the
pointer into the source buffer being copied from.

PR:		246737
Reported by:	Jenkins, ZFS test suite
Sponsored by:	Netflix
2020-05-29 05:41:21 +00:00
Alexander Motin
353c460050 Move EXPDATASN/R2TSN from PDU to CTL_PRIV_FRONTEND.
We any way have per-I/O space in CTL_PRIV_FRONTEND, while for PDU private
fields I have better use ideas.  Plus to me such use of PDU fields looked
a layering violation.

MFC after:	2 weeks
Sponsored by:	iXsystems, Inc.
2020-05-29 02:32:48 +00:00
Justin Hibbits
c4bc4ae778 powerpc: Stop advertising that POWER8 and POWER9 support HTM
HTM is on the chopping block, doesn't work on FreeBSD, and has only token
support in PowerISA 3.1 and POWER10.  Don't advertise something we'll never
support.
2020-05-29 00:46:31 +00:00
Rick Macklem
3f4739659e Oops two, missed syscall.mk as well. 2020-05-29 00:10:19 +00:00
John Baldwin
2684603c5f Permit SO_NO_DDP and SO_NO_OFFLOAD to be read via getsockopt(2).
MFC after:	2 weeks
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D24627
2020-05-29 00:09:12 +00:00
Adrian Chadd
5687a376df [mips] fix up the assembly generation of unaligned exception loads
I noticed that unaligned accesses were returning garbage values.

Give test data like this:

char testdata[] = { 0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf1, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, 0x5a };

Iterating through uint32_t space 1 byte at a time should
look like this:

freebsd-carambola2:/mnt# ./test
Hello, world!
offset 0 pointer 0x410b00 value 0x12345678 0x12345678
offset 1 pointer 0x410b01 value 0x3456789a 0x3456789a
offset 2 pointer 0x410b02 value 0x56789abc 0x56789abc
offset 3 pointer 0x410b03 value 0x789abcde 0x789abcde
offset 4 pointer 0x410b04 value 0x9abcdef1 0x9abcdef1
offset 5 pointer 0x410b05 value 0xbcdef123 0xbcdef123
offset 6 pointer 0x410b06 value 0xdef12345 0xdef12345
offset 7 pointer 0x410b07 value 0xf1234567 0xf1234567

.. but to begin with it looked like this:

offset 0 value 0x12345678
offset 1 value 0x00410a9a
offset 2 value 0x00419abc
offset 3 value 0x009abcde
offset 4 value 0x9abcdef1
offset 5 value 0x00410a23
offset 6 value 0x00412345
offset 7 value 0x00234567

The amusing reason? The compiler is generating the lwr/lwl incorrectly.
Here's an example after I tried to replace the two macros with a single
invocation and offset, rather than having the compiler compile in addiu
to s3 - but the bug is the same:

1044: 8a620003 lwl v0,0(s3)
1048: 9a730000 lwr s3,3(s3)

.. which is just totally trashy and wrong.

This explicitly tells the compiler to treat the output as being read
and written to, which is what lwl/lwr does with the destination
register.

I think a subsequent commit should unify these macros to skip an addiu,
but that can be a later commit.

Reviewed by:	jhb
Differential Revision:	https://reviews.freebsd.org/D25040
2020-05-29 00:05:43 +00:00
Rick Macklem
f4903a79fb Oops, missed syscall.h and sysproto.h for r361602.
Pointy hat goes on me.
2020-05-28 23:57:50 +00:00
Alexander Motin
30a31f6c71 Remove PDU_TOTAL_TRANSFER_LEN() macro.
I don't see a point to copy io->scsiio.kern_total_len into the request
PDU private field.  The io is going to stay with us till the end, and
kern_total_len field is not changed after being first initialized.

MFC after:	2 weeks
Sponsored by:	iXsystems, Inc.
2020-05-28 23:55:46 +00:00
Ed Maste
c5ea81f7a6 rename in-tree libevent v1 to libevent1
r316063 installed pf's embedded libevent as a private lib, with headers
in /usr/include/private/event.  Unfortunately we also have a copy of
libevent v2 included in ntp, which needed to be updated for compatibility
with OpenSSL 1.1.

As unadorned 'libevent' generally refers to libevent v2, be explicit that
this one is libevent v1.

Reviewed by:	vangyzen (earlier)
Differential Revision:	https://reviews.freebsd.org/D17275
2020-05-28 22:05:50 +00:00
Eric van Gyzen
0d0f3cdf58 Add an UPDATING entry for r360964
Reported by:	rpokala
Sponsored by:	Dell EMC Isilon
2020-05-28 22:05:33 +00:00
Eric van Gyzen
824214da64 Revert part of r360964
ports/devel/linux_libusb builds FreeBSD libusb with GCC 4.8.5
from devel/linux-c7-devtools.  Restore the tests for older GCC
in bsd.sys.mk to accomodate such ports.

Reported by:	tijl
Sponsored by:	Dell EMC Isilon
2020-05-28 21:56:31 +00:00
Alexander Motin
767300e87a Make struct ctl_be_lun first element of struct ctl_be_*_lun.
It allows to remove some extra pointer dereferences and slightly tightens
up the code by unification.

MFC after:	2 weeks
Sponsored by:	iXsystems, Inc.
2020-05-28 21:30:29 +00:00
Rick Macklem
6f05ed08c2 Add an entry to Symbol.map for the rpctls_syscall added by r361599.
Reviewed by:	brooks
Differential Revision:	https://reviews.freebsd.org/D24949
2020-05-28 21:26:26 +00:00
Rick Macklem
c01cd3f558 Update the files created from the new syscalls.master from r361599.
Reviewed by:	brooks
Differential Revision:	https://reviews.freebsd.org/D24949
2020-05-28 21:23:02 +00:00
Jason A. Harmening
98f7cf022c vt(4): Add support for `vidcontrol -C'
Extract scrollback buffer initialization into a common routine, used both
during vt(4) init and in handling the CONS_CLRHIST ioctl.

PR:		224436
Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D24815
2020-05-28 21:22:30 +00:00
Jung-uk Kim
0b229c80ae MFV: r361597
Import ACPICA 20200528.
2020-05-28 21:19:44 +00:00
Rick Macklem
d9021e389a Add a syscall for the nfs-over-tls daemons to use.
The nfs-over-tls daemons need a system call to perform operations such as
associate a file descriptor with a krpc socket.
The daemons will not be in head for some time, but it will make it
easier for testers of nfs-over-tls to do testing if the system call
is in head (basically the stub for libc which will be commited soon).

Reviewed by:	brooks
Differential Revision:	https://reviews.freebsd.org/D24949
2020-05-28 21:06:10 +00:00
Jung-uk Kim
93207c1c89 Import ACPICA 20200528. 2020-05-28 21:01:08 +00:00
Ed Maste
465fbce433 fortune: remove warning about potentially offensive fortunes
They were removed long ago.

PR:		246736
Submitted by:	Ruby Lazuli Lord
MFC after:	3 days
2020-05-28 20:39:27 +00:00
Mark Johnston
81302f1d77 Fix boot on systems where NUMA domain 0 is unpopulated.
- Add vm_phys_early_add_seg(), complementing vm_phys_early_alloc(), to
  ensure that segments registered during hammer_time() are placed in the
  right domain.  Otherwise, since the SRAT is not parsed at that point,
  we just add them to domain 0, which may be incorrect and results in a
  domain with only several MB worth of memory.
- Fix uma_startup1() to try allocating memory for zones from any domain.
  If domain 0 is unpopulated, the allocation will simply fail, resulting
  in a page fault slightly later during boot.
- Change _vm_phys_domain() to return -1 for addresses not covered by the
  affinity table, and change vm_phys_early_alloc() to handle wildcard
  domains.  This is necessary on amd64, where the page array is dense
  and pmap_page_array_startup() may allocate page table pages for
  non-existent page frames.

Reported and tested by:	Rafael Kitover <rkitover@gmail.com>
Reviewed by:	cem (earlier version), kib
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D25001
2020-05-28 19:41:00 +00:00
Glen Barber
537ab18306 Include the shells/bash port on Vagrant images, which prevents
a shell issue during startup.

PR:		245051
MFC after:	1 minute (if approved by re@)
X-MFC-for:	11.4-RC2
Sponsored by:	Rubicon Communications, LLC (netgate.com)
2020-05-28 18:48:30 +00:00
Alexander Motin
0d7fed74c7 Remove ctl_free_beio() LUN and ctl_io dependencies.
This slightly simplifies the code, plus may be a ground for asynchronous
buffer free.

MFC after:	2 weeks
Sponsored by:	iXsystems, Inc.
2020-05-28 18:12:05 +00:00
Mitchell Horne
dde3b16bbc Add macros simplifying the fake preload setup
This is in preparation for booting via loader(8). Lift these macros from arm64
so we don't need to worry about the size when inserting new elements. This
could have been done in r359673, but I didn't think I would be returning to
this function so soon.

Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D24910
2020-05-28 14:56:11 +00:00
Takanori Watanabe
f8143ed773 Fix connection event message string (n->\n)
PR: 246664
Submitted by: Marc Veldman (marc@bumblngdork.com)
Reported by:	Jose Luis Duran (jlduran@gmail.com)
2020-05-28 13:48:33 +00:00
Alexander V. Chernikov
9d5df78e64 Fix NOINET6 build broken by r361575.
Reported by:	ci, hps
2020-05-28 09:52:28 +00:00