1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-11-28 08:02:54 +00:00
Commit Graph

293466 Commits

Author SHA1 Message Date
Stefan Eßer
12e0d31664 vendor/bc: upgrade to version 7.0.0
This is a production release to fix three bugs, none of which
affects well formed scripts on FreeBSD:

The first bug is that bc/dc will exit on macOS when the terminal
is resized.

The second bug is that an array, which should only be a function
parameter, was accepted as part of larger expressions.

The third bug is that the value stack for dc was cleared on any error.
However, this is not how other dc behave. To bring dc more in line
with other implementations, this behavior was changed. This change is
why this version is a new major version.

(cherry picked from commit 54d20d67e2)

MFC after:	3 days
2024-08-26 18:27:29 +02:00
Joshua Rogers
49a5fe1a01 asmc: Add support for MacbookPro11,4
Signed-off-by: Joshua Rogers <Joshua@Joshua.Hu>

MFC after:	2 weeks
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1366
2024-08-26 14:27:58 +00:00
Alex Richardson
04262ed78d rtld-elf: Add CFI annotation for .rtld_start on RISC-V
Without this change, unwinders such as LLVM libunwind will attempt to
unwind beyond the start of RTLD and get stuck in an infinite loop or
crash (depending on the current values on the stack).
This fixes an infinite loop in the LLVM libunwind test suite on RISC-V.

See also https://reviews.freebsd.org/D40844 for AArch64

Reviewed By:	#riscv, jhb
MFC After:	2 weeks
Differential Revision: https://reviews.freebsd.org/D46406
2024-08-25 21:51:55 -07:00
Michael Tuexen
6e7581236e tcp: whitespace cleanup in enum tcp_log_events
No functional change intended.

Sponsored by:	Netflix, Inc.
2024-08-25 22:05:41 +02:00
Jose Luis Duran
0b2c159c8f msdosfs: return ENOENT if looking up invalid name for OPEN or DELETE
and keep reporting EINVAL for CREATE or RENAME lookups.  The reasoning is
that non-corrupted filesystem cannot have invalid dirents anyway, so
returning ENOENT is more in-line with the natural behavior.

PR:	281033
MFC after:	1 week
2024-08-25 17:50:53 +03:00
Konstantin Belousov
4f39ff1ea0 setkey(8): document -hwif extension
Sponsored by:	NVidia networking
2024-08-25 17:46:09 +03:00
Christos Margiolis
7ae4868a9a sound examples: Delete stale ossinit.h file
Fixes:		3decd659a788("sound examples: Simplify audio example")
Sponsored by:	The FreeBSD Foundation
MFC after:	2 days
2024-08-24 15:16:21 +03:00
Christos Margiolis
c3516c6533 ObsoleteFiles.inc: Update after sound changes
Sponsored by:	The FreeBSD Foundation
2024-08-24 15:08:15 +03:00
Christos Margiolis
0864dfe629 sound: Improve sndstat nvlist feederchain format
- Use snd_afmt2str() to display format conversions in feeder_format,
  instead of the plain hex value.
- Simplify feeder_rate contents.
- Print "ch" (e.g 2.1ch) after matrix values in feeder_matrix.
- Use snd_afmt2str() instead of a plain hex for the the rest of the
  feeder classes.

Sponsored by:	The FreeBSD Foundation
MFC after:	2 days
Reviewed by:	dev_submerge.ch
Differential Revision:	https://reviews.freebsd.org/D46309
2024-08-24 15:07:54 +03:00
Christos Margiolis
6747b1a821 sound examples: Move MIDI example out of OSS directory
This example is not related to OSS.

Sponsored by:	The FreeBSD Foundation
MFC after:	2 days
Reviewed by:	dev_submerge.ch, meka_tilda.center
Differential Revision:	https://reviews.freebsd.org/D46308
2024-08-24 15:07:49 +03:00
Christos Margiolis
3decd659a7 sound examples: Simplify audio example
- Merge ossinit.h and basic.c.
- Rename basic.c to audio.c.
- Use err(3) instead of fprintf(3) + exit(3).
- Some style(9) improvements.

Sponsored by:	The FreeBSD Foundation
MFC after:	2 days
Reviewed by:	dev_submerge.ch
Differential Revision:	https://reviews.freebsd.org/D46307
2024-08-24 15:07:45 +03:00
Christos Margiolis
0ca4d5d820 sound examples: Simplify MIDI example
Sponsored by:	The FreeBSD Foundation
MFC after:	2 days
Reviewed by:	dev_submerge.ch, emaste
Differential Revision:	https://reviews.freebsd.org/D46306
2024-08-24 15:07:40 +03:00
Christos Margiolis
9aac27599a mixer(8): Implement hot-swapping
Introduce a -V option, which can be used alongside -d (default unit
change), in order to hot-swap devices (i.e switch to them on the fly
without needing to restart the track), in case virtual_oss(8) exists and
is running.

