| 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>
|
|
|
|
|
| |
Not only on x86_64.
Message-ID: <20240327161841.95685-5-bugaevc@gmail.com>
|
|
|
|
| |
Message-ID: <20240327161841.95685-4-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>
|
|
|
|
|
|
|
|
| |
Is _IO{,R,W,WR} macros conflict with the glibc-provided macros and bring
confusion as to what is supposed to be the right definition.
There is currently no user of it anyway, the Hurd console driver has its
own copy.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
faster RPCs.
This is a follow up to
https://git.savannah.gnu.org/cgit/hurd/gnumach.git/commit/?id=69620634858b2992e1a362e33c95d9a8ee57bce7
where we made inlined ports 8 bytes long to avoid resizing.
The last thing that copy{in,out}msg were doing was just updating
msgt_size field since that's required for kernel stub code and implicitly
assumed by IPC code. This was moved into ipc_kmsg_copy{in,out}_body.
For a 32 bit userland, the code also stops updating
msgt_size for out of line ports, same as the 64 bit userland.
Message-ID: <ZdQxWNSieTHcpM1b@jupiter.tail36e24.ts.net>
|
|
|
|
| |
Message-ID: <20240309140244.347835-3-luca@orpolo.org>
|
|
|
|
| |
Message-ID: <20240309140244.347835-2-luca@orpolo.org>
|
|
|
|
|
|
| |
This allows 32on64 to work again. Also, it's a clearer indication of a
missing part.
Message-ID: <20240309140244.347835-1-luca@orpolo.org>
|
|
|
|
| |
Otherwise the types in linux/dev/include/linux/skbuff.h are unknown.
|
|
|
|
|
|
|
|
|
| |
non-pageable
Otherwise, if the allocated memory is passed over for returning data such as
in device_read, we end up with
../vm/vm_map.c:4245: vm_map_copyin_page_list: Assertion `src_entry->wired_count > 0' failed.Debugger invoked: assertion failure
|
|
|
|
|
|
|
| |
x86_64 ignores the segmentation limit, so we have to check it by hand
when accessing userland pointers.
Reported-by: Sergey Bugaev <bugaevc@gmail.com>
|
|
|
|
|
|
|
|
|
|
| |
We should only set USER
- for user processes maps
- for 32bit Xen support
This was not actually posing problem since in 32bit segmentation
protects us, and in 64bit the l4 entry for the kernel is already set.
But better be safe than sorry.
|
|
|
|
|
|
| |
If userland passes a kernel pointer, it's not a page fault that we get,
but a general protection fault. We also want to go through the recovery
in that case, to make e.g. copyin/out return an error.
|
|
|
|
|
|
| |
Otherwise, it is easy to crash the kernel if userland passes arbitrary port
names.
Message-ID: <ZdriTgNhPsfu7c2M@jupiter.tail36e24.ts.net>
|
|
|
|
|
|
| |
This will prevent calling vm_map_delete without the map locked
unless ref_count is zero.
Message-ID: <20240223081505.458240-1-damien@zamaudio.com>
|
|
|
|
| |
Suggested-by: Damien Zammit <damien@zamaudio.com>
|
|
|
|
| |
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>
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
The cpu number is already in edx register, so use that.
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
| |
This is only enabled when NCPUS > 1.
Enables some code paths that allows userspace to manage cpu resources via
processor set RPCs.
Message-ID: <20240211120023.1889731-1-damien@zamaudio.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: <20240211115958.1889648-1-damien@zamaudio.com>
|
|
|
|
| |
Message-ID: <20240211070915.1879676-1-damien@zamaudio.com>
|
| |
|
|
|
|
| |
Message-ID: <20240209021108.1715770-1-damien@zamaudio.com>
|
|
|
|
|
|
| |
TESTED: works in qemu
TESTED: works hardware with AMD cpu
Message-ID: <20240207050158.1640853-5-damien@zamaudio.com>
|
|
|
|
|
| |
vm_page_grab_contig does not necessarily allocate at the beginning of
the DMA segment, so rather allocate by hand very early.
|
|
|
|
|
| |
Make sure to fetch capabilities from cpuid(0xd,0x1)
Message-ID: <20240208165015.4700-3-valentio@free.fr>
|
|
|
|
|
| |
This reverts commit f8d0f98e80b3d7d9b24fa077818113fb0f4b3970.
Message-ID: <20240208165015.4700-2-valentio@free.fr>
|
|
|
|
|
|
|
| |
NB: Every x86 board that uses ACPI most likely has a HPET since 2005.
We can roll back to PIT in the cases where its not present,
but the PIT one shot code is definitely currently broken.
Message-ID: <20240207050158.1640853-4-damien@zamaudio.com>
|
|
|
|
|
|
|
| |
TESTED: This works in qemu correctly
TESTED: This works on an AMD board with ACPI v2.0 correctly
Message-ID: <20240207050158.1640853-3-damien@zamaudio.com>
|
|
|
|
|
|
|
| |
This initializes the lapic without
turning on the IOAPIC interrupts during SMP init.
Message-ID: <20240207050158.1640853-2-damien@zamaudio.com>
|
|
|
|
|
|
| |
self-modifying code is generally frowned upon, Intel largely says the
support is model-dependent. We can as well just relocate from the C
code like we did for the temporary gdt.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This took some time to figure out.
Involves a hand-crafted 16 bit assembly instruction [1]
because it requires an immediate for the memory address
of far jump. This required self-modifying code
to inject the next instruction, therefore I added a near
jump to clear the instruction cache queue in case the pipeline
cached the unmodified jump location.
[1] Intel Architecture Software Developer's Manual,
Volume 2: Instruction Set Reference Manual
|