FreeBSD/src 7685aaesys/vm vm_map.c vm_object.c

vm_object_coalesce(): return swap reservation back if overcharged

It is possible for both vm_map_insert() and vm_object_coalesce() to charge
both for the same region.  The issue is that vm_map_insert() must charge
in advance to ensure that the mapping would not exceed the swap limit,
but then the coalesce might decide to extend the object, and already
(partially) backs the mapped region.

Handle this by passing to vm_object_coalesce() exact information about
the charging mode of the extending range 'not charging', 'charged' using
flags instead of simple boolean.  In vm_object_coalesce(), detect
overcharge and undo it if needed.

Note that this relies on vm_object_coalesce() call being the last action
in vm_map_insert() before extending the previous map entry.

Reported and tested by: pho
Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation

    [2 lines not shown]
DeltaFile
+30-14sys/vm/vm_map.c
+31-10sys/vm/vm_object.c
+7-1sys/vm/vm_object.h
+68-253 files

FreeBSD/src 353ba3bsys/vm vm_object.c

vm_object_coalesce(): do not account holes twice

alc wrote:
Suppose that the object is OBJ_ONEMAPPING and that we, in fact,
have a single mapping to it. Then, we punch a hole in that mapping.
vm_map_entry_delete() only subtracts from the object's charge when
we shrink the size of the object. Now, suppose that we perform
mmap(MAP_ANON) to reallocate some of the hole. Aren't we going to add to
the charge here, even though vm_map_entry_delete() never subtracted from
the charge for the hole that was created?

Only account the change in the charged object size that was added to it.

Noted by:       alc
Reviewed by:    alc, markj
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D54263
DeltaFile
+7-4sys/vm/vm_object.c
+7-41 files

FreeBSD/src e7053d9sys/vm vm_object.c

vm_object_coalesce(): simplify common expression

Add the next_end variable to replace commonly occuring the
next_pindex + next_size expression.

Suggested by:   alc
Reviewed by:    alc, markj
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D54263
DeltaFile
+7-6sys/vm/vm_object.c
+7-61 files

FreeBSD/src efcb109sys/vm vm_object.c

vm_object_coalesce(): remove commented out code

Reviewed by:    alc, markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D54263
DeltaFile
+1-12sys/vm/vm_object.c
+1-121 files

FreeBSD/src 8b4f1d7contrib/xz ChangeLog THANKS, contrib/xz/src/common my_landlock.h

MFV 762f11d98d5cd57ebbe85c36e9e86a557a91fe4e: xz 5.8.2.

(cherry picked from commit ae12432049e7873ab3912643ae5d08297b8cbc49)
DeltaFile
+1,586-0contrib/xz/ChangeLog
+226-208contrib/xz/THANKS
+34-45contrib/xz/src/liblzma/common/stream_decoder_mt.c
+72-0contrib/xz/src/xz/hardware.c
+44-1contrib/xz/src/common/my_landlock.h
+18-20contrib/xz/src/liblzma/api/lzma/container.h
+1,980-27427 files not shown
+2,088-34233 files

FreeBSD/src 07700b0contrib/xz ChangeLog THANKS, contrib/xz/src/common my_landlock.h

MFV 762f11d98d5cd57ebbe85c36e9e86a557a91fe4e: xz 5.8.2.

(cherry picked from commit ae12432049e7873ab3912643ae5d08297b8cbc49)
DeltaFile
+1,586-0contrib/xz/ChangeLog
+226-208contrib/xz/THANKS
+34-45contrib/xz/src/liblzma/common/stream_decoder_mt.c
+72-0contrib/xz/src/xz/hardware.c
+44-1contrib/xz/src/common/my_landlock.h
+18-20contrib/xz/src/liblzma/api/lzma/container.h
+1,980-27427 files not shown
+2,088-34233 files

FreeBSD/src 4e48e50contrib/xz ChangeLog THANKS, contrib/xz/src/common my_landlock.h

MFV 762f11d98d5cd57ebbe85c36e9e86a557a91fe4e: xz 5.8.2.

(cherry picked from commit ae12432049e7873ab3912643ae5d08297b8cbc49)
DeltaFile
+1,586-0contrib/xz/ChangeLog
+226-208contrib/xz/THANKS
+34-45contrib/xz/src/liblzma/common/stream_decoder_mt.c
+72-0contrib/xz/src/xz/hardware.c
+44-1contrib/xz/src/common/my_landlock.h
+18-20contrib/xz/src/liblzma/api/lzma/container.h
+1,980-27427 files not shown
+2,088-34233 files