Sponsored by:	The FreeBSD Foundation
MFC after:	2 days
Reviewed by:	dev_submerge.ch
Differential Revision:	https://reviews.freebsd.org/D46253
2024-08-24 15:07:35 +03:00
Christos Margiolis
2668e76d6e sound tests: Add SNDSTIOC_ADD_USER_DEVS test
Test whether the SNDSTIOC_ADD_USER_DEVS IOCTL (registers a userland
device to /dev/sndstat) works properly.

Sponsored by:	The FreeBSD Foundation
MFC after:	2 days
Reviewed by:	dev_submerge.ch
Differential Revision:	https://reviews.freebsd.org/D46228
2024-08-24 15:07:29 +03:00
Gordon Tetlow
e972e408d1
release: Redirect etcupdate logfile to /dev/null.
Stop shipping a log file for etcupdate. This is a source of
non-reproducability as it uses mktemp thereby guaranteeing the output is
different each run.

MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D46317
2024-08-23 22:35:07 -07:00
Brooks Davis
5cbb98c825 proccontrol.1: bump doc date
Fixes:		70174ef7d2 proccontrol: make -s require a target
2024-08-23 18:59:46 +01:00
Brooks Davis
70174ef7d2 proccontrol: make -s require a target
Require a command to exec or a pid to target and update usage and the
manpage to make this more clear.

It makes no sense to invoke a procctl(2) command on the current process
only to exit.  Users are sometimes confused about how proccontrol works
and think it effects their shell environment when invoked without a
target.  Disallowing this nonsensical behavior and clarifiying usage
will hopefully reduce confusion.

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D46422
2024-08-23 18:57:59 +01:00
Simon J. Gerraty
bd8486b9fe kern.pre.mk include local.kern.pre.mk
Allow for local customization.

Reviewed by:	stevek
Differential Revision:	https://reviews.freebsd.org/D46423
2024-08-23 10:31:16 -07:00
Li-Wen Hsu
abdc7bb796
bhyve(8): Remove mention of -A flag, again
Follow 107584716c to remove the mention
of -A flag added in b30a7e5418 .

Sponsored by:	The FreeBSD Foundation
2024-08-23 19:57:09 +08:00
Oliver Fromme
ef3f8aa0a0 amdsmn(4), amdtemp(4): add support for AMD Ryzen 7 "Phoenix" processors
Adds support for AMD Ryzen 7 "Phoenix" processors (family 0x19,
model 0x70-0x7f) to the amdsmn(4) and amdtemp(4) drivers. This
enables temperature readings of these CPUs via sysctl.

The sensors function identically to those for the "Raphael" processors
(model 0x60-0x6f); only the PCI device ID differs.

PR:		kern/280942
Relnotes:	yes
MFC after:	3 days
2024-08-22 21:51:19 -07:00
Warner Losh
101afbc6ee loader/menu: tweak for added line
I added a line to the menu, but didn't adjust so things were a
line off. Make the necessary adjustments.

Fixes: 7cb65be96d
Sponsored by: Netflix
MFC After: 3 days
2024-08-22 17:28:51 -06:00
Maxim Konovalov
6aee1dc480 pam_xdg.8: the module option name corrected
PR:	280994
2024-08-22 21:07:10 +00:00
Michael Tuexen
e41364711c tcp: improve consistency of SYN-cache handling
Originally, a SYN-cache entry was always allocated and later freed,
when not needed anymore. Then the allocation was avoided, when no
SYN-cache entry was needed, and a copy on the stack was used.
But the logic regarding freeing was not updated.
This patch doesn't re-check conditions (which may have changed) when
deciding to insert or free the entry, but uses the result of
the earlier check.
This simplifies the code and improves also consistency.

Reviewed by:		glebius
MFC after:		1 week
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D46410
2024-08-22 22:17:05 +02:00
Jessica Clarke
8afae0caf4 riscv: Add machine/ifunc.h corresponding to rtld-elf's resolver interface
Reviewed by:	kib, mhorne
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D46279
2024-08-22 20:36:45 +01:00
Jessica Clarke
729d2b16b7 rtld-elf: Support IFUNCs on riscv
GNU/Linux has historically had the following two resolver prototypes:

  1. Elf_Addr(uint64_t, void *)
  2. Elf_Addr(uint64_t, void *, void *)

For the former, AT_HWCAP is passed in the first argument, and NULL in
the second. For the latter, AT_HWCAP is still passed, and the second
argument is a pointer to their home-grown __riscv_hwprobe function.
Should they want to use the third argument in future, they'll have to
introduce yet another prototype to allow for later expansion, and then
all users will have to check whether the second argument is NULL to know
if the third argument really exists. This is all rather silly and will
surely prove fun in the face of type-checking CFI.

