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

JitArm64: Allow DoJit at address 0 (fix launching Wii titles) #9618

Merged
merged 1 commit into from Apr 1, 2021

Conversation

JosJuice
Copy link
Member

@JosJuice JosJuice commented Apr 1, 2021

JitArm64::DoJit contains a check where it prints a warning and tries to pause emulation if instructed to compile code at address 0. I'm assuming this was done in order to provide a nicer error behavior in cases where PC was accidentally set to null. Unfortunately, it has started causing us problems recently, as 688bd61 writes and runs some code at address 0 to simulate the PPC being held in reset. What makes this worse is that calling Core::SetState from the CPU thread is actually not allowed and will cause a deadlock instead of the intended behavior. I don't believe there is anything on a real console that would stop you from executing code at address 0 (as long as the MMU has been set up to allow it), and Jit64::DoJit doesn't contain any check like this, so let's remove the check.

JitArm64::DoJit contains a check where it prints a warning and tries
to pause emulation if instructed to compile code at address 0. I'm
assuming this was done in order to provide a nicer error behavior
in cases where PC was accidentally set to null. Unfortunately, it
has started causing us problems recently, as 688bd61 writes and runs
some code at address 0 to simulate the PPC being held in reset.
What makes this worse is that calling Core::SetState from the CPU
thread is actually not allowed and will cause a deadlock instead of
the intended behavior. I don't believe there is anything on a real
console that would stop you from executing code at address 0 (as
long as the MMU has been set up to allow it), and Jit64::DoJit
doesn't contain any check like this, so let's remove the check.
Copy link
Member

@leoetlino leoetlino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoops, didn't notice this was in JitArm64, sorry :/

@JosJuice JosJuice requested a review from leoetlino April 1, 2021 09:35
@degasus
Copy link
Member

degasus commented Apr 1, 2021

0x0 is a valid memory address, both with IR=0 and (maybe) IR=1.

@degasus degasus merged commit a2fa9aa into dolphin-emu:master Apr 1, 2021
10 checks passed
@JosJuice JosJuice deleted the jitarm64-pc-0 branch April 1, 2021 10:44
@ghost
Copy link

ghost commented Apr 1, 2021

Whoops, didn't notice this was in JitArm64, sorry :/

Honestly, that is completely understandable. JitArm64 is just as cursed as ES_Launch :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants