| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
Initializing a variable with itself is undefined, and GCC 14 rightfully
produces a warning about the variable being used (to initialize itself)
prior to initialization. X15 sets the variables to 0 instead, so do the
same in Mach.
Message-ID: <20240327161841.95685-8-bugaevc@gmail.com>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
| |
Not only on x86_64.
Message-ID: <20240327161841.95685-5-bugaevc@gmail.com>
|
|
|
|
|
| |
It's not only x86_64, none of new architectures are going to have it.
Message-ID: <20240327161841.95685-3-bugaevc@gmail.com>
|
|
|
|
| |
Message-ID: <20240309140244.347835-3-luca@orpolo.org>
|
|
|
|
| |
Message-ID: <20240309140244.347835-2-luca@orpolo.org>
|
|
|
|
|
|
| |
Otherwise, it is easy to crash the kernel if userland passes arbitrary port
names.
Message-ID: <ZdriTgNhPsfu7c2M@jupiter.tail36e24.ts.net>
|
|
|
|
| |
so that kern/machine.c can use it
|
|
|
|
|
| |
Fixes assertion errors when LDEBUG is compiled in.
Message-ID: <20240223081404.458062-1-damien@zamaudio.com>
|
|
|
|
|
| |
During quantum adjustment, disable interrupts and call appropriate lock.
Message-ID: <20240223080948.457792-1-damien@zamaudio.com>
|
|
|
|
|
|
| |
This is not needed because cpu_up does this when it comes online,
it calls pset_add_processor().
Message-ID: <20240223080357.457465-1-damien@zamaudio.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>
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
This allows the slave_pset to be used for actual tasks
with the processor_set RPCs.
Message-ID: <20240212053817.1919056-1-damien@zamaudio.com>
|
|
|
|
|
|
|
| |
Like task_set_name, we use the same size as the task name and will
inherit the task name, whenever it exists. This will be used to
implement pthread_setname_np.
Message-ID: <20240212062634.1082207-2-flaviocruz@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
declarations.
I was trying to reuse TASK_NAME_SIZE in kern/thread.h but it was
impossible because files included from kern/task.h end up requiring
kern/thread.h (through percpu.h), creating a recursive dependency.
With this change, mach_types.h only defines forward declarations and
modules have to explicitly include the appropriate header file if they
want to be able touch those structures. Most of the other includes are
required because we no longer grab many different includes through
mach_types.h.
Message-ID: <20240212062634.1082207-1-flaviocruz@gmail.com>
|
|
|
|
| |
It is used for thread_wakeup and alike.
|
|
|
|
|
|
|
| |
This has the effect of running with one cpu only with smp,
but has the ability to enable APs in userspace with the right
processor set RPCs.
Message-ID: <20240211120051.1889789-1-damien@zamaudio.com>
|
|
|
|
| |
Message-ID: <20240211070915.1879676-1-damien@zamaudio.com>
|
|
|
|
|
|
|
| |
We need to check against the actual user size that will be used, not the
current kernel size.
Usually userland uses amply-large reception buffer, but better be exact.
|
| |
|
|
|
|
|
| |
Without a tree, we can still look up by hand in the buffers. This
also allows to find freed objects.
|
|
|
|
| |
This is convenient when tracking buffer overflows
|
|
|
|
|
|
| |
This fixes a page fault when the sampling occurs in MP.
Perhaps it is not MP safe yet.
Message-Id: <20230930063032.75232-4-damien@zamaudio.com>
|
|
|
|
| |
Message-Id: <20230929045936.31535-1-damien@zamaudio.com>
|
|
|
|
| |
Message-Id: <20230925002417.467022-1-damien@zamaudio.com>
|
|
|
|
|
| |
We cannot access cpu_id_lut from the initial AP state, so update the
percpu segment after loading gdt.
|
|
|
|
|
| |
TESTED: As per previous commit
Message-Id: <20230924052824.449219-4-damien@zamaudio.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This speeds up smp again, by storing the struct processor
in a percpu area and avoiding an expensive cpu_number every call
of current_processor(), as well as getting the cpu_number by
an offset into the percpu area. Untested on 64 bit
and work remains to use other percpu arrays.
TESTED: (NCPUS=8) -smp 1 boots to login shell ~2x slower than uniprocessor
TESTED: (NCPUS=8) -smp 2 boots to INIT but hangs there
TESTED: (NCPUS=8) -smp 4 gets stuck seemingly within rumpdisk and hangs
TESTED: (NCPUS=1) uniprocessor is a bit faster than normal
Message-Id: <20230924103428.455966-3-damien@zamaudio.com>
|
|
|
|
|
|
| |
TESTED: on uniprocessor and smp, both behaved as normal.
Message-Id: <20230924103428.455966-2-damien@zamaudio.com>
|
|
|
|
| |
Message-Id: <20230816014835.2322718-6-damien@zamaudio.com>
|
| |
|
|
|
|
| |
Message-Id: <20230816014835.2322718-5-damien@zamaudio.com>
|
|
|
|
|
| |
In case there is no slab for PAGE_SIZE allocations, we can use direct
physical allocation rather than consuming the kernel virtual space.
|
|
|
|
|
| |
Checking the range of addresses for operations on the kernel_pmap is
quite cheap, and allows to catch oddities quite early enough.
|
| |
|
|
|
|
|
| |
That would be refused by kmem_cache_compute_properties later on anyway,
and prevent the kernel from booting at all.
|
| |
|
|
|
|
| |
Message-Id: <20230811083424.2154350-3-damien@zamaudio.com>
|
| |
|
|
|
|
| |
by using simple_lock_irq.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
And pave the way for making the non-_irq variants check that they are
never used within interrupts.
We do have a few places which were missing it, as the following commits will
show.
|
| |
|