Commit Graph

279351 Commits

Author SHA1 Message Date
Wanpeng Qian
3a194eac3c nvmecontrol: fix wrong temperature unit for INTEL SSDs.
Although intel's specification did not tell which unit for Temperature
Statistics (Log Identifier C5h), I believe it is based on Celsius
instead of Kelvin.

here is my P3700 SSDs result(before):

Intel Temperature Log
=====================
Current:                        30 K, -243.15 C, -405.67 F
Overtemp Last Flags             0
Overtemp Lifetime Flags         0
Max Temperature                 53 K, -220.15 C, -364.27 F
Min Temperature                 17 K, -256.15 C, -429.07 F
Max Operating Temperature       63 K, -210.15 C, -346.27 F
Min Operating Temperature       0 K, -273.15 C, -459.67 F
Estimated Temperature Offset:   0 C/K
after apply the patch, result is

Intel Temperature Log
=====================
Current:                        303.15 K, 30 C, 86.00 F
Overtemp Last Flags             0
Overtemp Lifetime Flags         0
Max Temperature                 326.15 K, 53 C, 127.40 F
Min Temperature                 290.15 K, 17 C, 62.60 F
Max Operating Temperature       336.15 K, 63 C, 145.40 F
Min Operating Temperature       273.15 K, 0 C, 32.00 F
Estimated Temperature Offset:   0 C/K
I also compare to smartctl's report. it match very well.

also tested on Intel P3600, it fixed the problem.

Signed-off-by: Wanpeng Qian <wanpengqian@gmail.com>
Reviewed by: imp (added tweak to samsung.c so it still compiles)
Differential Revision: https://reviews.freebsd.org/D32845
2022-11-11 12:15:52 -07:00
Mitchell Horne
03d6764b38 ddb: don't limit pindex output in 'show vmopag'
This command already prints a tremendous amount of output, and properly
obeys the pager. It no longer makes sense to arbitrarily limit the pages
that are printed, as the reader will not be aware that this has
happened.

Reviewed by:	markj
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D37361
2022-11-11 14:25:39 -04:00
Mitchell Horne
831979ae0f ddb(4): document some missing commands
This is not exhaustive, just what I collected while working on
mac_ddb(4).

Reviewed by:	pauamma, markj, jhb
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation (in part)
Differential Revision:	https://reviews.freebsd.org/D37333
2022-11-11 14:25:39 -04:00
Mitchell Horne
94f6ee56e3 ddb(4): misc updates
- Describe optional 'addr' argument to many show commands
 - Remove obsolete commands (show cbstat)
 - 'show jails' was renamed to 'show prison'
 - Remove superfluous commentary about sleepqueues
 - Fix an xref to gdb(4)
 - Fix issues reported by mandoc -Tlint
 - Plus a couple other inaccuracies/inconsistencies

Reviewed by:	pauamma, markj, jhb
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation (in part)
Differential Revision:	https://reviews.freebsd.org/D37332
2022-11-11 14:25:38 -04:00
Mitchell Horne
b0832b5074 netdump(4): document all kernel options required
This means INET and DEBUGNET in addition to NETDUMP.

Reviewed by:	pauamma, markj
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D37331
2022-11-11 14:25:38 -04:00
Mitchell Horne
d5f3e80f5a netgdb(4): update list of required kernel options
The man page claims that netgdb will be enabled automatically with the
presence of the DDB, GDB, and INET options. Based on the logic in
conf/files, this is not the case. Update the manpage to list all
of the options required to include netgdb.

