Commit Graph

1129 Commits

Author SHA1 Message Date
Andreas Kling
1101994fad Kernel: Wrap ISO9660FS directory traversal in TRY() 2021-09-06 20:28:40 +02:00
Andreas Kling
704a2bfad5 Kernel: Use TRY() in TmpFSInode::write_bytes() 2021-09-06 20:24:38 +02:00
Andreas Kling
56a2594de7 Kernel: Make KString factories return KResultOr + use TRY() everywhere
There are a number of places that don't have an error propagation path
right now, so I've added FIXME's about that.
2021-09-06 19:25:36 +02:00
Andreas Kling
2065ced8f6 Kernel: Make KBufferBuilder::append() & friends return KResult
This allows callers to react to a failed append (due to OOM.)
2021-09-06 18:56:51 +02:00
Andreas Kling
6e3381ac32 Kernel: Use KResultOr and TRY() for {Shared,Private}InodeVMObject 2021-09-06 13:06:05 +02:00
Andreas Kling
cda2b9e71c Kernel: Improvements to Custody absolute path serialization
- Renamed try_create_absolute_path() => try_serialize_absolute_path()
- Use KResultOr and TRY() to propagate errors
- Don't call this when it's only for debug logging
2021-09-06 13:06:05 +02:00
Andreas Kling
b083b165a7 Kernel/Ext2FS: Wrap calls to traverse_as_directory() in TRY()
Nothing says we can't TRY() a multi-line function call. :^)
2021-09-06 13:06:05 +02:00
Andreas Kling
18dbafec85 Kernel: Use TRY() more in Plan9FS 2021-09-06 13:06:05 +02:00
Andreas Kling
d34f2b643e Kernel: Tidy up Plan9FS construction a bit 2021-09-06 13:06:05 +02:00
Andreas Kling
36725228fa Kernel: Tidy up Ext2FS construction a bit 2021-09-06 13:06:05 +02:00
Andreas Kling
47bfbe343b Kernel: Tidy up SysFS construction
- Use KResultOr and TRY() to propagate errors
- Check for OOM errors
- Move allocation out of constructors

There's still a lot more to do here, as SysFS is still quite brittle
in the face of memory pressure.
2021-09-06 13:06:05 +02:00
Andreas Kling
788b91a65c Kernel: Tidy up DevFS construction and handle OOM errorso
- Use KResultOr and TRY() to propagate errors
- Check for OOM
- Move allocations out of the DevFS constructor
2021-09-06 13:06:05 +02:00
Andreas Kling
efe4e230ee Kernel: Tidy up DevPtsFS construction and handle OOM errors
- Use KResultOr and TRY() to propagate errors
- Check for OOM when creating new inodes
2021-09-06 13:06:05 +02:00
Andreas Kling
a8516681b7 Kernel: Tidy up TmpFS and TmpFSInode construction
- Use KResultOr<NonnullRefPtr<T>>
- Propagate errors
- Use TRY() at call sites
2021-09-06 02:36:21 +02:00
Andreas Kling
7a8061ba0c Kernel: Use TRY() in ISO9660FileSystem 2021-09-06 02:06:49 +02:00
Andreas Kling
540d62d3b2 Kernel: Simplify WatchDescription::create() 2021-09-06 01:55:27 +02:00
Andreas Kling
8ceff65161 Kernel: Use TRY() some more in FileDescription 2021-09-06 01:55:27 +02:00
Andreas Kling
5516592748 Kernel: Use TRY() in BlockBasedFileSystem 2021-09-06 01:55:27 +02:00
Ali Mohammad Pur
97e97bccab Everywhere: Make ByteBuffer::{create_*,copy}() OOM-safe 2021-09-06 01:53:26 +02:00
Brian Gianforcaro
bb58a4d943 Kernel: Make all Spinlocks use u8 for storage, remove template
The default template argument is only used in one place, and it
looks like it was probably just an oversight. The rest of the Kernel
code all uses u8 as the type. So lets make that the default and remove
the unused template argument, as there doesn't seem to be a reason to
allow the size to be customizable.
2021-09-05 20:46:02 +02:00
Andreas Kling
100b3835f0 Kernel: Use TRY() in DevFSLinkInode::write_bytes() 2021-09-05 19:02:57 +02:00
Andreas Kling
667a39df6b Kernel: Use TRY() in ProcFS 2021-09-05 19:01:38 +02:00
Andreas Kling
caaeae9607 Kernel: Make FileSystem::get_inode() return KResultOr<NRP<Inode>>
This allows for natural error propagation in a bunch of new places.
2021-09-05 18:55:55 +02:00
Andreas Kling
48a0b31c47 Kernel: Make copy_{from,to}_user() return KResult and use TRY()
This makes EFAULT propagation flow much more naturally. :^)
2021-09-05 17:38:37 +02:00
Andreas Kling
abb43468dc Kernel: Use TRY() in FileDescription::attach() 2021-09-05 16:25:40 +02:00
Andreas Kling
b2950c67ea Kernel: Use TRY() in Inode 2021-09-05 16:25:40 +02:00
Andreas Kling
c1c774da91 Kernel: Use TRY() in FIFO 2021-09-05 16:25:40 +02:00
Andreas Kling
cad78f5904 Kernel: Use TRY() in InodeFile 2021-09-05 16:25:40 +02:00
Andreas Kling
865eb54f75 Kernel/Ext2FS: Use TRY() in the Ext2FS
This class was just *full* of great opportunities for TRY(). :^)
2021-09-05 15:30:15 +02:00
Andreas Kling
0cf65cf7ec Kernel: Use TRY() even more in VirtualFileSystem
Allowing TRY() with KResult unlocked a whole lot more opportunities.
2021-09-05 14:55:51 +02:00
Andreas Kling
71187d865e Kernel: Tidy up VirtualFileSystem::mount_root() a little bit
- Return KResult instead of bool
- Use TRY()
2021-09-05 14:46:44 +02:00
Andreas Kling
b0f2acbd91 Kernel: Use TRY() in FileDescription 2021-09-05 14:43:51 +02:00
Andreas Kling
4012099338 Kernel: Tidy up AnonymousFile construction a bit
- Rename create() => try_create()
- Use adopt_nonnull_ref_or_enomem()
2021-09-05 14:33:25 +02:00
Andreas Kling
a5e71debef Kernel: Use TRY() in VirtualFileSystem 2021-09-05 14:08:12 +02:00
sin-ack
566c5d1e99 AK+Kernel: Move KResult.h to Kernel/API for userspace access
This commit moves the KResult and KResultOr objects to Kernel/API to
signify that they may now be freely used by userspace code at points
where a syscall-related error result is to be expected. It also exposes
KResult and KResultOr to the global namespace to make it nicer to use
for userspace code.
2021-09-05 12:54:48 +02:00
Andreas Kling
e851a77346 Kernel: Rename FileBlocker::unblock() => unblock_if_conditions_are_met()
Since this may not actually unblock, the old name was very confusing.
2021-09-05 01:10:56 +02:00
Andreas Kling
68a6d4c30a Kernel: Tidy up InodeWatcher construction
- Rename create() => try_create()
- Use adopt_nonnull_ref_or_enomem()
2021-09-05 01:10:56 +02:00
Andreas Kling
211c1c087d Kernel/Plan9FS: Use KString instead of String in one place 2021-09-05 01:10:56 +02:00
Andreas Kling
9d736772bd Kernel/Ext2FS: Remove a String allocation in debug logging
We were creating a temporary String just to log the target when writing
a symlink directly into inline storage.
2021-09-05 01:10:55 +02:00
Liav A
e490c17bde Kernel/SysFS: Ensure data stability when reading from Inodes
Like with the ProcFS, description data can change at anytime, so it's
wise to ensure that when the userland reads from an Inode, data is
consistent unless the userland indicated it wants to refresh the data
(by seeking to offset 0, or re-attaching the Inode).
Otherwise, if the data changes in the middle of the reading, it can
cause silent corruption in output which can lead to random crashes.
2021-09-04 16:33:56 +02:00
Liav A
f2ba44cbdf Kernel/DevFS: Remove unnecessary include 2021-09-04 16:19:12 +02:00
Daniel Bertalan
d7b6cc6421 Everywhere: Prevent risky implicit casts of (Nonnull)RefPtr
Our existing implementation did not check the element type of the other
pointer in the constructors and move assignment operators. This meant
that some operations that would require explicit casting on raw pointers
were done implicitly, such as:
- downcasting a base class to a derived class (e.g. `Kernel::Inode` =>
  `Kernel::ProcFSDirectoryInode` in Kernel/ProcFS.cpp),
