Merge pull request #6100 from bunnei/arm-fix

core: arm_dynarmic: Ensure JIT state is saved/restored on page table changes.
This commit is contained in:
bunnei 2021-03-23 17:08:37 -07:00 committed by GitHub
commit 716285fab8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 0 deletions

View File

@ -306,13 +306,18 @@ void ARM_Dynarmic_32::ClearExclusiveState() {
void ARM_Dynarmic_32::PageTableChanged(Common::PageTable& page_table,
std::size_t new_address_space_size_in_bits) {
ThreadContext32 ctx{};
SaveContext(ctx);
auto key = std::make_pair(&page_table, new_address_space_size_in_bits);
auto iter = jit_cache.find(key);
if (iter != jit_cache.end()) {
jit = iter->second;
LoadContext(ctx);
return;
}
jit = MakeJit(page_table, new_address_space_size_in_bits);
LoadContext(ctx);
jit_cache.emplace(key, jit);
}

View File

@ -348,13 +348,18 @@ void ARM_Dynarmic_64::ClearExclusiveState() {
void ARM_Dynarmic_64::PageTableChanged(Common::PageTable& page_table,
std::size_t new_address_space_size_in_bits) {
ThreadContext64 ctx{};
SaveContext(ctx);
auto key = std::make_pair(&page_table, new_address_space_size_in_bits);
auto iter = jit_cache.find(key);
if (iter != jit_cache.end()) {
jit = iter->second;
LoadContext(ctx);
return;
}
jit = MakeJit(page_table, new_address_space_size_in_bits);
LoadContext(ctx);
jit_cache.emplace(key, jit);
}