Reviewed by:	pauamma, markj
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D37330
2022-11-11 14:25:38 -04:00
Jean-Sébastien Pédron
58cf3a69a5
linuxkpi: Define boot_cpu_data.x86_max_cores
Reviewed by:	manu
Approved by:	manu
Differential Revision:	https://reviews.freebsd.org/D36971
2022-11-11 18:43:07 +01:00
Jean-Sébastien Pédron
c4163160e4
linuxkpi: Add dev_warn_once() in <linux/device.h>
Reviewed by:	manu
Approved by:	manu
Differential Revision:	https://reviews.freebsd.org/D36968
2022-11-11 18:42:31 +01:00
Jean-Sébastien Pédron
23ebeac87f
linuxkpi: Add list_for_each_entry_from_rcu() in <linux/rculist.h>
Reviewed by:	manu
Approved by:	manu
Differential Revision:	https://reviews.freebsd.org/D36967
2022-11-11 18:42:10 +01:00
Jean-Sébastien Pédron
d3584f9283
linuxkpi: Define typeof_member() in <linux/kernel.h>
Reviewed by:	manu
Approved by:	manu
Differential Revision:	https://reviews.freebsd.org/D36964
2022-11-11 18:41:36 +01:00
Jean-Sébastien Pédron
0e5569a08c
linuxkpi: Add <linux/dma-buf-map.h>
I took the implementation from OpenBSD, commit
d55ef580b1748517027c3eabdb715316ca5b1442.

The only difference is the addition of `dma_buf_map_is_equal()`.

Reviewed by:	manu
Approved by:	manu
Differential Revision:	https://reviews.freebsd.org/D36963
2022-11-11 18:40:57 +01:00
Jean-Sébastien Pédron
c9c1255012
linuxkpi: Add <linux/mmzone.h>
It provides the `MAX_ORDER` constant.

Reviewed by:	emaste manu
Approved by:	emaste manu
Differential Revision:	https://reviews.freebsd.org/D36962
2022-11-11 18:39:48 +01:00
Jean-Sébastien Pédron
1676c97d5d
linuxkpi: Add <acpi/actbl.h>
It simply includes the same header in FreeBSD (which is located
elsewhere).

Reviewed by:	manu
Approved by:	manu
Differential Revision:	https://reviews.freebsd.org/D36960
2022-11-11 18:38:06 +01:00
Jean-Sébastien Pédron
1ad6b2b1da
linuxkpi: Add krealloc_array()
In FreeBSD, this is a wrapper on top of `realloc()`.

V2: Check if `n * size` would overflow and return `NULL` if that's the
    case. Suggested by hselasky@ and emaste@.

Reviewed by:	manu
Approved by:	manu
Differential Revision:	https://reviews.freebsd.org/D36959
2022-11-11 18:37:34 +01:00
Jean-Sébastien Pédron
0b8a423d07
linuxkpi: Introduce module_param() of type hexint
In Linux, this affects how the value is formatted. In FreeBSD, this
remains an unsigned integer.

Reviewed by:	manu
Approved by:	manu
Differential Revision:	https://reviews.freebsd.org/D36958
2022-11-11 18:36:46 +01:00
Jean-Sébastien Pédron
c72dd0aabe
linuxkpi: Introduce vma_set_file()
This code was moved from the i915 driver in Linux 5.11.

Reviewed by:	manu
Approved by:	manu
Differential Revision:	https://reviews.freebsd.org/D36957
2022-11-11 18:36:00 +01:00
Jean-Sébastien Pédron
415ca4d27d
linuxkpi: Include <linux/shinker.h> in <linux/mm.h>
This is done like this in Linux.

Reviewed by:	emaste manu
Approved by:	emaste manu
Differential Revision:	https://reviews.freebsd.org/D36956
2022-11-11 18:34:19 +01:00
Jean-Sébastien Pédron
f021c5c4a1
linuxkpi: Update struct irq_work
The previous `llnode` field is moved inside another field `node`.

This `node` field is a `struct __call_single_node` in Linux. Here, we
simply add an anonymous struct with the `llnode` field inside. That
field's new name is `llist` now.

V2: Use an anonymous union to keep the structure backward compatible
    with drivers using the previous `llnode` field. This was suggested
    by wufl@ and hselasky@. Thank you!

