Commit graph

30 commits

Author SHA1 Message Date
eladash 4a28319edf Implement SPU page faults notifications
* Implement both RawSPU and threaded SPU page fault recovery
* Guard page_fault_notification_entries access with a mutex
* Add missing lock in sys_ppu_thread_recover_page_fault/get_page_fault_context
* Fix EINVAL check in sys_ppu_thread_recover_page_fault, previously when the event was not found begin() was erased and
CELL_OK was returned.
* Fixed page fault recovery waiting logic:
- Do not rely on a single thread_ctrl notification (unsafe)
- Avoided a race where ::awake(ppu) can be called before ::sleep(ppu) therefore nop-ing out the notification
* Avoid inconsistencies with vm flags on page fault cause detection
* Fix sys_mmapper_enable_page_fault_notification EBUSY check
from RE it's allowed to register the same queue twice (on a different area) but not to enable page fault notifications twice
2019-03-12 13:28:31 +03:00
eladash a43e7c172c Fix shared memory page flags
TODO: From hw testing, it seems like sys_memory_get_page_attribute and sys_rsx_context_iomap check page size a little differently

get_page_attribute() always go by area flags, sys_rsx_context_iomap checks page by the page granularity
This means that if the area page size 64k, but shared memory is mapped with SYS_MEMORY_GRANULARITY_1M
It can be mapped for rsxio, but the page attribute will indicate 64k page size :thonk:
rsxio memory is verified to need 1m pages.
2019-03-08 23:44:46 +03:00
eladash e38b7aee5a check address in sys_rsx_context_iomap
* Fix 0 vm page flags to behave like 1m flags, follows c8a681e60
* check if address exists and valid for rsx io allcations (must be allocated on 1m pages)
2019-03-05 21:23:24 +03:00
eladash 2ea061b9c7 Set total memory size according to sdkver 2018-12-30 20:12:32 +00:00
eladash c0eb4965f2 mmapper_allocate_memory improvement
Added cases 0 for allocation granularity size,
alike sys_memory_allocate, the alignment of this case is 1mb.
2018-12-30 20:12:32 +00:00
Nekotekina ca5158a03e Cleanup semaphore<> (sema.h) and mutex.h (shared_mutex)
Remove semaphore_lock and writer_lock classes, replace with std::lock_guard
Change semaphore<> interface to Lockable (+ exotic try_unlock method)
2018-09-03 23:00:36 +03:00
Nekotekina 7bccdbf157 Make vm::var unmoveable
Fix bugs with discarding vm::make_var result
2018-09-03 21:40:36 +03:00
Nekotekina 363811981d Reintroduce LOG_CHANNEL
Groundwork for further improvements
2018-08-25 15:39:00 +03:00
Nekotekina aa4040bb7b Implement vm::find_map; improve memory allocation
Add vm::user64k and vm::user1m constants
Remove vm::user_space, unreserve it
2018-08-14 15:14:06 +03:00
eladash 449888b9db Rsx/vm: fix base addresses 2018-08-13 16:16:34 +03:00
eladash b456955688 rsx: fix hardcoded rsx allocation address 2018-06-24 10:57:30 +03:00
eladash 4576a31f47 fix memory mapping alignment 2018-05-30 00:34:38 +04:00
Nekotekina 5d15d64ec8 Memory mirror support
Implemented utils::memory_release (not used)
Implemented utils::shm class (handler for shared memory)
Improved sys_mmapper syscalls
Rewritten ppu_patch function
Implemented vm::get_super_ptr (ignores memory protection)
Minimal allocation alignment increased to 0x10000
2018-05-09 23:35:34 +03:00
Nekotekina cce0ad0c35 Clean vm::ps3 namespace use 2018-02-09 17:49:37 +03:00
Robbie 47b121a700 PPU Page Faults (#3309)
I guess I'll merge it and fix some issues later myself.
2017-10-08 23:37:54 +03:00
Nekotekina 22d8b57027 Improve lv2_memory object 2017-09-14 00:23:23 +03:00
Nekotekina 0e691e2c51 sys_mmapper: minor range fix 2017-09-14 00:23:23 +03:00
Nekotekina 88fef183a3 config.yml: Log section optimized 2017-05-15 14:37:05 +03:00
Inviuz b70a1edbc7 Mmapper with Neko's review fixes (#2503) 2017-03-12 03:15:22 +03:00
Nekotekina ce35554a55 Fixes (sys_memory, sys_mmapper)
DeS
2017-03-11 21:37:18 +03:00
Nekotekina 0674a58502 idm::check extended
idm::check_unlocked
idm::find_unlocked
idm::get_unlocked
2017-02-04 20:39:03 +03:00
Nekotekina b21fce4d6f IdManager improved
lv2_obj for kernel objects
Simple lookup (vector)
Another idm API refactoring
2017-01-29 21:37:04 +03:00
Nekotekina df6607e236 Minor fixes 2017-01-28 03:21:11 +03:00
Nekotekina a06223b844 IdManager sugar 2017-01-25 04:43:12 +03:00
Nekotekina ad174eb12c error_code implemented
Reports based on formatting system
ppu_error_code removed
arm_error_code removed
2016-08-16 18:57:44 +03:00
Nekotekina 05fb57baff VERIFY macro removed 2016-08-15 03:13:31 +03:00
Nekotekina 7a2802a5e0 Silly macro removed 2016-08-12 19:31:28 +03:00
Nekotekina 96728a83f6 Partial commit: sys_memory, sys_mmapper 2016-07-16 14:46:01 +03:00
Nekotekina e2d82394f6 Cell 2016-05-23 16:22:23 +03:00
Nekotekina 42e1d4d752 Partial commit: Syscalls 2016-04-15 19:22:30 +03:00
Renamed from rpcs3/Emu/SysCalls/lv2/sys_mmapper.cpp (Browse further)