Commit Graph

253170 Commits

Author SHA1 Message Date
John Baldwin
d8dc46f6e9 Add constant for the DE_CFG MSR on AMD CPUs.
Reported by:	Patrick Mooney <pmooney@pfmooney.com>
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D25885
2020-09-11 20:32:40 +00:00
Scott Long
d58ff30aca Improve the documenation for bus_dma templates. Also add notes to
make it clear that filters may not work correctly and that their use
is deprecated.

MFC after:	3 days
2020-09-11 19:45:26 +00:00
Gordon Bergling
e6ca69017c Improvements for the src.conf(5) and build(7) man pages
PR:		203863 (based on)
Submitted by:	Russell Haley <russ dot haley at gmail dot com>
Reviewed by:	bcr, imp
Approved by:	imp
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D26343
2020-09-11 18:09:49 +00:00
Glen Barber
c71c2b76aa Fix indentation following r365638. No functional changes.
Sponsored by:	Rubicon Communications, LLC (netgate.com)
2020-09-11 17:05:09 +00:00
Glen Barber
91ce469984 Add a NOGIT option to avoid explicitly requiring devel/git if the
sources are obtained through a different mechanism.

Reported and tested by:	Ruslan Garipov
Sponsored by:	Rubicon Communications, LLC (netgate.com)
2020-09-11 17:04:09 +00:00
Kyle Evans
0f8c7ba275 MFV r365636: libarchive: import fix for WARNS=6 builds in testing bits
Two more cases of explicitly marking globals for internal linkage where they
need not be shared. Committed upstream as of a38e62314a1f.

MFC after:	1 week
2020-09-11 16:13:45 +00:00
Kyle Evans
4dd2ae60c2 libarchive: import fix for WARNS=6 builds in testing bits
Two more cases of explicitly marking globals for internal linkage where they
need not be shared. Committed upstream as of a38e62314a1f.
2020-09-11 16:12:48 +00:00
Bjoern A. Zeeb
aaa1fdb87b iwm: fix regression from r365419 (ieee80211_media_change())
In r365419 ieee80211_media_change() callers were updated to not longer
act on the obselete ENETRESET return code.
While in the old days iwm has done a stop/init cycle in these cases,
this was not executed since r193340.
As a consequence simplify iwm code as well by passing ieee80211_media_change()
right to ieee80211_vap_attach() as there is no more need for a local
implementation.

Reported by:	Tomoaki AOKI (junchoon dec.sakura.ne.jp)
Tested by:	Tomoaki AOKI (junchoon dec.sakura.ne.jp)
MFC after:	3 days
X-MFC:		fix is already in stable/12
PR:		248955
2020-09-11 14:18:47 +00:00
Kyle Evans
ecebb3cc1d Only set WARNS if not defined
This would allow interested parties to do experimental runs with an
environment set appropriately to raise all the warnings throughout the
build; e.g. env WARNS=6 NO_WERROR=yes buildworld.

Not currently touching the numerous instances in ^/tools.

MFC after:	1 week
2020-09-11 13:28:37 +00:00
Andrey V. Elsukov
b876085f55 Fix compatibility regression after r364117.
Properly handle the case, when some opcode keywords follow after
the `frag` opcode without additional options.

Reported by:	Evgeniy Khramtsov <evgeniy at khramtsov org>
2020-09-11 10:07:09 +00:00
Kristof Provost
effd82ca70 dtrace: fix fbt return probes on RISC-V
Return values are passed in a0, so read it from there. We also pass a1 through
to userspace, as the ABI allows small structs to be returned in registers
a0/a1. While here read the register values directly from the trapframe rather
than rtval, and remove the now unneeded argument from dtrace_invop().

Set fbtp_roffset so that we get the correct return location in arg0.

Reviewed by:	markj
Sponsored by:	Axiado
Differential Revision:	https://reviews.freebsd.org/D26389
2020-09-11 09:15:49 +00:00
Li-Wen Hsu
e55e20a0e9 Revert r365592 and r365603 as the tests are fixed by r365593
PR:		249236
Sponsored by:	The FreeBSD Foundation
2020-09-11 05:45:27 +00:00
Kyle Evans
8b8cf4ece6 memfd_create: simplify HUGETLB support a little bit
This also fixes a minor issue that was missed in the initial review; the
layout of the MFD_HUGE_* flags is actually not 1:1 bit:flag -- it instead
borrowed the Linux convention of how this is laid out since it was
originally implemented on Linux, the top 6 bits represent the shift required
for the requested page size.