Instead, be like arm64 and just define all 8 possible general purpose
register arguments up front. To naive source code that forgets non-Linux
OSes exist this will be compatible with prototype 1 above, since the
second argument will be 0 and it won't look further (though should we
start using the second argument for something that wouldn't be true any
more and it might think it's __riscv_hwprobe, but that incompatibility
is one we can defer committing to, and can choose to never adopt).

Until the standard interface for querying extension information[1] is
settled and implemented in FreeBSD there's not much you can do in a
resolver other than use HWCAP_ISA_B, but this gets the infrastructure in
place for when that day comes.

[1] https://github.com/riscv-non-isa/riscv-c-api-doc/pull/74

Reviewed by:	kib, mhorne
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D46278
2024-08-22 20:36:44 +01:00
Jessica Clarke
228a3e73e1 riscv: Recognise B extension for AT_HWCAP
This was ratified earlier this year as an alias for Zba_Zbb_Zbs. Whilst
we don't currently export multi-letter extensions, we can still export
this alias in AT_HWCAP.

Reviewed by:	mhorne
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D46277
2024-08-22 20:36:44 +01:00
Jessica Clarke
33658afd4e rtld-elf: Pass parsed aux_info to ifunc_init
Currently we pass the raw pointer to the on-stack auxargs. This can
legitimately have fewer than AT_COUNT entries, so the use of
__min_size(AT_COUNT), i.e. static AT_COUNT, is inaccurate, and also
needlessly forces the callee to iterate over the elements to find the
entry for a given type. Instead we can just pass aux_info like we use
for everything else.

