Commit Graph

276455 Commits

Author SHA1 Message Date
Brooks Davis
bda5d2a45c installworld: improve portability of ldd use
b3b462229f added a case statement to ignore lines containing strings
in square brackets such as "[vdso]" and "[preloaded]". On MacOS
Monterey where /bin/sh may be zsh, this fails with:

/bin/sh: -c: line 0: syntax error near unexpected token `;;'

Invoke grep in the pipeline to remove such lines instead.

Reviewed by:	emaste
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D35618
2022-07-01 08:33:16 +01:00
Kornel Dulęba
3b8d04f845 igc: Change default duplex setting
During media selection through ifconfig one might not specify
the duplex setting through the mediaopt flag.
In that case the igc driver would default to full-duplex.
The problem with this approach is that e1000(em/igb) driver
defaults to half-duplex.
Because of that if one connects both NICs and sets media to
e.g. 100baseTX on both of them no link will be found.
Fix that by matching igc behaviour with what e1000 does.

Reviewed by: grehan
Approved by: mw(mentor)
Obtained from: Semihalf
Sponsored by: Stormshield
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D35673
2022-07-01 08:12:08 +02:00
Kornel Dulęba
ab453714fc Add myself(kd) as src commiter and mw/emaste as my co-mentors
Approved by: mw(mentor)
Differential Revision: https://reviews.freebsd.org/D35658
2022-07-01 08:12:08 +02:00
Jessica Clarke
b0a8333a88 libicp_rescue: Fix build for powerpc64le
This is a repeat of 13cee53cef35 ("libicp: Fix build for powerpc64le")
but for the rescue version of the library.

Fixes:	1f1e2261e3 ("zfs: merge openzfs/zfs@deb121309")
2022-07-01 04:28:15 +01:00
Jessica Clarke
9921563f43 libicp: Fix build for powerpc64le
The C sources use the assembly routines for little-endian powerpc64, and
the assembly files have ppc64le in their names, but the guard here was
for big-endian powerpc64.

Fixes:	1f1e2261e3 ("zfs: merge openzfs/zfs@deb121309")
2022-07-01 01:30:26 +01:00
Mihai Burcea
9aa02d5120 vmm: Fix snapshots for AMD CPUs
This patch fixes the AMD implementation for snapshotting.  It removes
unnecessary vmcb fields that should not be saved and duplicates.

Reviewed by:	jhb
Differential Revision: https://reviews.freebsd.org/D33431
2022-06-30 16:13:55 -07:00
John Baldwin
e5ed417bb4 bhyve: Document the "type" config variable for network device models. 2022-06-30 15:14:36 -07:00
Vitaliy Gusev
f0880ab791 libvmmapi: Add vm_close()
Currently there is no way to safely free a vm structure without
leaking the fd.  vm_destroy() closes the fd but also destroys the VM
whereas in some cases a VM needs to be opened (vm_open) and then
closed (vm_close).

Reviewed by:	jhb
Sponsored by:	vStack
Differential Revision:	https://reviews.freebsd.org/D35073
2022-06-30 14:21:57 -07:00
Mateusz Piotrowski
87f49967d3 Link pwd.db.5 and spwd.db.5 to passwd.5
Let's make it easier to find documentation for those databases.

MFC after:	3 days
2022-06-30 23:10:28 +02:00
Mateusz Piotrowski
606cdb2ef3 hier.7: Document /nonexistent
MFC after:	1 week
2022-06-30 23:10:28 +02:00
Mateusz Piotrowski
523477f8c5 devfs.5: Replace Nm with Xr devfs 8 where appropriate
MFC after:	3 days
2022-06-30 23:10:28 +02:00
Jessica Clarke
4ca6ecf100 Really fix cross-builds from macOS
LINKER_TYPE is set to mac not macos on macOS.

Fixes:	7927452ac4 ("Add RELRO build knob, default to enabled")
2022-06-30 22:08:31 +01:00
Jessica Clarke
22f731486e .github: Attempt to fix and increase robustness of macOS action
Homebrew has added LLVM 14 and made that the default version, but GitHub
continues to install LLVM 13 for now, so it ends up only accessible via
the versioned name and not the unversioned one. We also add an explicit
installation of llvm@13 so that, if GitHub updates the image to using
LLVM 14, the action continues to work, albeit slightly more slowly. This
also ensures the compiler label remains correct rather than outdated, as
has occurred in the past, and that we don't get new versions of LLVM
before we're ready for them, which is especially relevant for stable
branches. This all mirrors how the Ubuntu jobs are configured.
2022-06-30 21:03:26 +01:00
Doug Moore
91b30f7ad2 rb_tree: silence coverity
Add comments to RB_INSERT_COLOR to silence coverity warnings about the
use of an uninitialized variable.  Since other static analyzers will
complain too, add a comment to explain why the complaints are unwarranted.

Reviewed by:	markj
MFC after:	3 weeks
Differential Revision:	https://reviews.freebsd.org/D35671
2022-06-30 12:35:05 -05:00
Yan Ka Chiu
b9c3e544c4 bhyve virtio-net: Allow backend type to be explicitly specified.
Surrently virtio-net uses the prefix of the backing interface to
choose the backend.  This patch adds an additional option "type" to
choose the backend type explicitly.  This allows greater flexibility
for end users to manage bhyve specific resources (such as by naming
the tap interfaces to more descriptive names).  The option "type" is
optional.  When it is not presented, the backend is derived from the
name of the backend interface.

For example, the line `-s 3,virtio-net,bsdvm0,type=tap` will create a
virtio-net device for the guest using the tap interface "bsdvm0".

Adding a new "type" option preserves the current legacy format in which
the first value after virtio-net names an instance of a backend.

Note that tap interfaces not following the pattern "tap*" will not be
created on demand via devfs cloning but must be created explicitly.

Reviewed by:	vmaffione, jhb
Differential Revision:	https://reviews.freebsd.org/D35143
2022-06-30 10:29:45 -07:00
Vitaliy Gusev
5afcca138f vmm: Cherry pick illumos commit '13361 bhyve should mask RDT cpuid info'
Summary:
    commit  1a5f1879be09d3de900b2510692dd12003784d84
    Author: Patrick Mooney <pmooney@pfmooney.com>
    Date:   2020-12-16T20:02:23.000Z

        13361 bhyve should mask RDT cpuid info
        Reviewed by: Andy Fiddaman <andy@omnios.org>
        Reviewed by: Toomas Soome <tsoome@me.com>
        Approved by: Robert Mustacchi <rm@fingolfin.org>

    https://github.com/illumos/illumos-gate/commit/1a5f1879be09d3de900b2510692dd12003784d8

----

We saw similar warning of GP (on Intel Xeon CPU E5-2630 v4 and VM with Ubuntu 20.04 5.4.0-113-generic)  until this commit is applied:

```
[    1.658880] kernel: unchecked MSR access error: WRMSR to 0xc8f (tried to write 0x0000000000000000) at rIP: 0xffffffffacc735b4 (native_write_msr+0x4/0x30)
[    1.662734] kernel: Call Trace:
[    1.663885] kernel:  ? clear_closid_rmid.isra.0+0x36/0x40
[    1.665501] kernel:  resctrl_online_cpu+0xdc/0x3f0
[    1.666952] kernel:  ? __switch_to_asm+0x40/0x70
[    1.668358] kernel:  ? __switch_to+0x7f/0x480
[    1.669693] kernel:  ? cat_wrmsr+0x70/0x70
[    1.670970] kernel:  cpuhp_invoke_callback+0x9b/0x580
[    1.672541] kernel:  ? __schedule+0x2eb/0x740
[    1.673893] kernel:  cpuhp_thread_fun+0xb8/0x120
[    1.675304] kernel:  smpboot_thread_fn+0xd0/0x170
[    1.676685] kernel:  kthread+0x104/0x140
[    1.677948] kernel:  ? sort_range+0x30/0x30
[    1.679299] kernel:  ? kthread_park+0x90/0x90
[    1.680570] kernel:  ret_from_fork+0x35/0x40
[    1.682000] kernel: *** VALIDATE rdt ***
[    1.683454] kernel: resctrl: L3 monitoring detected
```

Reviewed by:	markj, jhb
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D35442
2022-06-30 10:27:27 -07:00
John Baldwin
c71f2370c5 crypto: Fix assertions for digest-only sessions with separate output.
Digest-only sessions do not generate modified payload as an output, so
don't bother asserting anything about the payload with respect to the
output buffer other than the payload output start being zero.

In addition, a verify request on a digest-only session doesn't
generate any output at all so should never have a separate output
buffer.

PR:		252316
Reviewed by:	markj
Co-authored-by:	Jeremy Faulkner <gldisater@gmail.com>
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D35578
2022-06-30 10:10:00 -07:00
John Baldwin
0bd73da206 busdma_bounce: Use PRI_ITHD scheduling class for worker thread.
Reviewed by:	kib
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D35641
2022-06-30 10:06:04 -07:00
John Baldwin
d95657a1a7 gcore: Use PT_GETREGSET for NT_THRMISC and NT_PTLWPINFO.
This avoids the need for dealing with converting lwpinfo for alternate
ABIs in gcore itself.

Reviewed by:	markj
MFC after:	2 weeks
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D35667
2022-06-30 10:05:02 -07:00
John Baldwin
0288d4277f Add register sets for NT_THRMISC and NT_PTLWPINFO.
For the kernel this is mostly a non-functional change.  However, this
will be useful for simplifying gcore(1).

Reviewed by:	markj
MFC after:	2 weeks
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D35666
2022-06-30 10:04:56 -07:00
John Baldwin
d2a3c30a51 gcore: Remove unused typedefs.
These are no longer needed after commit 4965ac059d which used
PT_GETREGSET to fetch NT_PRSTATUS and NT_FPREGSET.

Reviewed by:	markj, emaste
MFC after:	2 weeks
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D35665
2022-06-30 10:04:49 -07:00
John Baldwin
21d2d29f59 libclang_rt: Trim a few more MIPSisms.
The only FreeBSD architectures ending in 'hf' were MIPS hard-float
architectures.

Reviewed by:	emaste
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D35591
2022-06-30 10:02:37 -07:00
Michael Tuexen
61a73acd88 tcpsso: improve man page
Describe explicitly the handling of TCP endpoints in the TIME-WAIT and
SYN-RCVD state.

Reported by:		glebius@
Reviewed by:		glebius@
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D35651
2022-06-30 18:37:09 +02:00
Michal Krawczyk
79e1500276 ena: Update driver version to v2.6.0
Some of the changes in this release:
* Style fixes
* Fix ENI stats probing
* Add trace for the last Tx cleanup call
* Prevent LLQ initialization if member isn't exposed
* Improve logging

Obtained from: Semihalf
MFC after: 2 weeks
Sponsored by: Amazon, Inc.
2022-06-30 17:32:21 +02:00
Michal Krawczyk
79770fdad6 ena: Fix invalid KASSERT test in netmap code
The KASSERT was originally added to ensure that the netmap Rx ring is
not NULL, however, it was checking for the opposite.

Obtained from: Semihalf
MFC after: 2 weeks
Sponsored by: Amazon, Inc.
2022-06-30 17:32:17 +02:00
Dawid Gorecki
8f15f8a72b ena: Align names of constants
Most of the constants in ena.h file were prefixed with ENA_*, while
others did not have this prefix. Align the constants by prefixing the
remaining constants with ENA.

Obtained from: Semihalf
MFC after: 2 weeks
Sponsored by: Amazon, Inc.
2022-06-30 17:32:13 +02:00
Michal Krawczyk
d5d5ea8723 ena: Remove write-only datapath variable
The ena_qid variable value is never used. It can be safely removed.
That also silences the compilation warning.

Obtained from: Semihalf
MFC after: 2 weeks
Sponsored by: Amazon, Inc.
2022-06-30 17:32:09 +02:00
Dawid Gorecki
82e558eacf ena: Fix styling issues
Align code style with FreeBSD style(9) guidelines.

Obtained from: Semihalf
MFC after: 2 weeks
Sponsored by: Amazon, Inc.
2022-06-30 17:32:04 +02:00
Dawid Gorecki
755e60ca04 ena: Use device_set_desc in probe
During probe the driver created a temporary buffer to which the value of
DEVICE_DESC constant was printed. This buffer was then copied to the
device structure using device_set_desc_copy. Since the value of this
string is exactly the same for every device using the ENA driver, using
sprintf is unnecessary, and device_set_desc can be used instead.

Obtained from: Semihalf
MFC after: 2 weeks
Sponsored by: Amazon, Inc.
2022-06-30 17:32:01 +02:00
Michal Krawczyk
f65d7660b5 ena: Remove TSO refs from the documentation
The Hardware currently doesn't support TSO feature and it can be
misleading to mention that in the docs.

All references to the docs were removed from the man pages.

Obtained from: Semihalf
MFC after: 2 weeks
Sponsored by: Amazon, Inc.
2022-06-30 17:31:57 +02:00
Dawid Gorecki
b899a02ad7 ena: Move ena_copy_eni_metrics into separate task
Copying ENI metrics was done in callout context, this caused the driver
to panic when sample_interval was set to a value other than 0, as the
admin queue call which was executed could sleep while waiting on
a condition variable. Taskqueue, unlike callout, allows for sleeping, so
moving the function to a separate taskqueue fixes the problem.
ena_timer_service is still responsible for scheduling the taskqueue.

Stop draining the callout during ena_up/ena_down. This was done to
prevent a race between ena_up/down and ena_copy_eni_metrics admin queue
calls. Since ena_metrics_task is protected by ENA_LOCK there is no
possibility of a race between ena_up/down and ena_metrics_task.

Remove a comment about locking in ena_timer_service. With ENI metrics
in a separate task this comment became obsolete.

Obtained from: Semihalf
MFC after: 2 weeks
Sponsored by: Amazon, Inc.
2022-06-30 17:31:53 +02:00
Dawid Gorecki
0ac122c388 ena: Use atomic_load/store functions for first_interrupt variable
Surround cases of possible simultaneous access to the first_interrupt
variable with atomic_load/store functions.

Obtained from: Semihalf
MFC after: 2 weeks
Sponsored by: Amazon, Inc.
2022-06-30 17:31:49 +02:00
Dawid Gorecki
d8aba82b5c ena: Store ticks of last Tx cleanup
Store timestamp of last cleanup in Tx ring structure. This does not
change anything during normal operation of the driver but could be
useful when the device fails for some reason.

Obtained from: Semihalf
MFC after: 2 weeks
Sponsored by: Amazon, Inc.
2022-06-30 17:31:44 +02:00
Dawid Gorecki
90232d18ca ena: Prevent LLQ initialization when membar isn't exposed
The ena_com_config_dev_mode() function performs many LLQ related
calculations and sends an admin command to configure LLQ in the device.

All the LLQ related operations are unnecessary if the driver fails to
find LLQ memory bar.

Move LLQ memory bar allocation to separate helper function
ena_map_llq_mem_bar and execute this function before LLQ configuration.
If the LLQ memory bar cannot be allocated, then LLQ configuration is
skipped.

Obtained from: Semihalf
MFC after: 2 weeks
Sponsored by: Amazon, Inc.
2022-06-30 17:31:37 +02:00
Dawid Gorecki
a9c39b031f ena: Extend debug prints for invalid req_id resets
Print information about qid if req_id is invalid. Add information about
qid and req_id if mbuf is invalid.

Obtained from: Semihalf
MFC after: 2 weeks
Sponsored by: Amazon, Inc.
2022-06-30 17:31:29 +02:00
Dawid Gorecki
d209ffee15 ena: Move reset completion logging to the reset function
While ena_restore_device is called from the reset task, it can also be
called from other locations in the driver, for example in netmap
specific code. Move the reset completion logging to reset task, so it
better represents when the reset actually happened.

Obtained from: Semihalf
MFC after: 2 weeks
Sponsored by: Amazon, Inc.
2022-06-30 17:31:23 +02:00
Dawid Gorecki
3501d4f17e ena: Add ena_ring_tx_doorbell() function
Add ena_ring_tx_doorbell function to remove code duplication.

Obtained from: Semihalf
MFC after: 2 weeks
Sponsored by: Amazon, Inc.
2022-06-30 17:31:12 +02:00
Ed Maste
7fde0187cc Remove "All Rights Reserved" from Foundation copyrights
on man pages.

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2022-06-30 10:54:30 -04:00
Gleb Smirnoff
66c8e3fccf socket: fix listen(2) on an already listening socket
Reviewed by:		markj
Differential revision:	https://reviews.freebsd.org/D35669
Fixes:			141fe2dcee
2022-06-30 07:50:29 -07:00
Ed Maste
a765ac11c5 Remove "All Rights Reserved" from Foundation copyrights
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2022-06-30 10:49:09 -04:00
Mark Johnston
b8ec0ce5b4 wait.2: Remove sys/types.h from the list of required headers
wait.h is self-contained.

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2022-06-30 10:31:26 -04:00
Mark Johnston
ec014502ee libsysdecode: Grab some more ioctl definitions from CAM
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2022-06-30 10:31:26 -04:00
Mark Johnston
333670372f pf: Make sure that pfi_update_status() always zeros counters
pfi_update_status() can return early if the status interface doesn't
exist.  But in this case pf_getstatus() was copying uninitialized stack
memory into the output nvlist.

Reported by:	Jenkins (KMSAN job)
Reviewed by:	kp
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D35659
2022-06-30 10:31:26 -04:00
Mark Johnston
bc83b35922 pf: Ensure that pfiio_name is always nul terminated
Reported by:	syzkaller
Reviewed by:	kp
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D35660
2022-06-30 10:31:26 -04:00
Mateusz Piotrowski
d5a381f8c7 hier.7: Remove a.out lib directories
Fixes:		76b4234537 BSD.usr.dist: remove aout
MFC after:	1 week
2022-06-30 16:22:02 +02:00
Mateusz Piotrowski
3beedc3840 pkg.7: Clean up mdoc
MFC after:	1 week
2022-06-30 16:22:02 +02:00
Mateusz Piotrowski
0438e9beb5 sysctl.8: Reference sysctl(9)
MFC after:	1 week
2022-06-30 16:22:01 +02:00
Mateusz Piotrowski
383ccaa405 sysctl.conf.5: Document rc.d/sysctl and rc.d/sysctl_lastload
Also, update the BUGS section. The example describes an issue, which is
not true anymore thanks to sysctl_lastload. Point readers to rcorder(8)
instead.

MFC after:	2 weeks
2022-06-30 16:22:01 +02:00
Kristof Provost
c21cbaca2b dummynet: handle IPV6 layer 2 traffic
When pf sends layer 2 traffic into dummynet it still marks IPv6 with
IPFW_ARGS_IPV6 (which dummynet translates to PROTO_V6). That in turn
results in it not matching the 'DIR_IN | PROTO_LAYER2' case, and
triggering the 'bad switch' error message.

Add extra cases for LAYER2 | PROTO_IPV6.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
2022-06-30 13:36:26 +02:00
Mateusz Piotrowski
7963c02c9b rescure.8: Do not recommend release artifact disc2
The FreeBSD project does not publish disc2 image anymore.

MFC after:	2 weeks
2022-06-30 13:30:02 +02:00