Reviewed by:	manu
Approved by:	manu
Differential Revision:	https://reviews.freebsd.org/D36955
2022-11-11 18:32:58 +01:00
Jean-Sébastien Pédron
bfe6bfd79e
linuxkpi: Add __GFP_NOMEMALLOC kmalloc flag
Reviewed by:	manu
Approved by:	manu
Differential Revision:	https://reviews.freebsd.org/D36954
2022-11-11 18:30:31 +01:00
Konrad Witaszczyk
f0d1225734
Remove dead code in the cscope target
arm64 is the only currently supported architecture that has
${MACHINE_CPUARCH} set to a different value (aarch64) than ${MACHINE}
(arm64), as described in arch(7). However, there is no source directory
associated with arm64 that has a name set to ${MACHINE_CPUARCH}.

Remove the dead code that adds a directory with a name set to
${MACHINE_CPUARCH} to a list of directories indexed with cscope.
This change allows to use the cscope target on arm64.

Discussed with:	jhb
Reviewed by:	imp jhb
Approved by:	oshogbo (mentor)
Differential Revision:	https://reviews.freebsd.org/D36402
2022-11-11 15:53:57 +00:00
Elyes HAOUAS
cb25444c05 lib/libsecureboot: Fix some typos
Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr>
Pull Request:	https://github.com/freebsd/freebsd-src/pull/544
2022-11-11 10:38:39 -05:00
Mark Johnston
719e307f80 bhyve: Cast away const when fetching a config nvlist
Silence a warning from the compiler about "const" being discarded.  The
warning is correct: nvlist values are supposed to be immutable.
However, fixing this properly will require some contortions on behalf of
consumers who look up a subtree of the config and modify it.  Per a
discussion on freebsd-virtualization@, the solution will probably be to
outright replace the use of nvlists for VM configuration, but until that
happens let's document the problem and silence the warning.

No functional change intended.

MFC after:	2 weeks
Reviewed by:	corvink, jhb
Differential Revision:	https://reviews.freebsd.org/D37293
2022-11-11 10:02:42 -05:00
Mark Johnston
8b1adff8bc bhyve: Drop volatile qualifiers from snapshot code
They accomplish nothing since the qualifier is casted away in calls to
memcpy() and copyin()/copyout().  No functional change intended.

MFC after:	2 weeks
Reviewed by:	corvink, jhb
Differential Revision:	https://reviews.freebsd.org/D37292
2022-11-11 10:02:26 -05:00
Mark Johnston
593200c23b bhyve: Drop volatile qualifiers from virtio rings
The qualifiers are there presumably because these rings are mapped into
the guest, but they do not appear to be required for correctness, and
bhyve generally doesn't qualify accesses to guest memory this way.
Moreover, the qualifiers are discarded by snapshot code, causing clang
to emit warnings.  Just stop using volatile here.

MFC after:	2 weeks
Reviewed by:	corvink, jhb
Differential Revision:	https://reviews.freebsd.org/D37291
2022-11-11 10:02:10 -05:00
Mark Johnston
691e23e6c5 bhyve: Drop volatile qualifiers from xhci hw struct fields
This fixes a warning raised by the removal of the volatile qualifier
from &trb->qwTrb0 in the following snippet:

	xfer_block = usb_data_xfer_append(xfer,
	     (void *)(trbflags & XHCI_TRB_3_IDT_BIT ?
		 &trb->qwTrb0 : XHCI_GADDR(sc, trb->qwTrb0)),
	     trb->dwTrb2 & 0x1FFFF, (void *)addr, ccs);

The use of volatile appears to be inherited from the kernel driver's
definitions of the same structures.  It makes some sense, since USB TRBs
and related structures live in guest memory, but bhyve device models
generally don't volatile-qualify accesses to guest memory and I can't
see how they are required for correctness here.  Moreover, XHCI_GADDR
does not return volatile pointers so we're already being inconsistent.
Just drop the qualifiers to address the warning.

MFC after:	2 weeks
Reviewed by:	corvink, jhb
Differential Revision:	https://reviews.freebsd.org/D37290
2022-11-11 10:01:52 -05:00
Mark Johnston
0ced97acb0 bhyve: Define an accessor for net backend private data
Use it to silence warnings about potential unaligned accesses.  No
functional change intended.

