Commit graph

247 commits

Author SHA1 Message Date
Nekotekina 5dc3467337 vm: fix reservation_update notification
Rare function.
2021-03-23 21:09:37 +03:00
Eladash 1864419561 Fix SPU mapped memory page size 2021-03-19 22:25:08 +03:00
Nekotekina 87af905018 Enable -Wunused-parameter 2021-03-06 18:07:08 +03:00
Eladash 004ebfdaee SPU debugger: Implement MFC journal
* Allow to dump up to 1820 commands with up 128 bytes of data each, using key D with the debugger.
2021-03-02 21:57:51 +03:00
Nekotekina ea5e837bd6 fixed_typemap.hpp: return reference 2021-03-02 16:08:14 +03:00
Nekotekina d788b12a8e fixed_typemap.hpp: reduce indirection
Backported some changes from auto_typemap.hpp
Implemented methods init(), reset(), clear()
Disabled recreation support.
2021-03-02 16:08:14 +03:00
Eladash 73d45f3bf0 Remove vm::cleanup_unlock 2021-02-22 12:47:45 +03:00
Eladash 5b044a93c1
Fix vm::falloc() for misaligned args (#9764)
Force addr/size alignment.
2021-02-14 13:19:14 +03:00
Eladash 0652870204 New RSX Debugger 2021-01-28 17:40:26 +03:00
Nekotekina a69248299d SPU: Don't use shm::map_critical in SPU LS allocations
Use shm::try_map instead until proper area is found.
2021-01-25 17:45:47 +03:00
Nekotekina aaaeb66cc8 vm: Minor fix in vm::close
Supplied size was wrong.
2021-01-15 20:12:30 +03:00
Eladash e4c3b1c2bd vm: Remove vm::dealloc_verbose_nothrow 2021-01-15 17:37:52 +03:00
Nekotekina db8e6fe7a7 Enable -Wunused-variable 2021-01-12 14:34:14 +03:00
Eladash 66581d115b vm: Fix access violations on super memory, support super memory in vm::get_addr 2020-12-26 17:56:49 +03:00
Nekotekina 567d23d856 Implement util/auto_typemap.hpp
Used in vm::block_t as an example.
2020-12-24 14:55:25 +03:00
Nekotekina bd269bccaf types.hpp: remove intrinsic includes
Replace v128 with u128 in some places.
Removed some unused files.
2020-12-21 21:11:25 +03:00
Nekotekina eec11bfba9 Move align helpers to util/asm.hpp
Also add some files:
GLTextureCache.cpp
VKTextureCache.cpp
2020-12-18 18:07:42 +03:00
Nekotekina fb29933d3d Add usz alias for std::size_t 2020-12-18 12:23:53 +03:00
Nekotekina 62fdcf50ea vm: initialize g_pages at vm::init
Can reduce compile time/overhead.
2020-12-13 15:39:36 +03:00
Nekotekina b382d3b3e9 Remove ASSUME macro
It's dangerous and sometimes bluntly misused feature.
Its optimization potential is near-zero.
2020-12-10 14:08:02 +03:00
Nekotekina 36c8654fb8 Remove HERE macro
Some cleanup.
Add location to some functions.
2020-12-10 12:30:22 +03:00
Nekotekina e055d16b2c Replace verify() with ensure() with auto src location.
Expression ensure(x) returns x.
Using comma operator removed.
2020-12-09 15:43:38 +03:00
RipleyTom d0c271e534 Simplify g_pages
This was done because otherwise msvc runs out of heap space on azure.
2020-12-09 11:15:08 +03:00
RipleyTom af8c661a64 Remove BOM markers 2020-12-06 15:30:12 +03:00
Nekotekina f0cba1371c vm: adjustments
Increase max range lock size (less than 512 MiB)
Remove "range_executable" flag, make it reserved.
2020-11-24 01:09:04 +03:00
Nekotekina 3e1344e4e4 vm.cpp: minor optimization for filling stack guards
Use REP STOSQ on all compilers.
2020-11-19 14:44:58 +03:00
Nekotekina 68931b4c43 Debugger: fill stack guard with STACKGRD 2020-11-17 16:32:59 +03:00
Nekotekina 0fec99e75b SPU: absolutely unacceptable hack for SPU LS
Make normal threads inaccessible in PS3 memory.
2020-11-17 15:22:04 +03:00
Nekotekina d7e1cf7dd2 vm: respect initial protection for allocation mapping
Unused yet.
2020-11-17 05:33:46 +03:00
Nekotekina ea5f5aea5f vm: memory locking rewritten
Added vm::lock_sudo method (wrapper for utils::memory_lock).
Put locking outside of vm::g_mutex scope.
Prelock sudo memory for RSX, vm::stack, vm::main.
Prelock sudo memory for shared memory objects.
Don't check for TSX path.
2020-11-16 12:46:15 +03:00
Nekotekina eaf0bbc108 SPU: don't allocate SPU LS in vm::main
Create its own shared memory object.
Use vm::spu to allocate all SPU types.
Use vm::writer_lock for shm::map_critical.
2020-11-16 12:46:15 +03:00
Nekotekina 1e269751bf Temporarily disable memory locking if TSX is not used
It's a very heavy operation that could cause some problem under mutex lock.
2020-11-14 11:12:58 +03:00
Eladash fefab50e06 Fix vm::range_lock, imporve vm::check_addr 2020-11-11 10:30:09 +03:00
Eladash b32d989a10 Fix PPU stack contents on allocation 2020-11-10 06:30:35 +03:00
Nekotekina d1ee7c651f Make memory locking optional (mlock, VirtualLock).
Fix desired locking operation (to fix "sudo" memory).
It was discovered that some systems have outdated configuration.
With too tight limit, it's almost impossible to lock anything in memory.
2020-11-10 06:05:37 +03:00
Nekotekina 083397a555 vm: lock memory under "sudo" addr
Remove memory touching from transactions.
2020-11-09 23:54:36 +03:00
Nekotekina d1988d384c vm: remove unnecessary memset() on stop 2020-11-09 22:57:36 +03:00
Nekotekina bc61835d97 CPU: use unsigned (u8) priority in suspend_all 2020-11-09 22:57:36 +03:00
Nekotekina 8bc9868c1f SPU/vm: Improve vm::range_lock a bit
Use some prefetching
Use optimistic locking
2020-11-08 17:23:17 +03:00
Nekotekina 21ec32b465 vm: implement g_shmem for range locks
Renamed from g_shareable. Contains pointers instead of bits.
Used in range locks to prevent any "collision" between memory.
2020-11-08 16:43:15 +03:00
Nekotekina 1c99a2e7fb vm: add map_self() method to utils::shm
Add complementary unmap_self() method.
Move VirtualMemory to util/vm.hpp
Minor associated include cleanup.
Move asm.h to util/asm.hpp
2020-11-08 16:43:15 +03:00
Nekotekina b68bdafadc vm: refactor vm::range_lock again
Move bits to the highest, set RWX order.
Use only one reserved value (W = locked).
Assume lock size 128 for range_locked.
Add new "Size" template argument that replaces normal argument.
2020-11-08 16:43:15 +03:00
Eladash 6dcd482dd0 SPU reservations: Do not illegally dereference reservation data 2020-11-07 14:03:09 +03:00
Nekotekina 34fa010601 Improve cond_var notifiers
But nobody uses it anyway, so clean up includes.
2020-11-06 00:10:16 +03:00
Nekotekina ba5ed5f380 Fix vm::lock_range wrong check
Minor header refactoring.
2020-11-04 14:59:26 +03:00
Nekotekina 5d7acda80e vm: minor refactoring
Renamed internal main range locking method.
2020-11-04 14:59:25 +03:00
Nekotekina 06ecc2ae68 vm::range_lock cleanup and minor optimization
Removed unused arg.
Linearized some branches.
2020-11-01 23:29:33 +03:00
Nekotekina 46d3066c62 Optimize vm::range_lock
Only test address on `range_locked`
Don't check current transaction
Remove vm::clear_range_locks completely
2020-11-01 16:46:06 +03:00
Nekotekina ca57f25f26 Fix vm::page_protect and range flags
Should fix assertion in vm.cpp
Minor refactoring of internal locking
2020-11-01 02:30:10 +03:00
Nekotekina 78c986b5dd Improve vm::range_lock
Not sure how it ever worked
Clear redundant vm::clear_range_lock usage
2020-10-31 23:53:14 +03:00