ppcmmu: Ignore dcbz for MMIO regions - #203
Merged
Merged
Conversation
The ATI drivers uses dcbz to simulate a write-combining buffer when
sending HOST_DATA payloads.
The intent is something like this (on real hardware):
```
dcbz:
cache line = [0, 0, 0, 0, 0, 0, 0, 0]
ATI sees nothing
following stores:
cache line = [A, B, C, D, E, F, G, H]
ATI still sees nothing
dcbf or eviction:
write back [A, B, C, D, E, F, G, H]
ATI receives one completed cache line
```
With our previous cacheless implementation, the behavior was more like this:
```
dcbz:
ATI immediately receives [0, 0, 0, 0, 0, 0, 0, 0]
following stores:
ATI then receives [A, B, C, D, E, F, G, H]
dcbf:
no-op
```
The zero-ed out values have side effects (32 pixels of black being
written), so the intermediate state was visible.
The truly correct fix is to fully model the data cache, and do an
eventual write back of the modified cache lines with their final values,
but that is very invasive (and likely to be slow).
We instead just make `dcbz` a no-op for MMIO regions, which lets us
avoid that intermediate state and unintended side effects.
dingusdev
pushed a commit
that referenced
this pull request
Aug 15, 2026
Helps a bit with some of the code duplication introduced in #203.
mihaip
added a commit
to mihaip/dingusppc
that referenced
this pull request
Aug 21, 2026
PAT generation counters make invalidation constant-time by adding a generation check to every TLB lookup, but they added a per-access overhead to compare generation counters. I am swithcing to an alternate approach (explicitly tracking populated entries, which can also be used for BAT-derived entries), and am removing this first to make that diff easier to read. This logically reverts the work from dingusdev#199 (the TLB helper refactoring from dingusdev#203 prevents a mechanical revert).
dingusdev
pushed a commit
that referenced
this pull request
Aug 21, 2026
PAT generation counters make invalidation constant-time by adding a generation check to every TLB lookup, but they added a per-access overhead to compare generation counters. I am swithcing to an alternate approach (explicitly tracking populated entries, which can also be used for BAT-derived entries), and am removing this first to make that diff easier to read. This logically reverts the work from #199 (the TLB helper refactoring from #203 prevents a mechanical revert).
Link4Electronics
pushed a commit
to Link4Electronics/dingusppc
that referenced
this pull request
Aug 21, 2026
PAT generation counters make invalidation constant-time by adding a generation check to every TLB lookup, but they added a per-access overhead to compare generation counters. I am swithcing to an alternate approach (explicitly tracking populated entries, which can also be used for BAT-derived entries), and am removing this first to make that diff easier to read. This logically reverts the work from dingusdev#199 (the TLB helper refactoring from dingusdev#203 prevents a mechanical revert).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The ATI drivers uses dcbz to simulate a write-combining buffer when sending HOST_DATA payloads.
The intent is something like this (on real hardware):
With our cacheless implementation, the behavior was more like this:
The zero-ed out values have side effects (32 pixels of black being written), so the intermediate state was visible as visual corruption, especially visible when windows get redrawn on Mac OS 8.6.
The truly correct fix is to fully model the data cache, and do an eventual write back of the modified cache lines with their final values, but that is very invasive (and likely to be slow).
We instead just make
dcbza no-op for MMIO regions, which lets us avoid that intermediate state and unintended side effects.