-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SPU: Validate reservation in GET commands (Accurate DMA) #9062
Conversation
raddr = 0; | ||
} | ||
|
||
alignas(64) u8 temp[128]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Temporary storage, similar to a recent bugfix in GETLLAR which doesnt rely on LS to store constant data because its volatile.
Is there something similar to PAGE_GUARD in the Linux/other OS world? It seems like it might be an 'easier' way to detect if a write occurs to the reservation range. |
memory protection is probably very slow, you can perf test if you want. |
I can confirm memory protection is painfully slow. It is already a major bottleneck for texture cache management, I'm horrified to think how it can impact common code execution paths. |
SPU: Validate reservation in GET commands (Accurate DMA) (RPCS3#9062)
This originally striked me as I realized PPU accurate 128byte reservation mode does not work properly when there are two or more loads from the same address in the atomic loop. Why? because if one loads reads data X and the other reads data Y, if the reservation data there is X for example, meaning the data was changed twice by other thread (X ->Y ->X) the reservation store can even succeed in this case on rpcs3 although clearly the writes occured and the reservation store should fail in this case.
Now this pr doesnt fix, but it fixes a similar case in SPU side, where someone can use GET inside an atomic loop (essentialy reading the data twice as GETLLAR already read it) so add reservation validation checks there if this case is encountered.
Only affects Accurate SPU DMA as mentioned in the title.