summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2023-04-04Kernel: Mark inode watcher syscalls as not needing the big lockAndreas Kling
These syscalls are already protected by existing locking mechanisms, including the mutex inside InodeWatcher.
2023-04-04Kernel: Mark sys$killpg as not needing the big lockAndreas Kling
Same as sys$kill, nothing here that isn't already protected by existing locks.
2023-04-04Kernel: Mark sys$kill as not needing the big lockAndreas Kling
This syscall sends a signal to other threads or itself. This mechanism is already guarded by locking mechanisms, and widely used within the kernel without help from the big lock.
2023-04-04Kernel: Remove ancient InterruptDisablers in the kill/killpg syscallsAndreas Kling
These are artifacts from the pre-SMP times.
2023-04-04Kernel: Mark sys$getrusage as not needing the big lockAndreas Kling
Same deal as sys$times, nothing here that needs locking at the moment.
2023-04-04Kernel: Make the getsockname/getpeername syscall helper a bit nicerAndreas Kling
Instead of templatizing on a bool parameter, use an enum for clarity.
2023-04-04Kernel: Make sys$times not use the big lockAndreas Kling
...and also make the Process tick counters clock_t instead of u32. It seems harmless to get interrupted in the middle of reading these counters and reporting slightly fewer ticks in some category.
2023-04-04Kernel+Userland: Make some of the POSIX types largerAndreas Kling
Expand the following types from 32-bit to 64-bit: - blkcnt_t - blksize_t - dev_t - nlink_t - suseconds_t - clock_t This matches their size on other 64-bit systems.
2023-04-04Kernel: Mark sys$umask as not needing the big lockAndreas Kling
The body of this syscall is already serialized by calling with_mutable_protected_data().
2023-04-04Kernel: Mark sys$sigtimedwait as not needing the big lockAndreas Kling
Yet another syscall that only messes with the current thread.
2023-04-04Kernel: Mark sys$sigpending as not needing the big lockAndreas Kling
Another one that only touches the current thread.
2023-04-04Kernel: Mark sys$sigprocmask as not needing the big lockAndreas Kling
Another one that only messes with the current thread.
2023-04-04Kernel: Mark sys$sigsuspend as not needing the big lockAndreas Kling
This syscall is only concerned with the current thread.
2023-04-04Kernel: Mark sys$sigreturn as not needing the big lockAndreas Kling
This syscall is only concerned with the current thread (except in the case of a pledge violation, when it will add some details about that to the process coredump metadata. That stuff is already serialized.)
2023-04-04Kernel: Mark sys$open as not needing the big lockAndreas Kling
All the individual sub-operations of this syscall are protected by their own locking mechanisms, so it should be okay to get it off the big lock.
2023-04-04Kernel: Use custody_for_dirfd() in more syscallsAndreas Kling
This simplifies a lot of syscalls, some of which were doing very unnecessarily verbose things instead of calling this.
2023-04-04Kernel: Make custody_for_dirfd() fail on files other than directoriesAndreas Kling
2023-04-04Kernel: Make sys$getsid not require the big lockAndreas Kling
Reorganize the code slightly to avoid creating a TOCTOU bug, then mark the syscall as not needing the big lock anymore.
2023-04-04Kernel: Mark sys$getpgrp as not needing the big lockAndreas Kling
Access to the process's process group is already serialized by SpinlockProtected.
2023-04-04Kernel: Mark sys$getpgid as not needing the big lockAndreas Kling
Access to the process's process group is already serialized by SpinlockProtected.
2023-04-04Kernel: Mark sys$fcntl as not needing the big lockAndreas Kling
This syscall operates on the file descriptor table, and on individual open file descriptions. Both of those are already protected by scoped locking mechanisms.
2023-04-04Kernel: Make sys$disown not require the big lockAndreas Kling
This syscall had a TOCTOU where it checked the peer's PPID before locking the protected data (where the PPID is stored). After closing the race window, we can mark the syscall as not needing the big lock.
2023-04-04Kernel: Mark sys$alarm as not needing the big lockAndreas Kling
Access to Process::m_alarm_timer is serialized via SpinlockProtected, so there's no longer need for this syscall to use the big lock.
2023-04-04Kernel: Stop using *LockRefPtr for Kernel::TimerAndreas Kling
2023-04-04Kernel: Stop using *LockRefPtr for ProcessGroupAndreas Kling
Had to wrap Process::m_pg in a SpinlockProtected for this to be safe.
2023-04-04Kernel: Don't ref/unref the holder thread in MutexAndreas Kling
There was a whole bunch of ref counting churn coming from Mutex, which had a RefPtr<Thread> m_holder to (mostly) point at the thread holding the mutex. Since we never actually dereference the m_holder value, but only use it for identity checks against thread pointers, we can store it as an uintptr_t and skip the ref counting entirely. Threads can't die while holding a mutex anyway, so there's no risk of them going missing on us.
2023-04-04Kernel: Stop using *LockRefPtr for ThreadAndreas Kling
These were stored in a bunch of places. The main one that's a bit iffy is the Mutex::m_holder one, which I'm going to simplify in a subsequent commit. In Plan9FS and WorkQueue, we can't make the NNRPs const due to initialization order problems. That's probably doable with further cleanup, but left as an exercise for our future selves. Before starting this, I expected the thread blockers to be a problem, but as it turns out they were super straightforward (for once!) as they don't mutate the thread after initiating a block, so they can just use simple const-ified NNRPs.
2023-04-04Kernel: Simplify Process factory functionsAndreas Kling
- Instead of taking the first new thread as an out-parameter, we now bundle the process and its first thread in a struct and use that as the return value. - Make all Process factory functions return ErrorOr. Use this to convert some places to more TRY(). - Drop the "try_" prefix on Process factory functions.
2023-04-04Kernel: Stop using *LockRefPtr for Process pointersAndreas Kling
The only persistent one of these was Thread::m_process and that never changes after initialization. Make it const to enforce this and switch everything over to RefPtr & NonnullRefPtr.
2023-04-04Kernel: Simplify Mount internalsAndreas Kling
- The host custody never changes after initialization, so there's no need to protect it with a spinlock. - To enforce the fact that some members don't change after initialization, make them const.
2023-04-04Kernel: Stop using *LockRefPtr for FileSystem pointersAndreas Kling
There was only one permanent storage location for these: as a member in the Mount class. That member is never modified after Mount initialization, so we don't need to worry about races there.
2023-04-04Kernel/aarch64: Implement `Processor::time_spent_idle()`Caoimhe
2023-04-03Kernel: Merge x86_64 and aarch64 init.cpp filesTimon Kruiper
2023-04-03Kernel: Move deferred call code into separate DeferredCallPool classTimon Kruiper
This allows us to share this code between the x86_64 and aarch64 build.
2023-04-03Kernel/aarch64: Correctly implement Processor::leave_criticalTimon Kruiper
2023-04-03Kernel/Graphics: Only search for PCI graphics cards on x86_64Timon Kruiper
This is for the upcoming commit that merges the x86_64 and aarch64 init.cpp files.
2023-04-03Kernel/aarch64: Move query_firmware_version into RPi::MailboxTimon Kruiper
This is for the upcoming commit that merges the x86_64 and aarch64 init.cpp files.
2023-04-03Kernel/aarch64: Move logo drawing and initializing into RPi::FramebufferTimon Kruiper
This is for a upcoming commit that merges the x86_64 and aarch64 init.cpp files.
2023-04-03Kernel: Disable interrupts for aarch64 in WorkQueue's main loopTimon Kruiper
This code expects to be executed with interrupts disabled, however we currently spawn (kernel) threads with interrupts enabled on aarch64.
2023-04-03Kernel/aarch64: Rename Processor::install to Processor::early_initializeTimon Kruiper
Also pass the cpu number to Processor::initialize. This way the init code can be shared between the x86_64 and aarch64 build.
2023-04-03LibGUI+CertificateSettings: Use custom SortingProxyFabian Dellwing
The default SortingProxyModel does not allow to react to reodering. As we would like to keep the column width on sorting, we create a subclass and inject our code into the sorting method.
2023-04-03CertificateSettings: Add export functionalityFabian Dellwing
2023-04-03LibCrypto: Add PEM encoderFabian Dellwing
This commit adds a new method to create a PEM encoded ASN1 from its DER variant.
2023-04-03CertificateSettings: Add import functionalityFabian Dellwing
2023-04-03CertificateSettings: Create basic Cert Store applicationFabian Dellwing
This commit adds a new application named CertificateSettings that houses our Cert Store. It should be expanded in the future.
2023-04-03LibTLS: Refactor CA loading into central functionFabian Dellwing
2023-04-03Toolchain+Meta: Support kernel debugging with host AArch64 GDBDaniel Bertalan
Previously, we would unconditionally build GDB from source for the AArch64 toolchain. This commit makes it possible to use the system's `gdb` binary if it supports the architecture, or `aarch64-elf-gdb` if such a package is installed. An `aarch64-elf-gdb` package will be available through Homebrew once this PR is merged: https://github.com/Homebrew/homebrew-core/pull/127323
2023-04-03LibTest: Don't output information on tests if none existLucas CHOLLET
2023-04-03Tests: Add benchmarks for `JPEGLoader`Lucas CHOLLET
I'm the author of the image.
2023-04-03Spreadsheet: Propagate errors from SpreadsheetWidget::initialize_menubarSam Atkins