summaryrefslogtreecommitdiff
path: root/Kernel/Arch
AgeCommit message (Collapse)Author
2022-04-02Kernel: Make handle_crash available to aarch64James Mintram
2022-04-02Kernel: Make PageDirectory.cpp compile on aarch64James Mintram
2022-04-02Kernel: Make PhysicalRegion.cpp compile on aarch64James Mintram
2022-04-02Kernel: Make Region.cpp compile on aarch64James Mintram
2022-04-02Kernel: Add missing new/delete and kcalloc to dummy.cppJames Mintram
2022-04-02Kernel: Re-add dummy.cpp and remove duplicate definitionsJames Mintram
2022-04-02Kernel: Add idle_thread() to aarch64 Processor.hJames Mintram
2022-04-02Kernel: Add PAGE_MASK to an aarch64 CPU headerJames Mintram
2022-04-01Everywhere: Run clang-formatIdan Horowitz
2022-03-27Kernel: Support all AMD-defined CPUID feature flags for EAX=80000001hLinus Groh
We're now able to detect all the AMD-defined CPUID feature flags from ECX/EDX for EAX=80000001h :^)
2022-03-27Kernel: Support all Intel-defined extended CPUID feature flags for EAX=7Linus Groh
We're now able to detect all the extended CPUID feature flags from EBX/ECX/EDX for EAX=7 :^)
2022-03-27Kernel: Support all Intel-defined CPUID feature flags for EAX=1Linus Groh
We're now able to detect all the regular CPUID feature flags from ECX/EDX for EAX=1 :^) None of the new ones are being used for anything yet, but they will show up in /proc/cpuinfo and subsequently lscpu and SystemMonitor. Note that I replaced the periods from the SSE 4.1 and 4.2 instructions with underscores, which matches the internal enum names, Linux's /proc/cpuinfo and the general pattern of replacing special characters with underscores to limit feature names to [a-z0-9_]. The enum member stringification has been moved to a new function for better re-usability and to avoid cluttering up Processor.cpp.
2022-03-27Kernel: Implement CPUFeature as an ArbitrarySizedEnumLinus Groh
This will make it possible to add many, many more CPU features - more than the current limit 32 and later limit of 64 if we stick with an enum class to be specific :^)
2022-03-27Kernel: Fix whack formatting of the CPUID constructorLinus Groh
2022-03-27Kernel: Reorder code in Processor::cpu_detect() for readabilityLinus Groh
Checks of ECX go before EDX, and the bit indices are now ordered properly. Additionally, handling of the EDX[11] bit has been moved into a lambda function to keep the series of if statements neatly together. All of this makes it *a lot* easier to follow along and compare the implementation to the tables in the Intel manual, e.g. to find missing checks.
2022-03-22Kernel: Add and use bitwise operators to CPUFeatureHendiadyoin1
2022-03-21Kernel: Add helpers for rdrand and rdseedIdan Horowitz
2022-03-17Kernel: Use default constructors/destructorsLenny Maiorani
https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#cother-other-default-operation-rules "The compiler is more likely to get the default semantics right and you cannot implement these functions better than the compiler."
2022-03-12Kernel: Move aarch64 Prekernel into KernelJakub V. Flasar
As there is no need for a Prekernel on aarch64, the Prekernel code was moved into Kernel itself. The functionality remains the same. SERENITY_KERNEL_AND_INITRD in run.sh specifies a kernel and an inital ramdisk to be used by the emulator. This is needed because aarch64 does not need a Prekernel and the other ones do.
2022-03-12Kernel: Create a stub mcontext for aarch64Jakub V. Flasar
The struct only has a stub integer so that the size is the same for C and C++. Something caught by CLion. This commit was made with mrkct's help!
2022-03-04Kernel: Fix silly unintentional use of operator,Ali Mohammad Pur
Everyone's favourite activity, copy pasta, has produced yet another confusing use of operator,; fix this and make it less confusing.
2022-03-04Kernel: Add support for SA_SIGINFOAli Mohammad Pur
We currently don't really populate most of the fields, but that can wait :^)
2022-02-27Kernel: Add Processor::try_for_each() for fallible iterationIdan Horowitz
This API will allow users to short circuit iteration and properly propagate errors.
2022-02-27Kernel: Set CS selector when initializing thread context on x86_64Idan Horowitz
These are not technically required, since the Thread constructor already sets these, but they are set on i686, so let's try and keep consistent behaviour between the different archs.
2022-02-21Kernel: Implement booting all CPU cores on x86_64Tom
The AP boot code was partially adapted to build on x86_64 but didn't properly jump into 64 bit mode. Furthermore, the APIC code was still using 32 bit pointers. Fixes #12662
2022-02-18Kernel: Add 'RegisterState' & 'KString::try_create' stubs for aarch64Marco Cutecchia
The aarch64 build was broken due to missing these two things, this commit adds two empty stubs for them
2022-02-11Kernel: Workaround QEMU hypervisor.framework CPUID max leaf bugIdan Horowitz
This works around issue #10382 until it is fixed on QEMU's side. Patch from Anonymous.
2022-02-09Kernel: Change static constexpr variables to constexpr where possibleLenny Maiorani
Function-local `static constexpr` variables can be `constexpr`. This can reduce memory consumption, binary size, and offer additional compiler optimizations. These changes result in a stripped x86_64 kernel binary size reduction of 592 bytes.
2022-02-03Kernel: Move Spinlock lock/unlock functions out of lineAndreas Kling
I don't see why these have to be inlined everywhere in the kernel.
2022-01-30Kernel/Interrupts: Initialize two spurious handlers when PIC is disabledLiav A
Even if the PIC was disabled it can still generate noise (spurious IRQs) so we need to register two handlers for handling such cases. Also, we declare interrupt service routine offset 0x20 to 0x2f as reserved, so when the PIC is disabled, we can handle spurious IRQs from the PIC at separate handlers.
2022-01-30Kernel: Simplify x86 IOPL sanity checkAndreas Kling
Move this architecture-specific sanity check (IOPL must be 0) out of Scheduler and into the x86 enter_thread_context(). Also do this for every thread and not just userspace ones.
2022-01-30Kernel: Make Thread::State an `enum class` and use it consistentlyAndreas Kling
It was annoyingly hard to spot these when we were using them with different amounts of qualification everywhere. This patch uses Thread::State::Foo everywhere instead of Thread::Foo or just Foo.
2022-01-30Kernel: Don't dispatch signals in Processor::enter_current()Andreas Kling
Signal dispatch is already taken care of elsewhere, so there appears to be no need for the hack in enter_current(). This also allows us to remove the Thread::m_in_block flag, simplifying thread blocking logic somewhat. Verified with the original repro for #4336 which this was meant to fix.
2022-01-30Kernel: Remove unnecessary includes from Thread.hAndreas Kling
...and deal with the fallout by adding missing includes everywhere.
2022-01-29Everywhere: Remove redundant inline keywordLenny Maiorani
`constexpr` implies `inline` so when both are used it is redundant.
2022-01-28Kernel: Move kernel region checks from x86 page fault handler to MMAndreas Kling
Ideally the x86 fault handler would only do x86 specific things and delegate the rest of the work to MemoryManager. This patch moves some of the address checks to a more generic place.
2022-01-26Kernel: Implement Page Attribute Table (PAT) support and Write-CombineTom
This allows us to enable Write-Combine on e.g. framebuffers, significantly improving performance on bare metal. To keep things simple we right now only use one of up to three bits (bit 7 in the PTE), which maps to the PA4 entry in the PAT MSR, which we set to the Write-Combine mode on each CPU at boot time.
2022-01-24Kernel: Don't send crash signal to process itself when it has no handlerAndreas Kling
If there's nobody listening for the crash signal, fall back to the normal crash path where we get some debug output about what happened. Thanks to Idan for suggesting the fix.
2022-01-16Kernel: Make Processor::capture_stack_trace fallible using ErrorOrIdan Horowitz
2022-01-16Kernel: Specify inline capacity of return type in capture_stack_traceIdan Horowitz
Since the inline capacity of the Vector return type was not specified explicitly, the vector was automatically copied to a 0-length inline capacity one, essentially eliminating the optimization.
2022-01-12Kernel: Convert ProcessorInfo to KStringIdan Horowitz
2022-01-12Kernel: Remove unused ProcessorInfo::m_processor fieldIdan Horowitz
2022-01-12Kernel: Rename ProcessorInfo::{m_brandstr => m_brand}Idan Horowitz
There's no need to specify the type of the member in it's name, especially not in shorthand format.
2022-01-12Kernel: Convert Processor::features_string() API to KStringBrian Gianforcaro
2022-01-08Kernel: Dump memory regions when crashing in ring 0Andreas Kling
2022-01-07Everywhere: Fix spelling mistakesmjz19910
2022-01-04Kernel: Align GDT to the size of a DescriptorIdan Horowitz
This is not actually required by the specification, but it means we will take the aligned fast-path in QEMU.
2022-01-04Kernel: Replace incorrect loop condition in write_raw_gdt_entryIdan Horowitz
Contradictory to the comment above it, this while loop was actually clearing the selectors above or equal to the edited one (instead of the selectors that were skipped when the gdt was extended), this wasn't really an issue so far, as all calls to this function did extend the GDT, which meant this condition was always false, but future calls to this function that will try to edit an existing entry would fail.
2022-01-04Kernel: Use enum instead of magic numbers for GDT descriptor typesIdan Horowitz
Some of the enum members were also renamed to reflect the fact that the segment sizes are not necessarily 32bit (64bit on x86_64).
2021-12-30Kernel: Tighten String-related includesDaniel Bertalan