MFC after:	1 week
Reviewed by:	corvink, jhb
Differential Revision:	https://reviews.freebsd.org/D37289
2022-11-11 10:01:40 -05:00
Mark Johnston
f64f343809 bhyve: Address warnings about potential unaligned accesses in fwctl.c
This silences some warning about potential unaligned accesses.  No
functional change intended.

MFC after:	1 week
Reviewed by:	corvink, jhb
Differential Revision:	https://reviews.freebsd.org/D37288
2022-11-11 10:01:27 -05:00
Kristof Provost
c90b9a5ebb netpfil tests: add dummynet fq_codel test case
fq_codel was broken due to a missing m_rcvif_serialize() in the enqueue
path.
Add a simple test case to ensure it at least passes traffic.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
2022-11-11 11:55:59 +01:00
Kristof Provost
26b9e1f07f dummynet: fix codel
Serialize rcvif when enqueing packets for codel. We already tried to
restore the serialized rcvif in fq_codel_extract_head(), but that
doesn't work when we fail to serialize it first, so we ended up dropping
all packets passed through codel.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D37318
2022-11-11 11:53:31 +01:00
Kristof Provost
832c8a58e1 if_ovpn tests: add aes-128-gcm test case
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2022-11-11 11:17:39 +01:00
Kristof Provost
2c58d0cb3b if_ovpn: fix AES-128-GCM support
We need to explicitly list AES-128-GCM as an allowed cipher for that
mode to work. While here also add AES-192-GCM. That brings our supported
cipher list in line with other openvpn/dco platforms.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
2022-11-11 11:17:39 +01:00
Konstantin Belousov
8cc44a1e59 rtld: add support for the $LIB token
similar to the same token in glibc.

Requested and reviewed by:	bapt
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D37329
2022-11-11 12:06:30 +02:00
Andrew Turner
9142f3a885 Fix a rk356x pinctrl register offset
The pull-up/pull-down register offset was wrong on the Rockchip rk356x.
It was set such that the driver would modify the IOMUX control registers.

This seems to work with the current device tree files, but fails with
upstream files. Fix the offset so the later calculation has the correct
offset for the pull-up/pull-down control register.

Sponsored by:	The FreeBSD Foundation
2022-11-11 08:34:48 +00:00
Kristof Provost
3d98e253fe man4: if_bridge and if_vlan do support ALTQ
if_vlan(4) has supported ALTQ since 2e5ff01d0a, and if_bridge since
eb680a63de.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
2022-11-10 16:39:47 +01:00
Kristof Provost
4deab7aed7 man4: cxgbe(4) does not support ALTQ
It hasn't supported it since 65d43cc6e7 (so February 2012).

Sponsored by:	Rubicon Communications, LLC ("Netgate")
2022-11-10 16:33:04 +01:00
Kristof Provost
e838ed7ca1 if_ovpn tests: fix typo in test description
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2022-11-10 14:34:25 +01:00
Baptiste Daroussin
7592dd5527 ObsoleteFiles: add missing '+'
Reported by:	antoine
2022-11-10 14:04:54 +01:00
Baptiste Daroussin
6658132e5a ObsoleteFiles: fix typo
Reported by:	marck
2022-11-10 13:47:08 +01:00
Emmanuel Vadot
ee247fc1e9 linuxkpi: Move cpu_relax out of ifdef for x86
It's needed by drm-kmod and this allow building on arm64 and powerpc.

Reported by:	jhibbits
Sponsored by:	Beckhoff Automation GmbH & Co. KG
2022-11-10 12:50:51 +01:00
Richard Scheffenegger
1a70101a87 tcp: account sent/received IP ECN markings independently
Have tcpstats (netstat -s) differentiate between received and sent
ECN-marked packets. Also account for IP ECN bits (on TCP packets)
even when the tcp session has not negotiated ECN support.

Event:			IETF 115 Hackathon
Reviewed By:		glebius, tuexen, #transport
Sponsored by:		NetApp, Inc.
Differential Revision:	https://reviews.freebsd.org/D37314
2022-11-10 11:35:35 +01:00
Andrey V. Elsukov
8526120ad4 ixgbe: workaround errata about UDP frames with zero checksum
Intel 82599 has errata related to IPv4 UDP frames with zero checksum.
It reports such datagrams with L4 integrity errors in IXGBE_XEC
register. And after afb1aa4e6d commit such errors are reported
via IFCOUNTER_IERRORS. This confuses users, since actually all frames
are handled correctly by the system.
To workaround the problem, let's ignore the XEC register value for
82599 cards for now.

PR:		266048
Discussed with:	erj
MFC after:	1 week
Sponsored by:	Yandex LLC
2022-11-10 12:34:40 +03:00
Baptiste Daroussin
820b62d941 ObsoleteFiles: the rc.sendmail(8) man page was also removed 2022-11-10 10:27:42 +01:00
Peter Holm
f31ca922cb stress2: Add SU+J as a test. Save fsck_ffs core dump, if any 2022-11-10 10:12:46 +01:00
Alexander Leidinger
f993fff689 Sort list of supported features for more easy handling
in the future.

Reviewed by:	imp
2022-11-10 09:47:23 +01:00
Baptiste Daroussin
d88828148d rc.conf: document the sendmail options
While here remove the deprecation of the sendmail_enable="NONE" as
it has been deprecated for 20 years and never removed
2022-11-10 07:00:33 +01:00
Kirk McKusick
5f7acd1858 Fix printfs for fsck_ffs(8) i386 build.
Reported by:  jenkins
Sponsored by: The FreeBSD Foundation
2022-11-09 21:59:20 -08:00
Kyle Evans
8b8babf044 include: put includes into -dev packages
The includes build is kind of funky, as we support either copying or
symlinking files into /usr/include.  For `copies`, we were supplying
the include/ ${TAG_ARGS}, which puts packages into `FreeBSD-runtime`,
without any consideration to the fact that we're installing headers.

Let's copy the approach that the `symlinks` target uses for now, and
add ",dev" to the TAG_ARGS so that headers at least end up in
FreeBSD-runtime-dev, which is more appropriate.  Some of these includes
are actually technically supposed to be in *other* packages and their
INCSGROUP's PACKAGE setting is actually correct, but this is less
trivial to solve.  This is a bandaid to fix the immediate problem of
some headers ending up in two different packages.

PR:		267526
Reviewed by:	dfr, manu
Differential Revision:	https://reviews.freebsd.org/D37256
2022-11-09 22:20:38 -06:00
Kirk McKusick
689a9368eb Fix types for fsck_ffs(8) i386 build.
Reported by:  jenkins
Reported by:  Cy Schubert
Sponsored by: The FreeBSD Foundation
2022-11-09 18:31:19 -08:00
Luiz Amaral
813c5b75e6 pfsync: prepare code to accommodate AF_INET6 family
Work is ongoing to add support for pfsync over IPv6. This required some
changes to allow for differentiating between the two families in a more
generic way.

This patch converts the relevant ioctls to using nvlists, making future
extensions (such as supporting IPv6 addresses) easier.

Sponsored by:	InnoGames GmbH
Differential Revision:	https://reviews.freebsd.org/D36277
2022-11-09 21:06:07 +01:00
Anton Rang
cfbf1da0de vm_page_unswappable: remove wrong assertion
markj says:

    ...the assertion is incorrect and should simply be removed.
    It has been racy since we removed the use of the page hash
    lock to synchronize wiring of pages.

PR:		267621
Reviewed by:	markj, Anton Rang <rang@acm.org>
MFC after:	1 week
Sponsored by:	Dell Inc.
Differential Revision:	https://reviews.freebsd.org/D37320
2022-11-09 14:28:03 -06:00