Commit Graph

254554 Commits

Author SHA1 Message Date
Stefan Eßer
56d11d4a37 Make use of the getlocalbase() function for run-time adjustment of the
local software base directory, as committed in SVN rev. 367813.

The pkg and mailwrapper programs used the LOCALBASE environment variable
for this purpose and this functionality is preserved by getlocalbase().

After this change, the value of the user.localbase sysctl variable is used
if present (and not overridden in the environment).

The nvmecontrol program gains support of a dynamic path to its plugin
directory with this update.

Differential Revision:	https://reviews.freebsd.org/D27237
2020-11-18 20:00:55 +00:00
Dimitry Andric
991f6e7534 For llvm's internal function which retrieves the number of available
"hardware threads", use cpuset_getaffinity(2) on FreeBSD, so it will
honor processor sets configured by the cpuset(1) command.

This should make it possible to avoid e.g. lld creating a huge number of
threads on a machine with many cores, even for linking simple programs.

This will also be submitted upstream.

Submitted by:	mjg
MFC after:	1 week
2020-11-18 19:55:24 +00:00
Mateusz Guzik
1463aa8cf2 fd: reorder struct file to reduce false sharing
The size on LP64 is 80 bytes, which is just more than a cacheline, does
not lend itself to easy shrinking and rounding up to 2 would be a huge
waste given NOFREE marker.

The least which can be done is to reorder it so that most commonly used
fields are less likely to span different lines, and consequently suffer
less false sharing.

With the change at hand most commonly used fields land in the same line
about 3/4 of the time, as opposed to 2/4.
2020-11-18 19:47:24 +00:00
Stefan Eßer
30d21d2795 Add function getlocalbase() to libutil.
This function returns the path to the local software base directory, by
default "/usr/local" (or the value of _PATH_LOCALBASE in include/paths.h
when building the world).

The value returned can be overridden by 2 methods:

- the LOCALBASE environment variable (ignored by SUID programs)
- else a non-default user.localbase sysctl value

Reviewed by:	hps (earlier version)
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D27236
2020-11-18 19:44:30 +00:00
Li-Wen Hsu
ed0d16b017 ipheth(4): Fix for iOS 14
Fix USB tethering for iOS 14.

Inspired by:	https://github.com/libimobiledevice/libimobiledevice/issues/1038

PR:		249979
Reviewed by:	hselasky
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D27250
2020-11-18 19:35:30 +00:00
Alfredo Dal'Ava Junior
758f9acf8c msun tests: use standard floating-point exception flags on lrint and fenv tests
Some platforms have additional architecture-specific floating-point flags.
Msun test cases lrint and test_fegsetenv (fenv) expects only standard flags,
so make sure to mask them appropriately.

This makes test pass on PowerPC64.

Reviewed by:	jhibbits, ngie
Sponsored by:	Eldorado Research Institute (eldorado.org.br)
Differential Revision:	https://reviews.freebsd.org/D27202
2020-11-18 19:23:30 +00:00
Warner Losh
30a56f9ef7 mergemaster: handle symbolic links during update.
/etc/os-release is now a symbolic link to a generated file. Make
mergemaster cope with symbolic links generically. I'm no longer
a big mergemaster user, so this has only been lightly tested
by me, though Kimura-san has ran it through its paces.

Submitted by: Yasushiro KIMURA-san
PR: 242212
MFC After: 2 weeks
2020-11-18 19:22:24 +00:00
Dimitry Andric
1e4896b176 When elftoolchain's objcopy (or strip) is rewriting a file in-place,
make it create the temporary file in the same directory as the source
file by default, instead of always using $TMPDIR or /tmp. If creating
that file fails because the directory is not writable, also fallback to
$TMPDIR or /tmp.

This has also been submitted upstream as:
https://sourceforge.net/p/elftoolchain/tickets/597/

Reported by:	cem
PR:		250872
MFC after:	2 weeks
2020-11-18 18:40:58 +00:00
Justin Hibbits
1e4309ae4e Fix octeon_pmc post-r334827
MFC after:	3 days
Sponsored by:	Juniper Networks, Inc
2020-11-18 17:37:01 +00:00
John Baldwin
5335f6434b Fix a few nits in vn_printf().
- Mask out recently added VV_* bits to avoid printing them twice.

