Commit graph

138717 commits

Author SHA1 Message Date
Emmanuel Vadot
6bd6344f13 fb: Add new FBTYPE_EFIFB
Currently the type isn't set in the fbtype struct so any userland
program that call the FBIOGTYPE ioctl will think it's a FBTYPE_SUN1BW
which is far from the truth.
No app that I found find checks the type but at least now it's correct.

Reviewed by:	emaste, tsoome
MFC after:	2 weeks
Sponsored by:   Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D33221

(cherry picked from commit ca23e9d2ac)
2021-12-21 10:21:26 +01:00
Emmanuel Vadot
0c543a6541 fb: Remove some unused ioctls
6d1699583d added the FBIOGXINFO,FBIOMONINFO and FBIOPUTCMAPI/FBIOGETCMAPI
ioctls and said that implementation in driver will come later.
Since it was in 2001 I think we can remove this.

Reviewed by:	emaste, imp, tsoome
MFC after:      2 weeks
Sponsored by:   Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D33218
Differential Revision:	https://reviews.freebsd.org/D33219
Differential Revision:	https://reviews.freebsd.org/D33220

(cherry picked from commit 706f32db8a)
2021-12-21 10:21:26 +01:00
Emmanuel Vadot
cee79df364 fb: Remove unused cursors ioctls
The cursors related ioctls were added in 1994 with the 4.4 Lite import
but were never implemented in either sc(4), fb(4) or vt(4).
Remove it.

Reviewed by:	emaste, tsoome
MFC after:      2 weeks
Sponsored by:   Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D33217

(cherry picked from commit b9d3b253e2)

arm/freescale: remove FBIOSCURSOR

Unbreaks building EFIKA_MX

Fixes:	b9d3b253e2 ("fb: Remove unused cursors ioctls")
Sponsored by:	Rubicon Communications, LLC ("Netgate")

(cherry picked from commit 793c74e415)
2021-12-21 10:21:16 +01:00
Emmanuel Vadot
906e705e08 fb: Remove unused FBIOVERTICAL ioctl
Commit 6d1699583d added the FBIOVERTICAL ioctl and said that implementation
in driver will come later.
Since it was in 2001 I think we can remove this.

MFC after:      2 weeks
Sponsored by:   Beckhoff Automation GmbH & Co. KG

(cherry picked from commit 87fae70dc5)
2021-12-21 10:18:52 +01:00
Emmanuel Vadot
cc72313664 fb: Remove unused FBIOSVIDEO/FBIOGVIDEO ioctls
The FBIOSVIDEO/FBIOGVIDEO ioctls were added in 1994 with the 4.4 Lite import
but were never implemented in either sc(4), fb(4) or vt(4).
Remove it.

Reviewed by:	emaste, tsoome
MFC after:      2 weeks
Sponsored by:   Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D33216

(cherry picked from commit 26542b33a4)
2021-12-21 10:18:50 +01:00
Emmanuel Vadot
2d8d4ade23 fb: Remove unused FBIOSATTR/FBIOGATTR ioctls
The FBIOSATTR/FBIOGATTR ioctls were added in 1994 with the 4.4 Lite import
but were never implemented in either sc(4), fb(4) or vt(4).
Remove it.

Reviewed by:	emaste, tsoome
MFC after:      2 weeks
Sponsored by:   Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D33215

(cherry picked from commit f1105fb8f7)
2021-12-21 10:18:49 +01:00
Emmanuel Vadot
bc2b797c4a fb: Remove unused code
The FBIOGINFO ioctl was added in 1994 with the 4.4 Lite import but was commented.
Remove it.

Reviewed by:	emaste
MFC after:      2 weeks
Sponsored by:	Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D33211

(cherry picked from commit 95744d84b1)
2021-12-21 10:18:47 +01:00
Alexander Motin
dd8d32c669 isp(4): Allow more than 2 ports to read WWNs from NVRAM.
It appears at least on QLE2694L cards 3rd and 4th ports follow the
same NVRAM addressing logic as the first two.  In lack of proper
documentation this guess is as good as it can be.

