Skip to content
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

Fix crashes in Paranoid TSO mode #4285

Merged
merged 3 commits into from
Jan 21, 2025
Merged

Conversation

neobrain
Copy link
Member

This PR fixes two critical issues in Paranoid TSO mode: Many applications that work with FEX's default settings would fail to run since TSO emulation wasn't enabled for most instructions. Further complications arose due to indirect memory addressing not being implemented.

A negative (but expected) side effect of fixing these issues is that Paranoid TSO mode will now make emulation unusably slow (>90% performance impact). I'm not sure there are strong enough reasons to keep around the current PTSO approach, so I wrote a patch that implements backpatching-free TSO without requiring excessive signalling. It's not included here since it's a bit more tricky to maintain at the moment, but this current PR will get things back to a functional state at least.

As a small but related side change, I realized that memcpy/memset emit slightly more nops than needed in either TSO mode.

Implementation details

The ARM instructions emitted in PTSO mode don't support indirect memory addressing (unlike the instructions emitted with backpatching-based TSO emulation), so the indirect offsets are instead manually computed using add.

@Sonicadvance1 Sonicadvance1 merged commit 56c95e3 into FEX-Emu:main Jan 21, 2025
12 checks passed
@neobrain neobrain deleted the fix_ptso_offsets branch January 22, 2025 18:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants