Commit Graph

278005 Commits

Author SHA1 Message Date
Gordon Bergling
a5beac3992 isp: Remove a double word in the driver manual
- s/to to/to/

MFC after:	3 days
2022-09-10 13:03:38 +02:00
Gordon Bergling
bcb2341c7d netinet6: Remove a double word in a source code comment
- s/to to/to/

MFC after:	3 days
2022-09-10 13:01:44 +02:00
Gordon Bergling
eb2f7d9a5a ocs_fc(4): Remove double words in source code comments
- s/to to/to/

MFC after:	3 days
2022-09-10 13:00:23 +02:00
Gordon Bergling
82007616d0 msun: Remove a double word in a source code comment
- s/to to/to/

MFC after:	3 days
2022-09-10 12:59:10 +02:00
Gordon Bergling
8dcfb0282d mk: Remove a double word in a comment
- s/to to/to/

MFC after:	3 days
2022-09-10 12:57:55 +02:00
Gordon Bergling
11bc6be152 ipf-howto: Remove a double word
- s/to to/to/

MFC after:	3 days
2022-09-10 12:56:48 +02:00
Gordon Bergling
08cb3ac76c tools: Remove a double words
- s/to to/to/
 - s/to to/to do/ in an error message

MFC after:	3 days
2022-09-10 12:54:33 +02:00
Gordon Bergling
59cdd0e2ff stress2: Remove double words in comments
- s/to to/to/

 MFC after:3 days
2022-09-10 12:52:50 +02:00
Gordon Bergling
ba594e730e regression-netinet: Remove a double word in a source code comment
- s/to to/to/

 MFC after:	3 days
2022-09-10 12:52:01 +02:00
Peter Jeremy
c02d4224c8
arm64: allwinner: aw_r_intc: Add A64 and H6 compatible.
This fixes booting the Pine H64 with a 5.13 DTS.

Suggested by:	manu@
2022-09-10 20:36:22 +10:00
Gleb Smirnoff
29b4b63c59 ip_reass: optimize ipreass_drain_vnet()
- Call ipreass_reschedule() only once per slot [1]
- Aggregate stats and update them once

Suggested by:	jtl [1]
2022-09-10 02:17:15 -07:00
Gleb Smirnoff
13018bfae8 ip_reass: make stray callout assertion more verbose
Syzcaller hits this assertion, but can't find reproducer.  I also never
seen it hit in my testing.  Try to get more information via syzcaller.
2022-09-10 02:11:39 -07:00
Felix Johnson
53af9c235f da.4: Add some sysctl descriptions
Add descriptions for the following sysctl's:

- kern.cam.da.default_softtimeout
- kern.cam.da.disable_wp_protection
- kern.cam.da.enable_biospeedup
- kern.cam.da.enable_uma_ccbs
- kern.cam.da.poll_period
- kern.cam.da.send_ordered

While here, fix some mandocs warnings.

PR:		258727
Reported by:	Felix Johnson <felix dot the dot red at gmail dot com>
Reviewed by:	debdrup, pauamma, gbe
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D32278
2022-09-10 09:44:08 +02:00
Maxim Konovalov
1b7f08b917 ifnet(9): Duplicates for IFCAP_TOE flags removed.
PR:	266330
2022-09-10 01:35:34 +00:00
Warner Losh
45ad955714 stand: Add driver interface docs
Add some rather bare-bones driver interface docs.

Sponsored by:		Netflix
Suggestions by:		rpokala
Reviewed by:		pauamma
Differential Revision:	https://reviews.freebsd.org/D35912
2022-09-09 17:25:59 -06:00
Kirk McKusick
927f8d8bbb Handle NULL return from localtime(3) in ls(1) and find(1)
The ls(1) (with -l option) and find(1) (with -ls option) utilties
segment fault when operating on files with very large modification
times. A recent disk corruption set a spurious bit in the mtime
field of one of my files to 0x8000000630b0167 (576460753965089127)
which is in year 18,266,940,962. I discovered the problem when
running fsck_ffs(8) which uses ctime(3) to convert it to a readable
format. Ctime cannot fit the year into its four character field, so
returns ??? ??? ?? ??:??:?? ???? (typically Thu Nov 24 18:22:48 2021).