MFC after:	1 week
Sponsored by:	iXsystems, Inc.

(cherry picked from commit 483e464ed4)
2021-12-20 20:06:32 -05:00
Scott Long
8a45f0ab20 FIx "set but not used" in the isp driver.
Sponsored by: Rubicon Communications, LLC ("Netgate")

(cherry picked from commit 14c912c60d)
2021-12-20 20:05:59 -05:00
Ed Maste
43b5915ef4 Correct syscons description in i386 and amd64 configs
Commit 2d6f6d6373 switched to vt(4) as the default console.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 228e020a3b)
2021-12-20 11:16:21 -05:00
Andrew Turner
b5346307ed Per-thread stack canary on arm64
With the update to llvm 13 we are able to tell the compiler it can find
the SSP canary relative to the register that holds the userspace stack
pointer. As this is unused in most of the kernel it can be used here
to point to a per-thread SSP canary.

As the kernel could be built with an old toolchain, e.g. when upgrading
from 13, add a warning that the options was enabled but the compiler
doesn't support it to both the build and kernel boot.

Discussed with:	emaste
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D33079

(cherry picked from commit ae92ace05f)
2021-12-20 11:09:27 +00:00
Andrew Turner
b2db0024ae Fix bracketing in the arm64 minidump code
When building with gcc10 it suggests the parentheses are wrong. Set them
to be the calculated physical address or'd with page table attributes.

Reviewed by:	mhorne, imp
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D33099

(cherry picked from commit 3ff0419450)
2021-12-20 11:09:27 +00:00
John Baldwin
e951219f29 libmd: Only define SHA256_Transform_c when using the ARM64 ifunc.
GCC 9 doesn't define a SHA256_Transform symbol when the stub just wraps
SHA256_Transform_c resulting in an undefined symbol for
_libmd_SHA256_Transform in libmd.so.

Discussed with:	andrew, jrtc27
Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D31945

(cherry picked from commit a6765c4b44)
2021-12-20 11:09:26 +00:00
Andrew Turner
757a39b1b2 Use arm64 sha256 intrinsics in libmd
Summary:
When running on a CPU that supports the arm64 sha256 intrinsics use them
to improve perfromance of sha256 calculations.

With this changethe following improvement has been seen on an Apple M1
with FreeBS running under Parallels, with similar results on a
Neoverse-N1 r3p1.

x sha256.orig
+ sha256.arm64
+--------------------------------------------------------------------+
|++                                                               x x|
|+++                                                              xxx|
||A                                                               |A||
+--------------------------------------------------------------------+
    N           Min           Max        Median           Avg        Stddev