Note that the argument has been left unused by every callee since its
introduction in 4352999e0e ("Pass CPUID[1] %edx (cpu_feature), %ecx
(cpu_feature2) and CPUID[7].%ebx (cpu_stdext_feature), %ecx
(cpu_stdext_feature2) to the ifunc resolvers on x86.")

Reviewed by:	kib
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D46276
2024-08-22 20:36:44 +01:00
John Baldwin
776cd02b89 vmm ppt: Enable busmastering and BAR decoding while a device is assigned
Reviewed by:	corvink, markj
Fixes:		f44ff2aba2 bhyve: Treat the COMMAND register for PCI passthru devices as emulated
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D46245
2024-08-22 14:40:48 -04:00
Brooks Davis
5680cf6dc6 jemalloc: don't expose 3.0 compat symbols
Don't provide default linkage for jemalloc 3.0 compatability symbols.
We stopped declaring these interfaces with the introduction of jemalloc
4.0 prior to FreeBSD 11.0.  Any code using them would have had to
declare them manually so stop declaring them and export the symbols
directly for compatability.  Arguably they should be x86 only as they
were never declared on other Tier-1 architectures.

Reviewed by:	imp, kib
Differential Revision:	https://reviews.freebsd.org/D46407
2024-08-22 17:08:24 +01:00
Michael Tuexen
498286d4e8 tcp: fix format of sysctl variable
The format for CTLTYPE_UINT is "IU" instead of "UI" as specified
in sysctl.9.

Reviewed by:		cc, zlei
MFC after:		1 week
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D46408
2024-08-22 14:44:47 +02:00
Zhenlei Huang
0f64fc6a34 kern: Align the declaration of kernconfstring with its definition
It is defined as const char[] in config.c which is auto generated by
usr.sbin/config/kernconf.tmpl .

While here prefer macro SYSCTL_CONST_STRING to avoid casting.

MFC after:	1 week
2024-08-22 18:00:34 +08:00
Michael Tuexen
a1d9ce19b1 sctp: fix format of sysctl variables
MFC after:		1 week
2024-08-22 09:07:27 +02:00
Maxim Konovalov
d399c791b2 bsd-family-tree: NetBSD 8.3 added
PR:	280983
2024-08-22 00:29:36 +00:00
John Baldwin
c0c1b1cd89 freebsd32: Fix a few typos in syscalls.conf comments
Sponsored by:	AFRL, DARPA
2024-08-21 17:14:56 -04:00
Doug Moore
d48524e21f dev_pager: define free_page for mgt devices
Callers of cdev_pager_free_page in the kernel always have object->type
== OBJT_MGTDEVICE. Define a function for them to call that skips the
runtime type check in cdev_pager_free.

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D46389
2024-08-21 15:48:59 -05:00
Navdeep Parhar
d668a0b0ab cxgbe(4): reset routine for general use.
Add a reset_adapter wrapper that picks the most suitable reset routine
internally.  Use it in the fatal error handler as well as the sysctl
based reset.

MFC after:	1 week
Sponsored by:	Chelsio Communications
2024-08-21 11:47:15 -07:00
John Baldwin
297a9e552b libcxxrt: Add a stub implementation of __cxa_call_terminate
This function is called by GCC 14 if a destructor invoked during
exception unwinding throws an exception.

Reviewed by:	emaste
Obtained from:	libcxxrt commit 391a3dcc1054e18c2f0dff4e14d6d79ac95399d7
Differential Revision:	https://reviews.freebsd.org/D46004
2024-08-21 13:37:48 -04:00
Konstantin Belousov
47656cc1ef amd64: use INVLPGB for kernel pmap invalidations
avoiding broadcast IPIs.

Reviewed by:	alc, markj
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D45191
2024-08-21 19:35:15 +03:00
Konstantin Belousov
bc4ffcadf2 amd64: add variables indicating INVLPGB works
Reviewed by:	alc, markj
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D45191
2024-08-21 19:35:07 +03:00
Konstantin Belousov
111c7fc2fe amd64: add convenience wrappers for INVLPGB and TBLSYNC
Reviewed by:	alc, markj
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D45191
2024-08-21 19:34:59 +03:00
Konstantin Belousov
45543d3424 DMAR: clear dmar_devs[unit] if attach failed
This should stop attempts to use a unit which was not completely
initialized, but referenced by ACPI DMAR table during scoped devices
operions.

PR:	280817
Sponsored by:	Advanced Micro Devices (AMD)
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D46382
2024-08-21 18:23:07 +03:00
Konstantin Belousov
40bffb7d21 rangelocks: fix typo in rl_w_validate
The freed elements should be threaded using rl_q_free pointer.

Reported by:	dougm, markj
Tested by:	markj
Sponsored by:	The FreeBSD Foundation
2024-08-21 18:20:28 +03:00
Konstantin Belousov
c4d8b2462e rangelocks: recheck that entry is not marked after sleepq is locked in rl_w_validate()
otherwise we might loose the wakeup.

Reported and tested by:	markj
Sponsored by:	The FreeBSD Foundation
2024-08-21 18:19:57 +03:00
Konstantin Belousov
a725d61825 rangelock: if CAS for removal failed, restart list iteration
Our next pointer is invalid and cannot be followed.

Tested by:	markj, pho
Sponsored by:	The FreeBSD Foundation
2024-08-21 18:19:36 +03:00
Konstantin Belousov
9467c1a69b rangelock: assert that we never insert or remove our entry after a logically deleted one
Tested by:	markj, pho
Sponsored by:	The FreeBSD Foundation
2024-08-21 18:19:15 +03:00
Konstantin Belousov
e228961d6e rangelock_destoy(): poison lock->head to trip fault on lock attempt
Tested by:	markj, pho
Sponsored by:	The FreeBSD Foundation
2024-08-21 18:18:56 +03:00
Konstantin Belousov
8a5b2db3d8 ranglelock_destroy(): do not remove lock entries from under live lock acquirer
Tested by:	markj, pho
Sponsored by:	The FreeBSD Foundation
2024-08-21 18:18:39 +03:00
Konstantin Belousov
a3f10d0882 rangelocks: add rangelock_free_free() helper to free free list
Tested by:	markj, pho
Sponsored by:	The FreeBSD Foundation
2024-08-21 18:18:16 +03:00
Ed Maste
db87c98168 ctl: avoid heap info leak in ctl_request_sense
Previously 3 bytes of data from the heap could be leaked to ctl
consumers.

Reported by:	Synacktiv
Reviewed by:	asomers, mav
Sponsored by:	The Alpha-Omega Project
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D46091
2024-08-21 09:32:41 -04:00
Pietro Cerutti
1af7d5f389 libfetch: don't include fragments in HTTP requests
Summary:
Fragments are reserved for client-side processing, see
https://www.rfc-editor.org/rfc/rfc9110.html#section-7.1

Also, some servers don't like to receive HTTP requests with fragments.

```
$ fetch 'https://dropbox.com/a/b'
fetch: https://dropbox.com/a/b: Not Found

$ fetch 'https://dropbox.com/a/b#'
fetch: https://dropbox.com/a/b#: Bad Request
```

This is a real-world scenario, where some download link from dropbox
(eventually) redirects to an URL with a fragment:

```
$ fetch -v 'https://www.dropbox.com/sh/<some>/<thing>?dl=1' 2>&1 | grep requesting
requesting https://www.dropbox.com/sh/<some>/<thing>?dl=1
requesting https://www.dropbox.com/scl/fo/<foo>/<bar>?rlkey=<baz>&dl=1
requesting https://<boo>.dl.dropboxusercontent.com/zip_download_get/<some-long-strig>#
```

See how the last redirect ends with a `#`.

Currently, libfetch includes the ending fragment and makes it impossible
to download the file.

Differential Revision:	https://reviews.freebsd.org/D46318
MFC after:		2 weeks
2024-08-21 12:35:27 +00:00