[BPF] Return small aggregates directly in registers (#206876)
Previously the BPF ABI always returned aggregate (struct/union) types
indirectly through an sret pointer, regardless of size. This is
inconsistent with how classifyArgumentType() already passes small
aggregates: arguments up to 128 bits are coerced into one or two 64-bit
registers, while only larger aggregates use an indirect reference.
Make classifyReturnType() mirror that convention by factoring the shared
aggregate handling into a classifyAggregateType() helper used by both:
- empty aggregates (0 bits) are ignored;
- aggregates up to 64 bits are returned directly, coerced to an integer
of the padded size;
- aggregates of 65..128 bits are returned directly as [2 x i64];
- aggregates larger than 128 bits are returned indirectly via sret.
This keeps each returned value within the backend's two-register return
convention and avoids an unnecessary memory round-trip for small
[7 lines not shown]
ufs: Allow read-only mounting of NetBSD FFSv2 WAPBL filesystems
Skip UFS2 fs_metaspace upper-bound validation that rejects NetBSD FFSv2
WAPBL filesystems due to differing superblock layouts.
Detect the condition during mount instead and permit read-only mounts
while rejecting read-write mounts with EROFS. This follows NetBSD's
recommendation for systems without WAPBL support and avoids modifying
unsupported journal metadata.
PR: 296022
Signed-off-by: Ricardo Branco <rbranco at suse.de>
Reviewed by: imp, kirk
Pull Request: https://github.com/freebsd/freebsd-src/pull/2279
reboot: fix openlog(3) calls
LOG_CONS was OR'd into the facility argument instead of logopt, leaving
logopt as 0. The correct call is openlog(ident, LOG_CONS, LOG_AUTH),
as shutdown(8) and init(8) already do.
PR: 296315
Signed-off-by: Ricardo Branco <rbranco at suse.de>
Reviewed by: imp, des
Pull Request: https://github.com/freebsd/freebsd-src/pull/2300
[libc++] Replace the of use custom sections for detecting overriden functions (#175896)
This is a follow up to #133876 and an alternative to #120805 which
doesn't rely on aliases and works across both ELF and Mach-O. This
mechanism is preferable in baremetal environments since it doesn't
require special handling of the custom sections.
PR lib/60324 - isolate descent into lib
Since no-one seems interested in implementing a better fix
than this for the issue in the PR which (sometimes) breaks
the builds, simply do the easiest possible thing which will
avoid the observed symptoms.
Don't allow builds in lib and external to happen in parallel
by simply isolating the descent into lib (there is a LOT to
do in there). Don't start anything else until that is done.
If anyone would like to find a different workable solution than
this one, please go ahead.
[CIR][CUDA] Support built-in CUDA surface type (#196079)
Related: #179278
This patch adds initial support for CUDA built-in surface types in CIR
for device-side compilation.
CUDA surface references are lowered to the NVPTX device-handle
representation (`i64`), matching existing Clang CodeGen behavior.
Changes
* Add `getCUDADeviceBuiltinSurfaceDeviceType()` target hook to
`TargetCIRGenInfo`
* Implement NVPTX surface lowering in `NVPTXTargetCIRGenInfo`
* Handle CUDA built-in surface types in `CIRGenTypes::convertType`
* Add CIR CUDA test coverage for device-side surface lowering
Notes
[8 lines not shown]
[NFC][ELF] Don't reimplement addReloc in MipsGotSection::addConstant (#208130)
This is a repeat of d48eb719d240 ("[NFC][ELF] Don't reimplement addReloc
in GotSection::addConstant") but for MipsGotSection. Unfortunately,
9fb61d972213 ("[NFCI][ELF][Mips] Refactor MipsGotSection to avoid
explicit writes (#178561)") was put up for review before, and was landed
after, that commit, and I did not think to update it, so it ended up
copying the old GotSection code. Although there's no motivation to
support CHERI in this code (even though CHERI-MIPS existed it never used
the highly-specialised MipsGotSection to hold capabilities), it's still
better to use our own abstractions, and to be consistent.
Fixes: 9fb61d972213 ("[NFCI][ELF][Mips] Refactor MipsGotSection to avoid
explicit writes (#178561)")
kern: imgact: fix imgp->interpreted
This is a mask, so the new value should have taken the next bit to avoid
breaking a shell script that's interpreted by a binmisc-activated
interpreter.
Add a brief note that the new value is only used within the ELF
activator.
Fixes: 389c124fecb0 ("imgact_elf.c indicate that interpreter [...]")
Reported by: "polyduekes" on discord, madpilot
Reviewed by: kib, sjg (both previous version)
Differential Revision: https://reviews.freebsd.org/D58063
sbin/efi - avoid generating invalid UTF-8
Strings in UEFI are all made up of 16 bit chars, which are defined in the
UEFI standard to be UCS-2 (despite that format having been deprecated for
decades - replaced by UTF-16).
UCS-2 allowed for just 65536 code points (hence 16 bit storage). UTF-16
defines a block of 8192 of the available code-points to be surrogates, 4096
of them high surrogates, the other 4096 low surrogates, always to be used
as a pair, high then low.
Each surrogate of a pair provides 10 data bits, combining them together gives
a 20 bit value, which is used by UTF-16 to represent the code point values
from 0x10000 -> 0x10FFFF. By doing that they (for all time) reserved the
8192 surrogate code points (those with values from 0xD800 to 0xDFFF (incl)),
regardless of the format in which they're encoded, as being invalid, except
when used as part of a surrogate pair in UTF-16.
So, since UCS-2 had no surrogates (not really) and is (was) defined to
[16 lines not shown]
[Hexagon] Disable restore stubs when ShadowCallStack is active (#206302)
The returning restore stubs (e.g.
__restore_r16_through_r17_and_deallocframe) perform deallocframe+jumpr
r31 internally, returning via the on-stack return address. This is
incompatible with ShadowCallStack, which must restore r31 from the
shadow stack before returning.
Fix by having useRestoreFunction() return false when the ShadowCallStack
attribute is present, forcing inline callee-saved restores so the SCS
epilogue is properly emitted.
[libc][complex] Add basic complex ops including carg/cabs for GPU (#207887)
This PR adds carg and cabs for AMD GPU and also add all other basic
complex ops for NV GPU.
Signed-off-by: jinge90 <ge.jin at intel.com>