Age | Commit message (Collapse) | Author |
|
Otherwise, `MMIO::MMIO` will fault on the RPi 3 due to accessing
`__stack_chk_guard` before the kernel is mapped into high memory.
|
|
This is the only kernel issue blocking us from running the test suite.
Having userspace backtraces printed to the debug console during crashes
isn't vital to the system's function, so let's just return an empty
trace and print a FIXME instead of crashing.
|
|
Sadly, we don't have proper error propagation here. However, crashing
the Kernel just because a CDROM contains an invalid month seems like a
bad idea.
|
|
|
|
After examination of all overriden Inode::traverse_as_directory methods
it seems like proper locking is already existing everywhere, so there's
no need to take the big process lock anymore, as there's no access to
shared process structures anyway.
|
|
The contents of the directory inode could change if we are not taking so
we must take the m_inode_lock to prevent corruption when reading the
directory contents.
|
|
All shared structures are already protected by "atomic" spinlocks for
those structures, so there's no need to take the big process lock.
|
|
All accesses to the mount table are already serialized by the actual
spinlock of that table.
|
|
This is not needed, because when we are doing this traversing, functions
that are called from this function are using proper and more "atomic"
locking.
|
|
This locking is simply not needed because the associated SysFS component
will use proper and more "atomic" locking on its own.
|
|
|
|
|
|
This is easily identifiable by anyone who uses Duration::now_monotonic,
and any downstream users of that data.
|
|
"Wherever applicable" = most places, actually :^), especially for
networking and filesystem timestamps.
This includes changes to unzip, which uses DOSPackedTime, since that is
changed for the FAT file systems.
|
|
That's what this class really is; in fact that's what the first line of
the comment says it is.
This commit does not rename the main files, since those will contain
other time-related classes in a little bit.
|
|
Add a helper initialize_interrupt_queue() helper to enable_irq instead
of doing it as part of its object construction as it can fail. This is
similar to how AHCI initializes its interrupt as well.
|
|
NVMe{Poll|Interrupt}Queue don't have a try_create() method. Add one to
keep it consistent with how we create objects. Also this commit is in
preparation to moving any initialization related code out of the
constructor.
|
|
Propagate error if the rw_dma_page is NULL in try_create and use
relase_nonnull to convert RefPtr to NonnullRefPtr before passing it to
the NVMeQueue.
|
|
{cq|sq}_dma_page are not used by the NVMeQueue class. Remove them.
|
|
Upgrade to GCC 13.1.0 triggered an UBSAN in PCIIRQHandler. Moving the
handle_interrupt() function out-of-line fixes this issue.
|
|
This commit lets us differentiate whether access faults are caused by
accessing junk memory addresses given to us by userspace or if we hit a
kernel bug.
The stub implementations of the `safe_*` functions currently don't let
us jump back into them and return a value indicating failure, so we
panic if such a fault happens. Practically, this means that we still
crash, but if the access violation was caused by something else, we take
the usual kernel crash code path and print a register and memory dump,
rather than hitting the `TODO_AARCH64` in `handle_safe_access_fault`.
|
|
We want to detect if an access fault comes from within these operations,
so they cannot be calling out to the non-safe variants.
|
|
These are used in futexes, which are needed if we want to get further in
`run-tests`.
For now, we have no way to return a non-fatal error if an access fault
is raised while executing these, so the kernel will panic. Some would
consider this a DoS vulnerability where a malicious userspace app can
crash the kernel by passing bogus pointers to it, but I prefer to call
it progress :^)
|
|
Enabling these will fix the Unsupported Exclusive or Atomic access data
fault we get on bare metal Raspberry Pi 3. On A53/A57 chips (and newer),
atomic compare-exchange operations require the data cache to be enabled.
|
|
Referencing ARM DDI 0487J.a, update the names of previously reserved
fields, and set the reset_value() of the SCTLR_EL1 struct to reflect
the defaults we want for this register on reboot.
|
|
... key-value decomposition
The RaspberryPi firmware will give us a value for the 'video' key that
contains multiple equal signs:
```
video=HDMI-A-1:1920x1080M@30D,margin_left=48,margin_right=48,[...]
```
Instead of asserting that this only has one equal sign, let's just split
it by the first one.
|
|
Remove the hardcoded "AHCI Scattered DMA" for region name as it is a
part of a common API. Add region_name parameter to the try_create API
so that this API can be used by other drivers with the correct Memory
region name.
|
|
The constructor code of ScatterGatherList had code that can return
error. Move it to try_create for better error propagation.
This removes one TODO() and one
release_value_but_fixme_should_propagate_errors().
|
|
This removes the TODO from the try_create API to return ErrorOr. This
is also a preparation patch to move the init code in the constructor
that can fail to this try_create function.
|
|
|
|
These 2 are an actual separate types of syscalls, so let's stop using
special flags for bind mounting or re-mounting and instead let userspace
calling directly for this kind of actions.
|
|
The Multiboot header stores the framebuffer's pitch in bytes, so
multiplying it by the pixel's size is not necessary. We ended up
allocating 4 times as much memory as needed, which caused us to overlap
the MMIO reserved memory area on the Raspberry Pi.
|
|
Otherwise, the message's contents might be in the cache only, so
VideoCore will read stale/garbage data from main memory.
This fixes framebuffer setup on bare metal with the data cache enabled.
|
|
While the PL011-based UART0 is currently reserved for the kernel
console, UART1 is free to be exposed to the userspace as `/dev/ttyS0`.
This will be used as the stdout of `run-tests-and-shutdown.sh` when
testing the AArch64 kernel.
|
|
|
|
The Raspberry Pi hardware doesn't support a proper software-initiated
shutdown, so this instead uses the watchdog to reboot to a special
partition which the firmware interprets as an immediate halt on
shutdown. When running under Qemu, this causes the emulator to exit.
|
|
We now have everything in the AArch64 kernel to be able to use the full
`__panic` implementation, so we can share the code with x86-64.
I have kept `__assertion_failed` separate for now, as the x86-64 version
directly executes inline assembly, thus `Kernel/Arch/aarch64/Panic.cpp`
could not be removed.
|
|
Both of those are specified by POSIX.
|
|
Add MSI support to AHCI. Prefer MSI interrupts over pin-based
interrupts.
|
|
Extend reserve_irqs, allocate_irq, enable_interrupt and
disable_interrupt API to add MSI support in PCI device.
The current changes only implement single MSI message support.
TODOs have been added to support Multiple MSI Message (MME) support in
the future.
|
|
Implement enabling and disabling MSI interrupts for a PCI device.
Removes two more TODO()s from PCI::Device.cpp :^)
|
|
Instead of iterating through the capabilities, use the is_msi_capable()
API from the PCIDeviceIdentifier class that belongs to the device.
|
|
Add a struct named MSIInfo that stores all the relevant MSI
information as a part of PCI DeviceIdentifier struct.
Populate the MSI struct during the PCI device init.
|
|
This was erroneously deleted in 420952a4334b05d6ac639429e876150c78866963
|
|
This ensure that the stack pointer also stays 16 byte aligned. This
fixes a baremetal issue when getting an exception.
|
|
This is useful when debugging baremetal issues.
|
|
These functions would have caused a `-Woverloaded-virtual` warning with
GCC 13, as they shadow `File::{attach,detach}(OpenFileDescription&)`.
Both of these functions had a single call site. This commit inlines
`attach` into its only caller, `FIFO::open_direction`.
Instead of explicitly checking `is_fifo()` in `~OpenFileDescription`
before running the `detach(Direction)` overload, let's just override the
regular `detach(OpenFileDescription&)` for `FIFO` to perform this action
instead.
|
|
Commands that were helpful while investigating this:
```
grep -P '^set' Meta/CMake/all_the_debug_macros.cmake \
| sed -Ee 's,set\((.+) ON\)$,\1,' > macros.lst
for i in $(cat macros.lst); do
echo -n "$i "; git grep -Pn '\b'"$i"'\b' | wc -l
done | tee matches.lst
sort -k2 -n matches.lst
```
|
|
This logo was actually used as a first sign of life in the very early
days of the aarch64 port.
Now that we boot into the graphical mode of the system just fine there's
no need to keep this.
|
|
Add MSIx support to NVMe. Prefer MSIx over pin-based interrupts as they
are more efficient and all modern hardware support them.
|