summaryrefslogtreecommitdiff
path: root/Kernel
AgeCommit message (Collapse)Author
2022-04-06Kernel: Track big lock blocked threads in separate listJelle Raaijmakers
When we lock a mutex, eventually `Thread::block` is invoked which could in turn invoke `Process::big_lock().restore_exclusive_lock()`. This would then try to add the current thread to a different blocked thread list then the one in use for the original mutex being locked, and because it's an intrusive list, the thread is removed from its original list during the `.append()`. When the original mutex eventually unblocks, we no longer have the thread in the intrusive blocked threads list and we panic. Solve this by making the big lock mutex special and giving it its own blocked thread list. Because the process big lock is temporary and is being actively removed from e.g. syscalls, it's a matter of time before we can also remove the fix introduced by this commit. Fixes issue #9401.
2022-04-06Kernel: Improve the aarch64 kernel source files disk layoutJames Mintram
2022-04-05Kernel: Make sys$mmap() round requested VM size to page size multipleAndreas Kling
This fixes an issue where File::mmap() overrides would fail because they were expecting to be called with a size evenly divisible by PAGE_SIZE.
2022-04-05Kernel: Protect Mutex's thread lists with a spinlockAndreas Kling
2022-04-05Kernel: Don't unregister Region from RegionTree *before* unmapping itAndreas Kling
If we unregister from the RegionTree before unmapping, there's a race where a new region can get inserted at the same address that we're about to unmap. If this happens, ~Region() will then unmap the newly inserted region, which now finds itself with cleared-out page table entries.
2022-04-05Kernel: Remove MemoryManager::region_tree() accessorAndreas Kling
Let's not have a way to grab at the RegionTree from outside of MM.
2022-04-05Kernel: Move allocate_unbacked_region_anywhere() to MemoryManagerAndreas Kling
This didn't need to be in RegionTree, and since it's specific to kernel VM anyway, let's move it to MemoryManager.
2022-04-05Kernel: Move create_identity_mapped_region() to MemoryManagerAndreas Kling
This had no business being in RegionTree, since RegionTree doesn't track identity-mapped regions anyway. (We allow *any* address to be identity mapped, not just the ones that are part of the RegionTree's range.)
2022-04-05Kernel: Add RegionTree::find_region_containing(address or range)Andreas Kling
Let's encapsulate looking up regions so clients don't have to dig into RegionTree internals.
2022-04-05Kernel: Add RegionTree::remove(Region&)Andreas Kling
This allows clients to remove a region from the tree without reaching into the RegionTree internals.
2022-04-05Kernel: Take the RegionTree spinlock when inspecting tree from outsideAndreas Kling
This patch adds RegionTree::get_lock() which exposes the internal lock inside RegionTree. We can then lock it from the outside when doing lookups or traversal. This solution is not very beautiful, we should find a way to protect this data with SpinlockProtected or something similar. This is a stopgap patch to try and fix the currently flaky CI.
2022-04-05Kernel: Remove unused ShouldDeallocateVirtualRange parametersAndreas Kling
Since there is no separate virtual range allocator anymore, this is no longer used for anything.
2022-04-04Kernel: Add VERIFY_NOT_REACHED to aarch64 PageDirectory.cppJames Mintram
2022-04-04Kernel: Add VERIFY_NOT_REACHED to aarch64 locking functionsJames Mintram
2022-04-04Kernel: Add VERIFY_NOT_REACHED to the aarch64 handle_crash functionJames Mintram
2022-04-04Kernel: Remove unused dummy function from dummy.cppJames Mintram
2022-04-04Kernel: Add VERIFY_NOT_REACHED to stub functions in aarch64 dummy.cppJames Mintram
2022-04-04Kernel: Add VERIFY_NOT_REACHED to stub aarch64 Processor functionsJames Mintram
2022-04-04Kernel: Print out assertion info in __assertion_failed on aarch64James Mintram
2022-04-04Kernel: Add debug logging to learn more about unexpected NP faultsAndreas Kling
2022-04-04Kernel: Remove unused Region::try_create_kernel_only()Andreas Kling
2022-04-04Kernel: Tweak broken dbgln_if() in sys$fork() after RegionTree changesAndreas Kling
2022-04-04Kernel: Mark sys$adjtime() as not needing the big lockAndreas Kling
This syscall works on global kernel state and so doesn't need protection from threads in the same process.
2022-04-04Kernel: Mark sys$clock_settime() as not needing the big logAndreas Kling
This syscall ends up disabling interrupts while changing the time, and the clock is a global resource anyway, so preventing threads in the same process from running wouldn't solve anything.
2022-04-04Kernel: Mark sys$sched_{set,get}param() as not needing the big lockAndreas Kling
Both of these syscalls take the scheduler lock while accessing the thread priority, so there's no reliance on the process big lock.
2022-04-04Kernel: Randomize non-specific VM allocations done by sys$execve()Andreas Kling
Stuff like TLS regions, main thread stacks, etc. All deserve to be randomized unless the ELF requires specific placement. :^)
2022-04-03Kernel: Fix aarch64 kernel build on case sensitive file systemsBrian Gianforcaro
The dummy file has the wrong case, so it would fail to be found on case sensitive file systems.
2022-04-04Kernel: Use the InstrusiveRedBlackTree::begin_from(V&) APIIdan Horowitz
This let's us skip an O(logn) tree traversal.
2022-04-04Kernel: Remove false condition in RegionTree::allocate_range_specificIdan Horowitz
Since find_largest_not_above returns the highest region that is below the end of the request range, no region after it can intersect with it.
2022-04-04Kernel: Add RegionTree and remove VirtualRangeAllocator from aarch64James Mintram
2022-04-03Kernel: Actually fix accidental overlaps in allocate_range_specific()Andreas Kling
Thanks to Idan for spotting this! :^)
2022-04-03Kernel: Add kmalloc.cpp to aarch64James Mintram
2022-04-03Kernel: Convert ProcessorInfo::build_brand_string() to StringBuilderLinus Groh
2022-04-03Kernel: Add hypervisor_vendor_id entry to /proc/cpuinfoLinus Groh
2022-04-03Kernel+SystemMonitor+lscpu: Rename 'CPUID' -> 'Vendor ID'Linus Groh
This is what the Intel manual, as well as Linux's cpuinfo calls it.
2022-04-03Kernel: Remove EBX, ECX, and EDX values from hypervisor dmesgln()Linus Groh
2022-04-03Kernel: Move hypervisor vendor ID string to ProcessorInfoLinus Groh
This will make it possible to expose it in /proc/cpuinfo. :^)
2022-04-03Kernel: Make ProcessorInfo::build_foo_string() privateLinus Groh
2022-04-03Kernel: Move feature string building to ProcessorInfoLinus Groh
Other than a dmesgln(), ProcessorInfo is the only user of this function and is already responsible for building other CPUID-related strings.
2022-04-03Kernel: Rename some ProcessorInfo members to match Intel manualLinus Groh
Let's use terminology from the the Intel manual to avoid confusion. Also add `_string` suffixes to better distinguish the numeric values from the string values.
2022-04-03Kernel: Move private ProcessorInfo members to the endLinus Groh
2022-04-03Kernel: Fix accidental overlaps in RegionTree::allocate_range_specific()Andreas Kling
Thanks to Idan for spotting this! :^)
2022-04-03Kernel: Mark sys$listen() as not needing the big lockAndreas Kling
This syscall already performs the necessary locking and so doesn't need to rely on the process big lock.
2022-04-03Kernel: Don't hog file descriptor table lock in sys$bind()Andreas Kling
We don't need to hold the lock across the entire syscall. Once we've fetched the open file description we're interested in, we can let go.
2022-04-03Kernel: Don't hog file descriptor table lock in sys$listen()Andreas Kling
We don't need to hold the lock across the entire syscall. Once we've fetched the open file description we're interested in, we can let go.
2022-04-03Kernel: Mark sys$sendfd() and sys$recvfd() as not needing the big lockAndreas Kling
These syscalls already perform the necessary locking and don't rely on the process big lock.
2022-04-03Kenrel: Update a dmesgln() to say "RegionTree" instead of old class nameAndreas Kling
2022-04-03Kernel: Add a little explainer comment above RegionTreeAndreas Kling
2022-04-03Kernel: Improve RegionTree's internal helper function namesAndreas Kling
It's a bit nicer if functions that allocate ranges have some kind of name that includes both "allocate" and "range". :^)
2022-04-03Kernel: Add missing include to PageDirectory.hAndreas Kling