Support for dynamic BAT modification (dynamic-bat).
Fundamentally, all this does is enforce the invariant that we always translate effective addresses based on the current BAT registers and page table before we do anything else with them. This change can be logically divided into three parts. The first part is creating a table to represent the current BAT state, and keeping it up to date (PowerPC::IBATUpdated, PowerPC::DBATUpdated, etc.). This does nothing by itself, but it's necessary for the other parts. The second part (mostly in MMU.cpp) is simply removing all the hardcoded checks for specific untranslated addresses, and consistently translating addresses using the current BAT configuration. Very straightforward, but a lot of code changes because we hardcoded assumptions all over the place. The third part (mostly in Memmap.cpp) is making the fastmem arena reflect the current BAT configuration. We do this by redoing the mapping (calling memmap()) based on the BAT table whenever it changes. One additional minor change is that translation can fail in two ways: either the segment is a direct store segment, or page table lookup failed. The difference doesn't usually matter, but the difference affects cache instructions, like dcbz.
This commit is contained in:
1 parent
3e0355e7f6
commit
d557310371
20 files changed
+689
-598
No files matched your search
@@ -265,6 +265,8 @@ void ClearCacheLine(const u32 address); // Zeroes 32 bytes; address should be 3
|
||||
// TLB functions
|
||||
void SDRUpdated();
|
||||
void InvalidateTLBEntry(u32 address);
|
||||
void DBATUpdated();
|
||||
void IBATUpdated();
|
||||
|
||||
// Result changes based on the BAT registers and MSR.DR. Returns whether
|
||||
// it's safe to optimize a read or write to this address to an unguarded
|
||||
@@ -280,6 +282,12 @@ struct TranslateResult
|
||||
u32 address;
|
||||
};
|
||||
TranslateResult JitCache_TranslateAddress(u32 address);
|
||||
enum
|
||||
{
|
||||
BAT_INDEX_SHIFT = 17
|
||||
};
|
||||
extern u32 ibat_table[];
|
||||
extern u32 dbat_table[];
|
||||
} // namespace
|
||||
|
||||
enum CRBits
|
||||
|
||||
Reference in new issue
Block a user