With the filesystem mounted, I used `ls -l' to see how it would
report the modification time and it segment faulted. The find(1)
program also segment faulted (see script below). Both these utilities
call the localtime(3) function to decode the modification time.
Localtime(3) returns a pointer to a struct tm (which breaks things
out into its component pieces: year, month, day, hour, minute,
second). The ls(1) and find(1) utilities then print out the date
based on the appropriate fields in the returned tm structure.

Although not documented in the localtime(3) manual page, localtime(3)
returns a NULL pointer if the passed in time translates to a year
that will not fit in an "int" (which if "int" is 32-bits cannot
hold the year 18,266,940,962). Since ls(1) and find(1) do not check
for a NULL struct tm * return from localtime(3), they segment fault
when they try to dereference it.

When localtime(3) returns NULL, the attached patches produce a date
string of "bad date val". This string is chosen because it has the
same number of characters (12) and white spaces (2) as the usual
date string, for example "Sep 3 22:06" or "May 15 2017".

The most recent ANSI standard for localtime(3) does say that localtime(3)
can return NULL (see https://pubs.opengroup.org/onlinepubs/9699919799/
and enter localtime in the search box). Our localtime(3) man page should
be updated to indicate that NULL is a possible return. More importantly,
there are over 100 uses of localtime(3) in the FreeBSD source tree (see
Differential Revision D36474 for the list). Most do not check for a NULL
return from localtime(3).

Reported by:  Peter Holm
Reviewed by:  kib, Chuck Silvers, Warner Losh
MFC after:    2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D36474
2022-09-09 14:30:42 -07:00
Bjoern A. Zeeb
800aa9cd3d LinuxKPI: 80211 (+net80211): update and cleanup headers
Fix types for various struct fields (initially added as int).

Move structs and inline functions logically together, e.g., for wowlan.
Add more skeleton functions and #defines needed for iwlwifi d3.c
in the future.

Add struct ieee80211_vht_cap (without "_ie") to net80211 and remove
duplicate definitions in LinuxKPI headers now using net80211 structs.
For now leave ieee80211_ie_vhtcap in net80211.  I am not sure yet if we
actually need it as such.  That'll be cleaned up with more VHT updates
in net80211 in the future.

No functional changes in currently compiled code intended.

Try to implement ieee80211_action_contains_tpc() as I ran into it with
an older iwlwifi chipset.  This depends on c994352a88.

Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
2022-09-09 18:40:23 +00:00
Mateusz Guzik
e5d08f4729 pf: remove pf_bcmp_state_key
Clang 14 performs the optimisation on its own, thus the custom code is
no longer needed.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
2022-09-09 17:16:58 +00:00
Mateusz Guzik
6b94546a7e pf: partially depessimize pf_match_translation
Reviewed by:	kp
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2022-09-09 17:03:55 +00:00
Bjoern A. Zeeb
866e021654 rtw89: import firmware for Realtek's rtw89 supported chipsets.
Import the most recent versions of the firmware images for the
rtw89 driver.

This is based on linux-firmware at 2f2f0181581d3e35bfdb9fc65f609ee9d3fbaeb7.

The license of the firmware matches the previously added rtw88(4) firmware
and you can find a copy in sys/contrib/dev/rtw89fw/LICENCE.rtlwifi_firmware.txt.

Add build infrastructure to create the .ko files but do not yet hook
it up to the build until all parts are in the tree.

Approved by:	core.11 (imp) [2022-03-27]
MFC after:	6 weeks
2022-09-09 16:32:17 +00:00
Bjoern A. Zeeb
8e93258f26 rtw89: import Realtek's rtw89 driver
Import rtw89 based on wireless-testing at (tag: wt-2022-09-02)
78667a29c116c6b186a37e28cd8dd7fa9923aee8 with adjustments for FreeBSD.

For the moment this will stay disconnected from the build until the
last bits are flushed out, but this will help people with a card to
do testing and possibly help improving.

Given the lack of full license texts on non-local files this is
imported under the draft policy for handling SPDX files (D29226). [1]

Approved by:	core.11 (imp) [1] [2022-03-27]
MFC after:	6 weeks
2022-09-09 16:32:17 +00:00
Bjoern A. Zeeb
d6d687daaa LinuxKPI: 80211: add ieee80211_stop_tx_ba_session()
rtw89 needs ieee80211_stop_tx_ba_session().
Add the skeleton function for now so we can implement BA functions all
together.

MFC after:	3 days
2022-09-09 16:30:00 +00:00
Gleb Smirnoff
c8bc874172 ip_reass: fixup the just added tunable
- Don't use hardcoded hash mask
- free the memory on VNET destroy

Fixes:	1494f4776a
2022-09-09 09:19:39 -07:00
Jiahao LI
6501fcdc0a if_dwc: fix reinitialization with changed MAC
It was observed that on RockPro64 hardware, the dwc interface is unable
to receive packets after being assigned a new MAC address. The fix is
simply to call mii_mediachg() before touching any device registers in
dwc_init_locked(). This is consistent with what the OpenBSD driver does.

PR:		263820
MFC after:	1 week
2022-09-09 12:31:26 -03:00
Matthew Grooms
87705c5c21 bcm2835_clkman: add RPI4 compat string
This enables attachment on the RPI4, thus enabling the bcm2835_pwm
driver too. Per the device tree documentation, these compat strings are
equivalent, and no further changes to the driver are required.

https://lists.freebsd.org/archives/freebsd-arm/2021-June/000143.html

MFC after:	3 days
2022-09-09 12:31:25 -03:00
Warner Losh
c73d20c831 gicv3_its: Fix typo
Sponsored by:		Netflix
2022-09-09 09:23:08 -06:00
Felix Palmen
78c30a6ad4 Bump __FreeBSD_version after linuxkpi changes.
Approved by:	tcberner (mentor)
2022-09-09 17:07:40 +02:00
Felix Palmen
600f161295 linuxkpi: Add non-atomic readq()/writeq()
The non-atomic versions are required by drm-510-kmod to build on 32-bit
architectures.

Approved by:		hselasky, manu, tcberner (mentor)
Differential Revision:	https://reviews.freebsd.org/D36507
2022-09-09 16:59:41 +02:00
Emmanuel Vadot
3fc174845c Revert "vmm: permit some IPIs to be handled by userspace"
This reverts commit a5a918b7a9.

This cause some problem with vm using bhyveload.

Reported by:	pho, kp
2022-09-09 15:55:01 +02:00
Emmanuel Vadot
83b65d0ae1 Revert "vmm: Remove unneeded variable maxcpus"
This reverts commit 653c36179d.
2022-09-09 15:54:56 +02:00
Randall Stewart
81560c5582 TCP: Rack ends up sending all that is outstanding every timeout.
In doing some testing for a different problem, I have found rack retransmitting
all outstanding data every time a timeout occurs. The outstanding is sent 1ms
apart between each packet, and then the timeout runs off again. This causes
extra retransmissions when we should be waiting for an ack after sending the
very first segment.

Reviewed by: tuexen
Sponsored by: Netflix Inc
Differential Revision: https://reviews.freebsd.org/D36494
2022-09-09 08:59:21 -04:00
Dag-Erling Smørgrav
d3791ac46a NOTES: add Veriexec options and modules.
Sponsored by:	Klara, Inc.
MFC after:	1 week
2022-09-09 14:11:19 +02:00
Dag-Erling Smørgrav
08e331f41b mac_veriexec_parser: fix build after 7e1d3eefd4.
Sponsored by:	Klara, Inc.
2022-09-09 14:09:08 +02:00
Dag-Erling Smørgrav
f419a28349 OptionalObsoleteFiles.inc: add bearssl, secureboot, veriexec.
Sponsored by:	Klara, Inc.
MFC after:	1 week
2022-09-09 14:06:11 +02:00
Bjoern A. Zeeb
7ea1cac248 systm.h: change pause from #define to inline function
There are drivers are using (*pause)(x, y) function pointers and depending
on how "pause" is used it gets replaced by pause_sbt causing compile time
failures.
Given "pause" is a generic enough name change it from a #define to an
inline function to avoid replacements where it should not.

MFC after:	2 weeks
Reviewed by:	kib
Differential Revision: https://reviews.freebsd.org/D36489
2022-09-09 11:54:59 +00:00
Mateusz Kozyra
6665c7a628 TMP461: Add support for ADT7461 sensor
The register map is fairly similar, with one difference in the local
sensor temperature register width.
Both devices support reading two sensors - "local" and "remote".
While here add support for the latter one.
The ADT7461 doesn't update the temperature correctly, unless a write
transaction is done before every read.
Do just that as a workaround for this issue.

Tested on LS1046ARDB.

Reviewed by:	manu
Obtained from:	Semihalf
Differential Revision: https://reviews.freebsd.org/D36464
2022-09-09 13:42:28 +02:00
Gleb Popov
c44ca4c227 msun/Makefile: Fix conditional and unbreak the build.
Approved by:	imp
Fixes:	20adba8bc1
2022-09-09 11:07:33 +03:00
Gleb Popov
dcdf4c1acd src.conf.5: Regenerate.
Approved by:	imp
Fixes:	20adba8bc1
2022-09-09 11:07:33 +03:00
Andrew Turner
643e14d094 Use the correct size when checking an EFI address
Use the correct page size macro when checking if an address is with
the EFI runtime map. This would previously work correctly when the
page size is 4k. With a larger page size it may incorrectly detect
memory as within the map when it's not.

Reported by:	imp
Sponsored by:	Innovate UK
2022-09-09 08:47:15 +01:00
Gleb Popov
20adba8bc1 src.conf: Introduce WITHOUT_MACHDEP knob.
Summary:
This knob can be used to make buildsystem prefer generic C implentations of
various functions, instead of machine-specific assembler ones.

Test Plan: `make buildworld` on amd64

Reviewed by: imp, emaste

Differential Revision: https://reviews.freebsd.org/D36076

MFC after:	3 days
2022-09-09 09:54:28 +03:00
Gleb Smirnoff
1494f4776a ip_reass: add loader tunable to tune the reassembly hash size 2022-09-08 13:49:58 -07:00
Gleb Smirnoff
a30cb31589 ip_reass: retire ipreass_slowtimo() in favor of per-slot callout
o Retire global always running ipreass_slowtimo().
o Instead use one callout entry per hash slot.  The per-slot callout
  would be scheduled only if a slot has entries, and would be driven
  by TTL of the very last entry.
o Make net.inet.ip.fragttl read/write and document it.
o Retire IPFRAGTTL, which used to be meaningful only with PR_SLOWTIMO.

Differential revision:	https://reviews.freebsd.org/D36275
2022-09-08 13:49:58 -07:00
Mark Johnston
e599810ded tail: Initialize the stat buffer used when input is stdin
PR:		266284
Reported by:	Jenkins via delphij
Fixes:		7e11889959 ("tail: Fix -f with stdin")
MFC after:	3 days
2022-09-08 16:21:39 -04:00
Mateusz Guzik
dda6376b04 net: employ newly added pfil_mbuf_{in,out} where approriate
Reviewed by:	glebius
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D36454
2022-09-08 16:21:08 +00:00
Mateusz Guzik
0b70e3e78b net: add pfil_mbuf_{in,out}
This shaves a lot of branching due to MEMPTR flag.

Reviewed by:	glebius
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D36454
2022-09-08 16:20:43 +00:00
Elliott Mitchell
cb6abe87cf hwpmc: purge EOL release compatibility 2022-09-08 16:17:24 +00:00
Gleb Smirnoff
e80062a2d4 tcp: avoid call to soisconnected() on transition to ESTABLISHED
This call existed since pre-FreeBSD times, and it is hard to understand
why it was there in the first place.  After 6f3caa6d81 it definitely
became necessary always and commit message from f1ee30ccd6 confirms that.
Now that 6f3caa6d81 is effectively backed out by 07285bb4c2, the call
appears to be useful only for sockets that landed on the incomplete queue,
e.g. sockets that have accept_filter(9) enabled on them.

Provide a new TCP flag to mark connections that are known to be on the
incomplete queue, and call soisconnected() only for those connections.

Reviewed by:		rrs, tuexen
Differential revision:	https://reviews.freebsd.org/D36488
2022-09-08 09:16:04 -07:00
Kyle Evans
72291cee07 stand: i386: take into account disk sector size for blk calculation
disk_blocks assumes BIOSDISK_SECSIZE, but the media may not be using
it.  In particular, bioscd on Parallels presents a 2K sector size, so
we end up with a short disk_blocks and subsequent validation fails when
trying to read /boot/lua.

PR:		233098
Reviewed by:	imp, tsoome
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D36490
2022-09-08 10:05:08 -05:00
Andrew Turner
7d90ce7cae Use the cached dc zva length in arm64 memset
On boot we cache the length the 'dc zva' instruction will zero. Use
this in the memset function to decide when to use it. As the cached
value is in .bss it will be zero on boot so memset is safe to use
before the value has been read.

Sponsored by:	The FreeBSD Foundation
2022-09-08 14:30:11 +01:00
Andrew Turner
949bc17cf2 Import the arm64 Cortex Strings memset into the kernel
Bring in the last version of the optimized memset from the Cortex
Strings library that didn't use the VFP registers. While here clean up
to use the ENTRY/EDIT macros.

This is imported from:
https://git.linaro.org/toolchain/cortex-strings.git/tree/src/aarch64/memset.S?id=bc654e7a594385071b42db3c9c94bd0fd5fe0da5

Sponsored by:	The FreeBSD Foundation
2022-09-08 14:30:09 +01:00