- casting to an unrelated type (e.g. `Promise<bool>` => `Promise<Empty>`
  in LibIMAP/Client.cpp)

This, of course, allows gross violations of the type system, and makes
the need to type-check less obvious before downcasting. Luckily, while
adding the `static_ptr_cast`s, only two truly incorrect usages were
found; in the other instances, our casts just needed to be made
explicit.
2021-09-03 23:20:23 +02:00
Brian Gianforcaro
668c429900 Kernel: Convert UserOrKernelBuffer callbacks to use AK::Bytes 2021-09-01 18:06:14 +02:00
Brian Gianforcaro
0678ac265c Kernel: Pass InodeMetadata by reference in TmpFSInode::create
This struct is non-trivially large, it makes sense to pass it by
reference instead of by value in the factory method.

Found by Sonar Cloud.
2021-09-01 18:06:14 +02:00
Andreas Kling
244ede561b Kernel/SysFS: Remove unnecessary mutex lockers in SysFS metadata getters
SysFS inodes have immutable metadata once created.
2021-08-29 01:09:19 +02:00
Andreas Kling
8ebf08b6c8 Kernel: Make all ProcFS and SysFS files zero-sized
There is no value in exposing particular sizes for these files.
2021-08-29 01:09:19 +02:00
Andreas Kling
ed77b6f8cb Kernel: Remove an obviously redundant check in FIFO::read() 2021-08-29 01:09:19 +02:00
Andreas Kling
4cbe348a0f Kernel/Ext2FS: Avoid temporary String allocation during inode creation
Make sure we pass the StringView we get all the way through so it never
turns into a heap-allocated String. :^)
2021-08-29 01:09:19 +02:00
Andreas Kling
ae197deb6b Kernel: Strongly typed user & group ID's
Prior to this change, both uid_t and gid_t were typedef'ed to `u32`.
This made it easy to use them interchangeably. Let's not allow that.

This patch adds UserID and GroupID using the AK::DistinctNumeric
mechanism we've already been employing for pid_t/ProcessID.
2021-08-29 01:09:19 +02:00
Andreas Kling
59335bd8ea Kernel: Rename FileDescription::create() => try_create() 2021-08-29 01:09:19 +02:00
Andreas Kling
82c3cc4640 Kernel: Move Blocker setup out from constructors into setup_blocker()
Instead of registering with blocker sets and whatnot in the various
Blocker subclass constructors, this patch moves such initialization
to a separate setup_blocker() virtual.

setup_blocker() returns false if there's no need to actually block
the thread. This allows us to bail earlier in Thread::block().
2021-08-24 16:37:28 +02:00
Andreas Kling
7006cb82bd Kernel: Rename Blocker::not_blocking(bool) to something more descriptive
Namely, will_unblock_immediately_without_blocking(Reason).

This virtual function is called on a blocker *before any block occurs*,
if it turns out that we don't need to block the thread after all.

This can happens for one of two reasons:

- UnblockImmediatelyReason::UnblockConditionAlreadyMet

    We don't need to block the thread because the condition for
    unblocking it is already met.

- UnblockImmediatelyReason::TimeoutInThePast

    We don't need to block the thread because a timeout was specified
    and that timeout is already in the past.

This patch does not introduce any behavior changes, it's only meant to
clarify this part of the blocking logic.
2021-08-23 02:13:04 +02:00
Andreas Kling
b30081b49a Kernel: Rename BlockerSet::unblock() to something more accurate
Namely, unblock_all_blockers_whose_conditions_are_met().

The old name made it sound like things were getting unblocked no matter
what, but that's not actually the case.

