summaryrefslogtreecommitdiff
path: root/src/core/memory.cpp
AgeCommit message (Collapse)Author
2025-03-06revert ee3d858935600e23a7914620b21f45082cccf8bdZephyron
revert Follow Up Of the previous commit with the update of TLB update
2025-03-06revert 6565055865688ba316801d99a3c3a5a0300cad5dZephyron
revert Fix: Core_Memory logging and ARM_NCE Mutex logging
2025-03-06revert 031c635095622a35982f7f6faef894df9583e888Zephyron
revert arm: corrected declarations
2025-03-05arm: corrected declarationsCamilleLaVey
2025-03-05Fix: Core_Memory logging and ARM_NCE Mutex loggingCamilleLaVey
2025-03-04Follow Up Of the previous commit with the update of TLB updateCamilleLaVey
2025-02-03memory: Improve debug logging and validation in InvalidateNCEZephyron
Add more detailed debug logging and validation to the InvalidateNCE function: - Add entry debug log showing NCE invalidation request details - Add upfront validation of memory region before proceeding - Add debug logs for rasterizer and separate heap handling cases - Add warning logs for invalid address ranges and failed invalidations - Improve error message formatting and clarity - Group related operations with descriptive comments These changes make it easier to debug NCE invalidation issues by providing more visibility into the validation steps and failure cases.
2025-01-18memory: 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-01-14Revert incorrect copyright attribution for non-contributed filesZephyron
- In commit b3facaa6bb30cdc39f2b7d632fef1e3bfeee7785, the copyright header was updated to include "Citron Homebrew Project" across multiple files, regardless of whether any contributions were made. - This commit removes the incorrect attribution and reverts the copyright header to its previous state. - Copyright attribution should only be added when meaningful contributions have been made to the file. - This commit ensures proper compliance with copyright standards and maintains correct attribution to the respective contributors. - Special thanks to Tachi for pointing out the need for these corrections and ensuring that proper attribution practices are followed.
2024-12-31core: Update copyright headersZephyron
- Update copyright headers to include Citron Homebrew Project - Add 2025 to copyright years
2024-12-31chore: update project references and add Citron copyrightZephyron
- Replaced all references to the old project name with Citron. - Added Citron copyright information alongside existing notices in all files.
2024-03-04"Merge Tagged PR 13018"yuzubot
2024-02-19scope_exit: Make constexprFearlessTobi
Allows the use of the macro in constexpr-contexts. Also avoids some potential problems when nesting braces inside it.
2024-01-27atomic_ops: Remove volatile qualifierMerry
2024-01-18SMMU: Add Android compatibilityFernando Sahmkow
2024-01-18SMMU: Implement physical memory mirroringFernando Sahmkow
2024-01-18SMMU: Initial adaptation to video_core.Fernando Sahmkow
2023-12-25core: track separate heap allocation for linuxLiam
2023-12-22general: properly support multiple memory instancesLiam
2023-12-04core: refactor emulated cpu core activationLiam
2023-11-25Address more review commentsGPUCode
2023-11-25arm: Implement native code execution backendLiam
2023-11-25core: Respect memory permissions in MapGPUCode
2023-11-16Merge pull request #11995 from FernandoS27/you-dont-need-the-new-iphoneliamwhite
Revert PR #11806 and do a proper fix to the memory handling.
2023-11-12Memory: Fix invalidation handling from the CPU/ServicesFernando Sahmkow
2023-11-10kernel: add KPageTableBaseLiam
Co-authored-by: Kelebek1 <eeeedddccc@hotmail.co.uk>
2023-07-28Merge pull request #11155 from liamwhite/memory3liamwhite
memory: check page against address space size
2023-07-26Merge pull request #10990 from comex/ubsanliamwhite
Fixes and workarounds to make UBSan happier on macOS
2023-07-25memory: check page against address space sizeLiam
2023-07-22memory: minimize dependency on processLiam
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-14k_process: PageTable -> GetPageTableLiam
2023-07-02Use spans over guest memory where possible instead of copying data.Kelebek1
2023-06-28Memory Tracking: Optimize tracking to only use atomic writes when contested ↵Fernando Sahmkow
with the host GPU
2023-06-28MemoryTracking: Initial setup of atomic writes.Fernando Sahmkow
2023-05-07Address feedback, add CR notice, etcFernando Sahmkow
2023-05-07Settings: add option to enable / disable reactive flushingFernando Sahmkow
2023-05-07GPU: Add Reactive flushingFernando Sahmkow
2023-04-23Accuracy Normal: reduce accuracy further for perf improvements in Project LimeFernando Sahmkow
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-01-25Revert "MemoryManager: use fastmem directly."Merry
This reverts commit af5ecb0b15d4449f58434e70eed835cf71fc5527.
2023-01-15memory: fix watchpoint use when fastmem is enabledLiam
2023-01-05MemoryManager: use fastmem directly.Fernando Sahmkow
2022-12-11Merge pull request #9415 from liamwhite/dcMai
memory: correct semantics of data cache management operations
2022-12-11memory: correct semantics of data cache management operationsLiam
2022-12-10memory: remove DEBUG_ASSERT pointer testLiam
2022-11-12kernel: implement FlushProcessDataCacheLiam
2022-10-22general: Resolve -Wunused-lambda-capture and C5233Morph