Commit Graph

280462 Commits

Author SHA1 Message Date
Randall Stewart
26bdd35c39 rack and bbr not loading if TCP_RATELIMIT is not configured.
So it turns out that rack and bbr still will not load without TCP_RATELIMIT. This needs
to be fixed and lets also at the same time bring tcp_ratelimit up to date where we allow
the transports to set a divisor (though still having a default path with the default
divisor of 1000) for setting the burst size.

Reviewed by: tuexen, gallatin
Sponsored by: Netflix Inc
Differential Revision: https://reviews.freebsd.org/D37954
2023-01-05 11:59:52 -05:00
Robert Clausecker
95fa2e0aee loader.efi: make sure kernel image is executable
The Windows Dev Kit 2023 (Volterra) has an UEFI implementation that maps
EfiLoaderData pages as non-executable.  Map the kernel as EfiLoaderCode
to ensure that it can be executed.

With this change and another in review, FreeBSD boots to the mountroot
prompt if hw.pac.enable = 0 is set in loader.conf(5).

Reviewed by:	andrew, imp, tsoome
Sponsored by:	Berliner Linux User Group e.V.
Sponsored by:	spline / FU-Berlin
Differential Revision: https://reviews.freebsd.org/D37931
2023-01-05 09:58:33 +00:00
Andre Albsmeier
0deb25bd9d pwd_mkdb(8): Don't copy comments from /etc/master.passwd to /etc/passwd.
The intention of /etc/passwd was to support legacy applications that are
not yet converted to use modern API like getpwent(3). Comments are not
defined in the legacy format, so copying them could break these
applications. Plus, it could leak sensitive information (e.g. encrypted
form of password of an user that was commented out instead of deleted
or disabled).

PR:		bin/144652
MFC after:	1 month
2023-01-04 22:18:09 -08:00
Søren Schmidt
7daf96523b Add PCIe driver for RK3568 SoC.
PCIe3 ports work, however PCIe2x1 is not working yet in this case as it depends on Naneng Combo Phy driver.
2023-01-05 04:15:56 +00:00
John Baldwin
b069d3e019 rtld: Revert "When loading dso without PT_GNU_STACK phdr, only call"
After the removal of ia64 and sparc64, all current architectures
support executable stacks at an architectural level.

This reverts commit 1290d38ac5.

Reviewed by:	kib
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D37904
2023-01-04 14:55:00 -08:00
Justin Hibbits
11905a0b4e ifnet: Expose if_t to userspace
<net/if_var.h> should be a kernel-only header, but it's included
elsewhere.  Until that's addressed expose if_t to userspace to fix the
build.

Fixes:		be4315dcbb
Sponsored by:	Juniper Networks, Inc.
2023-01-04 16:04:05 -05:00
Justin Hibbits
be4315dcbb ifnet/DrvAPI: Move if_t typedef to a better place
Summary:
<net/if_var.h> should really be used by the netstack only, not by
drivers.  Eventually all the accessors will be moved to <net/if.h> as
well, but for now just move the typedef while the KPI gets sorted and
drivers get converted.

Sponsored by:	Juniper Networks, Inc.
Reviewed By:	melifaro, glebius
Differential Revision: https://reviews.freebsd.org/D37784
2023-01-04 15:15:10 -05:00
Justin Hibbits
74abe47e32 ifnet/DrvAPI: Implement if_setoutputfn() accessor
Fixes:		eb1da3e525
Sponsored by:	Juniper Networks, Inc.
2023-01-04 15:15:10 -05:00
Mike Karels
0e2fdab227 growfs script: fix config-dependent errors
- awk sometimes formatted swapbase as floating point, which gpart
  does not accept; force int.

- Fix typo in code for checking vm.max_swap_pages.

- While here, do not set kernel env if "gpart add" fails.

- Add "gpart show" before modification to verbose output.

Reported by:	marklmi at yahoo dot com
Tested by:	marklmi at yahoo dot com
2023-01-04 14:05:35 -06:00
Andrew Turner
e5b9b5ee8c Add Windows Dev Kit 2023 support to if_ure
The Windows Dev Kit 2023 has an if_ure NIC with custom vendor and
procuct IDs. Add them to the driver.

Tested by:	Robert Clausecker <fuz@fuz.su>
Obtained from:	OpenBSD
Sponsored by:	Arm Ltd
2023-01-04 17:12:20 +00:00
Andrew Turner
8793196ca2 Check for more XHCI ACPI IDs
The Windows Dev Kit 2023 uses the XHCI-compliant USB controller without
standard debug ID in its ACPI tables. Check for both ID values found
on [1] in the XHCI ACPI attachment.

