summaryrefslogtreecommitdiff
path: root/Kernel
AgeCommit message (Collapse)Author
2022-04-23Kernel+LibC+LibCore: Implement the unlinkat(2) syscallsin-ack
2022-04-22Kernel: Fix typo in Ramdiskb14ckcat
Remove the duplicate/extraneous access specifier.
2022-04-22Kernel/USB: Send correct data for Root Hub Configuration DescriptorJesse Buhagiar
A request of `GET_DESCRIPTOR` should be sending the entire configuration chain, and not just the configuration descriptor.
2022-04-22Kernel/USB: Get all interface descriptors on enumerationJesse Buhagiar
This creates all interfaces when the device is enumerated, with a link to the configuration that it is a part of. As such, a new class, `USBInterface` has been introduced to express this state.
2022-04-22Kernel/USB: Add new `USBHIDDescriptor` typeJesse Buhagiar
2022-04-22Kernel/USB: Add `control_transfer()` function `USB::Device`Jesse Buhagiar
Some other parts of the USB stack may require us to perform a control transfer. Instead of abusing `friend` to expose the default pipe, let's just expose it via a function.
2022-04-22Kernel/USB: Fetch configuration descriptors on enumerationJesse Buhagiar
This also introduces a new class, `USBConfiguration` that stores a configuration. The device, when instructed, sets this configuration and holds a pointer to it so we have a record of what configuration is currently active.
2022-04-21Kernel: Allow sys$bind() on local sockets with short socket addressAndreas Kling
Previously, we required local socket addresses to be exactly sizeof(sockaddr_un). There was no real reason for this, so let's not enforce it.
2022-04-21Kernel: Report AF_UNIX address family when accepting local socketsAndreas Kling
Previously we just wrote the local socket bind path into the sockaddr_un buffer. With this patch, we actually report the family as well.
2022-04-21Kernel: Don't require AnonymousFiles to be mmap'd completelykleines Filmröllchen
AnonymousFile always allocates in multiples of a page size when created with anon_create. This is especially an issue if we use AnonymousFile shared memory to store a shared data structure that isn't exactly a multiple of a page in size. Therefore, we can just allow mmaps of AnonymousFile to map only an initial part of the shared memory. This makes SharedSingleProducerCircularQueue work when it's introduced later.
2022-04-21Kernel: Limit free space between randomized memory allocationsTim Schumacher
2022-04-20Kernel: Take WorkQueue item as reference instead of pointer in do_queueLiav A
2022-04-20Kernel: Allow WorkQueue items allocation failures propagationLiav A
In most cases it's safe to abort the requested operation and go forward, however, in some places it's not clear yet how to handle these failures, therefore, we use the MUST() wrapper to force a kernel panic for now.
2022-04-20Kernel: Move VMWareBackdoor to new directory in the Firmware directoryLiav A
2022-04-18Kernel: Enable PS2 keyboard scan code translation if not already enabledLiav A
On the QEMU microvm machine type, it became apparent that the BIOS was not setting the i8042 controller to function as expected. To ensure that the controller is always outputting correct scan codes, set it to scan code 2 and enable first port translation to ensure all scan codes are translated to scan code set 1. This is the expected behavior when using SeaBIOS, but on qboot (the BIOS for the QEMU microvm machine type), the firmware doesn't take care of this so we need to do this ourselves.
2022-04-12Kernel: Increase the default userspace stack size to 4 MiBTim Schumacher
This makes the main thread stack size the same as the default stack size when creating new threads.
2022-04-12Kernel: Skip setting region name if none is given to mmapTim Schumacher
This keeps us from accidentally overwriting an already set region name, for example when we are mapping a file (as, in this case, the file name is already stored in the region).
2022-04-10Kernel: Use kernel_mapping_base as the minimum kernel stack addressIdan Horowitz
Since KASLR was added kernel_load_base only signifies the address at which the kernel image start, not the start of kernel memory, meaning that a valid kernel stack can be allocated before it in memory. We use kernel_mapping_base, the lowest address covered by the kernel page directory, as the minimal address when performing safety checks during backtrace generation.
2022-04-09Kernel: Remove big lock from sys$mkdirIdan Horowitz
This syscall doesn't access any unprotected shared data.
2022-04-09Kernel: Remove big lock from sys$renameIdan Horowitz
This syscall doesn't access any unprotected shared data.
2022-04-09Kernel: Remove big lock from sys$rmdirIdan Horowitz
This syscall doesn't access any unprotected shared data.
2022-04-09Kernel: Remove big lock from sys$statvfsIdan Horowitz
This syscall doesn't access any unprotected shared data.
2022-04-09Kernel: Remove big lock from sys$symlinkIdan Horowitz
This syscall doesn't access any unprotected shared data.
2022-04-09Kernel: Remove big lock from sys$linkIdan Horowitz
This syscall doesn't access any unprotected shared data.
2022-04-09Kernel: Remove big lock from sys$unlinkIdan Horowitz
This syscall doesn't access any unprotected shared data.
2022-04-09Kernel: Remove big lock from sys$setsockoptIdan Horowitz
This syscall doesn't access any unprotected shared data.
2022-04-09Kernel: Remove big lock from sys$getsockoptIdan Horowitz
This syscall doesn't access any unprotected shared data.
2022-04-09Kernel: Remove big lock from sys$shutdownIdan Horowitz
This syscall doesn't access any unprotected shared data.
2022-04-09Kernel: Remove big lock from sys$connectIdan Horowitz
This syscall doesn't access any unprotected shared data.
2022-04-09Kernel: Remove big lock from sys$closeIdan Horowitz
This syscall doesn't access any unprotected shared data.
2022-04-09Kernel: Remove big lock from sys$chownIdan Horowitz
This syscall doesn't access any unprotected shared data.
2022-04-09Kernel: Remove big lock from sys$fchownIdan Horowitz
This syscall doesn't access any unprotected shared data.
2022-04-09Kernel: Remove big lock from sys$bindIdan Horowitz
This syscall doesn't access any unprotected shared data.
2022-04-09Kernel: Move NNRP<Socket>s instead of copying in queue_connection_fromIdan Horowitz
2022-04-09Kernel: Accept NNRP<Socket> instead of RP<Socket> in release_for_acceptIdan Horowitz
This value is always non-null, so let's make it explicit.
2022-04-09Kernel: Remove big lock from `sys$set_coredump_metadata`Luke Wilde
The only requirement for this syscall is to make Process::m_coredump_properties SpinlockProtected.
2022-04-09Kernel: Remove big lock from `sys$accept4`Jelle Raaijmakers
The only thing we needed to check is whether `socket.accept()` returns a socket, and if not, we go back to blocking again.
2022-04-09Kernel: Verify mutex big lock behaviorJelle Raaijmakers
These two methods are big lock specific, so verify our mutex' behavior.
2022-04-09Kernel: Unblock big lock waiters correctlyJelle Raaijmakers
If the regular exclusive and shared lists were empty (which they always should be for the big lock), we were not unblocking any waiters.
2022-04-08Kernel: Query OS-enabled CPUID features again at the end of cpu_setup()Linus Groh
For OSPKE this is a no-op as we don't enable PKU yet, but the state of the OSXSAVE flag might have changed if we enabled XSAVE.
2022-04-08Kernel: Rename OSPKU CPUID feature flag to OSPKELinus Groh
Unlike "XSAVE enabled by OS" being indicated by the OSXSAVE flag, in this case it's "PKU enabled by OS" being indicated by the OSPKE flag.
2022-04-08Kernel: Adjust includes after file reorganizationTiaan Louw
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.)