What this actually does is iterate through the set of blockers,
unblocking those whose conditions are met. So give it a (very) verbose
name that errs on the side of descriptiveness.
2021-08-23 00:02:09 +02:00
Andreas Kling
85546af417 Kernel: Rename Thread::BlockCondition to BlockerSet
This class represents a set of Thread::Blocker objects attached to
something that those blockers are waiting on.
2021-08-23 00:02:09 +02:00
Andreas Kling
53019f413c Kernel: Mark BlockCondition subclasses as final 2021-08-23 00:02:09 +02:00
Andreas Kling
d60635cb9d Kernel: Convert Processor::in_irq() to static current_in_irq()
This closes the race window between Processor::current() and a context
switch happening before in_irq().
2021-08-23 00:02:09 +02:00
Peter Elliott
39a77559f1 Kernel+LibC: Implement FIONREAD ioctl
FIONREAD gets the number of bytes availible to read from a file
descriptor without blocking. I only implemented it for regular files and
sockets
2021-08-22 10:29:06 +02:00
Andreas Kling
c922a7da09 Kernel: Rename ScopedSpinlock => SpinlockLocker
This matches MutexLocker, and doesn't sound like it's a lock itself.
2021-08-22 03:34:10 +02:00
Andreas Kling
55adace359 Kernel: Rename SpinLock => Spinlock 2021-08-22 03:34:10 +02:00
Andreas Kling
ed6f84c2c9 Kernel: Rename SpinLockProtectedValue<T> => SpinLockProtected<T> 2021-08-22 03:34:09 +02:00
Andreas Kling
c2fc33becd Kernel: Rename ProtectedValue<T> => MutexProtected<T>
Let's make it obvious what we're protecting it with.
2021-08-22 03:34:09 +02:00
Idan Horowitz
cf271183b4 Kernel: Make Process::current() return a Process& instead of Process*
This has several benefits:
1) We no longer just blindly derefence a null pointer in various places
2) We will get nicer runtime error messages if the current process does
turn out to be null in the call location
3) GCC no longer complains about possible nullptr dereferences when
compiling without KUBSAN
2021-08-19 23:49:53 +02:00
Timothy Flynn
02e3633b7f AK: Move FormatParser definition from header to implementation file
This is primarily to be able to remove the GenericLexer include out of
Format.h as well. A subsequent commit will add AK::Result to
GenericLexer, which will cause naming conflicts with other structures
named Result. This can be avoided (for now) by preventing nearly every
file in the system from implicitly including GenericLexer.

Other changes in this commit are to add the GenericLexer include to
files where it is missing.
2021-08-19 23:49:25 +02:00
Edward Palmer
abccb45060 Kernel: Move set_metadata_dirty calls to notify_watchers 2021-08-19 10:41:54 +02:00
Andreas Kling
c70e2f2519 Kernel: Protect the Custody cache with a mutex instead of a spinlock
We don't need to access the Custody cache in IRQs or anything like that,
so it should be fine to use a regular Mutex (via ProtectedValue.)

This allows threads to block while waiting for the custody cache.
Thanks to Sergey for pointing this out. :^)
2021-08-18 00:44:35 +02:00
Andrew January
f62ac5d81d Kernel/SysFS: Prepend to the custody cache instead of append
Usage patterns mean we are more likely to need a Custody we just cached.
Because lookup walks the list from the beginning, prepending new items
instead of appending means they will be found quicker.

This reduces the number of items in the cache we need to walk by 50% for
boot and application startups.
2021-08-17 16:30:03 +02:00
Andreas Kling
ea09294351 Kernel: Port Inode to ListedRefCounted
This consolidates the lock+list combo into a SpinLockProtectedValue
and closes yet another unref() race. :^)
2021-08-17 01:21:47 +02:00
Andreas Kling
3a2d888913 Kernel/DevPtsFS: Avoid String allocation during directory traversal
Use a StringBuilder to generate a temporary string buffer with the
slave PTY names. (This works because StringBuilder has 128 bytes of
inline stack capacity before it does any heap allocations.)
2021-08-17 01:21:47 +02:00
Andreas Kling
0de8c95d49 Kernel: Convert SlavePTY all-instances HashTable to an IntrusiveList
This simplifies the DevPtsFS implementation somewhat, as it no longer
requires SlavePTY to register itself with it, since it can now simply
use the list of SlavePTY instances.
2021-08-17 01:21:47 +02:00
Andreas Kling
641083f3b8 Kernel: Customize File::unref() and make it virtual
Make File inherit from RefCountedBase and provide a custom unref()
implementation. This will allow subclasses that participate in lists to
remove themselves in a safe way when being destroyed.
2021-08-17 01:21:47 +02:00
Andreas Kling
fc0cd8317a Kernel/DevPtsFS: Add tightly typed DevPtsFSInode::fs() 2021-08-17 01:21:47 +02:00
Andreas Kling
29a58459ab Kernel: Use ProtectedValue for VirtualFileSystem::m_mounts
This is what VirtualFileSystem::m_lock was actually guarding, and
wrapping it in a ProtectedValue makes it so much more obvious how it
all works. :^)
2021-08-16 01:41:26 +02:00
Andreas Kling
d6d7d11590 Kernel: Cache Custody objects (weakly) to avoid expensive reconstruction
This patch adds a (spinlock-protected) custody cache. It's a simple
intrusive list containing all currently live custody objects.

This allows us to re-use existing custodies instead of creating them
again and again.