FreeBSD/src 68c94c3sys/contrib/openzfs/include/os/freebsd/linux compiler.h

Remove __deprecated definition from OpenZFS compiler.h

Since it is now provided by <sys/cdefs.h>.

Direct commit to stable/13, since OpenZFS compiler.h has been
substantially changed in newer branches.
DeltaFile
+0-1sys/contrib/openzfs/include/os/freebsd/linux/compiler.h
+0-11 files

FreeBSD/src 9622effsys/compat/linuxkpi/common/include/linux compiler.h, sys/sys cdefs.h

cdefs: Add __deprecated

Add __deprecated decorator. This is for a deprecated interface. copystr
is tagged with this today in copy(9), but don't actually provide it or
use it. copystr is a #define so adding it will have to wait.

LinuxKPI was defining this away completely in compiler.h. Since this is
shared between Linux KPI consumers and OpenZFS, if it's already defined,
use the FreeBSD sys/cdefs.h version, otherwise define it away. For
OpenZFS this will retain it, while for Linux KPI it will tend to drop it
(I think always, but I didn't look at everything).

Sponsored by:           Netflix
Reviewed by:            jhb, emaste
Differential Revision:  https://reviews.freebsd.org/D46137

(cherry picked from commit 16672453f12586703f1c51d909bd1900691bf884)
DeltaFile
+2-0sys/compat/linuxkpi/common/include/linux/compiler.h
+1-0sys/sys/cdefs.h
+3-02 files

FreeBSD/src c7826c8sys/sys cdefs.h

cdefs: Add __deprecated1 which accepts a message as an argument

This message will be included in any warning issued by the compiler
for use of the deprecated function.

Reviewed by:    imp
Differential Revision:  https://reviews.freebsd.org/D47701

(cherry picked from commit 6da04bcff9efedeae7d4046553002b9e3b2bc24f)
DeltaFile
+1-0sys/sys/cdefs.h
+1-01 files

FreeBSD/src cd2a65asys/sys cdefs.h

sys/cdefs.h: add __noexcept and __noexcept_if

These macros provide the C++11 noexcept and noexcept(...) keywords if
we're compiling in a C++11 environment.  Otherwise, they expand to an
empty string.

This will be used to add the required noexcept specifier to several libc
functions as required in C++11.

MFC after:      2 weeks

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1085

(cherry picked from commit 02b0d4b688cc4deb14cb6e7534a2a4958e48b753)
DeltaFile
+11-0sys/sys/cdefs.h
+11-01 files

FreeBSD/src 85e0cdesys/sys cdefs.h

cdefs: Add __deprecated1 which accepts a message as an argument

This message will be included in any warning issued by the compiler
for use of the deprecated function.

Reviewed by:    imp
Differential Revision:  https://reviews.freebsd.org/D47701

(cherry picked from commit 6da04bcff9efedeae7d4046553002b9e3b2bc24f)
DeltaFile
+1-0sys/sys/cdefs.h
+1-01 files

FreeBSD/src 4ff445dsys/compat/linuxkpi/common/include/linux compiler.h, sys/sys cdefs.h

cdefs: Add __deprecated

Add __deprecated decorator. This is for a deprecated interface. copystr
is tagged with this today in copy(9), but don't actually provide it or
use it. copystr is a #define so adding it will have to wait.

LinuxKPI was defining this away completely in compiler.h. Since this is
shared between Linux KPI consumers and OpenZFS, if it's already defined,
use the FreeBSD sys/cdefs.h version, otherwise define it away. For
OpenZFS this will retain it, while for Linux KPI it will tend to drop it
(I think always, but I didn't look at everything).

Sponsored by:           Netflix
Reviewed by:            jhb, emaste
Differential Revision:  https://reviews.freebsd.org/D46137

(cherry picked from commit 16672453f12586703f1c51d909bd1900691bf884)
DeltaFile
+2-0sys/compat/linuxkpi/common/include/linux/compiler.h
+1-0sys/sys/cdefs.h
+3-02 files

FreeBSD/src c4290c3sys/sys cdefs.h

sys/cdefs.h: add __noexcept and __noexcept_if

These macros provide the C++11 noexcept and noexcept(...) keywords if
we're compiling in a C++11 environment.  Otherwise, they expand to an
empty string.

This will be used to add the required noexcept specifier to several libc
functions as required in C++11.

MFC after:      2 weeks

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1085

(cherry picked from commit 02b0d4b688cc4deb14cb6e7534a2a4958e48b753)
DeltaFile
+11-0sys/sys/cdefs.h
+11-01 files

FreeBSD/src 8e95158share/man/man5 src.conf.5, tools/build/options WITH_REPRODUCIBLE_PATHS

Fix typo in tools/build/options/WITH_REPRODUCIBLE_PATHS

Fixes:          faeaa25f5624
DeltaFile
+4-4share/man/man5/src.conf.5
+3-3tools/build/options/WITH_REPRODUCIBLE_PATHS
+7-72 files

FreeBSD/src 660416fshare/mk bsd.opts.mk src.opts.mk

Move MK_REPRODUCIBLE_PATHS to bsd.opts.mk

In commit faeaa25f5624 MK_REPRODUCIBLE_PATHS was introduced, but some
ports that include bsd.debug.mk then started to fail with:

    make: /usr/share/mk/bsd.debug.mk:19: Variable "MK_REPRODUCIBLE_PATHS" is undefined
            in /usr/share/mk/bsd.lib.mk:525
            in /wrkdirs/usr/ports/devel/libsysinfo/work/libsysinfo-0.0.3/Makefile:16
    make: Fatal errors encountered -- cannot continue

This is because bsd.debug.mk includes bsd.opts.mk, not src.opts.mk. Move
the MK_REPRODUCIBLE_PATHS option to bsd.opts.mk to fix this.

Reviewed by:    imp, emaste
Fixes:          faeaa25f5624
DeltaFile
+1-0share/mk/bsd.opts.mk
+0-1share/mk/src.opts.mk
+1-12 files

FreeBSD/src bbaa7d6contrib/kyua/doc kyua-db-exec.1.in kyua-db-migrate.1.in

kyua manuals: Correct --results-file short form

PR:             290647
Ref:            kyua/cli/common.cpp#104
MFC after:      3 days
Reviewed by:    ziaee
Closes:         https://github.com/freebsd/kyua/issues/267
DeltaFile
+1-1contrib/kyua/doc/kyua-db-exec.1.in
+1-1contrib/kyua/doc/kyua-db-migrate.1.in
+1-1contrib/kyua/doc/kyua-report-html.1.in
+1-1contrib/kyua/doc/kyua-report-junit.1.in
+1-1contrib/kyua/doc/kyua-report.1.in
+1-1contrib/kyua/doc/kyua-test.1.in
+6-66 files

FreeBSD/src e2afbc4lib/libsys ioctl.2

ioctl.2: Mention EACCES

ioctls can fail with EACCES, see sys/kern/tty.c

PR:                     239504
MFC after:              3 days
Reviewed by:            ziaee
Reported by:            Brennan Vincent <brennan at umanwizard.com>
Differential Revision:  https://reviews.freebsd.org/D49072
DeltaFile
+4-1lib/libsys/ioctl.2
+4-11 files

FreeBSD/src 0487408usr.sbin/bhyve bhyve_config.5

bhyve_config.5: Fix consistency and terms in manpage

Correct inconsistent spelling of terms and duplication.

Reviewed by:    ziaee
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D54370

(cherry picked from commit 66604463e737f4754ae6268171031ceefc226837)
DeltaFile
+7-6usr.sbin/bhyve/bhyve_config.5
+7-61 files

FreeBSD/src b4f84b1usr.sbin/bhyve bhyve_config.5 bhyve.8

bhyve: Document that MAC address has to be unicast

bhyve accepts any MAC address even foreign as long it is a unicast one.

Reviewed by:    ziaee
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D54372

(cherry picked from commit e1bfd541c7cdee1e184cacb2ea3bbebb3a500dfb)
DeltaFile
+8-4usr.sbin/bhyve/bhyve_config.5
+2-1usr.sbin/bhyve/bhyve.8
+10-52 files

FreeBSD/src 9cfd75asys/kern vfs_bio.c

bio: Fix KASAN invalid access report in biodone

Do not touch the bio fields after calling the bio_done callback. The bio
might have been freed after the callback returns.

Fixes:  725f4b108d54
Reported by:    kp, markj
DeltaFile
+0-2sys/kern/vfs_bio.c
+0-21 files

FreeBSD/src 108f057usr.sbin/bhyve bhyve_config.5 bhyve.8

bhyve: Document that MAC address has to be unicast

bhyve accepts any MAC address even foreign as long it is a unicast one.

Reviewed by:    ziaee
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D54372

(cherry picked from commit e1bfd541c7cdee1e184cacb2ea3bbebb3a500dfb)
DeltaFile
+8-4usr.sbin/bhyve/bhyve_config.5
+2-1usr.sbin/bhyve/bhyve.8
+10-52 files

FreeBSD/src c847ea5usr.sbin/bhyve bhyve_config.5

bhyve_config.5: Fix consistency and terms in manpage

Correct inconsistent spelling of terms and duplication.

Reviewed by:    ziaee
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D54370

(cherry picked from commit 66604463e737f4754ae6268171031ceefc226837)
DeltaFile
+9-8usr.sbin/bhyve/bhyve_config.5
+9-81 files

FreeBSD/src ad6381ashare/man/man4 linprocfs.4

linprocfs.4: Improve docs around pid/self entries

Mark <pid> as a placeholder and document that self is a symlink to a directory.

PR:             283080
Reviewed by:    ziaee
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D54358

(cherry picked from commit 0d31189cbce4de142a43b65037beb7bf8c09cf26)
DeltaFile
+4-4share/man/man4/linprocfs.4
+4-41 files

FreeBSD/src 980c44dusr.sbin/bhyve bhyve_config.5 bhyve.8

bhyve: Document that MAC address has to be unicast

bhyve accepts any MAC address even foreign as long it is a unicast one.

Reviewed by:    ziaee
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D54372

(cherry picked from commit e1bfd541c7cdee1e184cacb2ea3bbebb3a500dfb)
DeltaFile
+8-4usr.sbin/bhyve/bhyve_config.5
+2-1usr.sbin/bhyve/bhyve.8
+10-52 files

FreeBSD/src 919cb70usr.sbin/bhyve bhyve_config.5

bhyve_config.5: Fix consistency and terms in manpage

Correct inconsistent spelling of terms and duplication.

Reviewed by:    ziaee
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D54370

(cherry picked from commit 66604463e737f4754ae6268171031ceefc226837)
DeltaFile
+9-8usr.sbin/bhyve/bhyve_config.5
+9-81 files

FreeBSD/src 23b83bfsys/dev/dpaa2 dpaa2_ni.c

dpaa2: Setup interface caps on attach

39d4094173f9 ("epair: add support for checksum offloading") revealed
that HW checksum offloading is not enabled when the dpaa2_ni driver
is attached despite being declared and enabled on the dpni interface.

I modified dpaa2_ni_setup_if_caps to take into account both IPv4 and
IPv6 checksum offloading capabilities and added a call to re-configure
interface capabilities on attach to fix it.

Reviewed by:    bz
Fixes:          39d4094173f9 ("epair: add support for checksum offloading")
MFC after:      1 week
Differential Revision: https://reviews.freebsd.org/D53436

(cherry picked from commit a731cb93a66271713d6ea197946e4a307e5b0837)
DeltaFile
+45-7sys/dev/dpaa2/dpaa2_ni.c
+45-71 files

FreeBSD/src 22f8973sys/dev/dpaa2 dpaa2_ni.c

dpaa2: Setup interface caps on attach

39d4094173f9 ("epair: add support for checksum offloading") revealed
that HW checksum offloading is not enabled when the dpaa2_ni driver
is attached despite being declared and enabled on the dpni interface.

I modified dpaa2_ni_setup_if_caps to take into account both IPv4 and
IPv6 checksum offloading capabilities and added a call to re-configure
interface capabilities on attach to fix it.

Reviewed by:    bz
Fixes:          39d4094173f9 ("epair: add support for checksum offloading")
MFC after:      1 week
Differential Revision: https://reviews.freebsd.org/D53436

(cherry picked from commit a731cb93a66271713d6ea197946e4a307e5b0837)
DeltaFile
+45-7sys/dev/dpaa2/dpaa2_ni.c
+45-71 files

FreeBSD/src c4bd487share/man/man4 genet.4

genet.4: Only for AArch64 + tag spdx

MFC after:      3 days
DeltaFile
+4-1share/man/man4/genet.4
+4-11 files

FreeBSD/src c6bd2aashare/man/man4 cpuctl.4

cpuctl.4: Formatting nits

+ Align ioctl list + Pad code examples + Tag spdx license identifier

MFC after:      3 days
DeltaFile
+6-1share/man/man4/cpuctl.4
+6-11 files