Age | Commit message (Collapse) | Author |
|
- Reduce max_memory_size from 512GB to 1GB for safer allocation limits
- Add memory operation logging for debugging purposes
- Implement MapMemory() with additional safety checks and large allocation handling
- Add validation checks for memory mappings
- Introduce chunked allocation strategy for large memory requests
- Add detailed error logging for memory operations
|
|
- Add maximum memory size limit of 512GB (Overkill)
- Implement additional safety checks for memory mapping:
* Validate non-zero addresses
* Verify address alignment
* Add length validation against maximum size
- Remove redundant assertion for host_offset alignment
- Remove potentially problematic mapping verification
- Improve error logging for invalid mapping attempts
These changes enhance memory safety by adding proper bounds
checking and validation before performing memory mappings,
while removing a potentially problematic post-mapping
verification step.
|
|
Renames 'size' parameter to 'length' in IsValidMapping() methods to avoid
conflicts with Android NDK macros that define 'size'. This fixes compilation
issues on Android platforms where the 'size' macro is defined.
|
|
Implements several improvements to memory handling and validation:
- host_memory: Add IsValidMapping() and IsDirectMappingEnabled() methods to
validate memory access
- host_memory: Fix virtual base offset calculation to use proper pointer
arithmetic
- host_memory: Add size field to track allocation size
- nvhost_ctrl_gpu: Return InvalidState instead of InvalidValue for TPC mask
buffer size validation
- Update copyright year for citron
The changes improve memory safety by adding explicit validation checks and
fixing pointer arithmetic in the virtual memory implementation.
|
|
This commit makes two main changes:
1. Adds support for GetTpcMasks2 (ioctl 0x13) in nvhost_ctrl_gpu:
- Implements new GetTpcMasks2 method to handle TPC mask queries
- Adds IoctlGetTpcMasks structure to store mask parameters
- Returns conservative single TPC configuration for compatibility
2. Enhances memory mapping validation in HostMemory:
- Adds verification check after memory mapping operations
- Improves error handling for direct mapped address enabling
- Adds logging for mapping and direct address failures
Additional changes:
- Updates copyright headers to include citron Emulator Project
- Improves error handling and validation in several paths
- Adds debug logging for TPC mask operations
This improves GPU virtualization support and memory mapping reliability.
|
|
Add proper error handling and recovery mechanisms for memory mapping
operations instead of using assertions.
|
|
- 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.
|
|
- Replaced all references to the old project name with Citron.
- Added Citron copyright information alongside existing notices in all files.
|
|
Allows the use of the macro in constexpr-contexts.
Also avoids some potential problems when nesting braces inside it.
|
|
|
|
|
|
src/common/host_memory.cpp:410:14: error: unused function 'ChooseVirtualBase' [-Werror,-Wunused-function]
410 | static void* ChooseVirtualBase(size_t virtual_size) {
| ^~~~~~~~~~~~~~~~~
|
|
src/common/host_memory.cpp:408:47: error: use of undeclared identifier 'MAP_NORESERVE'
MAP_PRIVATE | MAP_ANONYMOUS | MAP_NORESERVE, -1, 0);
^
|
|
* So we can use it in common
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Project Lime - yuzu Android Port
|
|
|
|
Track the private anonymous placeholder mappings created by Unmap() and
wherever possible, replace existing placeholders with larger ones
instead of creating many small ones.
This helps with the buildup of mappings in /proc/YUZU_PID/maps after a
longer gaming session, improving stability without having to increase
vm.max_map_count to a ridiculous value. The amount of placeholder
mappings will no longer outgrow the amount of actual memfd mappings in
cases of high memory fragmentation.
|
|
|
|
|
|
Specify that we do not require swap to be reserved for this address range;
allow overcommitting.
|
|
|
|
This formats all copyright comments according to SPDX formatting guidelines.
Additionally, this resolves the remaining GPLv2 only licensed files by relicensing them to GPLv2.0-or-later.
|
|
|
|
|
|
|
|
It is possible for virtual_offset to not be 0 when the iterator is at the beginning, and thus, std::prev(it) may be evaluated, leading to a crash in debug mode.
Co-Authored-By: Fernando S. <1731197+FernandoS27@users.noreply.github.com>
|
|
|
|
|
|
src/common/host_memory.cpp:360:14: error: use of undeclared identifier
'memfd_create'
fd = memfd_create("HostMemory", 0);
^
|
|
HW.Memory <Critical> common/host_memory.cpp:HostMemory:492: Fastmem unavailable, falling back to VirtualBuffer for memory allocation
|
|
Microsoft defines `MEM_RESERVE_PLACEHOLDER` as `0x00040000`, but our
manually imported version of it drops the last zero.
|
|
This falls back to the old approach of using a virtual buffer.
Windows is untested, but this build should fix support for Windows < 10 v1803. However without fastmem support at all.
|
|
Workaround old headers and libraries shipped on MinGW.
|
|
|
|
In theory, if we have 2 MB continously mapped, this should save one layer of TLB.
Let's make it at least more likely by aligning the memory.
|
|
|
|
|