Age | Commit message (Collapse) | Author |
|
This requires a few stubs such that the compiler won't complain.
|
|
Now that the code does not use architectural specific code, it is moved
to the generic Arch directory and the paths are modified accordingly.
|
|
This is for the upcoming change to make InterruptDisabler class work for
the aarch64 build.
|
|
This adds {enable, disable}_interrupts() and are_interrupts_enabled()
to the Processor class, and also implements them for x86(_64) and
aarch64.
|
|
This register can be used to check whether the 4 different types of
interrupts are masked. A different variant can be used to set/clear
specific interrupt bits.
|
|
This requires us to add an Interrupts.h file in the Kernel/Arch
directory, which includes the architecture specific files.
The commit also stubs out the functions to be able to compile the
aarch64 Kernel.
|
|
Including signal.h would cause several ports to fail on build,
because it would end up including AK/Platform.h through these
mcontext headers. This is problematic because AK/Platform.h defines
several macros with very common names, such as `NAKED` (breaks radare2),
and `NO_SANITIZE_ADDRESS` and `ALWAYS_INLINE` (breaks ruby).
|
|
The patch also prevents any try if the CPU's vendor isn't known and
improves the const-correctness of the AMD version.
|
|
These are added as properties of the "caches" object to each processor,
if available.
|
|
|
|
This allows us to print more information about what kind of exception
happend.
|
|
The aarch64 Kernel runs with SP_EL0, thus exceptions that happen can now
be handled.
|
|
When an exception is triggered on aarch64, the processor always switches
to the exception stack which is defined by the SP_EL1 register.
|
|
When disabling UBSAN, the compiler would complain that the constraints
of the inline assembly could not be met. By adding the alignas specifier
the compiler can now determine that the struct can be passed into a
register, and thus the constraints are met.
|
|
This adds some new buffers to the `FPUState` struct, which contains
enough space for the `xsave` instruction to run. This instruction writes
the upper part of the x86 SIMD registers (YMM0-15) to a seperate
256-byte area, as well as an "xsave header" describing the region.
If the underlying processor supports AVX, the `fxsave` instruction is no
longer used, as `xsave` itself implictly saves all of the SSE and x87
registers.
Co-authored-by: Leon Albrecht <leon.a@serenityos.org>
|
|
|
|
This is for an upcoming change to add the Kernel namespace to the
init.cpp file.
|
|
Now that we merged all the Prekernel files into the Kernel files, we can
get rid of the Prekernel namespace as well.
|
|
|
|
This lets us delete the Prekernel.h file, and gets us closer to deleting
the Prekernel from the aarch64 Kernel.
|
|
By moving these functions to the ASM_wrapper.h file, we can get rid of
another Prekernel file.
|
|
This allows us to get rid of one more Prekernel file.
|
|
Instead of storing the current Processor into a core local register, we
currently just store it into a global, since we don't support SMP for
aarch64 anyway. This simplifies the initial implementation.
|
|
Now that we have separated the kmalloc.cpp constructors into a separate
library, we can actually call the constructors in the init function.
|
|
By putting the NOLOAD sections (.bss and .super_pages) at the end of the
ELF file, objcopy does not have to insert a lot of zeros to make sure
that the .ksyms section is at the right place in memory. Now the .ksyms
section comes before the two NOLOAD sections. This shrinks the
kernel8.img with 6MB, from 8.3M to 2.3M. :^)
|
|
The sections did end up in the ELF file, however they weren't
explicitely mentioned in the linker.ld script. In the future, we can add
the --orphan-handling=error flag to the linker options, which will
enforce that the sections used in the sources files also are mentioned
in the linker script.
|
|
This in turn makes sure that we get a nice backtrace when an assertion
failed, or when a VERIFY_NOT_REACHED() is hit.
|
|
|
|
|
|
Now that dump_backtrace() works, we can actually print a helpful
backtrace when the Kernel panics.
|
|
Since kmalloc() now works, we can actually load the kernel symbol table!
This in turn allows us to call dump_backtrace(), and actually get a
useful backtrace in the aarch64 Kernel.
|
|
With the previous commits, we are now able to call kmalloc() :^)
|
|
These functions are called by kmalloc, and since there is no support for
threading in the aarch64 build yet, we can simply remove the
VERIFY_NOT_REACHED().
|
|
|
|
The code in Spinlock.h has no architectural specific logic, thus can be
moved to the Arch directory. This contains no functional change.
Also add the Spinlock.cpp file for aarch64 which contains stubs for the
lock and unlock functions.
|
|
Previously the embedmap.sh script generated a warning, since there was
no section defined where the actual kernel.map could be stored. This is
necesarry for generating kernel backtraces.
|
|
The implementation just calls the regular memcpy, and is not safe yet.
This can be done later.
|
|
The file does not contain any specific architectural code, thus it can
be moved to the Kernel/Arch directory.
|
|
This is the first step in making dump_backtrace() work.
|
|
|
|
Previously in the aarch64 Kernel, this would cause dbgln() to actually
print more characters of the next string in memory, because strings in
the Kernel are not zero terminated by default. Prevent this by using the
passed in length of the string.
|
|
|
|
Since we can now use dbgln() in the aarch64 Kernel, lets use it! :^)
|
|
When calling dbgln(), the formatting code in AK/Format.h calls
Processor::is_initialized() to determine whether to add some text about
the current processor to the debug output. Instead of crashing, we just
return false, such that we can use dbgln() etc in the aarch64 Kernel.
|
|
This allows us to use the AK formatting functions in the aarch64 Kernel.
Also add FIXME to make sure that this file will be removed when the
proper abstractions are in place in the normal Kernel/kprintf.cpp.
|
|
I've noticed that the KVM hypervisor vendor ID string contained null
terminators in the serialized JSON string in /proc/cpuinfo - let's avoid
that, and err on the side of caution and strip them from all strings
built from CPUID register values. They may not be fixed width after all.
|
|
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.
|
|
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.
|
|
|
|
|