linuxkpi: Pass a `const void *` to `krealloc()`
This matches the API on Linux.
Reviewed by: bz
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56451
linuxkpi: Include <linux/uuid.h> from <linux/mod_devicetable.h>
The DRM generic code started to deppend on this indirect include of
<linux/uuid.h> in Linux 6.12.
Reviewed by: bz, emaste
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56449
linuxkpi: Passing a size of zero to `krealloc()` frees the pointer
This matches the API on Linux.
Reviewed by: bz
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56452
linuxkpi: Add `fop_flags` to `struct file_operations`
... along with the `FOP_*` flag constants.
Note that this `fop_flags` field is not used on FreeBSD. It is added to
make the DRM drivers compile out of the box.
The DRM generic code and drivers started this in Linux 6.12.
Reviewed by: bz
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56450
linuxkpi: Define `MINORBITS`
We can't really define a proper value for this constant because minor
and major are encoded in a complex way on FreeBSD which cannot be
represented with a simple shift.
The DRM generic code started to use it in Linux 6.12.
In this context, `MINORBITS` is used to define an upper limit passed to
`xa_alloc()`. Therefore it is not used to encode or decode minors. It is
used as an arbitrary value. Therefore, we define the constant to 20,
like on Linux.
Reviewed by: bz
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56447
linuxkpi: Define `sort_r()`
Like Linux `sort()` and FreeBSD `qsort()`, `sort_r()` is a wrapper
around FreeBSD `qsort_r()`.
The i915 DRM driver started to use it in Linux 6.12.
Reviewed by: bz
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56437
linuxkpi: Add several `guid_*()` functions
The DRM generic code and the amdgpu DRM driver started to use several of
these functions in Linux 6.12. Likewise for `UUID_SIZE`.
Reviewed by: bz
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56448
linuxkpi: Define diagnostic macros like `might_resched()` or `cant_sleep()`
They are no-ops on FreeBSD.
While here, move the already defined `might_sleep*()` macros from
<linux/wait.h> to <linux/kernel.h> where they belong.
The DRM generic code started to use `might_fault()` in Linux 6.12.
Reviewed by: bz
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56434
linuxkpi: Define `dev_err_probe*()`
They differ from other `dev_*()` logging functions by returning the
passed error code. The error code is also used to determine if the
message should be logged in the first place and at which log level.
The DRM generic code started to use it in Linux 6.12.
Reviewed by: bz
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56435
linuxkpi: Define `__GFP_THISNODE`
It is used to force the NUMA node to allocate from. This flag is
unimplemented for now because we don't have an implementation of
`alloc_pages_node()` yet.
The DRM TTM code started to use this flag in Linux 6.12.
Reviewed by: bz
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56436
[libcxx][Github] Bump Github Runner to 2.334.0 (#193339)
To stay ahead of the support horizon. Use the same base image to prevent
any differences beyond the runner binary.
[mlir][func] Avoid to create duplicate symbol during conversion (#192342)
`LLVM::lookupOrCreateFn` only checks for an existing `LLVM::LLVMFuncOp`
before creating a new function declaration. When a symbol with the same
name exists as a different op type (e.g., `func.func` that hasn't been
converted to LLVM dialect yet), the function blindly creates a duplicate
`LLVMFuncOp`, which either causes a "redefinition of symbol" error or
silently introduces a renamed symbol (`@free_0`) that won't resolve at
link time.
This happens in practice when user code declares function that is also
used internally by MLIR lowerings. For example, a Fortran `bind(c,
name="free")` declaration produces a `func.func @free` in the IR. When
`memref.dealloc` is lowered (via DeallocOpLowering), it calls
lookupOrCreateFreeFn which calls lookupOrCreateFn — and since the
existing `func.func @free` is not an LLVMFuncOp, a conflicting duplicate
is created.
The fix adds a check in lookupOrCreateFn: before creating a new
[3 lines not shown]
[clang] Suppress glibc C11 extension warning in c-index-test
`c-index-test.c` is still compiled as gnu89 on purpose. That acts as
a useful guard rail: it helps keep the file compatible with older C
dialects instead of silently picking up newer C features because Clang
defaults to a newer language mode.
Ubuntu 26.04 LTS updates glibc's string.h so `strchr`, `strrchr` and
`strstr` are routed through `_Generic`-based macros. When Clang compiles
`c-index-test.c` with `-std=gnu89` and `-pedantic`, that now triggers
`-Wc11-extensions` warnings even though the source itself is not using
C11 features.
Keep the gnu89 check in place and suppress this warning only for Clang
when building c-index-test.
[compiler-rt][profile] Use runtimes-libc-headers in the GPU runtimes build (#192814)
When compiler-rt is built for a GPU target in the same runtimes build
as LLVM-libc, the profile sources `#include <string.h>`, `<limits.h>`,
... Those headers are generated by LLVM-libc for the GPU triple.
A concrete example is the amdgcn runtimes build:
-DLLVM_RUNTIME_TARGETS='default;amdgcn-amd-amdhsa'
-DRUNTIMES_amdgcn-amd-amdhsa_LLVM_ENABLE_RUNTIMES='compiler-rt;libc'
-DRUNTIMES_amdgcn-amd-amdhsa_RUNTIMES_USE_LIBC=llvm-libc
Even though `libc` is configured before `compiler-rt`, both sets of
targets live in the same ninja graph and race each other. Ninja can
start compiling `compiler-rt/lib/profile/InstrProfiling.c` before
LLVM-libc has finished generating its GPU `string.h`, and even when
hdrgen has finished, the profile compile needs `-isystem` pointing at
the generated header tree.
[26 lines not shown]
[SSAF][Analyses] Add an AST visitor for the contribution model (#191933)
Add an AST visitor that respects the contribution model and will be
shared across SSAF analyses.
---------
Co-authored-by: Balázs Benics <benicsbalazs at gmail.com>
[lldb] Directly access object variable in GetObjectPointerValueObject (NFC) (#193120)
The `GetObjectPointerValueObject` function does not need full variable
path expressions, or any of its functionality. This function simply gets
the value of `this` or `self`.
Merge tag 'f2fs-for-7.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs
Pull f2fs updates from Jaegeuk Kim:
"In this round, the changes primarily focus on resolving race
conditions, memory safety issues (UAF), and improving the robustness
of garbage collection (GC), and folio management.
Enhancements:
- add page-order information for large folio reads in iostat
- add defrag_blocks sysfs node
Bug fixes:
- fix uninitialized kobject put in f2fs_init_sysfs()
- disallow setting an extension to both cold and hot
- fix node_cnt race between extent node destroy and writeback
- preserve previous reserve_{blocks,node} value when remount
- freeze GC and discard threads quickly
- fix false alarm of lockdep on cp_global_sem lock
- fix data loss caused by incorrect use of nat_entry flag
[34 lines not shown]
[CIR] Cache isSafeToConvert results to avoid redundant record layout … (#193122)
…walks
CIRGenTypes::isSafeToConvert() walks record layouts to determine whether
a struct can be safely converted to MLIR types. The walk recurses into
field types and re-runs for the same record every time it is asked, so
workloads with many distinct record types (template-heavy code in
particular) repeat substantial work.
Cache the boolean result in a per-CIRGenTypes DenseMap keyed by the
RecordDecl. Lookup becomes O(1) after the first walk per type.
The impact in isolation is modest — on a synthetic stress with many
records and template instantiations, end-to-end compile time on `clang
-fclangir -S -emit-llvm -O0` improves by roughly 2-3% (e.g. 16.59s ->
16.09s on a 67K-LOC input).
Repro shape (scale records and template instantiations into the
[11 lines not shown]
[libunwind] Add SME detection for ZA test on OpenBSD / FreeBSD (#193148)
Follow up to 588451c160c34b888ced1c3d9263d361df22f757 to
add SME detection on OpenBSD and FreeBSD.