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
Revert "DSPLLE: Add assertion for bad DMA alignment" #11505
Revert "DSPLLE: Add assertion for bad DMA alignment" #11505
Conversation
This reverts commit e140516. This assert triggers for AX and AXWii uCode games (including the Wii System Menu) for various addresses that seem to be 4-byte aligned. Worse still, if the DSP thread is in use (i.e. for DSP LLE recompiler, but not for DSP LLE interpreter), Dolphin completely hangs after the panic alert. Perhaps the data DMA has fewer restrictions compared to the instruction DMA? The change to DSPTool (e391a28) has not been reverted, as it still fixes broken behavior for DSPSpy at -O0 on real hardware.
|
maybe on dspspy you hit some cache issue instead? |
|
I think I remembered the other issue I was having more clearly: some kind of infinite loop with mail (while also messing with external interrupts). The cache is flushed correctly: dolphin/Source/DSPSpy/main_spy.cpp Lines 334 to 348 in cb6d476
And for what it's worth, dolphin/Source/DSPSpy/main_spy.cpp Lines 53 to 54 in cb6d476
dolphin/Source/DSPSpy/main_spy.cpp Lines 609 to 611 in cb6d476
I also found explicit confirmation of the alignment requirements, both in yagcd and in https://patents.google.com/patent/US6606689 (control+F for "DSPA: DSp dma dsP memory Address High DSPaddress 0xFFCD" - no idea why the capitalization is like that; it's the same way in the PDF and original application as far as I can tell). I'll still try to make a hardware test to confirm these though. |
|
I think I explained before but I would really not take either yagcd nor the patents at face value. I also wouldn't be surprised if some stuff in this area slightly changes between gc and wii |
|
I'm more willing to trust the patents saying it must be 4-byte aligned to my own complete guess of 32-byte aligned (which had nothing significant to back it up other than I knew that that worked properly), but it definitely does need to be tested further. I think they're at least a good starting point for behaviors to check, though it definitely can't be assumed to be perfect (especially since they go out of their way to be weaselly yet extremely specific with "for example" and the like). Regarding GC/Wii changes, almost certainly the main memory address behaves differently since (to my understanding) the DSP can access MEM1 and MEM2 now, but I'm doing my testing on a Wii so that shouldn't make much of a difference. For what it's worth, the patent also has these paragraphs:
This describes something dolphin implemented (see Another edge case I accidentally found while trying to test the DMA alignment behavior is that bus 2 can't actually read the IFX registers; I'm not going to investigate those in detail for now, because even this DMA behavior was a side investigation from the thing I actually wanted to fix. |
This reverts commit e140516. This assert triggers for AX and AXWii uCode games (including the Wii System Menu) for various addresses that seem to be 4-byte aligned. Worse still, if the DSP thread is in use (i.e. for DSP LLE recompiler, but not for DSP LLE interpreter), Dolphin completely hangs after the panic alert. Perhaps the data DMA has fewer restrictions compared to the instruction DMA?
The change to DSPTool (e391a28) has not been reverted, as it still fixes broken behavior for DSPSpy at -O0 on real hardware.