stand: Force disable RETPOLINE for boot loaders
Boot loaders do not require speculative execution protection, and may be
too large if enabled.
Reported by: Shawn Webb
Reviewed by: dim, imp
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56068
(cherry picked from commit 61f78130c2f3a6abaa70bd66d6d6974060fb3d04)
fmax.3: Add caveat for going beyond C std requirements
libm's fmax and fmin family of functions treat +0.0 as greater than
-0.0. This is not required by the C standard, so the user may not see
this behaviour due to compiler optimization.
PR: 294214
Reviewed by: fuz
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56230
(cherry picked from commit 7764e9ca28a9702aed4ba7391e055ec2fcf35c41)
(cherry picked from commit 855507463e0d3903d31aa7c084efbf4f819b5d63)
kqueue_fork_copy_knote(): zero kn_knlist for the copy before calling knlist_add()
Reported by: pho, dhw
Sponsored by: The FreeBSD Foundation
(cherry picked from commit aab1ef4527f1b0935add3e8dba9e928e0623376f)
tunefs: Better fix for arm64 alignment issues
Rather than trust that the compiler will lay out the stack frame the
way we expect it to, use a union to force the correct alignment.
MFC after: 1 week
Fixes: 616f47f176c3 ("tunefs: Fix alignment warning on arm64")
Reviewed by: kevans, mckusick
Differential Revision: https://reviews.freebsd.org/D56245
(cherry picked from commit 8244dd326265867293b2286efc3d571f06ef0dab)
tunefs: Fix pointer arithmetic
While here, remove a bogus const which has been there for years.
MFC after: 1 week
Reported by: ivy@
Fixes: 1b83e8a3f840 ("Constify string pointers.")
[5 lines not shown]
tunefs: Better fix for arm64 alignment issues
Rather than trust that the compiler will lay out the stack frame the
way we expect it to, use a union to force the correct alignment.
MFC after: 1 week
Fixes: 616f47f176c3 ("tunefs: Fix alignment warning on arm64")
Reviewed by: kevans, mckusick
Differential Revision: https://reviews.freebsd.org/D56245
(cherry picked from commit 8244dd326265867293b2286efc3d571f06ef0dab)
tunefs: Fix pointer arithmetic
While here, remove a bogus const which has been there for years.
MFC after: 1 week
Reported by: ivy@
Fixes: 1b83e8a3f840 ("Constify string pointers.")
[5 lines not shown]
Fix default for .MAKE.SAVE_DOLLARS
NetBSD make defaults this to "yes",
bmake defauts it to "no" to retain the traditional behavior.
The default is dealt with in bmake's Makefile but that does not
address boot-strap.
For now, just change the ifdef in main.
PR: 294436
fmax.3: Add caveat for going beyond C std requirements
libm's fmax and fmin family of functions treat +0.0 as greater than
-0.0. This is not required by the C standard, so the user may not see
this behaviour due to compiler optimization.
PR: 294214
Reviewed by: fuz
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56230
(cherry picked from commit 7764e9ca28a9702aed4ba7391e055ec2fcf35c41)
ifconfig: Fix printf on geneve for 32-bit architectures
Replace uint64_t type with uintmax_t in printf to fix warnings
on 32-bit architectures.
Reported by: Jenkins
Fixes: 688e289ee904 ("ifconfig: Add support for geneve")
Differential Revision: https://reviews.freebsd.org/D55184
release: remove Oracle Cloud Infrastructure build targets
Oracle's previous support is no longer available to the project.
Repeated attempts to find a sponsor within Oracle's cloud business
have not been successful.
The last published official images are from 15.0-RELEASE.
https://marketplace.oracle.com/app/freebsd-release
Relnotes: yes
Sponsored by: SkunkWerks, GmbH
Differential Revision: https://reviews.freebsd.org/D56360
MFC after: 3 days
kqueue: don't leak file refs on failure to knote_attach()
We'll subsequently just knote_free() since the knote is barely
constructed, but that bypasses any logic that might release references
on owned files/fops. Defer clearing those until the knote actually owns
them and update the comment to draw the line more clearly.
Reviewed by: kib
(cherry picked from commit 0bf4d22c37083170961c31694b90551538901a1c)
libc: fix memfd_create's HUGETLB handling
The 'simplification' commit referenced below actually broke one aspect
of MFD_HUGETLB: the caller isn't supposed to be required to specify a
size. MFD_HUGETLB by itself without a shift mask just requests a large
page, so we revert that part of memfd_create() back.
While we're here, fix up the related parts of the manpages a little bit,
since MFD_HUGETLB is actually supported. The manpage claims that we
would return ENOSYS if forced mappings weren't supported, but this was
actually not true. However, that seems like a very important
distinction to make between ENOSYS and EOPNOTSUPP, so fix the
implementation to match the docs.
Reviewed by: kib, markj
(cherry picked from commit 9a8d333368baef356f0a611b47ec592568dd14f9)
kqueue: slightly clarify the flow in knlist_cleardel()
This is purely a cosmetic change to make it a little easier on the eyes,
rather than jumping back to the else branch up top. Re-flow it to use
another loop on the outside and just inline the re-lock before we repeat
after awaking from fluxwait.
The !killkn path should maybe issue a wakeup if there's a thread in
KQ_SLEEP so that userland can observe the EOF, but this isn't a
practical problem today: pretty much every case of knlist_clear is tied
to a file descriptor and called in the close(2) path. As a consequence,
potentially affected knotes are almost always destroyed before we even
get to knlist_clear().
Reviewed by: kib, markj
(cherry picked from commit c6dd40f2d35d596ca60a5d87616c3e4a0fd4f676)
lualoader: allow the local module to filter out the BE list
This allows something like the following local.lua to install a filter
to implement its own notion of hidden BEs using a naming convention of
a leading dot to hide them:
-- file: /boot/lua/local.lua
local core = require("core")
local function be_hide(be)
if core.isSingleUserBoot() then
-- All BEs are accepted for single-user
return true
end
local name = be:match("/([^/]+)$")
if not name then
-- Accept malformed BEs, for whatever reason
return true
[16 lines not shown]
kqueue: compare against the size in kqueue_expand
This is a cosmetic change, rather than a functional one: comparing the
knlistsize against the fd requires a little bit of mental gymnastics to
confirm that this is fine and not doing unnecessary work in some cases.
Notably, one must consider that kq_knlistsize only grows in KQEXTENT
chunks, which means that concurrent threads trying to grow the kqueue
to consecutive fds will usually not result in the list being replaced
twice. One can also more clearly rule out classes of arithmetic
problems in the final `else` branch.
Reviewed by: kib, markj
(cherry picked from commit 0b4f0e0515d0c7ec855cd654ae5dc562f4931cae)
kqueue: add some kn_knlist assertions around knlist_(add|remove)
We currently assert that kn_status is accurate, but there's more room
for error. Neither of these are very likely, but currently we'd blow up
in SLIST*() macros instead of providing more obvious diagnostics. It's
perhaps only worth testing these because knlist_remove() requires
getting logic across both f_attach() and f_detach() correct.
Reviewed by: kib, markj
(cherry picked from commit 306c9049c642da6a59a5dc088589605a9aa38b87)
kqueue: simplify knote_fdclose()
The influx logic in knote_fdclose() is a little misguided, the resulting
wakeup() call should always be redundant: knote_drop_detached() will
always issue a wakeup before it returns, so anything waiting on *that*
knote that had entered fluxwait should have been woken up then. This is
the obvious divergence from the other influx/wakeup pattern in the
implementation, which will kn_influx-- and then issue the wakeup after
it has processed all of the knotes it can make progress on.
While we're here, the kq_knlist cannot shrink, so we can avoid that
condition in the loop and avoid potentially excessive wakeups from
fluxwait on kqueues that we didn't touch.
Reviewed by: kib, markj
(cherry picked from commit ff1050d2a366bd288a6ebbf63f98003272513f92)
arm64: mte: configure initial state for system registers
The fields in SCTLR_EL1 and HCR_EL2 for enabling MTE are set, and if the
ID_AA64PFR1_EL1 register shows MTE is present, the GCR_EL1 register is
also configured, and the two TFSR registers which hold pending tag check
faults are cleared.
Reviewed by: andrew
Sponsored by: Arm Ltd
Signed-off-by: Harry Moulton <harry.moulton at arm.com>
Differential Revision: https://reviews.freebsd.org/D55946
arm64: mte: cleanup cache register definitions
Cleanup the definitions in armreg.h for the CSSIDR_EL1, CLIDR_EL1 and
CSSELR_EL1 system register to prepare for additional bitfeilds for
Memory Tagging Extension (MTE).
Reviewed by: andrew
Sponsored by: Arm Ltd
Signed-off-by: Harry Moulton <harry.moulton at arm.com>
Differential Revision: https://reviews.freebsd.org/D55944
arm64: Handle changing self-referential DMAP pages
Support changing the property of a DMAP page that holds it's own page
table entry.
Because we need to perform a break-before-make sequence to change the
properties of pages a page that also holds it's own page table entry
will fault in the make part of the sequence.
Handle this by mapping the page with a temporary mapping as we already
do when demoting a superpage.
Reviewed by: kib
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D55943
arm64: mte: add system register definitions
Add system register and bit field definitions for Memory Tagging
Extension (MTE) in ARMv8.5.
Reviewed by: andrew
Sponsored by: Arm Ltd
Signed-off-by: Harry Moulton <harry.moulton at arm.com>
Co-authored-by: Andrew Turner <andrew at FreeBSD.org>
Differential Revision: https://reviews.freebsd.org/D55945
arm64: Add a cmap page to pmap
When modifying mappings in pmap we may need to perform a
break-before-make sequence. This creates an invalid mapping, then
recreates it with the changes.
When modifying DMAP mappings we may be changing the mapping that
contains its own page table then after breaking the old entry we are
unable to create the new entry.
To fix this create a map that can be used & won't be affected by the
break-before-make sequence.
Reviewed by: kib
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D56306
geneve: Add tests for geneve
Add tests for each combinations of geneve modes, address families
and multicast.
Differential Revision: https://reviews.freebsd.org/D55183
if_geneve: Add Support for Geneve (RFC8926)
geneve creates a generic network virtualization tunnel interface
for Tentant Systems over an L3 (IP/UDP) underlay network that provides
a Layer 2 (ethernet) or Layer 3 service using the geneve protocol.
This implementation is based on RFC8926.
Reviewed by: glebius, adrian
Discussed with: zlei, kp
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D54172
libarchive: merge from vendor branch
libarchive 3.8.7
Important bugfixes:
#2871 libarchive: fix handling of option failures
#2897 iso9660: fix undefined behavior
#2898 RAR: fix LZSS window size mismatch after PPMd block
#2900 CAB: fix NULL pointer dereference during skip
#2911 libarchive: do not continue with truncated numbers
#2919 CAB: Fix Heap OOB Write in CAB LZX decoder
#2934 iso9660: fix posibble heap buffer overflow on 32-bit systems
#2939 cpio: Fix -R memory leak
#2947 libarchive: lzop and grzip filter support
Important bugfixes between 3.8.5 and 3.8.6:
#2860 bsdunzip: fix ISO week year and Gregorian year confusion
#2864 7zip: ix SEGV in check_7zip_header_in_sfx via ELF offset validation
#2875 7zip: fix out-of-bounds access on ELF 64-bit header
[12 lines not shown]
Update vendor/libarchive to 3.8.7
Important bugfixes between 3.8.6 and 3.8.7:
#2871 libarchive: fix handling of option failures
#2897 iso9660: fix undefined behavior
#2898 RAR: fix LZSS window size mismatch after PPMd block
#2900 CAB: fix NULL pointer dereference during skip
#2911 libarchive: do not continue with truncated numbers
#2919 CAB: Fix Heap OOB Write in CAB LZX decoder
#2934 iso9660: fix posibble heap buffer overflow on 32-bit systems
#2939 cpio: Fix -R memory leak
#2947 libarchive: lzop and grzip filter support
Important bugfixes between 3.8.5 and 3.8.6:
#2860 bsdunzip: fix ISO week year and Gregorian year confusion
#2864 7zip: ix SEGV in check_7zip_header_in_sfx via ELF offset validation
#2875 7zip: fix out-of-bounds access on ELF 64-bit header
#2877 RAR5 reader: fix infinite loop in rar5 decompression
#2878 mtree reader: Fix file descriptor leak in mtree parser cleanup
[9 lines not shown]
compat/linux: Add Linux i2c-dev ioctl compatibility support
Implement Linux I2C ioctl translation in the Linux compatibility layer
and wire iicbus cdevs up for in-kernel rdwr handling.
Support common i2c-dev requests including SLAVE, FUNCS, and RDWR,
while rejecting unsupported 10-bit and SMBus operations.
Signed-off-by: YAO, Xin <mr.yaoxin at outlook.com>
Reviewed by: imp, adrian, pouria
Differential Revision: https://reviews.freebsd.org/D56251
vm_fault: Reset m_needs_zeroing properly
- When allocating a page, we should only consider the PG_ZERO flag when
handling the top-level page.
- Unconditionally reset the flag when restarting the fault handler.
Previously, vm_fault_busy_sleep() would fail to reset it.
PR: 294039
Reviewed by: kib
Tested by: Peter Much <pmc at citylink.dinoex.sub.org>
MFC after: 3 days
Fixes: cff67bc43df1 ("vm_fault: only rely on PG_ZERO when the page was newly allocated")
Differential Revision: https://reviews.freebsd.org/D56234
(cherry picked from commit 04132e01004316ddd0e0cde6ef15b100b7b1844d)