Eladash
bacfa9be19
Debugger fixups ( #9226 )
...
Fix logic error in callstacks handling code, always set first to false after first iteration.
Add explicit check for zero return addresses. Current code validity checks may not check for it properly when it sits on interrupt handler entry point (which may contain valid code).
Do not allow 0x3FFF0 to be a back chain address because it needs space for LR save area, only 0x3FFE0 and below satisfy this criteria.
2020-11-08 16:42:20 +03:00
Eladash
516da4ecdd
Debugger: Improve SPU/PPU callstack handling
2020-11-08 09:17:13 +03:00
Eladash
3cb5fd8ebc
Debugger: Implement SPU callstack, fix PPU callstack
2020-11-07 20:45:57 +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
5248240e10
atomic.cpp: improvements.
...
Reduced static memory amount for waitable atomics.
Allow notifier to skip notifications if wait/notify masks don't overlap.
Improve raw_notify to wake up the thread by its id, add thread_id arg.
Add optional mask argument to notify_one() and notify_all().
2020-11-05 05:51:43 +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
8d12816001
TSX: fix transaction limit settings
2020-11-01 14:58:04 +03:00
Nekotekina
fe03b55046
TSX: tiny optimization of transaction functions
...
Because new memory manager puts them in first 2G.
2020-11-01 14:44:59 +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
Nekotekina
86fc842c89
TSX: new fallback method (time-based)
...
Basically, using timestamp counter.
Rewritten vm::reservation_op with the same principle.
Rewritten another transaction helper.
Add two new settings for configuring fallbacks.
Two limits are specified in nanoseconds (first and second).
Fix PUTLLC reload logic (prevent reusing garbage).
2020-10-31 15:34:14 +03:00
Nekotekina
150e18539c
Allow cpu_thread& arg passed to the syscalls
...
Minor cleanup. cpu_mem(), cpu_unmem() removed.
2020-10-30 17:03:32 +03:00
Nekotekina
3419d15878
vm: add extern clear_range_locks function
...
Allows to wait for range locks to clear for specified range.
vm::range_lock now monitors specified reservation lock as well.
2020-10-30 07:58:16 +03:00
Nekotekina
0da24f21d6
CPU: improve cpu_thread::suspend_all for cache efficiency (TSX)
...
Add prefetch hint list parameter.
Workloads may be executed by another thread on another CPU core.
It means they may benefit from directly prefetching the data as hinted.
Also implement mov_rdata_nt, for "streaming" data from such workloads.
2020-10-30 05:22:09 +03:00
Nekotekina
e794109a67
perf_meter.hpp: fix double rdtsc bug, add restart() method
2020-10-30 03:19:13 +03:00
Nekotekina
006c783aba
SPU: make do_dma_transfer() static with _this arg
...
Instead of this, nullptr will be passed from another thread.
MMIO via MMIO is disabled if it even possible.
2020-10-30 02:58:39 +03:00
Nekotekina
425fce5070
SPU: load previous data on PUTLLC failure
...
Since it will most likely execute GETLLAR to load it again.
Only implemented for TSX at moment.
2020-10-30 02:58:39 +03:00
Nekotekina
8ce0819b42
SPU: add stx/ftx counters
...
Just count pure transaction successes and failures.
2020-10-29 18:57:57 +03:00
Nekotekina
688a456642
TSX tweaks
...
Allow to do more in first-chance transactions.
Give PUTLLC +1 priority (minor change).
2020-10-29 18:57:57 +03:00
Nekotekina
280958ee74
Revert "TSX: adjust transaction logic"
...
This reverts commit ff550b5c3c
.
2020-10-28 21:59:12 +03:00
Nekotekina
ff550b5c3c
TSX: adjust transaction logic
...
Allow more in first-chance transactions.
Allow abandonment of PUTLLC as in original path.
Make PUTLLUC unconditionally shared-locked.
Give PUTLLC +1 priority (minor change).
2020-10-28 14:00:09 +03:00
Nekotekina
d6daa0d05b
Fix cpu_flag::temp, make sure it removes cpu_flag::wait
2020-10-28 14:00:09 +03:00
Nekotekina
c491b73f3a
SPU: improve accurate DMA
...
Remove vm::reservation_lock from it.
Use lock bits to prevent memory clobbering in GETLLAR.
Improve u128 for MSVC since it's used for bitlocking.
Improve 128 bit atomics for the same reason.
Improve vm::reservation_op and friends.
2020-10-28 03:47:41 +03:00
Nekotekina
c50233cc92
atomics.cpp: add support for waiting on 128-bit atomics
...
Complementarily.
Also refactored to make waiting mask non-template arg.
2020-10-28 03:47:41 +03:00
Nekotekina
4966f6de73
vm: improve range_lock and shareable cache (Non-TSX)
...
Allocate "personal" range lock variable for each spu_thread.
Switch from reservation_lock to range lock for all stores.
Detect actual memory mirrors in shareable cache setup logic.
2020-10-27 17:56:19 +03:00
Nekotekina
f1e66085cd
Fixup for cpu_flag::temp
...
Wrong check_state() result was triggering assertion.
2020-10-26 01:18:26 +03:00
Nekotekina
130a0ef20e
Implement cpu_flag::temp flag
...
Accompanies wait flag, indicating that it was set in limited conditions.
Such condition don't allow thread to terminate after its removal.
2020-10-25 21:48:20 +03:00
kd-11
18ca3ed449
rsx: Block-level reservation access
2020-10-25 20:21:04 +03:00
Eladash
4ea7628204
SPU: Fix LS capture entry point
2020-10-25 16:39:40 +03:00
Nekotekina
2b52b4a749
SPU: use normal notify() thread function
...
Using raw_notify() everywhere was overkill.
2020-10-24 14:16:32 +03:00
Eladash
49610f52f5
SPU: Save LS capture executable in one segment
2020-10-24 14:13:19 +03:00
Eladash
b56bc7e087
SPU: cleanup channels logging
2020-10-23 13:13:04 +03:00
Nekotekina
dc8252bb9f
Remove XABORT in PPU/SPU transactions.
...
It's expensive for unknown reason. Simply XEND is usually much cheaper.
Add some minor improvements. Use g_sudo_addr.
2020-10-20 09:10:21 +03:00
Nekotekina
72d1ac22aa
SPU: report too many PUTLLC attempts (TSX)
...
Mirrored to PPU STCX code and PUTLLUC (STORE128).
2020-10-19 19:41:28 +03:00
Nekotekina
8ce5392390
TSX: add prefetchw instruction in transaction code
2020-10-19 19:41:28 +03:00
Nekotekina
311682b341
SPU: fix GETLLAR regression
...
Misplaced mov_rdata
2020-10-19 19:41:28 +03:00
Nekotekina
120849c734
Implement perf stat counter for PPU/SPU reservation ops
...
Adds Emu/perf_meter.hpp header file.
Uses RDTSC for speed.
Prints stats at exit.
2020-10-19 19:41:28 +03:00
Nekotekina
adf50b7c4b
Implement cpu_thread::if_suspended
...
Use it for opportunistic guaranteed GETLLAR execution (TSX-FA).
2020-10-18 20:10:48 +03:00
Nekotekina
f5c575961f
Implement priorities for cpu_thread::suspend_all tasks
...
Give PUTLLUC increased priority.
2020-10-18 20:10:48 +03:00
Eladash
402e8b12a6
SPU: Touch unmapoed memory in reservation mismatch
2020-10-18 11:42:54 +03:00
Nekotekina
d0057c92e4
Fix spu_putlluc_tx (insignificant)
2020-10-17 21:27:19 +03:00
Nekotekina
583ed61712
SPU: return some give-up behaviour for PUTLLC (TSX)
...
Despite using concept of "shared" lock, allow only first to proceed.
This is similar how conditional stores for PPU are implemented.
2020-10-16 12:14:42 +03:00
Nekotekina
facde63460
PPU: fix ppu_stcx_accurate_tx
...
Don't destroy xmm6/xmm7 state on exit.
Improve addr arg handling (simplify).
2020-10-15 19:24:00 +03:00
Nekotekina
494953997e
PPU/SPU: give up on conditional stores if locking fails
...
Restores Non-TSX behaviour partially.
2020-10-15 17:18:49 +03:00
Nekotekina
1b89ad00e7
SPU: restore some LR event setting logic after #9048
2020-10-15 17:18:49 +03:00
Nekotekina
3bddba0c7a
SPU: fix spu_getllar_tx
...
Was not executing.
2020-10-14 02:53:29 +03:00
Nekotekina
97cd641da9
TSX: reimplement spu_getllar_tx
...
Only used as a backup method of reading reservation data.
Increase long GETLLAR reporting threshold.
2020-10-13 21:10:04 +03:00
Nekotekina
91db4b724c
SPU: fix PUTLLC (TSX-FA)
...
Some forgotten checks may affect performance.
2020-10-13 17:46:03 +03:00
Nekotekina
dcff8c2637
Fix remaining vm::reservation_lock usages (for now)
...
Optimization can be restored later.
2020-10-13 12:04:59 +03:00