This gives a pretty decent performance improvement on "find /" :^)
2021-08-15 23:30:52 +02:00
Andreas Kling
cda69704dc Kernel: Remove unused FIFO::all_fifos() table 2021-08-15 16:53:03 +02:00
sin-ack
61c0e3ca92 Kernel: Simplify OOM handling in ISO9660FileSystem 2021-08-15 15:41:02 +02:00
Andreas Kling
5416fa252a Kernel: Add tightly typed ISO9660Inode::fs() overload
We know the fs() is always an ISO9660FS, so let's be nice and make fs()
return that when called on an ISO9660Inode. :^)
2021-08-15 12:50:22 +02:00
Andreas Kling
1b739a72c2 Kernel+Userland: Remove chroot functionality
We are not using this for anything and it's just been sitting there
gathering dust for well over a year, so let's stop carrying all this
complexity around for no good reason.
2021-08-15 12:44:35 +02:00
sin-ack
2830a0ecda Kernel: Move ProcFS related overrides in Process to ProcessProcFSTraits
This allows us to 1) let go of the Process when an inode is ref'ing for
ProcFSExposedComponent related reasons, and 2) change our ref/unref
implementation.
2021-08-15 02:27:13 +02:00
sin-ack
748938ea59 Kernel: Handle allocation failure in ProcFS and friends
There were many places in which allocation failure was noticed but
ignored.
2021-08-15 02:27:13 +02:00
Andreas Kling
dcb015fa7e Kernel: Move VFS-internal O_FOO definitions to VirtualFileSystem.h 2021-08-14 19:58:11 +02:00
Andreas Kling
7676edfb9b Kernel: Stop allowing implicit conversion from KResult to int
This patch removes KResult::operator int() and deals with the fallout.
This forces a lot of code to be more explicit in its handling of errors,
greatly improving readability.
2021-08-14 15:19:00 +02:00
Andreas Kling
d30d776ca4 Kernel: Make FileSystem::initialize() return KResult
This forced me to also come up with error codes for a bunch of
situations where we'd previously just panic the kernel.
2021-08-14 15:19:00 +02:00
Andreas Kling
ef2720bcad Kernel: Make Inode::lookup() return a KResultOr<NonnullRefPtr<Inode>>
This allows file systems to return arbitrary error codes instead of just
an Inode or not an Inode.
2021-08-14 13:34:59 +02:00
Luke
e06660d33c Kernel/ProcFS: Get unveil stats instead of FDs stats for unveil data
It was accidentally using `procfs_get_fds_stats` instead of
`procfs_get_unveil_stats`.
2021-08-14 10:46:00 +02:00
Liav A
0a5312730c Kernel/ProcFS: Propagate errors correctly when they occur
Calling error() on KResult is a mistake I made in 7ba991dc37, so
instead of doing that, which triggers an assertion if an error occured,
in Inode::read_entire method with VERIFY(nread <= sizeof(buffer)), we
really should just return the KResult and not to call error() on it.
2021-08-13 20:07:43 +02:00
Liav A
7ba991dc37 Kernel: Steer away from heap allocations for ProcFS process data
Instead, use more static patterns to acquire that sort of data.
2021-08-12 20:57:32 +02:00
Liav A
bf1adc2d5d Kernel+LibC: Use 64 bit values for ino_t
Since the InodeIndex encapsulates a 64 bit value, it is correct to
ensure that the Kernel is exposing the entire value and the LibC is
aware of it.

This commit requires an entire re-compile because it's essentially a
change in the Kernel ABI, together with a corresponding change in LibC.
2021-08-12 20:57:32 +02:00
LuK1337
e1ed1d9176 VirtualFileSystem: Return early in rename() when old_path==new_path
This change fixes disappearing symlink after trying to do the following
thing:
  cp /res/icons/16x16/add-event.png .
  ln -s add-event.png a
  mv a a
2021-08-10 21:56:10 +02:00
Jean-Baptiste Boric
4c4b8ea443 Kernel: Properly handle non-blocking I/O on pipes
Previously, non-blocking read operations on pipes returned EOF instead
of EAGAIN and non-blocking write operations blocked. This fixes
pkgsrc's bmake "eof on job pipe!" error message when running in
non-compatibility mode.
2021-08-10 21:55:35 +02:00
Andreas Kling
552dd7abd3 Kernel: Port BlockBasedFileSystem to ProtectedValue :^) 2021-08-08 00:28:10 +02:00
Andreas Kling
c94c15d45c Everywhere: Replace AK::Singleton => Singleton 2021-08-08 00:03:45 +02:00
sin-ack
0d468f2282 Kernel: Implement a ISO 9660 filesystem reader :^)
This commit implements the ISO 9660 filesystem as specified in ECMA 119.
Currently, it only supports the base specification and Joliet or Rock
Ridge support is not present. The filesystem will normalize all
filenames to be lowercase (same as Linux).

The filesystem can be mounted directly from a file. Loop devices are
currently not supported by SerenityOS.

Special thanks to Lubrsi for testing on real hardware and providing
profiling help.

Co-Authored-By: Luke <luke.wilde@live.co.uk>
2021-08-07 15:21:58 +02:00
Jean-Baptiste Boric
6d83b2d8f0 Kernel: Migrate FIFO table locking to ProtectedValue 2021-08-07 11:48:00 +02:00
Jean-Baptiste Boric
25d7beec6b Kernel: Use atomic integer for next FIFO id 2021-08-07 11:48:00 +02:00
Jean-Baptiste Boric
aea98a85d1 Kernel: Move Lockable into its own header 2021-08-07 11:48:00 +02:00
Jean-Baptiste Boric
f7f794e74a Kernel: Move Mutex into Locking/ 2021-08-07 11:48:00 +02:00
Andreas Kling
2cd8b21974 Kernel: Add convenience values to the Memory::Region::Access enum
Instead of `Memory::Region::Access::Read | Memory::Region::AccessWrite`
you can now say `Memory::Region::Access::ReadWrite`.
2021-08-06 22:25:00 +02:00
Andreas Kling
44da58c0b2 Kernel: Move UnveilNode.h into Kernel/FileSystem/ 2021-08-06 14:11:45 +02:00
Andreas Kling
208147c77c Kernel: Rename Process::space() => Process::address_space()
We commonly talk about "a process's address space" so let's nudge the
code towards matching how we talk about it. :^)
2021-08-06 14:05:58 +02:00
Andreas Kling
cd5faf4e42 Kernel: Rename Range => VirtualRange
...and also RangeAllocator => VirtualRangeAllocator.

This clarifies that the ranges we're dealing with are *virtual* memory
ranges and not anything else.
2021-08-06 14:05:58 +02:00
Andreas Kling
93d98d4976 Kernel: Move Kernel/Memory/ code into Kernel::Memory namespace 2021-08-06 14:05:58 +02:00
Andreas Kling
a1d7ebf85a Kernel: Rename Kernel/VM/ to Kernel/Memory/
This directory isn't just about virtual memory, it's about all kinds
of memory management.
2021-08-06 14:05:58 +02:00
Andreas Kling
ad3ae7e0e8 Kernel: Fix handful of remaining "return -EFOO" mistakes
Now that all KResult and KResultOr are used consistently throughout the
kernel, it's no longer necessary to return negative error codes.
However, we were still doing that in some places, so let's fix all those
(bugs) by removing the minuses. :^)
2021-08-06 00:37:47 +02:00
Andreas Kling
32a150f2b4 Kernel: Make Thread::state_string() return StringView 2021-08-06 00:37:47 +02:00
Brian Gianforcaro
a6db2f985a Kernel: Handle OOM in DiskCache when mounting Ext2 filesystems
Create the disk cache up front, so we can verify it succeeds.
Make the KBuffer allocation fail-able, so we can properly handle
failure when the user asks up to mount a Ext2 filesystem under
OOM conditions.
2021-08-03 18:54:23 +02:00
Brian Gianforcaro
8d3b819daf Kernel: Handle OOM from DoubleBuffer creation in FIFO creation 2021-08-03 18:54:23 +02:00
Brian Gianforcaro
15cd5d324c Kernel: Handle OOM from KBuffer usage in Ext2FS::get_bitmap_block()
Fixes up error handling on an OOM-able path, and removes one more usage
of KBuffer::create_with_size.
2021-08-03 18:54:23 +02:00
LuK1337
3dd40535c1 VirtualFileSystem: Don't let rename() overwrite non-empty directory
According to POSIX, rename shouldn't succeed if newpath is a non-empty
directory.
2021-08-02 01:04:34 +02:00
Andreas Kling
58f62cd1d0 Kernel/ProcFS: Add S_IFREG bit to regular files in /proc
Regular files should have regular file mode.
2021-07-28 18:55:38 +02:00
Brian Gianforcaro
de9ff0af50 Kernel: Modify the IOCTL API to return KResult
The kernel has been gradually moving towards KResult from just bare
int's, this change migrates the IOCTL paths.
2021-07-27 01:23:37 +04:30
Brian Gianforcaro
9a04f53a0f Kernel: Utilize AK::Userspace<T> in the ioctl interface
It's easy to forget the responsibility of validating and safely copying
kernel parameters in code that is far away from syscalls. ioctl's are
one such example, and bugs there are just as dangerous as at the root
syscall level.