- Keep VI_LOCKed on the same line as the rest of the flags.

Reviewed by:	kib
Obtained from:	CheriBSD
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D27261
2020-11-18 16:21:37 +00:00
Marcin Wojtas
7dee315ed7 Update ENA driver version to v2.3.0
The v2.3.0 introduces new ena_com layer, ENI metrics updates and SPDX
license tags.

Submitted by:   Michal Krawczyk <mk@semihalf.com>
Obtained from:  Semihalf
Sponsored by:   Amazon, Inc
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D27120
2020-11-18 15:25:38 +00:00
Nick Hibma
0c4a53b453 Fix mandoc lint warnings. 2020-11-18 15:23:43 +00:00
Marcin Wojtas
7d2e6f207e Rename descriptions of the supported ENA devices
Some of the PCI ID were described as ENA with LLQ support - it's not
fully accurate and because of that, their names were changed.

Instead of LLQ, use RSERV0 for the description of those devices.

Submitted by:   Michal Krawczyk <mk@semihalf.com>
Obtained from:  Semihalf
Sponsored by:   Amazon, Inc
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D27119
2020-11-18 15:20:01 +00:00
Marcin Wojtas
f180142c76 Add ENI metrics for the ENA driver
The new HAL allows the driver to read extra ENI stats. Exact meaning of
each of them can be found in base/ena_defs/ena_admin_defs.h file and
structure ena_admin_eni_stats.

Those stats are being updated inside of the timer service, which is
executed every second.
ENI metrics are turned off by default. They can be enabled, using the
sysctl node: dev.ena.X.eni_metrics.update_delay
0 value in this node means that the update is turned off. Other values
determine how many seconds must pass, before ENI metrics will be
updated.

They can be acquired, using sysctl:

sysctl dev.ena.X.eni_metrics

Where X stands for the interface number.

Submitted by:   Michal Krawczyk <mk@semihalf.com>
Obtained from:  Semihalf
Sponsored by:   Amazon, Inc
MFC after:      1 week
Differential revision: https://reviews.freebsd.org/D27118
2020-11-18 15:17:55 +00:00
Marcin Wojtas
0835cc783b Add SPDX license tag to the ENA driver files
Refering to guide: https://wiki.freebsd.org/SPDX the SPDX tag should not
replace the standard license text, however it should be added over the
standard license text to make the automation easier.

Because of that, the old license was kept, but the SPDX tag was added
on top of every ENA driver file.

Submited by:    Michal Krawczyk <mk@semihalf.com>
Obtained from:  Semihalf
Sponsored by:   Amazon, Inc
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D27117
2020-11-18 15:07:34 +00:00
Marcin Wojtas
c74443892c Add Rx offsets support for the ENA driver
For the first descriptor in a chain the data may start at an offset.
It is optional feature of some devices, so the driver must ack that
it supports it.

The data pointer of the mbuf is simply shifted by the given value.

Submitted by:   Maciej Bielski <mba@semihalf.com>
Submitted by:   Michal Krawczyk <mk@semihalf.com>
Obtained from:  Semihalf
Sponsored by:   Amazon, Inc
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D27116
2020-11-18 15:02:12 +00:00
Marcin Wojtas
9eb1615f33 Adjust ENA driver files to latest ena-com changes
* Use the new API of ena_trace_*
* Fix typo syndrom --> syndrome
* Remove validation of the Rx req ID (already performed in the ena-com)
* Remove usage of deprecated ENA_ASSERT macro

Submitted by:   Ido Segev <idose@amazon.com>
Submitted by:   Michal Krawczyk <mk@semihalf.com>
Obtained from:  Semihalf
Sponsored by:   Amazon, Inc
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D27115
2020-11-18 14:59:22 +00:00
Andrew Gallatin
8732245d29 LACP: When suppressing distributing, return ENOBUFS
When links come and go, lacp goes into a "suppress distributing" mode
where it drops traffic for 3 seconds. When in this mode, lagg/lacp
historiclally drops traffic with ENETDOWN. That return value causes TCP
to close any connection where it gets that value back from the lower
parts of the stack.  This means that any TCP connection with active
traffic during a 3-second windown when an LACP link comes or goes
would get closed.

