| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
Depending on the architecture and setup, it may not be possible to
access user memory directly, for example, due to user mode mappings not
being accessible from kernel mode (x86 SMAP, AArch64 PAN). There are
dedicated machine-specific copyin()/copyout() routines that know how to
access user memory from the kernel; use them.
Message-ID: <20240327161841.95685-6-bugaevc@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This prevents a deadlock in smp where a read lock on the map
is taken in gsync and then the map is locked again inside
vm_map_lookup() but another thread had a pre-existing write lock,
therefore the second read lock blocks.
This is fixed by removing the initial gsync read lock on the map
but keeping the read lock held upon returning from vm_map_lookup().
Co-Authored-By: Sergey Bugaev <bugaevc@gmail.com>
Message-ID: <20240222082410.422869-4-damien@zamaudio.com>
|
|
|
|
|
|
|
|
|
|
|
| |
This adds a parameter called keep_map_locked to vm_map_lookup()
that allows the function to return with the map locked.
This is to prepare for fixing a bug with gsync where the map
is locked twice by mistake.
Co-Authored-By: Sergey Bugaev <bugaevc@gmail.com>
Message-ID: <20240222082410.422869-3-damien@zamaudio.com>
|
|
|
|
|
| |
* kern/gsync.c (temp_mapping): Initialize start address to
VM_MIN_KERNEL_ADDRESS.
|
| |
|
|
|
|
|
| |
* kern/gsync.c (gsync_wait, gsync_wake, gsync_requeue):
Return immediately if task argument is TASK_NULL
|
|
|
|
|
|
|
| |
Agustina relicenced her work.
* kern/gsync.c: Relicence to GPL 2+.
* kern/gsync.h: Relicence to GPL 2+.
|
|
|
|
|
| |
* kern/gsync.c (gsync_wait, gsync_wake, gsync_requeue): Return
KERN_FAILURE when task != current_task().
|
|
|
|
|
|
|
|
|
| |
vm_map_lock_read calls check_simple_locks(), so we need to lock hbp
after taking the vm_map read lock.
* kern/gsync.c (gsync_wait): Call vm_map_lock_read before locking
&hbp->lock.
(gsync_wake): Likewise.
|
|
|
|
| |
* kern/gsync.c (gsync_setup): Declare `i' variable out of for loop.
|
|
* Makefrag.am (libkernel_a_SOURCES): Add kern/gsync.c and kern/gsync.h.
* include/mach/gnumach.defs (gsync_wait, gsync_wake, gsync_requeue): New
routines.
* include/mach/kern_return.h (KERN_TIMEDOUT, KERN_INTERRUPTED): New error
codes.
* kern/gsync.c: New file.
* kern/gsync.h: New file.
* kern/startup.c: Include <kern/gsync.h>
(setup_main): Call gsync_setup.
|