To avoid this case, utilize the AK::Userspace<T> template in the ioctl
kernel interface so that implementors have no choice but to properly
validate and copy ioctl pointer arguments.
2021-07-27 01:23:37 +04:30
Andreas Kling
2d1a651e0a Kernel: Make purgeable memory a VMObject level concept (again)
This patch changes the semantics of purgeable memory.

- AnonymousVMObject now has a "purgeable" flag. It can only be set when
  constructing the object. (Previously, all anonymous memory was
  effectively purgeable.)

- AnonymousVMObject now has a "volatile" flag. It covers the entire
  range of physical pages. (Previously, we tracked ranges of volatile
  pages, effectively making it a page-level concept.)

- Non-volatile objects maintain a physical page reservation via the
  committed pages mechanism, to ensure full coverage for page faults.

- When an object is made volatile, it relinquishes any unused committed
  pages immediately. If later made non-volatile again, we then attempt
  to make a new committed pages reservation. If this fails, we return
  ENOMEM to userspace.

mmap() now creates purgeable objects if passed the MAP_PURGEABLE option
together with MAP_ANONYMOUS. anon_create() memory is always purgeable.
2021-07-25 17:28:05 +02:00
Andreas Kling
f9b7ea6de9 Revert "Kernel: Use IntrusiveList for keeping track of InodeWatchers"
This reverts commit 43d6a7e74e.

This breaks multi-inode watchers.
2021-07-21 21:24:26 +02:00
Andreas Kling
a9f76b8270 Kernel: Remove Inode's inheritance from Weakable
Nobody was using WeakPtr<Inode> anywhere, so there's no need for this
to inherit from Weakable.
2021-07-21 20:17:55 +02:00
Andreas Kling
43d6a7e74e Kernel: Use IntrusiveList for keeping track of InodeWatchers 2021-07-21 20:17:55 +02:00
Peter Elliott
3fa2816642 Kernel+LibC: Implement fcntl(2) advisory locks
Advisory locks don't actually prevent other processes from writing to
the file, but they do prevent other processes looking to acquire and
advisory lock on the file.

This implementation currently only adds non-blocking locks, which are
all I need for now.
2021-07-20 17:44:30 +04:30
ls
222b97488a VirtualFileSystem: Check for '.' '..' and empty filenames
This commit adds a check, to prevent empty dot or dot-dot filenames when
renaming a file and returns EINVAL in that case.
2021-07-19 18:20:34 +02:00
Andreas Kling
7791f7b9e6 Kernel/TmpFS: Remove some unnecessary includes 2021-07-18 14:29:27 +02:00
Andreas Kling
61e17ed590 Kernel/TmpFS: Use IntrusiveList and KString for OOM safety
This patch moves TmpFS to using OOM-safe data types for storing
directory children.
2021-07-18 14:29:27 +02:00
Andreas Kling
df5fa8aa39 Kernel/ProcFS: Remove redundant ProcFS& member from ProcFSInode 2021-07-18 02:24:26 +02:00
Andreas Kling
d298de5e09 Kernel/SysFS: Remove redundant SysFS& member from SysFSInode 2021-07-18 02:23:22 +02:00
Andreas Kling
d3cf4cd8f0 Kernel/DevFS: Remove redundant DevFS& member from DevFSInode
All Inode subclasses can get to their FileSystem via Inode::fs().
2021-07-18 02:21:34 +02:00
Andreas Kling
bd37840cf5 Kernel/Ext2FS: Surface Vector allocation failures in block allocation 2021-07-18 02:15:56 +02:00
Andreas Kling
1f18558ee2 Kernel: Make FileSystem::root_inode() return a plain Inode&
All file system classes are expected to keep their root Inode object
in memory, so this function can safely return an Inode&.
2021-07-18 01:53:04 +02:00
Andreas Kling
58c6d30f6a Kernel/Ext2FS: Cache the root inode in a member variable
We often get queried for the root inode, and it will always be cached
in memory anyway, so let's make Ext2FS::root_inode() fast by keeping
the root inode in a dedicated member variable.
2021-07-18 01:53:04 +02:00
Andreas Kling
9457d83986 Kernel: Rename Locker => MutexLocker 2021-07-18 01:53:04 +02:00
Andreas Kling
b975a74a1d Kernel/USB: Move USB bus information from /proc to /sys
This patch moves all the USB data from /proc/bus/usb to /sys/bus/usb.
2021-07-18 00:55:16 +02:00
Andreas Kling
d686d2ef18 Kernel/SysFS: Remove unused SysFSComponent::entries_count() 2021-07-17 23:50:01 +02:00
Andreas Kling
2da0581fd2 Kernel: Replace "folder" => "directory" everywhere
Folders are a GUI concept. File systems have directories.
2021-07-17 23:50:00 +02:00
Andreas Kling
b8d6c3722d Kernel: Remove Inode::directory_entry_count()
This was only used in one place: VirtualFileSystem::rmdir(), and that
has now been converted to a simple directory traversal.
2021-07-17 22:36:04 +02:00
Andreas Kling
d1bbe8b652 Kernel: Count remaining children in VirtualFileSystem::rmdir() manually
To count the remaining children, we simply need to traverse the
directory and increment a counter. No need for a custom virtual that
all file systems have to implement. :^)
2021-07-17 22:34:43 +02:00
Andreas Kling
a3f58a5003 Kernel/DevFS: Use KString for DevFSDeviceInode::m_name 2021-07-17 22:17:07 +02:00
Andreas Kling
0d89cfcd9a Kernel/DevFS: Use KString for DevFSLinkInode::m_link 2021-07-17 22:11:41 +02:00
Andreas Kling
dd37d0a327 Kernel/DevFS: Use KString for DevFSLinkInode::m_name 2021-07-17 21:40:32 +02:00
Andreas Kling
61c1937d02 Kernel/DevFS: Make DevFSInode::name() return StringView 2021-07-17 21:36:54 +02:00
Andreas Kling
6766efff9c Kernel: Make Inode::create_child() take the name as a StringView
No sense in forcing callers to construct a String. One more small step
towards not using String in the kernel.
2021-07-17 21:32:59 +02:00
Andreas Kling
9359f7801f Kernel/DevFS: Remove some unnecessary inode locking
Unless we're accessing mutex-guarded metadata, there's no need to
acquire the inode lock.

