1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-11-21 07:15:49 +00:00
Commit Graph

288528 Commits

Author SHA1 Message Date
Warner Losh
499e84e16f copyright: Bump the copyright date.
Sponsored by:		Netflix
2023-12-31 23:15:43 -07:00
Warner Losh
259e6fefc0 test-includes: Add -ansi to the compile line to catch problems
We support C89 files, but compile everything in the tree with C99 or
newer. By compiling these -ansi, that will force C89 which doesn't
understand inline. All our header files must use __inline instead of
inline when they define inline functions.

Sponsored by:		Netflix
Reviewed by:		emaste
Differential Revision:	https://reviews.freebsd.org/D43235
2023-12-31 23:14:08 -07:00
Warner Losh
39e39ba056 nanobsd: Revert back to 1G (really 927M) partitions for rescue.
The last bump to 8G was caused by all the new symbols and debug info we
install by default. Turning those off gets us back to a reasonable size:

Filesystem     Size    Used   Avail Capacity  Mounted on
/dev/md1s1a    927M    771M     83M    90%    /mnt

Sponsored by:		Netflix
Reviewed by:		jlduran@gmail.com
Differential Revision:	https://reviews.freebsd.org/D43232
2023-12-31 23:13:57 -07:00
Mark Johnston
91d2a093df isp: Fix endianness conversion in isp_read_flash_data()
Reported by:	Jenkins
Fixes:	10ed63fc06 ("isp(4): Rework firmware handling/loading")
2023-12-31 18:59:06 -05:00
Rick Macklem
2319ca6a01 vfs_vnops.c: Fix vn_generic_copy_file_range() for truncation
When copy_file_range(2) was first being developed,
*inoffp + len had to be <= infile_size or an error was
returned. This semantic (as defined by Linux) changed
to allow *inoffp + len to be greater than infile_size and
the copy would end at *inoffp + infile_size.

Unfortunately, the code that decided if the outfd should
be truncated in length did not get updated for this
semantics change.
As such, if a copy_file_range(2) is done, where infile_size - *inoffp
is less that outfile_size but len is large, the outfd file is truncated
when it should not be. (The semantics for this for Linux is to not
truncate outfd in this case.)

This patch fixes the problem. I believe the calculation is safe
for all non-negative values of outsize, *outoffp, *inoffp and insize,
which should be ok, since they are all guaranteed to be non-negative.

Note that this bug is not observed over NFSv4.2, since it truncates
len to infile_size - *inoffp.

PR:	276045
Reviewed by:	asomers, kib
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D43258
2023-12-31 15:55:24 -08:00
Richard Scheffenegger
38c63bdc46 libdtrace: decode all tcp header flags and add
decoding capability of TH_AE to dtrace, including
the example provided with tcpdebug.

MFC after:             1 week
Reviewed By:           markj, mav
Sponsored by:          NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D43243
2023-12-31 15:02:03 +01:00
Jose Luis Duran
a04ca1c229 rc.initdiskless: Remove bogus plus sign
Reviewed by:	imp, dab
Fixes:		Fixes: 93b7818226 ("libexec/rc/rc.initdiskless: make tar's path flexible")
Differential Revision:	https://reviews.freebsd.org/D43241
2023-12-31 13:39:37 -05:00
Mark Johnston
ad3174ecea libdtrace: Fix line number reporting in error messages
MFC after:	1 week
2023-12-31 12:47:30 -05:00
Mark Johnston
e1f336704d gtaskqueue: Fix a typo
This is a no-op in practice since gtaskqueue_thread_enqueue() and
taskqueue_thread_enqueue() are identical, and while _gtaskqueue_create()
compares the enqueue callback pointer with gtaskqueue_thread_enqueue(),
the result has no effect since TQ_FLAGS_UNLOCKED_ENQUEUE was copied
directly from subr_taskqueue.c and is unused in the gtaskqueue code.

Fix it anyway since it's a bug.  More generally we really need to
consolidate subr_taskqueue.c and subr_gtaskqueue.c.

PR:		270661
MFC after:	1 week
2023-12-31 11:49:08 -05:00
Mark Johnston
8b57b2a98b frag6 tests: Serialize
I'm not sure exactly why, but these tests consistently fail when run in
parallel.  Serialize them for now.