TCP treats return values of ENOBUFS as transient errors, and re-schedules
transmission later. So rather than returning ENETDOWN, lets
return ENOBUFS instead.  This allows TCP connections to be preserved.

I've tested this by repeatedly bouncing links on a Netlfix CDN server
under a moderate (20Gb/s) load and overved ENOBUFS reported back to
the TCP stack (as reported by a RACK TCP sysctl).

Reviewed by:	jhb, jtl, rrs
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D27188
2020-11-18 14:55:49 +00:00
Marcin Wojtas
62023a0e6d Upgrade ENA HAL to the latest version (26/10/20)
Add support for the ENI metrics, bug fix for destroying wait event and
also other minor bug fixes, improvements, etc.

Submitted by:   Ido Segev <idose@amazon.com>
Obtained from:  Amazon, Inc.
2020-11-18 14:54:55 +00:00
Marcin Wojtas
4f8f476e73 Fix completion descriptors alignment for the ENA
The latest generation hardware requires IO CQ (completion queue)
descriptors memory to be aligned to a 4K. It needs that feature for
the best performance.

Allocating unaligned descriptors will have a big performance impact as
the packet processing in a HW won't be optimized properly. For that
purpose adjust ena_dma_alloc() to support it.

It's a critical fix, especially for the arm64 EC2 instances.

Submitted by: Ido Segev <idose@amazon.com>
Obtained from: Amazon, Inc
MFC after: 1 week
Differential revision:  https://reviews.freebsd.org/D27114
2020-11-18 14:50:12 +00:00
Marcin Wojtas
d5fc5012bb ena-com: Fix ena-com to allocate cdesc aligned to 4k
The latest generation hardware requires IO CQ (completion queue)
descriptors memory to be aligned to a 4K. It needs that feature for
the best performance.

Allocating unaligned descriptors will have a big performance impact as
the packet processing in a HW won't be optimized properly.

It's a critical fix, especially for the arm64 EC2 instances.
2020-11-18 14:30:59 +00:00
Hans Petter Selasky
99f20bdc47 Allow LinuxKPI types to be used in bootloaders, by checking for the
_STANDALONE definition.

No functional change intended.

MFC after:	1 week
Sponsored by:	Mellanox Technologies // NVIDIA Networking
2020-11-18 13:47:11 +00:00
Hans Petter Selasky
db4df56365 Add missing header file when building the LinuxKPI module separately.
MFC after:	1 week
Sponsored by:	Mellanox Technologies // NVIDIA Networking
2020-11-18 13:45:32 +00:00
Hans Petter Selasky
a2dd1caade Fix build of USB bootloader code by adding checks for _STANDALONE being defined.
Currently the USB bootloader code is not part of buildworld.

MFC after:	1 week
Sponsored by:	Mellanox Technologies // NVIDIA Networking
2020-11-18 13:22:22 +00:00
Alan Somers
ac8c4a61af nfs: Mark unused statistics variable as reserved
FreeBSD's NFS exporter has long exported some unused statistics fields.
Revision r366992 removed them from nfsstat. This revision renames those
fields in the kernel's exported structures to make it clear to other
consumers that they are unused.

Reported by:	emaste
Reviewed by:	emaste
Sponsored by:	Axcient
Differential Revision:	https://reviews.freebsd.org/D27258
2020-11-18 04:35:49 +00:00
Alexander Motin
cf770ba3e9 Move ecmd memory allocation itto separate DMA tag.
Ecmd memory is not directly related to the request queue, only referenced
from it sometimes in target mode.  Separate allocation should be easier
in case of fragmented memory and can be skipped when target is not built.

MFC after:	1 month
2020-11-18 03:43:03 +00:00
Kyle Evans
27a9392d54 _umtx_op: fix robust lists after r367744
A copy-pasto left us copying in 24-bytes at the address of the rb pointer
instead of the intended target.

Reported by:	sigsys@gmail.com
Sighing:	kevans
2020-11-18 03:30:31 +00:00
Alexander Motin
9cca0e7ee5 Remove bus_dma locking/sleeping when not needed.
MFC after:	1 month
2020-11-18 02:54:05 +00:00
Alexander Motin
57713eda85 Don't allocate full XCMD_SIZE (512 bytes) on stack.
We need only 24 bytes (fcp_rsp_iu_t) there for isp_put_fcp_rsp_iu().

