| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Since handlers are call in a thread context we can simply use a workqueue
to emulate those functions.
The DRM code was patched to do that already, having it in linuxkpi allows us
to not patch the upstream code.
Sponsored-by: The FreeBSD Foundation
Reviewed by: hselasky
Differential Revision: https://reviews.freebsd.org/D24859
Notes:
svn path=/head/; revision=361247
|
|
|
|
|
|
|
|
|
|
|
|
| |
pci_dev_present shows if a set of pci ids are present in the system.
It just wraps pci_find_device.
Needed by DRMv5.2
Submitted by: Austing Shafer (ashafer@badland.io)
Differential Revision: https://reviews.freebsd.org/D24796
Notes:
svn path=/head/; revision=361246
|
|
|
|
|
|
|
|
|
|
|
|
| |
The only difference with init_waitqueue_head is that the name and the
lock class key are provided but we don't use those so use init_waitqueue_head
directly.
Sponsored-by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D24861
Notes:
svn path=/head/; revision=361245
|
|
|
|
|
|
|
|
|
|
|
| |
This calculate the offset of the end of the member in the given struct.
Needed by DRM in Linux v5.3
Sponsored-by: The FreeBSD Foudation
Differential Revision: https://reviews.freebsd.org/D24849
Notes:
svn path=/head/; revision=361140
|
|
|
|
|
|
|
|
|
|
|
|
| |
Same as mutex_init, the lock_class_key argument seems to be only used for
debug in Linux, simply ignore it for now.
Needed by DRM in Linux v5.3
Sponsored-by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D24848
Notes:
svn path=/head/; revision=361139
|
|
|
|
|
|
|
|
|
|
|
|
| |
This function decrement the counter and if the result is 0 it acquires
the mutex and returns 1, if not it simply returns 0.
Needed by DRM from Linux v5.3
Sponsored-by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D24847
Notes:
svn path=/head/; revision=361138
|
|
|
|
|
|
|
|
|
| |
Differential Revision: https://reviews.freebsd.org/D24798
MFC after: 1 week
Sponsored by: Mellanox Technologies
Notes:
svn path=/head/; revision=361110
|
|
|
|
|
|
|
|
|
|
| |
This is used in the amdgpu driver from Linux 5.2
Sponsored-by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D24807
Notes:
svn path=/head/; revision=361007
|
|
|
|
|
|
|
|
|
| |
Reviewed by: hselasky, kib
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D24779
Notes:
svn path=/head/; revision=361006
|
|
|
|
|
|
|
|
|
| |
This was missing in r360870
Sponsored-by: The FreeBSD Foundation
Notes:
svn path=/head/; revision=360871
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a simple call to kmallock_array/kfree, therefore include linux/slab.h as
this is where the kmalloc_array/kfree definition is.
Sponsored-by: The FreeBSD Foundation
Reviewed by: hselsasky
Differential Revision: https://reviews.freebsd.org/D24794
Notes:
svn path=/head/; revision=360870
|
|
|
|
|
|
|
|
|
|
|
|
| |
bitmap_copy simply copy the bitmaps, no idea why it exists.
bitmap_andnot is similar to bitmap_and but uses !src2.
Sponsored-by: The FreeBSD Foundation
Reviewed by: hselasky
Differential Revision: https://reviews.freebsd.org/D24782
Notes:
svn path=/head/; revision=360851
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Those function are use to map/unmap io region of a pci device.
Different resource can be mapped depending on the bar so use a
tailq to store them all.
Sponsored-by: The FreeBSD Foundation
Reviewed by: emaste, hselasky
Differential Revision: https://reviews.freebsd.org/D24696
Notes:
svn path=/head/; revision=360787
|
|
|
|
|
|
|
|
|
|
|
|
| |
No need to compute value twice.
No functional change intended.
MFC after: 1 week
Sponsored by: Mellanox Technologies
Notes:
svn path=/head/; revision=360623
|
|
|
|
|
|
|
|
|
|
| |
Differential Revision: https://reviews.freebsd.org/D24611
Submitted by: ashafer_badland.io (Austin Shafer)
MFC after: 1 week
Sponsored by: Mellanox Technologies
Notes:
svn path=/head/; revision=360622
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
"current" from linux_cdev_pager_populate() in the LinuxKPI:
Backtrace:
witness_debugger()
witness_warn()
uma_zalloc_arg()
malloc()
linux_alloc_current()
linux_cdev_pager_populate()
vm_fault()
vm_fault_trap()
trap_pfault()
trap()
calltrap()
Suggested by: avg@
MFC after: 1 week
Sponsored by: Mellanox Technologies
Notes:
svn path=/head/; revision=360621
|
|
|
|
|
|
|
|
|
| |
Submitted by: ashafer_badland.io (Austin Shafer)
MFC after: 1 week
Sponsored by: Mellanox Technologies
Notes:
svn path=/head/; revision=360532
|
|
|
|
|
|
|
|
|
| |
Submitted by: ashafer_badland.io (Austin Shafer)
MFC after: 1 week
Sponsored by: Mellanox Technologies
Notes:
svn path=/head/; revision=360531
|
|
|
|
|
|
|
|
|
| |
Submitted by: ashafer_badland.io (Austin Shafer)
MFC after: 1 week
Sponsored by: Mellanox Technologies
Notes:
svn path=/head/; revision=360530
|
|
|
|
|
|
|
|
|
| |
Submitted by: ashafer_badland.io (Austin Shafer)
MFC after: 1 week
Sponsored by: Mellanox Technologies
Notes:
svn path=/head/; revision=360529
|
|
|
|
|
|
|
|
|
| |
Submitted by: ashafer_badland.io (Austin Shafer)
MFC after: 1 week
Sponsored by: Mellanox Technologies
Notes:
svn path=/head/; revision=360528
|
|
|
|
| |
Notes:
svn path=/head/; revision=360237
|
|
|
|
| |
Notes:
svn path=/head/; revision=360236
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This allows non-LinuxKPI based infiniband device drivers to attach
correctly to ibcore.
No functional change intended.
Reviewed by: np @
Differential Revision: https://reviews.freebsd.org/D24514
MFC after: 1 week
Sponsored by: Mellanox Technologies
Notes:
svn path=/head/; revision=360196
|
|
|
|
|
|
|
|
| |
MFC after: 1 week
Sponsored by: Mellanox Technologies
Notes:
svn path=/head/; revision=360127
|
|
|
|
|
|
|
|
|
|
| |
Makes a difference for 32-bit platforms mostly.
MFC after: 1 week
Sponsored by: Mellanox Technologies
Notes:
svn path=/head/; revision=360119
|
|
|
|
|
|
|
|
| |
MFC after: 1 week
Sponsored by: Mellanox Technologies
Notes:
svn path=/head/; revision=360118
|
|
|
|
|
|
|
|
|
|
| |
No functional change.
MFC after: 1 week
Sponsored by: Mellanox Technologies
Notes:
svn path=/head/; revision=360115
|
|
|
|
|
|
|
|
|
| |
kmem_object has been an alias of kernel_object for a while.
MFC after: 1 week
Notes:
svn path=/head/; revision=360052
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Use AUXARGS_ENTRY_PTR to export these pointers. This is a followup to
r359987 and r359988.
Reviewed by: jhb
Obtained from: CheriBSD
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D24446
Notes:
svn path=/head/; revision=360024
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This simplifies discovery of these values, potentially with reducing the
number of syscalls we need to make at runtime. Longer term, we wish to
convert the startup process to pass an auxargs pointer to _start() and
use that rather than walking off the end of envv. This is cleaner,
more C-friendly, and for systems with strong bounds (e.g. CHERI)
necessary.
Reviewed by: kib
Obtained from: CheriBSD
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D24407
Notes:
svn path=/head/; revision=359988
|
|
|
|
|
|
|
|
|
|
|
| |
This is a prepratory commit for D24407.
Reviewed by: kib
Obtained from: CheriBSD
Sponsored by: DARPA
Notes:
svn path=/head/; revision=359987
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There's no point in pre-checking that we can access the user's rmtp
pointer before we do it in copyout().
While here, improve style(9) compliance.
Reviewed by: imp
MFC after: 1 week
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D24409
Notes:
svn path=/head/; revision=359938
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Copy the CP, PTRIN, etc macros from freebsd32.h into a sys/abi_compat.h
and replace existing definitation with includes where required. This
eliminates duplicate code and allows Linux and FreeBSD compatability
headers to be included in the same files.
Input from: cem, jhb
Obtained from: CheriBSD
MFC after: 2 weeks
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D24275
Notes:
svn path=/head/; revision=359937
|
|
|
|
| |
Notes:
svn path=/head/; revision=359931
|
|
|
|
|
|
|
|
|
|
|
| |
Include a temporarily compatibility shim as well for kernels predating
close_range, since closefrom is used in some critical areas.
Reviewed by: markj (previous version), kib
Differential Revision: https://reviews.freebsd.org/D24399
Notes:
svn path=/head/; revision=359930
|
|
|
|
| |
Notes:
svn path=/head/; revision=359837
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
close_range(min, max, flags) allows for a range of descriptors to be
closed. The Python folk have indicated that they would much prefer this
interface to closefrom(2), as the case may be that they/someone have special
fds dup'd to higher in the range and they can't necessarily closefrom(min)
because they don't want to hit the upper range, but relocating them to lower
isn't necessarily feasible.
sys_closefrom has been rewritten to use kern_close_range() using ~0U to
indicate closing to the end of the range. This was chosen rather than
requiring callers of kern_close_range() to hold FILEDESC_SLOCK across the
call to kern_close_range for simplicity.
The flags argument of close_range(2) is currently unused, so any flags set
is currently EINVAL. It was added to the interface in Linux so that future
flags could be added for, e.g., "halt on first error" and things of this
nature.
This patch is based on a syscall of the same design that is expected to be
merged into Linux.
Reviewed by: kib, markj, vangyzen (all slightly earlier revisions)
Differential Revision: https://reviews.freebsd.org/D21627
Notes:
svn path=/head/; revision=359836
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
in the LinuxKPI.
This allows synchronize RCU to be used inside a SRCU read section.
No functional change intended.
Bump the __FreeBSD_version to force recompilation of external kernel modules.
PR: 242272
MFC after: 1 week
Sponsored by: Mellanox Technologies
Notes:
svn path=/head/; revision=359727
|
|
|
|
|
|
|
|
|
|
|
| |
- Make sure to use READ_ONCE() when deferring variables.
- Remove superfluous zero initializer.
MFC after: 1 week
Sponsored by: Mellanox Technologies
Notes:
svn path=/head/; revision=359726
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Modern debuggers and process tracers use ptrace() rather than procfs
for debugging. ptrace() has a supserset of functionality available
via procfs and new debugging features are only added to ptrace().
While the two debugging services share some fields in struct proc,
they each use dedicated fields and separate code. This results in
extra complexity to support a feature that hasn't been enabled in the
default install for several years.
PR: 244939 (exp-run)
Reviewed by: kib, mjg (earlier version)
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D23837
Notes:
svn path=/head/; revision=359530
|
|
|
|
|
|
|
| |
Sponsored by: The FreeBSD Foundation
Notes:
svn path=/head/; revision=359332
|
|
|
|
|
|
|
|
|
|
|
|
| |
pci_iov_if.h was added to pci.h, but none of the kms-drm branches have
that. Rather than play whack a mole with the branches, move its inclusion to
linux_pci.c which is the only part of the code that needs it now.
Longer term, other solutions will be needed, but this gives us time to get those
deployed on all the supported versions.
Notes:
svn path=/head/; revision=359165
|
|
|
|
|
|
|
|
|
|
|
| |
pci_driver methods.
Reviewed by: hselasky
Sponsored by: Mellanox Technologies
MFC after: 2 weeks
Notes:
svn path=/head/; revision=359096
|
|
|
|
|
|
|
|
|
|
| |
linux_libusb upgrade.
MFC after: 3 days
Sponsored by: Mellanox Technologies
Notes:
svn path=/head/; revision=358838
|
|
|
|
|
|
|
|
|
|
| |
only defined by linux_common kernel module and not both linux and linux64
modules.
Reported by: Yuri Pankov <ypankov@fastmail.com>
Notes:
svn path=/head/; revision=358673
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This presents an extensible interface to the generic mmap(2)
implementation via a struct pointer intended to use a designated
initializer or compount literal. We take advantage of the mandatory
zeroing of fields not listed in the initializer.
Remove kern_mmap_fpcheck() and use kern_mmap_req().
The motivation for this change is a desire to keep the core
implementation from growing an ever-increasing number of arguments
that must be specified in the correct order for the lowest-level
implementations. In CheriBSD we have already added two more arguments.
Reviewed by: kib
Discussed with: kevans
Obtained from: CheriBSD
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D23164
Notes:
svn path=/head/; revision=358650
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
resource leakage when destroying a LinuxKPI character device.
Submitted by: Andrew Boyer <aboyer@pensando.io>
Reviewed by: kib@
PR: 244572
MFC after: 1 week
Sponsored by: Mellanox Technologies
Notes:
svn path=/head/; revision=358586
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The new structure is copy-on-write. With the assumption that path lookups are
significantly more frequent than chdirs and chrooting this is a win.
This provides stable root and jail root vnodes without the need to reference
them on lookup, which in turn means less work on globally shared structures.
Note this also happens to fix a bug where jail vnode was never referenced,
meaning subsequent access on lookup could run into use-after-free.
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D23884
Notes:
svn path=/head/; revision=358503
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
On Linux the valid range of priorities for the SCHED_FIFO and SCHED_RR
scheduling policies is [1,99]. For SCHED_OTHER the single valid priority is
0. On FreeBSD it is [0,31] for all policies. Programs are supposed to
query the valid range using sched_get_priority_(min|max), but of course some
programs assume the Linux values are valid.
This commit adds a tunable compat.linux.map_sched_prio. When enabled
sched_get_priority_(min|max) return the Linux values and sched_setscheduler
and sched_(get|set)param translate between FreeBSD and Linux values.
Because there are more Linux levels than FreeBSD levels, multiple Linux
levels map to a single FreeBSD level, which means pre-emption might not
happen as it does on Linux, so the tunable allows to disable this behaviour.
It is enabled by default because I think it is unlikely that anyone runs
real-time software under Linux emulation on FreeBSD that critically relies
on correct pre-emption.
This fixes FMOD, a commercial sound library used by several games.
PR: 240043
Tested by: Alex S <iwtcex@gmail.com>
Reviewed by: dchagin
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D23790
Notes:
svn path=/head/; revision=358483
|