MFC after:	1 week
2023-12-31 11:22:45 -05:00
Mark Johnston
0736a38072 frag6: Reduce code duplication
The code which removes a fragment queue from the per-VNET hash table was
duplicated three times.  Factor it out into a function.  No functional
change intended.

Reviewed by:	kp, bz
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D43228
2023-12-31 11:15:48 -05:00
Mark Johnston
f12a9a4c04 frag6: Drop unneeded casts from malloc calls
No functional change intended.

MFC after:	1 week
2023-12-31 11:15:22 -05:00
Michael Osipov
e2f6bafc38 periodic: Make daily diff(1) output as small is possible
Make, by default, daily diff(1) ignore whitespace changes and the unified output
a context of zero (0) lines. This reduces output of unrelated lines in e-mails
delivered to root.

PR:		270266
Approved by:	jrm (mentor), karels
MFC after:	1 month
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D42762
2023-12-31 11:24:43 +01:00
Michael Osipov
15e35d058c periodic: Make daily diff(1) flags configurable with daily_diff_flags
PR:		270266
Approved by:	jrm (mentor), karels
MFC after:	1 month
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D42900
2023-12-31 11:22:19 +01:00
Michael Osipov
3aa71ea7c2 periodic: Make security diff(1) output as small is possible
Make, by default, security diff(1) produce a unified output with a context of
zero (0) lines. This reduces output of unrelated lines in e-mails delivered
to root.

PR:		270266
Approved by:	jrm (mentor), karels
MFC after:	1 month
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D43071
2023-12-31 11:16:30 +01:00
Simon J. Gerraty
4d08b569a0 bsd.man.mk allow staging compressed pages
In the DIRDEPS_BUILD we use staging.
The staging logic in bsd.man.mk was in the wrong place, shift it
and add compressed man pages to the stage set if appropriate.

Reviewed by:	stevek
Differential Revision:	https://reviews.freebsd.org/D43238
2023-12-30 09:10:03 -08:00
Michael Tuexen
642ac6015b tcp: fix ports
inline is only support in C99 and newer. To support also C89, use
__inline instead as suggested by dim.

Reported by:		eduardo
Reviewed by:		rscheff, markj, dim, imp
Tested by:		eduardo
Fixes:			a8b70cf260 ("netpfil: Use accessor functions and named constants for all tcphdr flags")
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D43231
2023-12-30 03:28:13 +01:00
Pawel Jakub Dawidek
1b8d70b2eb kern: Introduce kern.pid_max_limit sysctl.
The kern.pid_max_limit will hold the PID_MAX value the kernel was
compiled with. The existing kern.pid_max sysctl can be modified and
doesn't really represent maximum PID number in the system, as there
may still be processes created with higher PIDs before kern.pid_max
was lowered.

Reivewed by:	kib, zlei
Approved by:	oshogbo
Differential Revision:	https://reviews.freebsd.org/D43077
2023-12-29 22:15:17 -08:00
Rick Macklem
84b4342c0d copy_file_range.2: Clarify that only regular files work
PR#273962 reported that copy_file_range(2) did not work
on shared memory objects and returned EINVAL.
Although the reporter felt this was incorrect, it is what
the Linux copy_file_range(2) syscall does.

Since there was no collective agreement that the FreeBSD
semantics should be changed to no longer be Linux compatible,
copy_file_range(2) still works on regular files only.

This man page update clarifies that. If, someday, copy_file_range(2)
is changed to support non-regular files, then the man page will
need to be updated to reflect that.

PR:	273962
Reviewed by:	karels, pauamma_gundo.com (manpages)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D43227
2023-12-29 14:59:00 -08:00
Robert Wing
0600b57540 bhyve: verify that user provided fbuf values fall within limits
The upper limits for height/width are already checked, this commit
enforces the lower limit as well.

The behavior is also changed such that, the framebuffer fails to
initialize if the provided values don't parse cleanly.

Reviewed by:	corvink, jhb
Differential Revision:	https://reviews.freebsd.org/D42692
2023-12-29 11:37:57 -09:00
Pierre Pronchery
19bb1886be bsdinstall: rename "Live CD" to "Live System"
This uses more generic wording in the FreeBSD installer, when offering
the user to use the system booted without running the installer.

The updated wording is also reflected in freebsd-version(1).