This allows us to remove the flag <-> pgsize mapping table and simplify the
logic just prior to validation of the requested page size.

While we're here, fix two small nits:

- HUGETLB memfd shouldn't exhibit the SHM_GROW_ON_WRITE behavior. We can
  only grow largepage shm by appropriately aligned (i.e. requested pagesize)
  sizes, so it can't work in the typical/sane fashion. Furthermore, Linux
  does the same, so let's be compatible.

- We don't allow MFD_HUGETLB without specifying a pagesize, so no need to
  check for that later.

Reviewed by:	kib (slightly earlier version)
2020-09-11 02:02:15 +00:00
John-Mark Gurney
0b39e3448a Don't clear reserved bits per RealTek
MFC after:	3 days
2020-09-11 02:02:13 +00:00
John Baldwin
39585a4c10 Disable WITNESS for spin locks by default.
This matches all other architectures and removes substantial overhead.

Reported by:	arichardson (indirectly)
Reviewed by:	imp, arichardson
Obtained from:	CheriBSD
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D26403
2020-09-11 00:06:16 +00:00
Eric Joyner
7d7af7f85b ice(4): Update to 0.26.16
Summary of changes:

- Assorted bug fixes
- Support for newer versions of the device firmware
- Suspend/resume support
- Support for Lenient Link Mode for E82X devices (e.g. can try to link with
  SFP/QSFP modules with bad EEPROMs)
- Adds port-level rx_discards sysctl, similar to ixl(4)'s

This version of the driver is intended to be used with DDP package 1.3.16.0,
which has already been updated in a previous commit.

Tested by:	Jeffrey Pieper <jeffrey.e.pieper@intel.com>
MFC after:	3 days
MFC with:	r365332, r365550
Sponsored by:	Intel Corporation
Differential Revision:	https://reviews.freebsd.org/D26322
2020-09-10 23:46:13 +00:00
John Baldwin
385f4a5ac8 Use vmcb_read/write for the vmcb snapshot functions.
This avoids some unnecessary layers of indirection.
2020-09-10 22:22:23 +00:00
Kyle Evans
9bf2b80ca6 memfd_create: fix return values
Literally returning EINVAL from a function designed to return an fd makes
for interesting scenarios.

I cannot assign enough pointy hats to cover this one.
2020-09-10 21:25:16 +00:00
Konstantin Belousov
7978363417 Fix interaction between largepages and seals/writes.
On write with SHM_GROW_ON_WRITE, use proper truncate.
Do not allow to grow largepage shm if F_SEAL_GROW is set. Note that
shrinks are not supported at all due to unmanaged mappings.
Call to vm_pager_update_writecount() is only valid for swap objects,
skip it for unmanaged largepages.
Largepages cannot support write sealing.
Do not writecnt largepage mappings.

Reported by:	kevans
Reviewed by:	kevans, markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D26394
2020-09-10 20:54:44 +00:00
Alexander V. Chernikov
99efb80d00 Add basic test for net.fibs dynamic growth.
Reviewed by:	kp
Differential Revision:	https://reviews.freebsd.org/D26382
2020-09-10 19:25:51 +00:00
Brandon Bergren
691b35f344 [PowerPC64LE] Add LOAD_LR_NIA and RETURN_TO_NATIVE_ENDIAN defines.
* Add LOAD_LR_NIA define. This is preferred to "bl 1f; 1:" because it
doesn't pollute the branch predictor.

* Add magic sequence to return the CPU to the correct endianness after
jumping to cross-endian code, similar to the sequence from Linux.

Sponsored by:	Tag1 Consulting, Inc.
2020-09-10 18:41:15 +00:00
Li-Wen Hsu
9f917148e0 urndis(4): Add support of Inseego/Novatel Wireless MiFi 8800/8000
PR:		245152
Submitted by:	rootless@gmail.com
Reviewed by:	hselasky
MFC after:	3 days
2020-09-10 18:27:52 +00:00
Kyle Evans
fc90521002 crunchgen(8): fix crunched application build with WARNS=6
This was revealed by the rescue build with a patch I'm working on to default
WARNS=6 everywhere. The issues resolved were:

- Missing prototype for _crunched_${ident}_stub in the *_stub.c generated
  bits
- Missing prototype for crunched_main
- Incomplete prototype for _crunched_${ident}_stub in the generated parts of
  crunched_main
- Literal strings in the stub table must drop const qualifier, unless we
  const'ify name
- f field in struct stub didn't have a proper prototype

Most of these issues are minor formalities and easily addressed.

