ppcmu: Use generational flush for PAT entries - #199
Merged
Conversation
`TLBEntry` and its cache constants and flags are used exclusively by ppcmmu.cpp. Keep them out of the public MMU header so future TLB changes do not expand its interface. This required a small fix in dbdma.cpp since it was implicitly relying on an include that we removed. Also declare `gTLBFlush*` variables as static to make it explicit that we don't expect them to be accessed outside of ppcmmu.cpp.
We end up flushing all entries very frequently (hundreds of thousands of times during Mac OS X boot), and were spending a lot of time in `tlb_flush_entries` walking through the array. We can instead store a generation counter and make invalidation be a simple increment. This does make validity checks slightly more expensive, but it appears to be a net win. On my machine it takes booting the Mac OS X public meta to the Finder from ~58 seconds to ~35 seconds.
mihaip
added a commit
to mihaip/infinite-mac
that referenced
this pull request
Aug 6, 2026
Includes dingusdev/dingusppc#199 which significantly speeds up Mac OS X boot time. For #219
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.
We end up flushing all entries very frequently (hundreds of thousands of times during Mac OS X boot), and were spending a lot of time in
tlb_flush_entrieswalking through the array. We can instead store a generation counter and make invalidation be a simple increment. This does make validity checks slightly more expensive, but it appears to be a net win. On my machine it takes booting the Mac OS X public meta to the Finder from ~58 seconds to ~35 seconds.To hide these implemetation details we first do a preparatory refactor to move
TLBEntryand related code into ppcmmu.cpp - it didn't actually need to be in the header file.