summaryrefslogtreecommitdiff
path: root/Kernel
AgeCommit message (Collapse)Author
2021-06-03Kernel: Make sure outgoing ICMP packets have the correct checksumGunnar Beutner
The internet_checksum() function relies on the buffer - or at least the checksum field - to be all zeroes.
2021-06-03Kernel: Support new lines when doing critical printingLiav A
If we are printing strings in the critical path, handling new lines require us to break abstraction a bit to print new lines. Fixes #7562.
2021-06-03Kernel/Graphics: Remove unused overloaded write methods of ConsoleLiav A
If we happen to print a string, we could use a StringView instead. For now, let's remove them entirely.
2021-06-03Kernel: Fix "sv" being inside of "no-fbdev" instead of outsideLuke
It was previously "no-fbdevsv" when it should be "no-fbdev"sv.
2021-06-03Kernel: Switch ProcessGroup to IntrusiveList from InlineLinkedListBrian Gianforcaro
2021-06-03AK: Allow inlining ref-count functionalityGunnar Beutner
Previously we'd incur the costs for a function call via the PLT even for the most trivial ref-count actions like increasing/decreasing the reference count. By moving the code to the header file we allow the compiler to inline this code into the caller's function.
2021-06-02Kernel: Avoid allocations in the VMObject constructorGunnar Beutner
This avoids allocations in the VMObject constructor. The number of inline elements was determined empirically and covers most common cases including LibC malloc.
2021-06-02Kernel: Add operator delete for KStringGunnar Beutner
This doesn't change anything because our global operator delete also calls kfree() - however instead of relying on this implementation detail this makes this dependency more explicit.
2021-06-02Kernel: Make KString non-copyable and non-movableGunnar Beutner
The user is supposed to hold these in an OwnPtr but bad things would happen if the user takes these out of the OwnPtr so let's make the class non-copyable and non-movable.
2021-06-02Kernel: Fix use-after-free in sys$mremapGunnar Beutner
Now that Region::name() has been changed to return a StringView we can't rely on keeping a copy of the region's name past the region's destruction just by holding a copy of the StringView.
2021-06-01Kernel: Handle OOM of file system in sys$mountBrian Gianforcaro
2021-06-01Kernel: Move ProcFS API towards OOM safetyBrian Gianforcaro
2021-06-01Kernel: Move TmpFS towards OOM safetyBrian Gianforcaro
2021-06-01Kernel: Move DevFS APIs towards OOM safetyBrian Gianforcaro
2021-06-01Kernel: Make AnonymousFile::create API OOM safeBrian Gianforcaro
2021-06-01Kernel: Dont try to register ephemeral TCP ports twicestelar7
2021-05-31Kernel/ACPI: Sprinkle links to the specification all overLuke
The latest version of the ACPI specification (6.4) now has a web version, making it possible to link directly to the relevant sections of the specification. I added links to the stuff that was easy to find. The spec can be found here: https://uefi.org/specs/ACPI/6.4/index.html
2021-05-31Kernel: Rename instances of IO port 0xe9 to BOCHS_DEBUG_PORTNick Miller
2021-05-31Documentation: Add explanation about AHCI lockingLiav A
2021-05-31Kernel: Fix crash when switching to console 5 & 6Sebastian Zaha
The changes in commit 20743e8 removed the s_max_virtual_consoles constant and hardcoded the number of consoles to 4. But in PS2KeyboardDevice the keyboard shortcuts for switching to consoles were hardcoded to 6. I reintroduced the constant and added it in both places.
2021-05-31AK+Kernel: Disallow implicitly lifting pointers to OwnPtr'sAli Mohammad Pur
This doesn't really _fix_ anything, it just gets rid of the API and instead makes the users explicitly use `adopt_own_if_non_null()`.
2021-05-31Kernel: Add KString::must_{..} factory methodsBrian Gianforcaro
There are a bunch of places like drivers which for all intense and purposes can't really fail allocation during boot, and if they do fail we should crash immediately. This change adds `KString::must_create_uninitialized(..)` as well as `KString::must_create(..)` for use during early boot initialization of the Kernel. They enforce that they are only used during early boot.
2021-05-31Kernel: Move CommandLine API to use AK::StringView instead of AK::StringBrian Gianforcaro
The current CommandLine API unfortunately allocates Strings just to query the presence of arguments on the command line. Switch the API to use StringView instead to reduce the number of String allocations.
2021-05-30Kernel: Unnamed regions still need a null-terminator in core dumpsAndreas Kling
Fixes #7595.
2021-05-30Kernel: Don't log profile data before/after the process/thread lifetimeGunnar Beutner
There were a few cases where we could end up logging profiling events before or after the associated process or thread exists in the profile: After enabling profiling we might end up with CPU samples before we had a chance to synthesize process/thread creation events. After a thread exits we would still log associated kmalloc/kfree events. Instead we now just ignore those events.
2021-05-29Everywhere: Sort out superfluous QuickSort.h importsBen Wiederhake
They were sorta unneeded. :^)
2021-05-29Kernel: Ensure that an unveil node with no permission is never acceptedAli Mohammad Pur
Otherwise nodes inheriting from root may still be accessed with `access(..., F_OK)`. Also adds a test case to TestKernelUnveil about this behaviour.
2021-05-29Kernel: Convert Process::get_syscall_path_argument() to KStringAndreas Kling
This API now returns a KResultOr<NonnullOwnPtr<KString>> and allocation failures should be propagated everywhere nicely. :^)
2021-05-29AK: Move RefCountedBase definitions out-of-lineAndreas Kling
This dramatically reduces code size since we no longer inline all these VERIFY() checks everywhere. Appears to be performance neutral.
2021-05-29Kernel: Make sure we free the thread stack on thread exitGunnar Beutner
This adds two new arguments to the thread_exit system call which let a thread unmap an arbitrary VM range on thread exit. LibPthread uses this functionality to unmap the thread stack. Fixes #7267.
2021-05-29Kernel: Move sys$munmap functionality into a helper methodGunnar Beutner
2021-05-29Kernel: Make sure we unmap the TLS region when a thread exitsGunnar Beutner
Previously the TLS region would get leaked which was noticible when creating/destroying a lot of threads and then inspecting the region map.
2021-05-29Kernel/Storage: Enable interrupts for AHCI ports if PHY is not enabledLiav A
This change allows the controller to utilize interrupts even if no device was connected to a port when we initialize it, so we can support hotplug events now.
2021-05-29Kernel/Storage: Remove the None option from AHCI reset policyLiav A
This was proved to be a problematic option. I tested this option on bare metal AHCI controller, and if we didn't reset the controller, the firmware (SeaBIOS) could leave the controller state not clean, so an plugged device signature was in place although the specific port had no plugged device after rebooting. Therefore, we need to ensure we use the controller in a clean state always. In addition to that, the Complete option was renamed to Aggressive, as it represents better the consequences of choosing this option.
2021-05-29Kernel/Storage: Rename the method hba_region => default_hba_regionLiav A
Also, make sure we unmap it after the init process.
2021-05-29Kernel: Don't overrun the buffer in krealloc()Gunnar Beutner
The allocation_size_in_chunks field contains the bytes necessary for the AllocationHeader so we need to subtract that when we try to figure out how much user data we have to copy. Fixes #7549.
2021-05-29Kernel: Make Region creation API OOM safeBrian Gianforcaro
- Make Region::create_kernel_only OOM safe. - Make Region::create_user_accessible mostly OOM safe, there are still some tendrils to untangle before it and be completely fixed.
2021-05-29Kernel: Make PerformanceEventBuffer creation API OOM safeBrian Gianforcaro
2021-05-29Kernel: Make Space::create API OOM safeBrian Gianforcaro
2021-05-29Kernel: Make CoreDump::create API OOM safeBrian Gianforcaro
2021-05-29Kernel: Remove usage of adopt_own in MultiProcessorParserBrian Gianforcaro
2021-05-29Kernel: Remove usage of adopt_own in KStringBrian Gianforcaro
2021-05-29Kernel: Make KBuffer APIs OOM safeBrian Gianforcaro
2021-05-29Kernel: Make ContiguousVMObject factory API OOM safeBrian Gianforcaro
2021-05-29Kernel: Make AnonymousVMObject::clone() API OOM safeBrian Gianforcaro
Propagate allocation failure of m_shared_committed_cow_pages, and uncommit previously committed COW pages on failure. This method needs a closer look in terms of error handling, as we will eventually need to rollback all changes on allocation failure. Alternatively we could allocate the anonymous object much earlier and only initialize it once the other steps have succeeded.
2021-05-29Kernel: Make PrivateInodeVMObject factory APIs OOM safeBrian Gianforcaro
2021-05-28Kernel: Allow building the kernel with -O0Gunnar Beutner
Unfortunately the kernel doesn't run with -O0 but at least it can be successfully built with this change.
2021-05-28Kernel: Don't crash when writing a coredump with an unnamed regionGunnar Beutner
Previously we'd try to call ByteBuffer::append(nullptr, 1) when we came across a VM region that had no name.
2021-05-28Kernel: Rename Custody::create() => try_create()Andreas Kling
The try_ prefix indicates that this may fail. :^)
2021-05-28Kernel: Use a KString for Custody::m_nameAndreas Kling