MFC after:	1 month
2020-11-18 02:12:51 +00:00
Cy Schubert
dd4f81cd06 Restore identification of VDEVs using non-native block size.
NAME         STATE     READ WRITE CKSUM
    dsk02        ONLINE       0     0     0
      mirror-0   ONLINE       0     0     0
        ada1s4a  ONLINE       0     0     0
        ada2s4a  ONLINE       0     0     0  block size: 512B configured,
					     4096B native

Reviewed by:		tsoome (previous FreeBSD phab version)
Differential Revision:	https://reviews.freebsd.org/D26880

Upstream commit:	3928ec5339
Reviewed-by:		Matt Macy <mmacy@FreeBSD.org>
Reviewed-by:		Toomas Soome <tsoome@me.com>
Reviewed-by:		Brian Behlendorf <behlendorf1@llnl.gov>
Signed off by:		Cy Schubert <cy@FreeBSD.org>
Closes #11088
2020-11-18 01:18:45 +00:00
Conrad Meyer
f8f74aaa84 linux(4) clone(2): Correctly handle CLONE_FS and CLONE_FILES
The two flags are distinct and it is impossible to correctly handle clone(2)
without the assistance of fork1().  This change depends on the pwddesc split
introduced in r367777.

I've added a fork_req flag, FR2_SHARE_PATHS, which indicates that p_pd
should be treated the opposite way p_fd is (based on RFFDG flag).  This is a
little ugly, but the benefit is that existing RFFDG API is preserved.
Holding FR2_SHARE_PATHS disabled, RFFDG indicates both p_fd and p_pd are
copied, while !RFFDG indicates both should be cloned.

In Chrome, clone(2) is used with CLONE_FS, without CLONE_FILES, and expects
independent fd tables.

The previous conflation of CLONE_FS and CLONE_FILES was introduced in
r163371 (2006).

Discussed with:	markj, trasz (earlier version)
Differential Revision:	https://reviews.freebsd.org/D27016
2020-11-17 21:20:11 +00:00
Conrad Meyer
85078b8573 Split out cwd/root/jail, cmask state from filedesc table
No functional change intended.

Tracking these structures separately for each proc enables future work to
correctly emulate clone(2) in linux(4).

__FreeBSD_version is bumped (to 1300130) for consumption by, e.g., lsof.

Reviewed by:	kib
Discussed with:	markj, mjg
Differential Revision:	https://reviews.freebsd.org/D27037
2020-11-17 21:14:13 +00:00
Conrad Meyer
ede4af47ae unix(4): Enhance LOCAL_CREDS_PERSISTENT ABI
As this ABI is still fresh (r367287), let's correct some mistakes now:

- Version the structure to allow for future changes
- Include sender's pid in control message structure
- Use a distinct control message type from the cmsgcred / sockcred mess

Discussed with:	kib, markj, trasz
Differential Revision:	https://reviews.freebsd.org/D27084
2020-11-17 20:01:21 +00:00
Conrad Meyer
b1976ea14c linprocfs(5): Add rudimentary /proc/<pid>/mountinfo
This is used by some Linux programs using filehandles (r367773) to locate
the mountpoint for a given fsid.

Differential Revision:	https://reviews.freebsd.org/D27136
2020-11-17 19:56:47 +00:00
Conrad Meyer
77eb984147 'make sysent' for r367773
X-MFC-With:	r367773
2020-11-17 19:53:59 +00:00
Conrad Meyer
de774e422e linux(4): Implement name_to_handle_at(), open_by_handle_at()
They are similar to our getfhat(2) and fhopen(2) syscalls.

Differential Revision:	https://reviews.freebsd.org/D27111
2020-11-17 19:51:47 +00:00
Ed Maste
46a5f8837d uplcom: add ATen/Prolific USB-232 Controller D USB ID
PR:		251166
Submitted by:	marcus
MFC after:	2 weeks
2020-11-17 18:28:20 +00:00
Adrian Chadd
44c52406ce [nvmecontrol] Fix type signedness warning-to-error on gcc-6.4
This fixes a type signedness comparison warning-to-error on
gcc-6.4. The ternary operation casts it right but the actual
assignment doesn't.

Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D26791
2020-11-17 17:12:28 +00:00
Adrian Chadd
975e1c1ce6 [cddl] Fix lz4 function definitions to not tri pup compile.
This tripped up in llvm compilation on amd64 noting that lz4_init/lz4_fini
were lacking in being previously defined.