[1] https://learn.microsoft.com/en-us/windows-hardware/drivers/bringup/device-management-namespace-objects

Tested by:	Robert Clausecker <fuz@fuz.su>
Sponsored by:	Arm Ltd
2023-01-04 16:54:05 +00:00
Mark Johnston
6ebd8466af atomic: Make atomic_san.h self-contained
This file assumes that uint*_t and __typeof() are defined, so ensure
that consumers don't have to pull in the requisite includes themselves.
This is consistent with sys/atomic_common.h.

Reviewed by:	kib
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D37939
2023-01-04 23:43:01 +08:00
Kyle Evans
e898a3af97 grep: properly switch EOL indicator with -z
-z is supposed to use only the NUL byte as EOL, but we were
inadvertently using both newline and NUL due to REG_NEWLINE in cflags.

The odds of anyone relying on this bsdgrep-specific bug are quite low,
so let's just fix it.  At least one port in the wild has been reported
to expect the intended behavior.

Reported by:	Hill Ma <maahiuzeon@gmail.com>
Triaged by:	the self-proclaimed peanut gallery on Discord
2023-01-03 23:37:54 -06:00
Takanori Watanabe
eb03c1f81c wdatwd: fix i386 build breakage.
Formatting string for uint64_t has portablity issue and
lead bulid breakage, so fix it.

Reviewed by hrs
Differential Revision: https://reviews.freebsd.org/D37937
2023-01-04 10:04:44 +09:00
Ed Maste
170d10421a Cirrus-CI: add gpart show to setup script
GCP instances have stopped resizing the UFS root filesystem.  The 14.x
snapshot image built from b1ef176eb5 works while c89209c674 fails.
Discovered via testing a WIP branch in Cirrus-CI that uses
`image: family/freebsd-14-0-snap`.

Add `gpart show` to the setup script to confirm that the partition
size (as set by Cirrus config / GCP) took effect and to help when
investigating any similar issue in the future.

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2023-01-03 11:06:16 -05:00
Takanori Watanabe
99aeb219ca wdatwd: Add support for ACPI WDAT based watchdog timer.
Simply said, WDAT is an abstraction for the real WDT hardware. For
instance, to add a newer generation WDT to ichwd(4), one must know the
detailed hardware registers, etc..

With WDAT, the necessary IO accesses to operate the WDT are comprehensively
described in it and no hardware knowledge is required.

With this driver, the WDT on Advantech ARK-1124C, Dell R210 and Dell R240 are
detected and operated flawlessly.
* While R210 is also supported by ichwd(4), others are not supported yet.

The unfortunate thing is that not all systems have WDAT defined.

Submitted by: t_uemura at macome.co.jp
Reviewed by: hrs
Differential Revision: https://reviews.freebsd.org/D37493
2023-01-04 00:36:24 +09:00
Joseph Mingrone
a0c50eda29
beinstall.sh: Check correct exit status
When retrieving the timestamp of the last commit using git-show(1), do
not pipe the output to head(1), otherwise the return value in $? will be
for head(1) and not git-show(1).

Approved by:	bapt
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D37742
2023-01-03 10:27:53 -04:00
Konstantin Belousov
01143ba118 ifcapnv: fix IFCAP2 usage
IFCAP2_XXX constants are integers, they do not need shift for the
definition.  But their usage as bitmask for if_capenable2 does require
shift.  Add convenience macro IFCAP2_BIT() for consumers.

Fix the only existing consumer, mlx5(4) RXTLS enable bits.

Reported by:	jhb
Reviewed by:	jhb, jhibbits, hselasky
Coverity CID:	1501659
Sponsored by:	NVIDIA networking
Differential revision:	https://reviews.freebsd.org/D37862
2023-01-03 11:48:16 +02:00
Peter Holm
17edacfb6e stress2: Added a regression test 2023-01-03 10:34:00 +01:00
Michal Meloun
e4ef4c5d66 extres/phy: Add mode setting function.
Modern multi-protocol phys are capable of supporting multiple different
protocols. Add a method for mode (and/or its variants) setting.

Discused with:	ganbold, manu, andrew
MFC after:	3 weeks
2023-01-03 10:19:29 +01:00
Eugene Grosbein
2ce3ef5503 syslog: fix PID of forking process
Do not cache PID for a process that does not fabricate it,
calls openlog() before forking and does not call exec() thereafter.

PR:		268666
Fixes:		e9ae9fa937
Tested by:	kp
MFC after:	3 days
2023-01-03 15:58:36 +07:00
Jean-Sébastien Pédron
17f2b12a38
linuxkpi: Define lockdep_assert_none_held_once()
This is defined as a no-op even when INVARIANTS is defined. I admit I
don't know how to implement that in FreeBSD and didn't search
thoroughly.

