| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
| |
The new KPI is only used in <asm/set_memory.h>, but it's provided in
linux_page.c. The latter only includes the former indirectly by way of
<linux/io.h>, and that's only conditionally included outside of 32-bit
ARM there.
All of our archs have the necessary pmap_page_set_memattr(), so just
move the declaration into <linux/page.h> instead of trying to reason
about the usability of <asm/set_memory.h> directly in linux_page.c.
Reported by: jenkins (via ivy)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
These calls are used for buddy pages at least in drm's ttm_pool, which
leads to a panic when we invoke lowmem handlers and drm tries to shrink
the pool.
Cope with numpages > 1 by traversing the contiguous pages and executing
the adjustment there, as well, as suggested by markj@. Previous
versions have tried to use the corresponding `set_memory_*()` functions,
but it is believed that not updating `md.pat_mode` breaks subsequent
userspace mappings in ways that may result in things like screen tearing
or other artifacts when running i915kms.
This stabilized my amdgpu laptop running two VMs, chromium and a
concurrent buildworld.
Reviewed by: bz, markj
Differential Revision: https://reviews.freebsd.org/D57004
|
| |
|
|
|
|
| |
Reviewed by: bz
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D56997
|
| |
|
|
|
|
|
| |
Reviewed by: bz
Fixes: c41d83548b6c ("LinuxKPI: pci.h add more defines and functions")
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D57066
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The amdgpu driver in drm-kmod will attempt to update/reserve certain GPU
VRAM ranges as write-combining. Depending on the system, this address
range may fall outside of FreeBSD's constructed DMAP. We cannot use
pmap_change_attr() in this case.
When INVARIANTS is enabled, this results in the following:
panic: physical address 0x880000000 not covered by the DMAP
Add a guard against triggering the KASSERT in PHYS_TO_DMAP().
This limitation in our implementation of arch_io_reserve_memtype_wc() is
already known in drm-kmod's amdgpu_bo_init(), and errors are ignored
there (see "BSDFIXME"). This change is only to eliminate the preventable
assertion failure within this scheme.
Tested by: kevans
Reviewed by: kib, emaste
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56971
|
| |
|
|
|
|
|
|
|
|
| |
Make sleep type names clearer and more consistent, and allow space for
something like "os_hibernate" once that gets added to FreeBSD.
Reviewed by: jaeyoon, olce, markj
Approved by: jaeyoon, olce, markj
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56920
|
| |
|
|
|
|
|
|
|
|
| |
The __maybe_unused attribute should be used for variables which may or
may not be used, such as when their only use is in an assertion. This
attribute is functionally identical to __unused, suppressing compiler
warnings for particular variable if it remains unused.
Reviewed by: Minsoo Choo <minsoo@minsoo.io>, imp
Differential Revision: https://reviews.freebsd.org/D56517
|
| |
|
|
|
|
|
|
|
| |
This fixes an "unused variable" warning when building DRM drivers.
Reviewed by: emaste
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56780
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This macro will return non-zero if there are threads waiting for this
lock; otherwise, it will return zero.
The function assumes (but does not assert) that the caller already holds
the lock and that it is interested in other threads waiting for it to
release the lock.
The motivation to add this is the implementation of
`rwsem_is_contended()` in linuxkpi.
This Linux function indicates the same thing to the caller: if other
threads are waiting for this semaphore.
The amdgpu DRM driver started to use `rwsem_is_contended()` in Linux
6.12.
Reviewed by: bz, olce
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56443
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
They use another set of constants and macros in <asm/intel-family.h>.
All these macros are defined regardless of the architecture, even though
they are specific to x86. Perhaps we should restrict them using #ifdefs.
The amdgpu DRM driver started to used `VFM_MODEL()` and the
`INTEL_*LAKE*` constants in Linux 6.12.x.
Reviewed by: bz, olce
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56585
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
In Linux 7.1, `__copy_from_user_inatomic_nocache()` was renamed to
`copy_from_user_inatomic_nontemporal()`. This change was backported to
several LTS branches.
This includes Linux 6.12.x and the i915 DRM driver started to use it in
that version.
Reviewed by: bz
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56719
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The `DEFINE_XARRAY*()` macros are used to declare a static xarray.
As the structure embeds a mutex(9), we also need to declare the static
mutex after the `struct xarray`. Thus the slightly awkward definition
of `DEFINE_XARRAY_FLAGS()`.
The DRM generic code started to use `DEFINE_XARRAY_ALLOC()` in Linux
6.12.
Reviewed by: bz
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56446
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The `xa_alloc*()` functions family takes a `struct xa_limit` to describe
the range of IDs the caller wants to allocate. We were using a single
mask to qualify a maximum ID only.
This commit changes that to use the same `struct xa_limit`. The logic
did not change, except it now supports a minimum ID as well.
The definition of `XA_LIMIT()` macro is adapted, as well as the
definitions of `xa_limit_*` (only `xa_limit_32b` existed, the other two
are added with this commit).
The DRM generic code started to use this `struct xa_limit` in Linux
6.12.
Reviewed by: bz
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56445
|
| |
|
|
|
|
|
|
| |
Effort: CHERI upstreaming
Suggested by: kib
Reviewed by: kib
Sponsored by: AFRL, DARPA
Pull Request: https://github.com/freebsd/freebsd-src/pull/2068
|
| |
|
|
|
|
|
|
|
|
| |
Add a new PHYS_TO_DMAP_ADDR that still returns an address for use in
places that only need an address and not a pointer.
Effort: CHERI upstreaming
Reviewed by: kib
Sponsored by: AFRL, DARPA
Pull Request: https://github.com/freebsd/freebsd-src/pull/2068
|
| |
|
|
|
|
|
| |
Effort: CHERI upstreaming
Reviewed by: kib
Sponsored by: AFRL, DARPA
Pull Request: https://github.com/freebsd/freebsd-src/pull/2068
|
| |
|
|
|
|
|
| |
Effort: CHERI upstreaming
Reviewed by: kib
Sponsored by: AFRL, DARPA
Pull Request: https://github.com/freebsd/freebsd-src/pull/2068
|
| |
|
|
|
|
|
|
|
| |
This removes the need for several casts to pointer in callers.
Effort: CHERI upstreaming
Reviewed by: kib
Sponsored by: AFRL, DARPA
Pull Request: https://github.com/freebsd/freebsd-src/pull/2068
|
| |
|
|
|
|
|
| |
Effort: CHERI upstreaming
Reviewed by: kib
Sponsored by: AFRL, DARPA
Pull Request: https://github.com/freebsd/freebsd-src/pull/2068
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The seq_file.rst documentation in the Linux kernel documents the
iterator interface for the seq_file structure. In particular, the
ppos passed to seq_read is a logical offset into a seq_file managed by
the iterator interface, not an offset into the generated data. For
example, if a seq_file outputs state for each node in a linked-list or
array, *ppos might be used as the index of the node to output, not a
byte offset.
Rewrite seq_read to honor this contract which fixes a few bugs:
- Treat *ppos as a logical iterator offset that is only updated by the
next callback after outputting a single item via the show method.
- Use a loop to permit outputting descriptions of multiple items if
the user buffer is large enough.
- Always invoke the stop method after terminating the loop to cleanup
any state setup by start (e.g. if start allocated a buffer or
obtained a lock, the stop method is called to cleanup).
While here, implement support for SEQ_SKIP as documented in the Linux
documentation even though it is not currently used in the tree.
Reviewed by: bz
Sponsored by: AFRL, DARPA
Differential Revision: https://reviews.freebsd.org/D55899
|
| |
|
|
|
|
|
|
|
|
| |
It indicates to `alloc_pages()` to allocate the pages from the current
NUMA domain. If it couldn't, it should not retry elsewhere and return
failure.
Reviewed by: bz
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56590
|
| |
|
|
|
|
|
|
|
|
|
|
| |
This flag combines `GFP_KERNEL` and `__GFP_ACCOUNT`. The latter is also
defined in this commit. It is defined as a no-op flag as it is not
implemented.
The DRM generic code started to use it in Linux 6.12.x.
Reviewed by: bz
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56587
|
| |
|
|
|
|
|
|
|
|
| |
`sizeof(*ndev->name)` is `sizeof(char)`, not IFNAMSIZ, so
the interface name was effectively limited to a single byte.
Use `sizeof(ndev->name)` for the `char name[IFNAMSIZ]` member.
Signed-off-by: Weixie Cui <cuiweixie@gmail.com>
Reviewed by: pouria
Pull-Request: https://github.com/freebsd/freebsd-src/pull/2111
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
... from <linux/bitops.h>.
This matches the location on Linux.
<linux/bits.h> is also included from <linux/bitops.h>. Therefore it will
not break anything.
Reviewed by: bz
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56584
|
| |
|
|
|
|
|
|
|
|
|
|
| |
For now, it is an empty stub that always return false. On Linux, it
looks at an internal error state of the device to determine if it is
disconnected.
The amdgpu DRM driver started this in Linux 6.12.x.
Reviewed by: bz
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56582
|
| |
|
|
|
|
|
|
|
|
|
| |
They are macros that return the minimum or maximum values of an array of
integers. They assume that the array contains elements.
The i915 DRM driver started to use `min_array()` in Linux 6.12.x.
Reviewed by: bz
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56583
|
| |
|
|
|
|
|
|
| |
The amdgpu DRM driver started this in Linux 6.12.x.
Reviewed by: bz
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56574
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
The DRM generic code started to import this header directly in Linux
6.12.x. Let's move the definition of `ARRAY_SIZE()` (the only thing that
<linux/array_size.h> defines) to this header.
Also, include <linux/array_size.h> from the same headers as Linux. This
includes <linux/kernel.h>, so the change should not break anything.
Reviewed by: bz
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56570
|
| |
|
|
|
|
|
|
|
|
|
| |
In Linux 6.12, the API changed to be closer to `krealloc()`:
* The function does not take the old size anymore
* The function becomes a wrapper around `krealloc()` with a fallback
mechanism.
Reviewed by: bz
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56453
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
... from <linux/compiler.h>.
<linux/wordpart.h> is the header defining them on Linux 6.12 (I didn't
check older versions).
<linux/wordpart.h> is also included from <linux/kernel.h>.
The DRM generic code started to depend on <linux/wordpart.h> in Linux
6.12.
Reviewed by: bz
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56441
|
| |
|
|
|
|
|
|
|
|
|
| |
It is the same as `rb_add_cached()` but it works on `struct rb_root`, not
a `struc rb_root_cached`. It also does not return anything.
The DRM generic code started to use this in Linux 6.12.x.
Reviewed by: bz
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56577
|
| |
|
|
|
|
|
|
|
|
|
| |
It is the same as `DIV64_U64_ROUND_UP()` but takes a 32-bit integer as
the divisor.
The amdgpu DRM driver started to use this in Linux 6.12.x.
Reviewed by: bz
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56576
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a global variable used to track the state of the system, like
booting, running, halting and so on.
This variable is based on the `enum system_states` enumeration.
For now, always set `system_state` to `SYSTEM_RUNNING`.
The amdgpu DRM driver started to use this in Linux 6.12.x.
Reviewed by: emaste
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56575
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
This function calls `raw_atomic_read_acquire()` which is also added.
They are located in <linux/atomic/*.h> headers, both included from
<linux/atomic.h>.
The amdgpu DRM driver started to use this in Linux 6.12.x.
Reviewed by: bz
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56573
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
They are empty stub returning success for now, like the previously
defined stubs in this header.
Several constant are also defined in the process.
The amdgpu DRM driver started to use them in Linux 6.12.x.
Reviewed by: bz
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56572
|
| |
|
|
|
|
|
|
| |
The amdgpu DRM driver started to use `guard(mutex)` in Linux 6.12.x.
Reviewed by: bz
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56571
|
| |
|
|
|
|
| |
Reviewed by: bz
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56454
|
| |
|
|
|
|
|
|
|
|
|
| |
It is similar to `kmemdup()` but takes a number of elements to duplicate
and their size.
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/D56444
|
| |
|
|
|
|
|
|
|
|
| |
The DRM generic code and the i915 DRM driver started to replace the use
of `memchr_inv()` by a `mem_is_zero()` in Linux 6.12. We reuse the
previous use of `memchr_inv()` to implement `mem_is_zero()`.
Reviewed by: bz
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56442
|
| |
|
|
|
|
|
|
|
|
|
| |
This macro simply returns the `file` field of the `struct fd`.
The DRM generic code and the amdgpu driver started to use it in
Linux 6.12.
Reviewed by: bz
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56440
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The i915 DRM driver started to replace the use of `struct page` by
`struct folio` in its GEM shmem code in Linux 6.12.
linuxkpi were missing a few more functions: `kmap_local_folio()`,
`memcpy_to_folio()` and `offset_in_folio()`. They are equivalent of
their `struct page` counterparts.
One difference is that `kmap_local_folio()` takes an offset argument and
the returned address takes this offset into account.
Reviewed by: bz
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56438
|
| |
|
|
|
|
|
|
|
|
|
|
| |
This structure is used in a modified definition of `struct kmsg_dumper`
field `dump` in Linux 6.12. Therefore this field has two definitions put
behind the values of `LINUXKPI_VERSION`.
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/D56433
|
| |
|
|
|
|
|
|
| |
This matches the API on Linux.
Reviewed by: bz
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56452
|
| |
|
|
|
|
|
|
| |
This matches the API on Linux.
Reviewed by: bz
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56451
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
... 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
|
| |
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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
|