The file system ID or inode index of a constructed inode will never
change, for example.
2021-07-17 21:26:47 +02:00
Andreas Kling
3b805a57e6 Kernel: Rename Inode::m_lock => m_inode_lock
This makes file system code much easier to read since it was hard when
both the file system and inode locks were called "m_lock".
2021-07-17 21:17:39 +02:00
Andreas Kling
63e1423830 Kernel: Remove unused Inode::is_shared_vmobject() 2021-07-17 21:11:12 +02:00
Andreas Kling
cee9528168 Kernel: Rename Lock to Mutex
Let's be explicit about what kind of lock this is meant to be.
2021-07-17 21:10:32 +02:00
Andreas Kling
a803c4026c Kernel: Make FileSystem::class_name() return a StringView 2021-07-17 20:59:48 +02:00
Timothy
9715311837 AK+Kernel: Implement and use EnumBits has_any_flag()
This duplicates the old functionality of has_flag and will return true
when any flags present in the mask are also in the value.
2021-07-16 11:49:50 +02:00
Andreas Kling
41c0009f6d Kernel/Ext2FS: Don't hog inode lock in traverse_as_directory()
Reimplement directory traversal in terms of read_bytes() instead of
doing direct block access. This lets us avoid taking the inode lock
while iterating over the directory contents.
2021-07-16 02:40:53 +02:00
Andreas Kling
abbd237ec1 Kernel/Ext2FS: Don't hog FS lock when calling base class flush_writes()
Once we've finalized all the file system metadata in flush_writes(),
we no longer need to hold the file system lock during the call to
BlockBasedFileSystem::flush_writes().
2021-07-16 02:40:53 +02:00
Andreas Kling
98c230b370 Kernel/Ext2FS: Uncache unknown inode indices when flushing writes
Ext2FS::get_inode() will remember unknown inode indices that it has
been asked about and put them into the inode cache as null inodes.

flush_writes() was not null-checking these while iterating, which
was a bug I finally managed to hit.

Flushing also seemed like a good time to drop unknown inodes from
the cache, since there's no good reason to hold to them indefinitely.
2021-07-16 02:40:53 +02:00
Andreas Kling
a7d193951f Kernel: Don't hog file system lock when doing BlockBasedFileSystem I/O
The file system lock is meant to protect the file system metadata
(super blocks, bitmaps, etc.) Not protect processes from reading
independent parts of the disk at once.

This patch introduces a new lock to protect the *block cache* instead,
which is the real thing that needs synchronization.
2021-07-16 02:40:53 +02:00
Andreas Kling
abf0249f35 Kernel: Don't explicitly seek before I/O in BlockBasedFileSystem
Use the new FileDescription APIs to avoid doing seek+read or seek+write
as two separate operations.
2021-07-16 02:40:53 +02:00
Andreas Kling
d1395f2eb9 Kernel: Add FileDescription read/write API that bypasses current offset
Forcing users of a FileDescription to seek before they can read/write
makes it inherently racy. This patch adds variants of read/write that
simply ignore the "current offset" of the description in favor of a
caller-supplied offset.
2021-07-16 02:40:53 +02:00
Andreas Kling
ace8b9a0ee Kernel/Ext2FS: Don't hog both locks in Ext2FSInode::lookup()
This function was acquiring both the inode and file system locks (in
that order) which could lead to deadlocks.
2021-07-16 02:40:53 +02:00
Liav A
bee75c1f24 Kernel/ProcFS: Allow a process directory to have a null Process pointer
In case we are about to delete the PID directory, we clear the Process
pointer. If someone still holds a reference to the PID directory (by
opening it), we still need to delete the process, but we can't delete
the directory, so we will keep it alive, but any operation on it will
fail by propogating the error to userspace about that the Process was
deleted and therefore there's no meaning to trying to do operations on
the directory.

