summaryrefslogtreecommitdiff
path: root/src/core/arm
AgeCommit message (Collapse)Author
2025-05-12android: Update build system and optimize ARM NCE implementationZephyron
- Update Kotlin from 1.9.20 to 2.1.20-RC2 - Upgrade Java version from 17 to 21 - Update Android Gradle plugin from 8.1.2 to 8.9.0 - Update Gradle wrapper from 8.10.2 to 8.11.1 - Update NDK version to 29.0.13113456 rc1 - Update all Android dependencies to latest versions - Simplify ARM NCE implementation by removing custom TLB handling - Improve alignment and access fault handling - Update hardware BASE_CLOCK_RATE from 1.02GHz to 1.785GHz - Add citron Emulator Project copyright notices Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-05-12arm: Improve TLB implementation and fault handling in NCEZephyron
This commit enhances the Translation Lookaside Buffer (TLB) implementation in the ARM Native Code Execution (NCE) component to increase stability, particularly on Android devices. The changes prioritize robustness and error recovery over performance optimizations. Key improvements: - Replace set-associative TLB with a simpler linear search implementation - Implement a basic LRU replacement policy for TLB entries - Add validation checks for memory addresses before TLB insertion - Ensure proper page alignment for guest and host addresses - Enhance alignment fault handling with instruction skipping as fallback - Add comprehensive debug logging for memory access errors - Improve error recovery in guest memory access scenarios These changes should significantly reduce crashes during emulation on Android devices by gracefully handling memory access edge cases that previously resulted in hard crashes. Co-Authored-By: Camille LaVey <camillelavey@citron-emu.org> Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-05-12core/arm/nce: Implement TLB caching systemZephyron
Adds a software TLB cache to improve memory access performance in the NCE (Native Code Execution) system. Key changes include: - Implement set-associative TLB with 64 sets and 8 ways - Add TLB lookup before memory access in HandleGuestAccessFault - Implement LRU replacement policy with access frequency consideration - Add thread context caching to reduce overhead - Add proper synchronization with mutex locks - Add helper functions for TLB management (lookup, insert, invalidate) This change should improve performance by reducing redundant memory translations and providing faster access to frequently used pages.
2025-05-12build: upgrade fmt and SDL2Zephyron
Update fmt library to version 11.0.2 and make necessary adjustments: - Replace fmt/format.h includes with fmt/ranges.h - Add const qualifiers to formatter::format functions - Update CMake to require fmt version 11 Additional dependency updates: - Update SDL2 bundled version from 2.28.2 to 2.32.0 - Update catch2 to version 3.7.1 - Update vcpkg baseline to ca846b21276c9a3171074ac8d2b4f6516894a7d0
2025-05-11arm/video: Fix shader extension and exception handlingZephyron
Two main changes in this commit: 1. Replace NVIDIA-specific GL_NV_gpu_shader5 extension with the more widely supported GL_EXT_shader_explicit_arithmetic_types_float16 in the scaleforce shader. This improves compatibility across different GPU vendors. 2. Refactor ARM32 exception handling: - Restructure exception cases for better readability - Update exception handling to match current Dynarmic API - Fix indentation in switch statement - Remove AccessViolation case as it's no longer supported in current API These changes improve shader compatibility and align the exception handling with the current Dynarmic implementation.
2025-05-11memory: Improve null pointer and unmapped memory handlingZephyron
- Update vcpkg baseline to a42af01b72c28a8e1d7b48107b33e4f286a55ef6 - Add SPIRV-Tools and SPIRV-Headers as submodules - Update Vulkan-related submodules to latest stable versions - Improve memory access error handling: - Add specific handling for null pointer accesses in ARM32 emulation - Return 0 for null pointer reads instead of undefined behavior - Silently ignore writes to null pointers - Add more detailed error messages distinguishing between null pointer access and other unmapped memory errors - Treat addresses below 0x1000 as potential null pointer accesses These changes should provide more graceful handling of null pointer accesses and improve stability when running games that attempt invalid memory operations.
2025-05-11arm: Skip duplicate consecutive addresses in backtrace outputZephyron
Adds logic to track and skip duplicate consecutive addresses when logging backtraces. This improves log readability by removing redundant entries that point to the same address in sequence.
2024-12-20arm: Skip duplicate consecutive addresses in backtrace outputEmulationEnjoyer
ref: https://git.citron-emu.org/Citron/Citron/commit/aa56430f2a3179068f77b865d4fd0179aa5cc4c4
2024-12-20Use fmt 11.0.0Mike Lothian
2024-12-20fix: Fixes compiling to non-Apple OSes on arm64Exverge
2024-12-20externals: Update dynarmic to 6.7.1Mike Lothian
2024-01-15core: Support multiple modules per patcherGPUCode
2023-12-25core: track separate heap allocation for linuxLiam
2023-12-22kernel: instantiate memory separately for each guest processLiam
2023-12-20Merge pull request #12417 from liamwhite/arm64-gcc-fixFernando S
nce: hide shadowing warnings from dynarmic headers
2023-12-20nce: hide shadowing warnings from dynarmic headersLiam
2023-12-19nce: increase handler stack sizeLiam
2023-12-19nce: fix read size in simd immediate emulationLiam
2023-12-11nce: adjust initialization for repeated callsLiam
2023-12-10nce: implement instruction emulation for misaligned memory accessesLiam
2023-12-09debug: fix reading of module namesLiam
2023-12-06Merge pull request #12236 from liamwhite/cpu-refactorFernando S
core: refactor emulated cpu core activation
2023-12-04arm: fix context save of vector regsLiam
2023-12-04core: refactor emulated cpu core activationLiam
2023-12-02nce: fix pre-text patch for single modulesLiam
2023-11-29core: Rename patcher fileGPUCode
2023-11-25oaknut: Address warningsGPUCode
2023-11-25Address more review commentsGPUCode
2023-11-25arm_nce: skip data aborts for crash handling parityLiam
2023-11-25arm: Print backtrace on data abortGPUCode
2023-11-25patch: check offsets from first code wordLiam
2023-11-25arm_nce: skip dc cvac on possibly write-protected areasLiam
2023-11-25Address some review commentsGPUCode
2023-11-25arm: Implement native code execution backendLiam
2023-11-13core: check for thread dpc before eretLiam
2023-10-21kernel: update KProcessLiam
2023-08-02Merge pull request #10839 from lat9nq/pgc-plusliamwhite
general: Reimplement per-game configurations
2023-07-26Merge pull request #10990 from comex/ubsanliamwhite
Fixes and workarounds to make UBSan happier on macOS
2023-07-21core: remove remaining uses of dynamic_castLiam
2023-07-21settings,general: Rename non-confirming enumslat9nq
2023-07-15Fixes and workarounds to make UBSan happier on macOScomex
There are still some other issues not addressed here, but it's a start. Workarounds for false-positive reports: - `RasterizerAccelerated`: Put a gigantic array behind a `unique_ptr`, because UBSan has a [hardcoded limit](https://stackoverflow.com/questions/64531383/c-runtime-error-using-fsanitize-undefined-object-has-a-possibly-invalid-vp) of how big it thinks objects can be, specifically when dealing with offset-to-top values used with multiple inheritance. Hopefully this doesn't have a performance impact. - `QueryCacheBase::QueryCacheBase`: Avoid an operation that UBSan thinks is UB even though it at least arguably isn't. See the link in the comment for more information. Fixes for correct reports: - `PageTable`, `Memory`: Use `uintptr_t` values instead of pointers to avoid UB from pointer overflow (when pointer arithmetic wraps around the address space). - `KScheduler::Reload`: `thread->GetOwnerProcess()` can be `nullptr`; avoid calling methods on it in this case. (The existing code returns a garbage reference to a field, which is then passed into `LoadWatchpointArray`, and apparently it's never used, so it's harmless in practice but still triggers UBSan.) - `KAutoObject::Close`: This function calls `this->Destroy()`, which overwrites the beginning of the object with junk (specifically a free list pointer). Then it calls `this->UnregisterWithKernel()`. UBSan complains about a type mismatch because the vtable has been overwritten, and I believe this is indeed UB. `UnregisterWithKernel` also loads `m_kernel` from the 'freed' object, which seems to be technically safe (the overwriting doesn't extend as far as that field), but seems dubious. Switch to a `static` method and load `m_kernel` in advance.
2023-07-09arm_interface: correct breakpoint rewind conditionLiam
2023-06-27arm_dynarmic_32: Remove disabling of block linking on arm64Merry
2023-06-12core: decouple ARM interface from DynarmicLiam
2023-04-01core: arm_dynarmic_32: Update SaveContext/LoadContext.bunnei
2023-03-23memory: rename global memory references to application memoryLiam
2023-03-22kernel: use KTypedAddress for addressesLiam
2023-02-13general: rename CurrentProcess to ApplicationProcessLiam
2023-02-06kernel/svc: switch to generated wrappersLiam
2023-01-14Be careful of mangled out of bounds readKelebek1