I note that if my patch to eventually raise WARNS for the rescue build
lands, we'll need to bump the __FreeBSD_version requirement for
bootstrapping crunchgen and wipe out the rescue .OBJDIR if it's stale, which
we should be able to detect pretty easily from a couple of the issues that
have been fixed here.

Reviewed by:	arichardson
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D26363
2020-09-10 18:19:45 +00:00
Kyle Evans
4d6265e3e4 Fix the build after r365592
r365592 accidentally mixed atf-c and atf-sh; convert atf_skip -> atf_tc_skip
2020-09-10 17:58:24 +00:00
Kyle Evans
ac29e8a94f librt: tests: fix minor issues with higher WARNS
got_sigalrm is a global with external linkage and must therefore have a
previous extern declaration. There's no reason to maintain the status quo
there, so just make it static.

The result var is unused.

This part of the test has not been upstreamed, presumably because it exists
solely for sem_clockwait_np. We should perhaps consider moving it into its
own test file outside of ^/contrib/netbsd-tests, but this can happen later.

MFC after:	1 week
2020-09-10 17:53:00 +00:00
Kyle Evans
3c13467099 MFV r365599: import fix for a libexecinfo warning at higher WARNS
v1.17 of this file included a fix that I just submitted upstream to fix a
warning about prevent_inline with external linkage not having been
previously declared.

MFC after:	1 week
2020-09-10 17:48:27 +00:00
Kyle Evans
d328162dcb netbsd-tests: import fix for a libexecinfo warning at higher WARNS
v1.17 of this file included a fix that I just submitted upstream to fix a
warning about prevent_inline with external linkage not having been
previously declared.
2020-09-10 17:46:40 +00:00
Kyle Evans
944174e7bf Fix memfd_create tests after r365524
r365524 did accidentally invert this check that sets SHM_LARGEPAGE, leading
non-hugetlb memfd as unconfigured largepage shm and thus test failures when
we try to ftruncate or write to them.

PR:		249236
Discussed with:	kib
2020-09-10 17:23:30 +00:00
Li-Wen Hsu
b804b5bca1 Temporarily skip failing sys.kern.memfd_test.* tests in CI
PR:		249236
Sponsored by:	The FreeBSD Foundation
2020-09-10 17:15:44 +00:00
Dimitry Andric
18ed63b8f1 Follow-up r364753 by only using arm's stdatomic.c implementation, as it
already covers the functions in compiler-rt's atomic.c, leading to
conflicts when linking.

PR:		230888
MFC after:	3 days
X-MFC-With:	r364753
2020-09-10 16:47:12 +00:00
Alex Richardson
b7b5bdba96 Ensure that the makewhatis symlink is added in the bootstrap-tools stage
We currently set MK_MAN=no in $BSARGS so MK_MAN_UTILS will also be false
which means that the makewhatis symlink will not be created.
This change fixes the build when using both -DBUILD_WITH_STRICT_TMPPATH and
-DBOOTSTRAP_ALL_TOOLS.

Tested by:	andrew
Differential Revision: https://reviews.freebsd.org/D16761
2020-09-10 15:37:29 +00:00
Alex Richardson
0a81de38dc Silence GCC's -Wno-unused-result during bootstrap
Unlike clang, GCC still warns even with (void) casts (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66425)
2020-09-10 15:37:24 +00:00
Alex Richardson
266b51ac6e Fix -Wpointer-sign warnings in bwstring.c 2020-09-10 15:37:19 +00:00
Alex Richardson
9373ca5879 Fix a noisy -Wundef warning when bootstrapping tools 2020-09-10 15:37:15 +00:00
Alex Richardson
e17ebfd3b7 Remove -I flag for include path that doesn't exist
Found this while trying to get macOS bootstrap to work again after OpenZFS merge.

Reviewed By:	#zfs, freqlabs
Differential Revision: https://reviews.freebsd.org/D26192
2020-09-10 15:37:07 +00:00
Andrew Turner
15fe2adacb Move the pl061 acpi attachment earlier
As the pl061 driver can be an interrupt controller attach it earlier in the
boot so other drivers can use it.

Use a new GPIO xref to not conflict with the existing root interrupt
controller.

Sponsored by:	Innovate UK
2020-09-10 14:58:46 +00:00
Andrew Turner
6215ed7c5c Ignore the .interp section in the arm64 EFI loader
When building the loader an unneeded .interp section may be added. Move
this to the unused section region so offsets of used sections don't
change.