Fixes #8576.
2021-07-14 13:40:01 +02:00
Brian Gianforcaro
1c43836990 Kernel: Remove unused header includes in FileSystem subtree 2021-07-11 21:37:38 +02:00
Andrew Kaster
3f0dcd63dc Kernel: Fix TmpFS resize behavior around INT32_MAX for 32-bit systems
We need some overflow checks due to the implementation of TmpFS.
When size_t is 32 bits and off_t is 64 bits, we might overflow our
KBuffer max size and confuse the KBuffer set_size code, causing a VERIFY
failure. Make sure that resulting offset + size will fit in a size_t.
Another constraint, we make sure that the resulting offset + size will
be less than half of the maximum value of a size_t, because we double
the KBuffer size each time we resize it.
2021-07-11 19:42:00 +02:00
Andreas Kling
88d490566f Kernel: Rename various *VMObject::create*() => try_create()
try_*() implies that it can fail (and they all return RefPtr with
nullptr signalling failure.)
2021-07-11 17:55:29 +02:00
Andreas Kling
af8c74a328 Kernel: Make SharedInodeVMObject allocation OOM-safe 2021-07-11 17:52:07 +02:00
Max Wipfli
29d53cbee2 Kernel: Return correct error numbers for the mkdir syscall
Previously, VirtualFileSystem::mkdir() would always return ENOENT if
no parent custody was returned by resolve_path(). This is incorrect when
e.g. the user has no search permission in a component of the path
prefix (=> EACCES), or if on component of the path prefix is a file (=>
ENOTDIR). This patch fixes that behavior.
2021-07-11 14:59:57 +02:00
Andreas Kling
98080497d2 Kernel: Use Forward.h headers more 2021-07-11 14:14:51 +02:00
Andreas Kling
c9f6786e8b Kernel: Make various T::class_name() and similar return StringView
Instead of returning char const*, we can also give you a StringView.
2021-07-11 01:46:59 +02:00
Andreas Kling
fa9111ac46 Kernel: Rename ProcFSComponentsRegistrar => ProcFSComponentRegistry
This matches the formatting used in SysFS.
2021-07-11 01:40:26 +02:00
Andreas Kling
805319ed30 Kernel: Replace "Folder" => "Directory" everywhere
Folders are a GUI concept, file systems have directories. :^)
2021-07-11 01:33:40 +02:00
Andreas Kling
c74b3a310f Kernel: Remove pointless lock/unlock in SysFS constructor 2021-07-11 01:18:20 +02:00
Andreas Kling
a9decf5aa6 Kernel: Remove all friend declarations from SysFSComponentRegistry
Let them access the class using public API instead.
2021-07-11 01:17:57 +02:00
Andreas Kling
d40ea1a0a8 Kernel: Move SystemExposed.* => FileSystem/SysFSComponent.* 2021-07-11 01:14:53 +02:00
Andreas Kling
807aadbe6e Kernel: Remove some dead code and unused includes in SysFS files 2021-07-11 01:13:24 +02:00
Andreas Kling
98acebf56b Kernel: Move SysFS forward declarations to FileSystem/Forward.h 2021-07-11 01:09:48 +02:00
Andreas Kling
60a7a9d523 Kernel: Rename SystemExposedFolder => SysFSDirectory
"Folder" is a GUI concept, let's call this "Directory".
Also, "System" is completely generic, so let's be more specific and
call this "SysFS..."
2021-07-11 01:07:27 +02:00
Andreas Kling
517170a986 Kernel: Rename SystemExposedComponent => SysFSComponent 2021-07-11 01:06:27 +02:00
Andreas Kling
27244eb0ee Kernel: Rename SystemRegistrar => SysFSComponentRegistry 2021-07-11 01:05:26 +02:00
Andreas Kling
ea8578bf11 Kernel: Remove unnecessary includes in FileSystem.{cpp,h} 2021-07-11 01:01:54 +02:00
Andreas Kling
66f483b1a1 Kerne: Switch SysFS to east-const style 2021-07-11 00:56:53 +02:00
Andreas Kling
7a4e6257b7 Kernel: Switch Custody to east-const style 2021-07-11 00:51:38 +02:00
Andreas Kling
4238e2e9be Kernel: Only allow looking up Mounts by InodeIdentifier
Let's simplify the interface by not allowing lookup by Inode&.
2021-07-11 00:51:06 +02:00
Andreas Kling
6a27de2d94 Kernel: Make VirtualFileSystem::Mount a top-level class
And move it to its own compilation unit.
2021-07-11 00:51:06 +02:00
Andreas Kling
79552c91d5 Kernel: Rename BlockBasedFS => BlockBasedFileSystem 2021-07-11 00:34:36 +02:00
Andreas Kling
502bbacea0 Kernel: Rename FileBackedFS => FileBackedFileSystem 2021-07-11 00:33:27 +02:00
Andreas Kling
07c4c89297 Kernel: Make VirtualFileSystem::sync() static 2021-07-11 00:26:17 +02:00
Andreas Kling
0d39bd04d3 Kernel: Rename VFS => VirtualFileSystem 2021-07-11 00:25:24 +02:00
Andreas Kling
d53d9d3677 Kernel: Rename FS => FileSystem
This matches our common naming style better.
2021-07-11 00:20:38 +02:00
Max Wipfli
d5722eab36 Kernel: Custody::absolute_path() => try_create_absolute_path()
This converts most users of Custody::absolute_path() to use the new
try_create_absolute_path() API, and return ENOMEM if the KString
allocation fails.
2021-07-07 15:32:17 +02:00
Max Wipfli
95f769ea51 Kernel: Add Custody::try_create_absolute_path()
This adds a way to get a Custody's absolute path as KString, which
enables it to fail gracefully on OOM.
2021-07-07 15:32:17 +02:00
Max Wipfli
1f792faf34 Kernel: Add KLexicalPath::try_join and use it
This adds KLexicalPath::try_join(). As this cannot be done without
allocation, it uses KString and can fail. This patch also uses it at one
place. All the other cases of String::formatted("{}/{}", ...) currently
rely on the return value being a String, which means they cannot easily
be converted to use the new API.
2021-07-07 15:32:17 +02:00
Max Wipfli
ee342f5ec3 Kernel: Replace usage of LexicalPath with KLexicalPath
This replaces all uses of LexicalPath in the Kernel with the functions
from KLexicalPath. This also allows the Kernel to stop including
AK::LexicalPath.
2021-07-07 15:32:17 +02:00
Jean-Baptiste Boric
fdb5367da1 Kernel: Promote various integers to 64 bits in storage layer 2021-07-06 00:16:22 +02:00
Max Wipfli
8a295299f3 Kernel: Fix regression in VFS::symlink
The create_child method should be called with basename, not the full
linkpath.
2021-07-05 19:12:31 +02:00
Max Wipfli
502436f9fc Kernel: Stricter path checking in validate_path_against_process_veil
This change enforces that paths passed to
VFS::validate_path_against_process_veil are absolute and do not contain
any '..' or '.' parts. We should VERIFY here instead of returning EINVAL
since the code that calls this should resolve non-canonical paths before
calling this function.
2021-07-05 18:51:21 +02:00
Max Wipfli
82c25aad01 Kernel: Use the static LexicalPath::basename(String) in VFS
This is just for improved code clarity, and shouldn't change anything
else.
2021-07-05 18:51:21 +02:00
Max Wipfli
3c0272126e Kernel: Don't allocate Strings unnecessarily in process veil validation
Previously, Custody::absolute_path() was called for every call to
validate_path_against_process_veil(). For processes that don't have a
veil, the path is not used by the function. This means that it is
unnecessarily generated. This introduces an overload to
validate_path_against_process_veil(), which takes a Custody const& and
only generates the absolute path if it there is actually a veil and it
is thus needed.

