| 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
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
| |
Effort: CHERI upstreaming
Reviewed by: kib
Sponsored by: AFRL, DARPA
Pull Request: https://github.com/freebsd/freebsd-src/pull/2068
|
| |
|
|
|
|
|
|
|
|
| |
For now, only define it for x86 architectures.
The DRM generic code started to use it in Linux 6.11.
Reviewed by: bz, emaste
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55734
|
| |
|
|
|
|
|
|
|
|
|
| |
This function was the only one missing in the `get_unaligned_*()`
family. This is going to be used by the imported `linux_siphash.c` in a
future commit, which itself is used by DRM drivers starting from Linux
6.10.
Reviewed by: bz
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D54500
|
| |
|
|
|
|
|
|
|
|
|
| |
... from <asm/topology.h>.
The amdgpu DRM driver started to use `topology_num_cores_per_package()`
in Linux 6.9.
Reviewed by: manu
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D50993
|
| |
|
|
|
|
|
| |
Sponsored by: Serenity Cyber Security, LLC
MFC after: 1 week
Reviewed by: manu
Differential Revision: https://reviews.freebsd.org/D45611
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
set_memory_* is currently implemented using PHYS_TO_DMAP but not all
architectures have a DMAP. Looking at how this function is used the
given address isn't physical but virtual so the PHYS_TO_DMAP call can
simply be removed.
Also cast numpages before shifting it to avoid overflow.
Reviewed by: kib, markj
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D45057
|
| |
|
|
|
|
|
|
|
| |
and initialize it at linuxkpi module load.
Sponsored by: Serenity Cyber Security, LLC
Reviewed by: manu
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D42820
|
| |
|
|
|
|
|
|
| |
Sponsored by: Serenity Cyber Security, LLC
Obtained from: OpenBSD
Reviewed by: manu, bz
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D42802
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Start scaling arrays dynamically instead of using MAXCPU, resulting in
extra allocations on startup but reducing the overall memory footprint.
For the static single CPU mask we provide two versions to further save
memory depending on a low or high CPU count system. The threshold to
switch is currently at 128 CPUs on 64bit platforms.
More detailed comments on the implementations can be found in the code.
If I am not wrong on a MAXCPU=65536 system the memory footprint should
roughly go down from 512M to 1.5M for the static single CPU mask.
Submitted by: olce (most of this final version)
Sponsored by: The FreeBSD Foundation
PR: 274316
Differential Revision: https://reviews.freebsd.org/D42345
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
[Why]
This function takes an offset and a length as argument, not a physical
address and a number of pages.
This misuse caused the `set_memory_*()` and
`arch_io_reserve_memtype_wc()` functions to return EINVAL.
Another problem was the fact that they returned errors as a positive
integer, whereas Linux uses negative integers.
[How]
Physical addresses and number of pages are converted to offset+length in
the `set_memory_*()` functions.
`arch_io_reserve_memtype_wc()` now calls `pmap_change_attr()` directly
instead of using `set_memory_wc()`.
Reviewed by: manu
Approved by: manu
Differential Revision: https://reviews.freebsd.org/D42053
|
| |
|
|
| |
Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
We currently define (Linux) page to (FreeBSD) vm_page.
Cleanup some of the direct struct vm_page and vm_page_t declarations
and usages in the Linux KPI and make them 'struct page' or
'struct page *' to prepare for more upcoming work.
This should be a NOP.
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D41255
|
| |
|
|
|
|
|
|
|
|
| |
Add the two new functions needed by wireless drivers by the same
implementation pattern we did for different sizes.
Sponsored by: The FreeBSD Foundation
MFC after: 10 days
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D40174
|
| |
|
|
|
|
|
|
|
| |
The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch
up to that fact and revert to their recommended match of BSD-2-Clause.
Discussed with: pfg
MFC After: 3 days
Sponsored by: Netflix
|
| |
|
|
|
|
| |
Needed by drm-kmod.
Sponsored by: Beckhoff Automation GmbH & Co. KG
|
| |
|
|
|
|
|
|
|
| |
This new <asm/memtype.h> header is included from <linux/pci.h> because
that's how it is included in Linux too. DRM drivers depend on this.
Reviewed by: manu
Approved by: manu
Differential Revision: https://reviews.freebsd.org/D39052
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
`cpu_data(cpu)` evaluates to a `struct cpuinfo_x86` filled with
attributes of the given CPU number. The CPU number is an index in the
`__cpu_data[]` array with MAXCPU entries. On FreeBSD, we simply
initialize all of them like we do with `boot_cpu_data`.
While here, we add the `x86_model` field to the `struct cpuinfo_x86`. We
use `CPUID_TO_MODEL()` to set it.
At the same time, we fix the value of `x86` which should have been set
to the CPU family. It was using the same implementation as
`CPUID_TO_MODEL()` before. It now uses `CPUID_TO_FAMILY()`.
Reviewed by: manu
Approved by: manu
Differential Revision: https://reviews.freebsd.org/D38542
|
| |
|
|
|
|
|
|
| |
I'm sure I got it wrong but at least the DRM drivers compile.
Reviewed by: manu
Approved by: manu
Differential Revision: https://reviews.freebsd.org/D38157
|
| |
|
|
|
|
|
|
|
|
| |
By (ab)using `atomic_long_add_return()`, `atomic_long_sub()` was making
the atomic long overflow. Indeed the underlying FreeBSD atomic is based
on an unsigned long.
Reviewed by: manu
Approved by: manu
Differential Revision: https://reviews.freebsd.org/D38090
|
| |
|
|
|
| |
Reviewed by: imp, emaste
Differential Revision: https://reviews.freebsd.org/D37945
|
| |
|
|
| |
Differential Revision: https://reviews.freebsd.org/D36966
|
| |
|
|
|
|
| |
Reviewed by: manu
Approved by: manu
Differential Revision: https://reviews.freebsd.org/D36971
|
| |
|
|
|
|
|
| |
It's needed by drm-kmod and this allow building on arm64 and powerpc.
Reported by: jhibbits
Sponsored by: Beckhoff Automation GmbH & Co. KG
|
| |
|
|
|
|
|
|
|
| |
Add virt_to_phys() as a define to vtophys().
This is used by a wireless driver for dma related work; sigh.
MFC after: 3 days
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D37301
|
| |
|
|
|
|
| |
Reviewed by: bz, manu
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D37023
|
| |
|
|
|
|
|
|
|
| |
Also fill the boot_cpu_data struct as drm needs it.
Reviewed by: bz
Obtained from: drm-kmod
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D36107
|
| |
|
|
|
|
|
|
|
| |
Needed by drm-kmod
Reviewed by: bz
Obtained from: drm-kmod
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D36101
|
| |
|
|
|
|
|
| |
Reviewed by: hselasky
Obtained from: drm-kmod
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D36020
|
| |
|
|
|
|
|
|
| |
Needed by drm-kmod
Obtain from: drm-kmod
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D36015
|
| |
|
|
|
|
| |
Reviewed by: hselasky
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D35936
|
| |
|
|
|
|
|
|
| |
Provide functions needed for drm-kmod.
MFC after: 1 week
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D35571
|
| |
|
|
|
|
|
|
|
| |
Provide dummy functions needed for drm-kmod.
Obtain from: OpenBSD (via drm-kmod)
MFC after: 1 week
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D35570
|
| |
|
|
|
|
|
|
| |
This is equivalent to asm/fpu/api.h, but is included by drm on aarch64.
Reviewed by: bz, imp, hselasky
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D35512
|
| |
|
|
|
|
|
|
|
| |
Linux variant of atomic_fetchadd_64.
Reviewed by: bz
MFC after: 2 weeks
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D34296
|
| |
|
|
|
|
|
|
|
| |
Needed by drm-kmod v5.8
Reviewed by: bz
MFC after: 2 weeks
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D34284
|
| |
|
|
|
|
|
|
| |
Add get_unaligned_le16() to asm/unaligned.h needed by a driver.
MFC after: 3 days
Reviewed by: hselasky
Differential Revision: https://reviews.freebsd.org/D34224
|
| |
|
|
|
|
| |
MFC after: 1 week
Reviewed by: bz, emaste, hselasky, manu
Differential Revision: https://reviews.freebsd.org/D33562
|
| |
|
|
|
|
|
|
|
| |
static_cpu_has returns true if CPU supports requested feature.
Obtained from: OpenBSD
MFC after: 1 week
Reviewed by: hselasky, manu
Differential Revision: https://reviews.freebsd.org/D33301
|
| |
|
|
|
|
|
|
| |
for x86 and move them to asm/barrier.h
MFC after: 1 week
Reviewed by: bz, hselasky, manu
Differential Revision: https://reviews.freebsd.org/D33296
|
| |
|
|
|
|
|
|
| |
to reduce number of #ifdefs in drm-kmod
Reviewed by: hselasky
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D32094
|
| |
|
|
|
|
|
|
| |
Reviewed by: kib
Submitted by: greg@unrelenting.technology
Differential Revision: https://reviews.freebsd.org/D29921
MFC after: 1 week
Sponsored by: NVIDIA Networking
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Add a few more le<n>_{tp,add}_cpu*() #defines/functions found in
wireless drivers. While here fill most of the combinatorics gaps
and also add the remaining combinations [1].
Suggested by: emaste [1] (for one part)
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Reviewed by: hselasky
Differential Revision: https://reviews.freebsd.org/D30418
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
We are not aware of any out-of-tree consumers anymore
which would need KPI support for before Linux version 5.
Update the two in-tree consumers to use the new KPI.
This allows us to remove the extra version check and
will also give access to {lower,upper}_32_bits() unconditionally.
Sponsored-by: The FreeBSD Foundation
Reviewed-by: hselasky, rlibby, rstone
MFC-after: 2 weeks
X-MFC: to 13 only
Differential Revision: https://reviews.freebsd.org/D29391
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The upcoming in-kernel implementations for LinuxKPI based on work on
iwlwifi (and other wireless drivers) conflicts in a few places with
the drm-kmod graphics work outside the base system.
In order to transition smoothly extract the conflicting bits.
This included "unaligned" accessor functions, sg_pcopy_from_buffer(),
IS_*() macros (to be further restricted in the future), power management
bits (possibly no longer conflicting with DRM), and other minor changes.
Obtained-from: bz_iwlwifi
Sponsored-by: The FreeBSD Foundation
MFC after: 3 days
Reviewed by: kib, hselasky, manu, bdragon (looked at earlier versions)
Differential Revision: https://reviews.freebsd.org/D26598
|
| |
|
|
|
|
|
|
|
|
|
| |
With newer AMD GPUs (>=Navi,Renoir) there is FPU context usage in the
amdgpu driver.
The `kernel_fpu_begin/end` implementations in drm did not even allow nested
begin-end blocks.
Submitted by: Greg V
Reviewed By: manu, hselasky
Differential Revision: https://reviews.freebsd.org/D28061
|
| |
|
|
|
|
|
|
|
|
|
|
| |
_STANDALONE definition.
No functional change intended.
MFC after: 1 week
Sponsored by: Mellanox Technologies // NVIDIA Networking
Notes:
svn path=/head/; revision=367789
|
| |
|
|
| |
Notes:
svn path=/head/; revision=365080
|