Reviewed by:		emaste
Sponsored by:		The FreeBSD Foundation
Differential revision:	https://reviews.freebsd.org/D43233
2023-12-29 15:24:25 -05:00
Dimitry Andric
7963968640 Merge commit c97a7675eea4 from llvm git (by Qiu Chaofan):
[PowerPC] Expand FSINCOS of fp128 (#76494)

This fixes "fatal error: error in backend: Cannot select: 0x6d420285c0:
f128,f128 = fsincos 0x6d4202b6f0" when compiling s_cpowl.c for
powerpc64le.

Upstream ticket: https://github.com/llvm/llvm-project/issues/76442

Reported by:	pkubaj
MFC after:	3 days
2023-12-29 20:30:45 +01:00
Kenneth D. Merry
cd95f18c47 camcontrol: add support for Toshiba drive firmware update
Thanks to Toshiba for providing the SCSI spec for their latest
generation drives so I could confirm how they operate.

The firmware download works in a pretty standard way, so this
is a straightforward table addition.

sbin/camcontrol/camcontrol.8:
	Document that Toshiba drives are supported for fwdownload,
	and that it was tested on TOSHIBA MG10SFA22TE 22TB drives.

sbin/camcontrol/fwdownload.c:
	Add TOSHIBA to the known SCSI vendors list for fwdownload.

Sponsored by:	Spectra Logic
MFC after:	3 days
2023-12-29 14:23:51 -05:00
Mateusz Guzik
3358108a38 llvm: Support: don't block signals around close if it can be avoided
Signal blocking originally showed up in 51c2afc4b65b2782 ("Support:
Don't call close again if we get EINTR"), but it was overzealous --
there are systems where the error is known to be fine.

This commit elides signal blocking for said systems (the list is
incomplete though).

Note close() can still fail for other reasons (like ENOSPC), in which
case an error will be returned while the fd slot is cleared up.

Reviewed by: dim
Differential Revision: https://reviews.freebsd.org/D42984
2023-12-29 18:52:12 +00:00
Vitaliy Gusev
683ea4d22b vmm: MTRR should be saved/restored
This fixes restoring a Linux VM if it was suspended while in the GRUB
menu.

Adding MTTR increases the kernel dump size by 256 bytes per vCPU.

Sponsored by:   vStack
Reviewed by:    markj, rew
Differential Revision:  https://reviews.freebsd.org/D43226
2023-12-29 09:03:20 -09:00
Vitaliy Gusev
b831c7732c bhyve: increase SNAPSHOT_BUFFER_SIZE
After commit fb51ddb20d, suspending a vm fails with the error:
    vm_snapshot_buf: buffer too small

Sponsored by:   vStack
Reviewed by:    markj, rew
Fixes: fb51ddb20d ("bhyve: increase fbuf display resolution limit")
Differential Revision: https://reviews.freebsd.org/D43218
2023-12-29 08:52:40 -09:00
Ed Maste
56c202de78 tegra210: change to UTF-8 (from ISO-8859)
Prompted by Phabricator's complaint that a C source file was a binary
file, in D43192.

Reviewed by:	mmel
Differential Revision: https://reviews.freebsd.org/D43229
2023-12-29 09:51:00 -05:00
Wolfram Schneider
9035bfffed indent: make the URL of the manpage two characters longer so that the test is successful 2023-12-29 09:37:43 +00:00
Xin LI
2f036705f3 Document the two recent newsyslog(8) change (-c option and <compress>
configuration option).
2023-12-29 00:45:52 -08:00
Xin LI
61174ad88e newsyslog(8): Add support of specifying compression method in configuration file.
Administrators can now specify a global compression method directly
at the beginning of the newsyslog.conf file, for example:

	<compress> none

Relnotes:	yes
Reviewed by:	dvl
MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D43174
2023-12-29 00:32:26 -08:00
Vincenzo Maffione
ee5804da11 netmap: fix unit tests
After ad874544d9, interface name
validation has been removed, resulting in two unit tests failures.
Drop the failing tests since they no longer apply.

Reported by:	markj
2023-12-29 07:46:46 +00:00
Colin Percival
8a735ffdf0 EC2: Bump AMI size to 6 GB
This week's cloud-init ZFS snapshots ran out of disk space.
2023-12-28 14:24:46 -08:00
John Baldwin
e7300a8f63 OptionalObsoleteFiles.inc: Add libnss_tacplus_p.a as an old profiled library
Noticed this was still present after upgrading a 12.x stable host to
14.0 stable.
2023-12-28 14:20:54 -08:00
Kenneth D. Merry
40a492d38e camcontrol: Add a sense subcommand
As the name suggests, this sends a SCSI REQUEST SENSE to a device,
and prints out decoded sense information.  It can also print out a
hexdump of the sense data.

sbin/camcontrol/camcontrol.c:
	Add the new sense subcommand.

sbin/camcontrol/camcontrol.8:
	Document camcontrol sense.

Sponsored by:	Spectra Logic
Reviewed by:	mav
MFC after:	3 days
Differential Revision:  https://reviews.freebsd.org/D43225
2023-12-28 16:23:16 -05:00
Lexi Winter
f79b200b6a nfsstat: make -q work without -e/-E
MFC after:	2 weeks
Pull Request:	https://github.com/freebsd/freebsd-src/pull/961
2023-12-28 13:27:07 -07:00
Mark Johnston
c63dda466a atrtc: Add a required include
PR:		275867
MFC after:	1 week
2023-12-28 15:17:32 -05:00
John Baldwin
f7d5900aa0 sys: Style fix for M_EXT | M_EXTPG
Add a space around the | operator in places testing for either M_EXT
or M_EXTPG.

Reviewed by:	imp, glebius
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D43216
2023-12-28 11:17:59 -08:00
John Baldwin
854e1fd692 mbuf.9: Document mtodo
mtodo() accepts an mbuf and offset and returns a void * pointer to the
requested offset into the mbuf's associated data.  Similar to mtod(),
no bounds checking is performed.

Reviewed by:	imp, markj
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D43215
2023-12-28 11:17:45 -08:00
Joerg Pulz
10ed63fc06 isp(4): Rework firmware handling/loading
Correctly identify the active firmware in flash on adapters with
primary and secondary firmware region in flash.
Correctly identify the active NVRAM on adapters with primary
and secondary NVRAM region in flash.

Loading ispfw(4) moved from isp_pci_attach() to isp_reset().
Drop the reference to ispfw(4) after using it so one can kldunload(8) it.
New isp_load_ram() function to load either ispfw(4) or flash firmware
into RISC's RAM.
New functions to read data from flash. The old ones will be removed later.
A bunch of new helper functions to identify and validate active flash
regions for firmware, auxiliary and NVRAM.
Overhaul ISP_FW_* macros and make use of it when comparing firmware
versions. We can handle firmware versions up to 255.255.255.

Firmware load priority slightly changed:
For 27xx and newer adapters:
- load ispfw(4) firmware
- request (active) flash firmware information
- compare version numbers of ispfw(4) and flash firmware
- load firmware with highest version into RISC's RAM
- if loading ispfw(4) is disabled or failed - load firmware from flash
- if everything else fails use MBOX_LOAD_FLASH_FIRMWARE as fallback

For 26xx and older adapters nothing changed:
- load ispfw(4) firmware and load it into RISC's RAM
- if loading ispfw(4) is disabled or failed use MBOX_EXEC_FIRMWARE
- for 26xx a preceding MBOX_LOAD_FLASH_FIRMWARE is used

New read only sysctl(8)'s:
 dev.isp.N.fw_version_run: the firmware version actually running
 dev.isp.N.fw_version_ispfw: the firmware version provided by ispfw(4)
 dev.isp.N.fw_version_flash: the (active) firmware version in flash

While here:
  - firmware attribute handling/parsing reworked
    + renamed defines from ISP2400_FW_ATTR_* to ISP_FW_ATTR_*
    + changed values to match new handling/parsing
    + added some more attributes
  - enable FLT support on 26xx based adapters
  - log level adjustments
  - new function return status codes (some for now, some for later use)
  - some minor style changes

Tested and approved to work on real hardware with:
  - Qlogic ISP 2532 (QLogic QLE2560 8Gb FC Adapter)
  - Qlogic ISP 2031 (QLogic QLE2662 16Gbit 2Port FC Adapter)
  - Qlogic ISP 2722 (QLogic QLE2690 16Gb FC Adapter)
  - Qlogic ISP 2812 (QLogic QLE2772 32Gbit 2Port FC Adapter)

PR:		273263
Reviewed by:	mav
Pull Request:	https://github.com/freebsd/freebsd-src/pull/877
MFC after:	1 month
Sponsored by:	Technical University of Munich
2023-12-28 13:33:07 -05:00
Joerg Pulz
b0c6b06836 ispfw(4): Update and add firmware
Update 25xx firmware: version 8.8.207
Add 26xx firmware: version 8.8.231
Add 27xx firmware: version 9.12.0
Add 28xx firmware: version 9.12.1

Remove BUGS section from manpage as we now have firmware for
all supported controllers.

PR:		273263
MFC after:	1 month
Pull Request:	https://github.com/freebsd/freebsd-src/pull/877
Sponsored by:	Technical University of Munich
2023-12-28 13:31:56 -05:00
Mark Johnston
d068ea16e3 cam: Let cam_periph_unmapmem() return an error
As of commit b059686a71, cam_periph_unmapmem() can legitimately fail
if the copyout() operation fails.  However, this failure was never
signaled to upper layers.  In practice it is unlikely to occur
since cap_periph_mapmem() would most likely fail in such
circumstances anyway, but an error is nonetheless possible.

However, some code reading revealed a few paths where the return value
of cam_periph_mapmem() is not checked, and this is definitely a bug.
Add error checking there and let cam_periph_unmapmem() return errors
from copyout().

Reviewed by:	dab, mav
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D43201
2023-12-28 12:36:15 -05:00
Warner Losh
23699ff23c Revert "vtnet: Adjust rx buffer so IP header 32-bit aligned"
This reverts commit 9e6d11ce9a.

This wasn't right to start with...

Requested by: markj
2023-12-28 10:22:23 -07:00
Warner Losh
8ee1cc4a7f Revert "vtnet: Better adjust for ethernet alignment."
This reverts commit e9da71cd35.

This was inadvertantly pushed and turns out ot be not quite right.

Requested by: markj
2023-12-28 10:22:14 -07:00
Wolfram Schneider
ffd76b1f30 use long manpage URL (broken in last commit)
Reported by:	pstef
2023-12-28 15:58:56 +00:00
rilysh
5f71f9636e CONTRIBUTING.md: fix typo from commmit to commit
Signed-off-by: rilysh <nightquick@proton.me>
Pull-request: https://github.com/freebsd/freebsd-src/pull/960
2023-12-28 10:01:03 -05:00
Osama Abboud
4e2688cc76 ena: Update driver version to v2.7.0
Features:
* Introduce customer and SRD metrics through sysctl
* Introduce spreading IRQs to CPUs capability using sysctl
* Upgrade ena-com to v2.7.0

Bug Fixes:
* Remove outdated APIs

Minor Changes:
* Introduce a shared stats sample interval for all stats

Approved by: cperciva (mentor)
MFC after: 2 weeks
Sponsored by: Amazon, Inc.
2023-12-28 13:56:43 +00:00
Osama Abboud
246aa27324 ena: Update the license dating to 2023
Some of the files are using outdated linceses.
Update the license to be 2023.

Approved by: cperciva (mentor)
MFC after: 2 weeks
Sponsored by: Amazon, Inc.
2023-12-28 13:56:36 +00:00
Osama Abboud
36d42c862f ena: Support srd metrics with sysctl
This commit introduces SRD metrics through sysctl.
The metrics can be queried using the following sysctl node:
sysctl dev.ena.<device index>.ena_srd_info

Approved by: cperciva (mentor)
MFC after: 2 weeks
Sponsored by: Amazon, Inc.
2023-12-28 13:56:30 +00:00
Osama Abboud
f97993ad7b ena: Support customer metric with sysctl
This commit adds sysctl support for customer metrics.
Different customer metrics can be found in the following sysctl node:
sysctl dev.ena.<device index>.customer_metrics

Approved by: cperciva (mentor)
MFC after: 2 weeks
Sponsored by: Amazon, Inc.
2023-12-28 13:56:24 +00:00
Osama Abboud
5b925280d9 ena: Introduce shared sample interval for all stats
Rename sample_interval node to stats_sample_interval and move
it up in the sysctl tree to make it clear that it's relevant for
all the stats and not only ENI metrics (Currently, sample interval node
is found under eni_metrics node).

Path to node:
dev.ena.<device_index>.stats_sample_interval

Once this parameter is set it will set the sample interval for all the
stats node including SRD/customer metrics.

Approved by: cperciva (mentor)
MFC after: 2 weeks
Sponsored by: Amazon, Inc.
2023-12-28 13:56:18 +00:00