This patch results in a speed up of Assistant's file system cache
building by around 16 percent.
2021-07-05 18:51:21 +02:00
Daniel Bertalan
42d197cde7 Kernel: Fix miscellaneous warnings when building with Clang
These small changes fix the remaining warnings that come up during
kernel compilation with Clang. These specific fixes were for benign
things: unused lambda captures and braces around scalar initializers.
2021-07-03 01:56:31 +04:30
Daniel Bertalan
b97a00d4b1 Kernel: Add missing override specifiers
The `#pragma GCC diagnostic` part is needed because the class has
virtual methods with the same name but different arguments, and Clang
tries to warn us that we are not actually overriding anything with
these.

Weirdly enough, GCC does not seem to care.
2021-07-03 01:56:31 +04:30
Liav A
3344f91fc4 Kernel/ProcFS: Clean dead processes properly
Now we use WeakPtrs to break Ref-counting cycle. Also, we call the
prepare_for_deletion method to ensure deleted objects are ready for
deletion. This is necessary to ensure we don't keep dead processes,
which would become zombies.

In addition to that, add some debug prints to aid debug in the future.
2021-07-02 13:16:12 +02:00
Max Wipfli
7405536a1a AK+Everywhere: Use mostly StringView in LexicalPath
This changes the m_parts, m_dirname, m_basename, m_title and m_extension
member variables to StringViews onto the m_string String. It also
removes the m_is_absolute member in favour of computing if a path is
absolute in the is_absolute() getter. Due to this, the canonicalize()
method has been completely rewritten.

The parts() getter still returns a Vector<String>, although it is no
longer a const reference as m_parts is no longer a Vector<String>.
Rather, it is constructed from the StringViews in m_parts upon request.
The parts_view() getter has been added, which returns Vector<StringView>
const&. Most previous users of parts() have been changed to use
parts_view(), except where Strings are required.

Due to this change, it's is now no longer allow to create temporary
LexicalPath objects to call the dirname, basename, title, or extension
getters on them because the returned StringViews will point to possible
freed memory.
2021-06-30 11:13:54 +02:00
Max Wipfli
fc6d051dfd AK+Everywhere: Add and use static APIs for LexicalPath
The LexicalPath instance methods dirname(), basename(), title() and
extension() will be changed to return StringView const& in a further
commit. Due to this, users creating temporary LexicalPath objects just
to call one of those getters will recieve a StringView const& pointing
to a possible freed buffer.

To avoid this, static methods for those APIs have been added, which will
return a String by value to avoid those problems. All cases where
temporary LexicalPath objects have been used as described above haven
been changed to use the static APIs.
2021-06-30 11:13:54 +02:00
Liav A
1f98d7d638 Kernel/ProcFS: Tighten modified time value across the filesystem objects
It didn't make any sense to hardcode the modified time of all created
inodes with "mepoch", so we should query the procfs "backend" to get
the modified time value.
Since ProcFS is dynamically changed all the time, the modified time
equals to the querying time.
This could be changed if desired, by making the modified_time()
method virtual and overriding it in different procfs-backed objects :)
2021-06-29 20:53:59 +02:00
Liav A
d79d9e833e Kernel/ProcFS: Tighten permissions on the exposed objects
This is needed so we properly set the limits for different objects in
the filesystem.
2021-06-29 20:53:59 +02:00
Liav A
12b6e69150 Kernel: Introduce the new ProcFS design
The new ProcFS design consists of two main parts:
1. The representative ProcFS class, which is derived from the FS class.
The ProcFS and its inodes are much more lean - merely 3 classes to
represent the common type of inodes - regular files, symbolic links and
directories. They're backed by a ProcFSExposedComponent object, which
is responsible for the functional operation behind the scenes.
2. The backend of the ProcFS - the ProcFSComponentsRegistrar class
and all derived classes from the ProcFSExposedComponent class. These
together form the entire backend and handle all the functions you can
expect from the ProcFS.

The ProcFSExposedComponent derived classes split to 3 types in the
manner of lifetime in the kernel:
1. Persistent objects - this category includes all basic objects, like
the root folder, /proc/bus folder, main blob files in the root folders,
etc. These objects are persistent and cannot die ever.
2. Semi-persistent objects - this category includes all PID folders,
and subdirectories to the PID folders. It also includes exposed objects
like the unveil JSON'ed blob. These object are persistent as long as the
the responsible process they represent is still alive.
3. Dynamic objects - this category includes files in the subdirectories
of a PID folder, like /proc/PID/fd/* or /proc/PID/stacks/*. Essentially,
these objects are always created dynamically and when no longer in need
after being used, they're deallocated.
Nevertheless, the new allocated backend objects and inodes try to use
the same InodeIndex if possible - this might change only when a thread
dies and a new thread is born with a new thread stack, or when a file
descriptor is closed and a new one within the same file descriptor
number is opened. This is needed to actually be able to do something
useful with these objects.

The new design assures that many ProcFS instances can be used at once,
with one backend for usage for all instances.
2021-06-29 20:53:59 +02:00
Liav A
1baa05d6b2 Kernel/SysFS: Add PCI exposed folder 2021-06-29 20:53:59 +02:00
Liav A
92c0dab5ab Kernel: Introduce the new SysFS
The intention is to add dynamic mechanism for notifying the userspace
about hotplug events. Currently, the DMI (SMBIOS) blobs and ACPI tables
are exposed in the new filesystem.
2021-06-29 20:53:59 +02:00
Liav A
b8ec5449f2 Kernel: Remove DMI exposed blobs from ProcFS
This was a hack I wrote merely to allow dmidecode to find these blobs
somewhere.

These blobs are going to be part of upcoming SysFS :)
2021-06-29 20:53:59 +02:00
Daniel Bertalan
f820917a76 Everywhere: Use nothrow new with adopt_{ref,own}_if_nonnull
This commit converts naked `new`s to `AK::try_make` and `AK::try_create`
wherever possible. If the called constructor is private, this can not be
done, so we instead now use the standard-defined and compiler-agnostic
`new (nothrow)`.
2021-06-24 17:35:49 +04:30
Gunnar Beutner
441d6dcdf9 Kernel: Fix compiling TmpFSInode::write_bytes on x86_64 2021-06-24 09:27:13 +02:00
Hendiadyoin1
62f9377656 Kernel: Move special sections into Sections.h
This also removes a lot of CPU.h includes infavor for Sections.h
2021-06-24 00:38:23 +02:00