Reviewed by:	emaste, freqlabs, brooks
Differential Revision:	https://reviews.freebsd.org/D27240
2020-11-17 17:11:07 +00:00
Mateusz Piotrowski
c2364e5a41 Partially revert r367756 (chpass(1) synopsis changes)
Let's have two entries in the synopsis:
- chpass now lists options which can be used for non-NIS-specific
  functionalities.
- ypchpass additionally lists the NIS-specific flags.

Technically, it is an artificial distinction, as chpass and ypchpass behave
identically. Nevertheless, it might help navigating the synopsis section.

Reviewed by:	imp
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D27251
2020-11-17 16:54:12 +00:00
Alexander Motin
329327e272 Stop using NVME_MAX_XFER_SIZE constant.
This constant depends on MAXPHYS and does not respect device capabilities.
Use proper dynamic ioctl(NVME_GET_MAX_XFER_SIZE) instead.

MFC after:	1 month
2020-11-17 16:34:58 +00:00
Emmanuel Vadot
e35c28a24b syscon: Add syscon_get_by_ofw_node
This allow to get a syscon node defined under a specific fdt node (which isn't
always the device one).
2020-11-17 14:59:58 +00:00
Emmanuel Vadot
891ea2d7b4 arm64: allwinner: Init the Display Engine clock
In case u-boot was compiled without video support set the PLL
to 432Mhz (which allow us to use most of the HDMI resolution for
tcon) and set it as the parent for the DE clock.
2020-11-17 14:58:30 +00:00
Emmanuel Vadot
b7d31bf5ee arm: allwinner: Add DE2 Clock support for H3 SoC
While here also enable the clock and deassert the reset
2020-11-17 14:57:34 +00:00
Emmanuel Vadot
04b8208fc0 vchiq: Rename timer func so they do not conflict with linuxkpi 2020-11-17 14:41:23 +00:00
Jonathan T. Looney
3cbb4cc200 When copying types from one CTF container to another, ensure that we
always copy intrinsic data types before copying bitfields which are
based on those types. This ensures the type ordering in the destination
CTF container matches the assumption made elsewhere in the CTF code
that instrinsic data types will always appear before bitfields based on
those types.

This resolves the following error message some users have seen after
r366908:
    "/usr/lib/dtrace/ipfw.d", line 121: failed to copy type of 'ip6p':
    Conflicting type is already defined

Reviewed by:	markj
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D27213
2020-11-17 14:07:27 +00:00
Peter Grehan
2f40fc6ff3 Add legacy debug/test interfaces for kvm unit tests.
Implement the legacy debug/test interfaces expected by KVM-unit-tests'
realmode, emulator, and ioapic tests.

Submitted by:	adam_fenn.io
Reviewed by:	markj, grehan
Approved by:	grehan (bhyve)
MFC after:	3 weeks
Relnotes:	Yes
Differential Revision:	https://reviews.freebsd.org/D27130
2020-11-17 13:14:04 +00:00
Alfredo Dal'Ava Junior
e7bd4f846f [POWERPC] msun: fix incorrect flag in fesetexceptflag
Fix incorrect mask being used when FE_INVALID bit is wanted by user.
The problem was noticed thanks to msun fenv tests.

Reviewed by:	jhibbits, luporl
Sponsored by:	Eldorado Research Institute (eldorado.org.br)
Differential Revision:	https://reviews.freebsd.org/D27201
2020-11-17 12:36:59 +00:00
Alfredo Dal'Ava Junior
23f001f742 [POWERPC] fix signal race condition
r367416 should have called save_fpu() before kern_sigprocmask to avoid
race condition

Thanks jhibbits and bdragon for pointing it out

Reviewed by:	jhibbits
Sponsored by:	Eldorado Research Institute (eldorado.org.br)
Differential Revision:	https://reviews.freebsd.org/D27241
2020-11-17 12:33:12 +00:00
Mateusz Piotrowski
dda1987fe5 Add an example for the -s flag
MFC after:	2 weeks
2020-11-17 12:04:29 +00:00