aboutsummaryrefslogtreecommitdiff
path: root/src/core/arm
AgeCommit message (Collapse)Author
2020-06-27General: Add better safety for JIT use.Fernando Sahmkow
2020-06-27General: Recover Prometheus project from harddrive failure Fernando Sahmkow
This commit: Implements CPU Interrupts, Replaces Cycle Timing for Host Timing, Reworks the Kernel's Scheduler, Introduce Idle State and Suspended State, Recreates the bootmanager, Initializes Multicore system.
2020-06-22arm_dynarmic_64: Log the instruction when an exception is raisedMorph
2020-06-22arm_dynarmic_32: Log under Core_ARM instead of HW_GPUMorph
2020-06-18arm_dynarmic_32: Fix implicit conversion error in SetTPIDR_EL0ReinUsesLisp
On MSVC builds we treat conversion warnings as errors.
2020-06-17arm_dynarmic_cp15: Implement CNTPCTMerryMage
2020-06-17arm_dynarmic_cp15: Update CP15MerryMage
2020-06-17arm_dynarmic_32: InterpreterFallback should never happenMerryMage
2020-04-24physical_core: Make use of std::make_unique instead of std::make_shared in ctorLioncash
We can also allow unicorn to be constructed in 32-bit mode or 64-bit mode to satisfy the need for both interpreter instances. Allows this code to compile successfully of non x86-64 architectures.
2020-04-20Merge pull request #3724 from bunnei/fix-unicornbunnei
core: arm_unicorn: Fix interpret fallback by temporarily mapping instruction page.
2020-04-20dynarmic: Add option to disable CPU JIT optimizationsMerryMage
2020-04-19core: arm_unicorn: Fix interpret fallback by temporarily mapping instruction ↵bunnei
page.
2020-04-17dynarmic: Enable strict alignment checks.bunnei
- Also add a missing include.
2020-04-17core: memory: Move to Core::Memory namespace.bunnei
- helpful to disambiguate Kernel::Memory namespace.
2020-04-17core: kernel: Move SVC to its own namesapce.bunnei
2020-04-17arm_interface: Ensure ThreadContext is zero'd out.bunnei
2020-04-15CMakeLists: Specify -Wextra on linux buildsLioncash
Allows reporting more cases where logic errors may exist, such as implicit fallthrough cases, etc. We currently ignore unused parameters, since we currently have many cases where this is intentional (virtual interfaces). While we're at it, we can also tidy up any existing code that causes warnings. This also uncovered a few bugs as well.
2020-03-02core: Implement separate A32/A64 ARM interfaces.bunnei
2020-03-02core: dynarmic: Add CP15 from Citra.bunnei
2020-02-26ARM_Interface: Cache the JITs instead of deleting/recreating.Fernando Sahmkow
This was a bug inherited from citra which was fixed by then at some time. This commit corrects such bug and ensures JITs are correctly recycled.
2020-02-11Core: Set all hardware emulation constants in a single file.Fernando Sahmkow
2020-01-30core/arm: Remove usage of global GetCurrentThread()Lioncash
Now both CPU backends go through their referenced system instance to obtain the current thread.
2020-01-27System: Address FeedbackFernando Sahmkow
2020-01-26Core: Refactor CpuCoreManager to CpuManager and Cpu to Core Manager.Fernando Sahmkow
This commit instends on better naming the new purpose of this classes.
2020-01-26ArmInterface: Delegate Exclusive monitor factory to exclusive monitor ↵Fernando Sahmkow
interfasce.
2020-01-01core/memory + arm/dynarmic: Use a global offset within our arm page table.Markus Wick
This saves us two x64 instructions per load/store instruction. TODO: Clean up our memory code. We can use this optimization here as well.
2019-11-26core/memory: Migrate over Write{8, 16, 32, 64, Block} to the Memory classLioncash
The Write functions are used slightly less than the Read functions, which make these a bit nicer to move over. The only adjustments we really need to make here are to Dynarmic's exclusive monitor instance. We need to keep a reference to the currently active memory instance to perform exclusive read/write operations.
2019-11-26core/memory: Migrate over Read{8, 16, 32, 64, Block} to the Memory classLioncash
With all of the trivial parts of the memory interface moved over, we can get right into moving over the bits that are used. Note that this does require the use of GetInstance from the global system instance to be used within hle_ipc.cpp and the gdbstub. This is fine for the time being, as they both already rely on the global system instance in other functions. These will be removed in a change directed at both of these respectively. For now, it's sufficient, as it still accomplishes the goal of de-globalizing the memory code.
2019-11-26core: Prepare various classes for memory read/write migrationLioncash
Amends a few interfaces to be able to handle the migration over to the new Memory class by passing the class by reference as a function parameter where necessary. Notably, within the filesystem services, this eliminates two ReadBlock() calls by using the helper functions of HLERequestContext to do that for us.
2019-11-12arm_unicorn: Resolve sign conversion warningsLioncash
While we're at it, this also resolves a type truncation warning as well, given the code was truncating from a 64-bit value to a 32-bit one.
2019-10-11Core_Timing: Address Feedback and suppress warnings.Fernando Sahmkow
2019-10-09Core Timing: Rework Core Timing to run all cores evenly.Fernando Sahmkow
2019-09-29Revert "arm_dynarmic: Check if jit is nullptr when preparing reschedule"bunnei
2019-09-29Merge pull request #2574 from DarkLordZach/dynarmic-jit-nullptrbunnei
arm_dynarmic: Check if jit is nullptr when preparing reschedule
2019-07-12core: Remove CurrentArmInterface() global accessorLioncash
Replaces the final usage of the global accessor function and removes it. Removes one more enabler of global state.
2019-07-11core/arm: Remove obsolete Unicorn memory mappingLioncash
This was initially necessary when AArch64 JIT emulation was in its infancy and all memory-related instructions weren't implemented. Given the JIT now has all of these facilities implemented, we can remove these functions from the CPU interface.
2019-06-10arm_dynarmic: Check if jit is nullptr when preparing rescheduleZach Hilman
Prevents crash with multiprocess loading.
2019-05-26loader: Move NSO module tracking to AppLoaderZach Hilman
Also cleanup of general stuff
2019-05-25arm_interface: Expand backtrace generationZach Hilman
Returns results as a vector of entries for further processing. Logs addresses, offsets, and mangled name.
2019-04-11core/cpu_core_manager: Create threads separately from initialization.Lioncash
Our initialization process is a little wonky than one would expect when it comes to code flow. We initialize the CPU last, as opposed to hardware, where the CPU obviously needs to be first, otherwise nothing else would work, and we have code that adds checks to get around this. For example, in the page table setting code, we check to see if the system is turned on before we even notify the CPU instances of a page table switch. This results in dead code (at the moment), because the only time a page table switch will occur is when the system is *not* running, preventing the emulated CPU instances from being notified of a page table switch in a convenient manner (technically the code path could be taken, but we don't emulate the process creation svc handlers yet). This moves the threads creation into its own member function of the core manager and restores a little order (and predictability) to our initialization process. Previously, in the multi-threaded cases, we'd kick off several threads before even the main kernel process was created and ready to execute (gross!). Now the initialization process is like so: Initialization: 1. Timers 2. CPU 3. Kernel 4. Filesystem stuff (kind of gross, but can be amended trivially) 5. Applet stuff (ditto in terms of being kind of gross) 6. Main process (will be moved into the loading step in a following change) 7. Telemetry (this should be initialized last in the future). 8. Services (4 and 5 should ideally be alongside this). 9. GDB (gross. Uses namespace scope state. Needs to be refactored into a class or booted altogether). 10. Renderer 11. GPU (will also have its threads created in a separate step in a following change). Which... isn't *ideal* per-se, however getting rid of the wonky intertwining of CPU state initialization out of this mix gets rid of most of the footguns when it comes to our initialization process.
2019-04-07kernel/svc: Deglobalize the supervisor call handlersLioncash
Adjusts the interface of the wrappers to take a system reference, which allows accessing a system instance without using the global accessors. This also allows getting rid of all global accessors within the supervisor call handling code. While this does make the wrappers themselves slightly more noisy, this will be further cleaned up in a follow-up. This eliminates the global system accessors in the current code while preserving the existing interface.
2019-04-07arm/arm_dynarmic: Remove unnecessary current_page_table memberLioncash
Given the page table will always be guaranteed to be that of whatever the current process is, we no longer need to keep this around.
2019-04-05Merge pull request #2240 from FearlessTobi/port-4651bunnei
Port citra-emu/citra#4651: "gdbstub: Fix some bugs in IsMemoryBreak() and ServeBreak. Add workaround to let watchpoints break into GDB."
2019-04-04core: Add missing override specifiers where applicableLioncash
Applies the override specifier where applicable. In the case of destructors that are defaulted in their definition, they can simply be removed. This also removes the unnecessary inclusions being done in audin_u and audrec_u, given their close proximity.
2019-03-16core: Move PageTable struct into Common.bunnei
2019-03-15gdbstub: Fix some bugs in IsMemoryBreak() and ServeBreak. Add workaround to ↵Dimitri A
let watchpoints break into GDB. (#4651) * gdbstub: fix IsMemoryBreak() returning false while connected to client As a result, the only existing codepath for a memory watchpoint hit to break into GDB (InterpeterMainLoop, GDB_BP_CHECK, ARMul_State::RecordBreak) is finally taken, which exposes incorrect logic* in both RecordBreak and ServeBreak. * a blank BreakpointAddress structure is passed, which sets r15 (PC) to NULL * gdbstub: DynCom: default-initialize two members/vars used in conditionals * gdbstub: DynCom: don't record memory watchpoint hits via RecordBreak() For now, instead check for GDBStub::IsMemoryBreak() in InterpreterMainLoop and ServeBreak. Fixes PC being set to a stale/unhit breakpoint address (often zero) when a memory watchpoint (rwatch, watch, awatch) is handled in ServeBreak() and generates a GDB trap. Reasons for removing a call to RecordBreak() for memory watchpoints: * The``breakpoint_data`` we pass is typed Execute or None. It describes the predicted next code breakpoint hit relative to PC; * GDBStub::IsMemoryBreak() returns true if a recent Read/Write operation hit a watchpoint. It doesn't specify which in return, nor does it trace it anywhere. Thus, the only data we could give RecordBreak() is a placeholder BreakpointAddress at offset NULL and type Access. I found the idea silly, compared to simply relying on GDBStub::IsMemoryBreak(). There is currently no measure in the code that remembers the addresses (and types) of any watchpoints that were hit by an instruction, in order to send them to GDB as "extended stop information." I'm considering an implementation for this. * gdbstub: Change an ASSERT to DEBUG_ASSERT I have never seen the (Reg[15] == last_bkpt.address) assert fail in practice, even after several weeks of (locally) developping various branches around GDB. Only leave it inside Debug builds.
2019-02-16Corrections, documenting and fixes.Fernando Sahmkow
2019-02-15Use u128 on Clock Cycles calculation.Fernando Sahmkow
2019-02-15Correct CNTPCT to use Clock Cycles instead of Cpu Cycles.Fernando Sahmkow
2019-02-15core_timing: Convert core timing into a classLioncash
Gets rid of the largest set of mutable global state within the core. This also paves a way for eliminating usages of GetInstance() on the System class as a follow-up. Note that no behavioral changes have been made, and this simply extracts the functionality into a class. This also has the benefit of making dependencies on the core timing functionality explicit within the relevant interfaces.