1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-22 02:32:36 +01:00

vm: adjustments

Increase max range lock size (less than 512 MiB)
Remove "range_executable" flag, make it reserved.
This commit is contained in:
Nekotekina 2020-11-24 00:50:48 +03:00
parent 14fa96fdef
commit f0cba1371c
2 changed files with 7 additions and 9 deletions

View File

@ -289,8 +289,8 @@ namespace vm
return;
}
// Limit to 256 MiB at once; make sure if it operates on big amount of data, it's page-aligned
if (size > 256 * 1024 * 1024 || (size > 65536 && size % 4096))
// Limit to <512 MiB at once; make sure if it operates on big amount of data, it's page-aligned
if (size >= 512 * 1024 * 1024 || (size > 65536 && size % 4096))
{
fmt::throw_exception("Failed to lock range (flags=0x%x, addr=0x%x, size=0x%x)" HERE, flags >> 32, addr, size);
}
@ -827,8 +827,6 @@ namespace vm
safe_bits |= range_readable;
if (old_val & start_value & page_writable && safe_bits & range_readable)
safe_bits |= range_writable;
if (old_val & start_value & page_executable && safe_bits & range_readable)
safe_bits |= range_executable;
// Protect range locks from observing changes in memory protection
_lock_main_range_lock(safe_bits, start * 4096, page_size);

View File

@ -13,16 +13,16 @@ namespace vm
enum range_lock_flags : u64
{
/* flags (3 bits, RWX) */
/* flags (3 bits, W + R + Reserved) */
range_readable = 4ull << 61,
range_writable = 2ull << 61,
range_executable = 1ull << 61,
range_writable = 4ull << 61,
range_readable = 2ull << 61,
range_reserved = 1ull << 61,
range_full_mask = 7ull << 61,
/* flag combinations with special meaning */
range_locked = 1ull << 61, // R+W as well, but being exclusively accessed (size extends addr)
range_locked = 4ull << 61, // R+W as well, but being exclusively accessed (size extends addr)
range_allocation = 0, // Allocation, no safe access, g_shmem may change at ANY location
range_pos = 61,