Reviewed by:	bz
Approved by:	bz
Differential Revision:	https://reviews.freebsd.org/D37911
2023-01-02 22:07:31 +01:00
Jean-Sébastien Pédron
8dfb5571c4
linuxkpi: Include errno.h from acpi/video.h
This defines `ENODEV` used in this header. This fixes a build failure in
the DRM drivers.

Reviewed by:	bz
Approved by:	bz
Differential Revision:	https://reviews.freebsd.org/D37909
2023-01-02 22:05:27 +01:00
Cy Schubert
e3e57edf4a network.subr: Fix infinite loop
When setting up carp tunnel, using a password consisting of only the
characters used as hexadecimal characters, i.e. abc-def, there will be
an infinite loop in the shell function ifalias_af_common_handler().
To circumvent this we test for " pass ".

PR:		268378
Reported by:	jyoung15@gmail.com
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D37748
2023-01-02 10:20:05 -08:00
Cy Schubert
87061d3bff network.subr: Add missing brace
PR:		268378
Submitted by:	jyoung15@gmail.com
Reported by:	jyoung15@gmail.com
MFC after:	3 days
2023-01-02 10:20:05 -08:00
Cy Schubert
fef0e429f1 network.subr: Replace "\ " with "[[:space:]]"
"[[:space:]]" is easier to read than "\ " and is conisitent with
clone_up().

Reported by:	eugen
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D37748
2023-01-02 10:20:05 -08:00
Yoshihiro Takahashi
a1f28ec729 unzip: Document optional member list
Submitted by:	Pat Maddox (man page)
PR:		267426
MFC after:	2 weeks
2023-01-02 13:17:27 +09:00
Kirk McKusick
e84e44215f Fix vop_readdir's ncookies handling in UFS and EXT2.
Submitted by: Kusumi Tomohiro
PR:           267706
MFC after:    1 week
2023-01-01 19:30:14 -08:00
Jose Luis Duran
8eb4df9487 ping(8): man page cleanup
* Appease mandoc -T lint and igor

* Use example.com for documentation

* Update the IPv4 TTL section.
  Update the IPv4 TTL section specifically for FreeBSD.
  FreeBSD changed the default TTL to 64 in
  5639e86bdd.  NetBSD and OpenBSD still
  use 255.  Remove some references of extinct operating systems.

Reviewed by:	gbe (manpages), asomers
MFC after:	2 weeks
Pull Request:	https://github.com/freebsd/freebsd-src/pull/630
2023-01-02 00:48:25 +00:00
Ceri Davies
5affc86b80 mp[rs].4: correct spelling error, and expand "man page"
PR:		262957
Reported by:	Trond Endrestol
Reviewed by:	pauamma
2023-01-01 16:49:51 +00:00
Ceri Davies
14abc96e43 mpt.4: correct spelling error 2023-01-01 16:49:22 +00:00
Alexander V. Chernikov
8161b823d7 testing: add python test examples
Simplify the adoption of python tests by proving some examples,
 utilising commonly-used patterns.

Differential Revision: https://reviews.freebsd.org/D37902
Reviewed by:	asomers
MFC after:	2 weeks
2023-01-01 15:29:29 +00:00
Alexander V. Chernikov
bb60d265c9 testing: fix tests without cleanup in pytest.
It was broken by 89ffac3b01,
which added "cleanup" method to the base test class,
 resulting in reporting cleanup for all of the tests.
2023-01-01 14:11:18 +00:00
Li-Wen Hsu
6541e7696f
Update the SPDX header to preferred BSD-2-Clause
Discussed with:	imp, bcr
2023-01-01 18:33:40 +08:00
Eugene Grosbein
6ab555cff6 syslog(3): expand a commentary adding a reference to RFC 3164. 2023-01-01 15:28:42 +07:00
Li-Wen Hsu
674627b9b5
Happy New Year 2023!
Sponsored by:	The FreeBSD Foundation
2023-01-01 13:44:43 +08:00
Xin LI
73ed8e77a7 MFV: xz 5.4.0
MFC after:	2 weeks
2022-12-31 20:25:17 -08:00
Xin LI
f6a891c2b4 Vendor import of xz 5.4.0 (trimmed) 2022-12-31 20:23:22 -08:00
Konstantin Belousov
231d75568f Move INVLPG to pmap_quick_enter_page() from pmap_quick_remove_page().
If processor prefetches neighboring TLB entries to the one being accessed
(as some have been reported to do), then the spin lock does not prevent
the situation described in the "AMD64 Architecture Programmer's Manual
Volume 2: System Programming" rev. 3.23, "7.3.1 Special Coherency
Considerations".