Obtained from:	CheriBSD
Sponsored by:	Innovate UK
2020-09-10 14:13:49 +00:00
Ruslan Bukin
cb9050dd21 Move the rid variable to the generic iommu context.
It could be used in various IOMMU platforms, not only DMAR.

Reviewed by:	kib
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D26373
2020-09-10 14:12:25 +00:00
Alex Richardson
22a39a8912 Set AlignTrailingComments in the clang-format config
This seems to be fairly common in existing code and often looks better when
adding trailing comments to e.g. enumerators or array initializers.
See D26340 for more context.

Reviewed By:	emaste
Differential Revision: https://reviews.freebsd.org/D26391
2020-09-10 14:11:29 +00:00
Alex Richardson
8efceeb6ac Use the correct config names for some .clang-format entries
Those values are enum entries and should use "Never" instead of "false".
clang-format currently accepts false, but it's better to use the correct
syntax in case that changes in the future.
2020-09-10 14:11:24 +00:00
Rainer Hurling
500e0f0833 Add author entity for rhurlin, part 2
Forgot to submit step 5 from procedure 1 in Chap. 6 of the Committers Guide:
Update Mentor and Mentee Information

Reviewed by:	arrowd (mentor), tcberner (mentor)
Approved by:	arrowd (mentor), tcberner (mentor)
2020-09-10 13:57:57 +00:00
Andrew Turner
128e746c6a Switch the name of the pl061 driver to gpio
We need it to be named gpio for gpiobus to work.

Sponsored by:	Innovate UK
2020-09-10 09:50:43 +00:00
Andrew Turner
f5e4e9153c Only manage ofw gpio providers on ofw systems
On arm64 we may boot via ACPI. In this case we will still try to manage the
gpio providers as if we are using FDT. Fix this by checking if the FDT node
is valid before registering a cross reference.

Sponsored by:	Innovate UK
2020-09-10 09:42:37 +00:00
Andrew Turner
365ed84f28 Use the correct variable to check which interrupt mode to use
In the PL061 driver we incorrectly used the mask rather than mode to find
how to configure the interrupt.

Sponsored by:	Innovate UK
2020-09-10 09:37:30 +00:00
Alexander V. Chernikov
2b32d93e55 Fix RADIX_MPATH build broken by r365521.
Reported by:	jenkins, Hartmann, O. <ohartmann at walstatt.org>
2020-09-10 07:05:31 +00:00
Li-Wen Hsu
95407a79cb Remove vm_map_create(9) KPI's manpage according to r364302
Submitted by:	Ka Ho Ng <khng300@gmail.com>
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D26372
2020-09-10 06:32:25 +00:00
Eric Joyner
cf08d707d4 ice_ddp: Fix 1.3.16.0 package
The version uploaded in the previous commit was far too small. This one
should be the right size.

MFC after:	1 day
Sponsored by:	Intel Corporation
2020-09-10 04:00:13 +00:00
Alan Somers
c01816a97f cp: use copy_file_range(2)
This has three advantages over write(2)/read(2):

* Fewer context switches and data copies
* Mostly preserves a file's sparseness
* On some file systems (currently NFS 4.2) the file system will perform the
  copy in an especially efficient way.

Reviewed by:	rmacklem
MFC after:	2 weeks
Sponsored by:	Axcient
Differential Revision:	https://reviews.freebsd.org/D26377
2020-09-10 02:48:55 +00:00
Brandon Bergren
5c74d551d2 [PowerPC] Fix setting of time in OPAL
There were multiple bugs in the OPAL RTC code which had never been
discovered, as the default configuration of OPAL machines is to
have the BMC / FSP control the RTC.

* Fix calling convention for setting the time -- the variables are passed
directly in CPU registers, not via memory.

* Fix bug in the bcd encoding routines. (from jhibbits)

Tested on POWER9 Talos II (BE) and POWER9 Blackbird (LE).

Reviewed by:	jhibbits (in irc)
Sponsored by:	Tag1 Consulting, Inc.
2020-09-10 01:49:53 +00:00
Richard Scheffenegger
6034024dad Add -z "TOS" option to ping6, to test DSCP/ECN values
ping has the option to add the (deprecated) TOS byte
using the -z option. Adding the same option, with the
same (deprecated) Traffic Class Byte (nowadays actually
DSCP and ECN fields) to ping6 to validate proper QoS
processing in network switches.

Reviewed by:	tuexen
MFC after:	2 weeks
Sponsored by:	NetApp, Inc.
Differential Revision:	https://reviews.freebsd.org/D26384
2020-09-10 00:50:18 +00:00