x   5          3.41           3.5          3.46         3.458   0.042661458
+   5          0.47          0.54           0.5         0.504   0.027018512
Difference at 95.0% confidence
        -2.954 +/- 0.0520768
        -85.4251% +/- 0.826831%
        (Student's t, pooled s = 0.0357071)

Reviewed by:	cem
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D31284

(cherry picked from commit 69d8dc20be)
2021-12-20 11:09:26 +00:00
Andriy Gapon
ac55524730 pcf8591: remove write-only variables
(cherry picked from commit b416345d5b)
2021-12-20 12:47:38 +02:00
Konstantin Belousov
bafbbd46ca Regen 2021-12-20 02:29:11 +02:00
Konstantin Belousov
1791debf4a swapoff: add one more variant of the syscall
For MFC, COMPAT_FREEBSD13 braces were removed.

(cherry picked from commit 5346570276)
2021-12-20 02:29:11 +02:00
Konstantin Belousov
45786883b0 swapoff(2): add a SWAPOFF_FORCE flag
(cherry picked from commit e8dc2ba29c)
2021-12-20 02:29:11 +02:00
Konstantin Belousov
6ceede7d36 swapoff(2): replace special device name argument with a structure
(cherry picked from commit a4e4132fa3)
2021-12-20 02:29:11 +02:00
Gleb Smirnoff
42301a9db1 ng_l2tp: improve seq structure locking.
PR:			241133
Reviewed by:		mjg, markj
Differential Revision:	https://reviews.freebsd.org/D31476
Author:			glebius

(cherry picked from commit 0a76c63dd4)
(cherry picked from commit 89042ff776)
(cherry picked from commit ae04d30451)
2021-12-20 01:21:38 +07:00
Martin Matuska
3aa1cabca3 zfs: merge openzfs/zfs@af88d47f1 (zfs-2.1-release) into stable/13
OpenZFS release 2.1.2

Notable upstream pull request merges:
  #12668 FreeBSD: Catch up with recent VFS changes
  #12704 Fix some FreeBSD VOPs to synchronize properly with teardown
  #12717 VOP_RENAME fixes for FreeBSD
  #12724 Fix lseek(SEEK_DATA/SEEK_HOLE) mmap consistency
  #12745 Restore dirty dnode detection logic
  #12770 ZFS send/recv with ashift 9->12 leads to data corruption
  #12828 FreeBSD: Add vop_standard_writecount_nomsyn
  #12828 FreeBSD: Catch up with more VFS changes

Obtained from:	OpenZFS
OpenZFS commit:	af88d47f1e
OpenZFS tag:	zfs-2.1.2
Relnotes:	yes
2021-12-19 16:25:26 +01:00
Wenfeng Liu
19592949ab ipsec: fix a logic error in key_do_getnewspi
(cherry picked from commit 509f1a0f40)
2021-12-19 14:44:52 +00:00
Alexander Motin
96787c2ffe x86: Make AMD elvtX dump more compact.
MFC after:	2 weeks

(cherry picked from commit a07d426509)
2021-12-18 23:49:07 -05:00
Corvin Köhne
3a5ac549a4 pci: add missing PCI id of Coffee Lake GPU
(cherry picked from commit 16f02a4cb4)
2021-12-19 04:42:52 +02:00
Florian Walpen
10b9991492 Thread creation privilege for realtime group
(cherry picked from commit e28767f0e1)
2021-12-19 04:42:52 +02:00
Florian Walpen
30c3a5f248 Add idle priority scheduling privilege group to MAC/priority
(cherry picked from commit a9545eede4)
2021-12-19 04:42:51 +02:00
Florian Walpen
5719dba765 Add PRIV_SCHED_IDPRIO
(cherry picked from commit a20a2450cd)
2021-12-19 04:42:51 +02:00
Florian Walpen
984b9d89f8 MAC/priority module for realtime privilege group
PR:	239125

(cherry picked from commit bf2fa8d9d1)
2021-12-19 04:42:51 +02:00
Konstantin Belousov
c35b12cc7d exec_elf: use intermediate u_long variable to correct mismatched type
(cherry picked from commit e499988f0c)
2021-12-19 04:42:51 +02:00
Konstantin Belousov
f1b1fa3505 imgact_elf: avoid mapsz overflow
(cherry picked from commit bf83941638)
2021-12-19 04:42:51 +02:00
Konstantin Belousov
f1f4d58a6b imgact_elf: check that the alignment of PT_LOAD segment is power of two
(cherry picked from commit 36df8f540f)
2021-12-19 04:42:51 +02:00
Konstantin Belousov
681e834b02 imgact_elf: exclude invalid alignment requests
(cherry picked from commit 714d6d09b5)
2021-12-19 04:42:51 +02:00
Konstantin Belousov
29ef89ab1b rnd_elf: add comment explaining the interface
(cherry picked from commit a4007ae10c)
2021-12-19 04:42:51 +02:00
Konstantin Belousov
e0dc92e185 elf image activator: convert asserts into errors
(cherry picked from commit 9cf78c1cf6)
2021-12-19 04:42:51 +02:00
Konstantin Belousov
5b1800d62f exec_elf: assert that the image vnode is still locked on return
(cherry picked from commit b4b20492cd)
2021-12-19 04:42:50 +02:00
Konstantin Belousov
995954f0dd Style
(cherry picked from commit 88dd7a0a39)
2021-12-19 04:42:50 +02:00
Rick Macklem
690bcf605d param.h: Bump __FreeBSD_version for commit 18f5b477ee
Commit 18f5b477ee added two arguments to VOP_ALLOCATE().
As such, all NFS modules must be rebult from sources.

This is a direct commit.
2021-12-18 14:44:46 -08:00
Rick Macklem
18f5b477ee vfs: Add "ioflag" and "cred" arguments to VOP_ALLOCATE
When the NFSv4.2 server does a VOP_ALLOCATE(), it needs
the operation to be done for the RPC's credential and not
td_ucred. It also needs the writing to be done synchronously.

This patch adds "ioflag" and "cred" arguments to VOP_ALLOCATE()
and modifies vop_stdallocate() to use these arguments.

The VOP_ALLOCATE.9 man page will be patched separately.

(cherry picked from commit f0c9847a6c)
2021-12-18 14:30:25 -08:00
Vincenzo Maffione
56eeb84f10 em: skip rxcsum offload processing when disabled
Similarly to the other Intel drivers, don't try to process
RX checksum offloads when this feature (IFCAP_RXCSUM) is
disabled.

Reviewed by:	gallatin, kbowling, erj
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D33155

(cherry picked from commit d0633af765)
2021-12-18 12:00:25 +00:00
Vincenzo Maffione
a00d9c7f8c e1000: remove unused ifp backpointer
The ifp (struct ifnet) backpointer in the e1000 private ifnet
data is not used anymore since the iflib transition.
Remove it so that developers are not tempted to use it and
get a NULL pointer dereference.

Reviewed by:	markj, kbowling, erj
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D33157

(cherry picked from commit d91559564d)
2021-12-18 11:46:41 +00:00
Rick Macklem
f15f29c975 nfsd: Fix Verify for attributes like FilesAvail
When the Verify operation calls nfsv4_loadattr(), it provides
the "struct statfs" information that can be used for doing a
compare for FilesAvail, FilesFree, FilesTotal, SpaceAvail,
SpaceFree and SpaceTotal.  However, the code erroneously
used the "struct nfsstatfs *" argument that is NULL.
This patch fixes these cases to use the correct argument
structure.  For the case of FilesAvail, the code in
nfsv4_fillattr() was factored out into a separate function
called nfsv4_filesavail(), so that it can be called from
nfsv4_loadattr() as well as nfsv4_fillattr().

In fact, most of the code in nfsv4_filesavail() is old
OpenBSD code that does not build/run on FreeBSD, but I
left it in place, in case it is of some use someday.

I am not aware of any extant NFSv4 client that does Verify
on these attributes.

PR:	260176

(cherry picked from commit 2d90ef4714)
2021-12-17 17:36:41 -08:00
Alexander Motin
d87f1e2e36 Make msgbuf_peekbytes() not return leading zeroes.
Introduce new MSGBUF_WRAP flag, indicating that buffer has wrapped
at least once and does not keep zeroes from the last msgbuf_clear().
It allows msgbuf_peekbytes() to return only real data, not requiring
every consumer to trim the leading zeroes after doing pointless copy.
The most visible effect is that kern.msgbuf sysctl now always returns
proper zero-terminated string, not only after the first buffer wrap.

MFC after:	1 week
Sponsored by:	iXsystems, Inc.

(cherry picked from commit 81dc00331d)
2021-12-17 20:36:23 -05:00
Rick Macklem
fac8422a41 nfsd: Sanity check the Layouttype count
PR:	260155

(cherry picked from commit 480be96e1e)
2021-12-17 17:32:47 -08:00
Ram Kishore Vegesna
de7809c1ee ocs_fc: Remove unused function delarations.
Remove unused function declarations.
Changes required for internal tool.

Approved by: ken

(cherry picked from commit 6f78736cb1)
2021-12-17 16:01:06 +05:30
Ram Kishore Vegesna
161148e61f ocs_fc: Fix device lost timer where device is not getting deleted.
Issue: Devices wont go away after the link down.

Device lost timer functionality in ocs_fc is broken,
`is_target` flag is not set in the target database and target delete is skipped.

Fix: Remove unused flags and delete the device when timer expires.

Reported by: ken@kdm.org
Reviewed by: mav, ken

(cherry picked from commit 41e9466943)
2021-12-17 16:01:06 +05:30
Ram Kishore Vegesna
0fff02894f ocs_fc: When commands complete with an error, freeze the device queue.
Proper error recovery depends on freezing the device queue when an
error occurs, so we can recover from an error before sending
additional commands.

The ocs_fc(4) driver was not freezing the device queue for most
SCSI errors, and that broke error recovery.

sys/dev/ocs_fc/ocs_cam.c:
	In ocs_scsi_initiator_io_cb(), freeze the device queue if
        we're passing back status other than CAM_REQ_CMP.

Submitted by: ken@kdm.org
Reviewed by: mav, ken

(cherry picked from commit d063d1bc92)
2021-12-17 16:01:06 +05:30
Ram Kishore Vegesna
4821da88ab ocs_fc: Fix CAM status reporting in ocs_fc(4) when no data is returned.
In ocs_scsi_initiator_io_cb(), if the SCSI command that is
        getting completed had a residual equal to the transfer length,
        it was setting the CCB status to CAM_REQ_CMP.

        That breaks the expected behavior for commands like READ ATTRIBUTE.
        For READ ATTRIBUTE, if the first attribute requested doesn't exist,
        the command is supposed to return an error (Illegal Request,
        Invalid Field in CDB).  The broken behavior for READ ATTRIBUTE
        caused LTFS tape formatting to fail.  It looks for attribute
        0x1623, and expects to see an error if the attribute isn't present.

        In addition, if the residual is negative (indicating an overrun),
        only set the CCB status to CAM_DATA_RUN_ERR if we have not already
        reported an error.  The SCSI sense data will have more detail about
        what went wrong.

        sys/dev/ocs_fc/ocs_cam.c:
                In ocs_scsi_initiator_io_cb(), don't set the status to
                CAM_REQ_CMP if the residual is equal to the transfer length.

                Also, only set CAM_DATA_RUN_ERR if we didn't get SCSI
                status.

Submitted by: ken@kdm.org
Reviewed by: mav, ken

(cherry picked from commit 1af49c2eeb)
2021-12-17 16:01:05 +05:30
Ram Kishore Vegesna
661875cecb ocs_fc: Increase maximum supported SG elements to support larger transfer sizes.
Reported by: ken@kdm.org
Reviewed by: mav, ken

(cherry picked from commit 322dbb8ce8)
2021-12-17 16:01:05 +05:30
Ram Kishore Vegesna
ccd32c6513 ocs_fc: Emulex Gen 7 HBA support.
Emulex Gen7 adapter support in ocs_fc driver.

Reviewed by: mav, ken

(cherry picked from commit 3bf42363b0)
2021-12-17 16:01:05 +05:30
Ram Kishore Vegesna
44a78c21df ocs_fc: Add gendump and dump_to_host ioctl command support.
Support to generate firmware dump.

Approved by: mav(mentor)

(cherry picked from commit 29e2dbd42c)

Add ocs_gendump.c to the build, missed in 29e2dbd42c.

(cherry picked from commit d0732fa819)
2021-12-17 16:00:59 +05:30