Reported and reviewed by:	alc
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D37770
2023-01-01 00:09:46 +02:00
Konstantin Belousov
cde70e312c amd64: for small cores, use (big hammer) INVPCID_CTXGLOB instead of INVLPG
A hypothetical CPU bug makes invalidation of global PTEs using INVLPG
in pcid mode unreliable, it seems.  The workaround is applied for all
CPUs with small cores, since we do not know the scope of the issue, and
the right fix.

Reviewed by:	alc (previous version)
Discussed with:	emaste, markj
Tested by:	karels
PR:	261169, 266145
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D37770
2023-01-01 00:09:45 +02:00
Konstantin Belousov
45ac7755a7 amd64: identify small cores
Reviewed by:	alc
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D37770
2023-01-01 00:09:45 +02:00
Alexander V. Chernikov
89ffac3b01 testing: allow custom test cleanup handlers in pytest
In order to provide more flexibility for the test writers,
add per-test-method cleanups in addition to the per-class cleanups.

Now the test 'test_one' can perform cleanup by either defining
per-class 'cleanup' method (typically used in VNET classes) and
per-test method 'cleanup_test_one'. The latter has preference.
In order to handle paramatrization, testid is passed as a single
 argument to both of the methods.

MFC after:	2 weeks
2022-12-31 16:27:27 +00:00
Vincenzo Maffione
e81ecab4b1 netmap: bridge: fix -Wdate-time compilation issue
MFC after: 3 days
2022-12-31 14:56:02 +00:00
Bjoern A. Zeeb
4052b0e4b2 LinuxKPI: pm.h add pm_sleep_ptr and DEFINE_SIMPLE_DEV_PM_OPS
Extend pm.h by pm_sleep_ptr and DEFINE_SIMPLE_DEV_PM_OPS().
For the moment this duplicates some parts (as can be seen in the earlier
review I tried to simplify bits but given our implementation this
was easier in the end).

While here and cleanup the SIMPLE_DEV_PM_OPS() bits (white-space only).

MFC after:	3 days
Reviewed by:	hselasky
Differential Revision: https://reviews.freebsd.org/D37527
2022-12-31 02:51:09 +00:00
Bjoern A. Zeeb
55038a6306 LinuxKPI: add simplified vesion of page_frag_cache
For the moment and the currently only consumer (mt76) add a simplified
version of the page_frag_cache.  We will only accept fragement sizes up
to 1 PAGE_SIZE (KASSERT) and we will always return a full page.
Should we add more consumers or small (or large) objects would become a
problem we can always add a more elaborate version.

Discussed with:	markj
Reviewed by:	markj (,hselasky commented as well)
MFC after:	3 days
Differential Revision: https://reviews.freebsd.org/D37595
2022-12-31 02:45:44 +00:00
Bjoern A. Zeeb
4b0af11437 LinuxKPI: 802.11: move ieee80211_{unregister,restart}_hw out of header
Migrate the two functions from the header into the implementation file
in order to have access to more facilities and not to run into possible
allocation/locking/... problems in the future.

Sponsored by:	The FreeBSD Foundation
MFC after:	10 days
2022-12-31 02:24:23 +00:00
Bjoern A. Zeeb
c990500bf1 LinuxKPI; 802.11: update mac80211.h structures and fields
Cleanup some fields and structures and add new ones.

Sponsored by:	The FreeBSD Foundation
MFC after:	10 days
2022-12-31 02:15:28 +00:00
Bjoern A. Zeeb
3391199496 LinuxKPI: 802.11: implement ieee80211_get_hdrlen_from_skb()
Implement ieee80211_get_hdrlen_from_skb() doing basic sanity checks
on lengths (minimal length or skb data length vs. header length).

Sponsored by:	The FreeBSD Foundation
MFC after:	10 days
2022-12-31 02:02:01 +00:00
Bjoern A. Zeeb
13d87d92e4 LinuxKPI: 802.11: implement cfg80211_get_ies_channel_number()
Using the previous changes implement cfg80211_get_ies_channel_number()
either based on DSPARMS (or for the future HTINFO).

Sponsored by:	The FreeBSD Foundation
MFC after:	10 days
2022-12-31 01:59:20 +00:00
Bjoern A. Zeeb
5db817d864 LinuxKPI: 802.11: implement some *eleme/ie* lookup functions
Implement cfg80211_find_elem(), ieee80211_bss_get_elem(),
ieee80211_bss_get_ie(), and cfg80211_find_vendor_ie() with the last
one having a short cut always also checking oui_type in the pattern.

Sponsored by:	The FreeBSD Foundation
MFC after:	10 days
2022-12-31 01:33:28 +00:00