Merge pull request #8745 from merryhime/null-fastmem-arena

arm_dynarmic: Fix nullptr fastmem arenas
This commit is contained in:
liamwhite 2022-08-12 14:57:32 -04:00 committed by GitHub
commit 5a6a26449c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 7 deletions

View File

@ -195,14 +195,16 @@ std::shared_ptr<Dynarmic::A32::Jit> ARM_Dynarmic_32::MakeJit(Common::PageTable*
if (page_table) { if (page_table) {
config.page_table = reinterpret_cast<std::array<std::uint8_t*, NUM_PAGE_TABLE_ENTRIES>*>( config.page_table = reinterpret_cast<std::array<std::uint8_t*, NUM_PAGE_TABLE_ENTRIES>*>(
page_table->pointers.data()); page_table->pointers.data());
config.fastmem_pointer = page_table->fastmem_arena;
}
config.absolute_offset_page_table = true; config.absolute_offset_page_table = true;
config.page_table_pointer_mask_bits = Common::PageTable::ATTRIBUTE_BITS; config.page_table_pointer_mask_bits = Common::PageTable::ATTRIBUTE_BITS;
config.detect_misaligned_access_via_page_table = 16 | 32 | 64 | 128; config.detect_misaligned_access_via_page_table = 16 | 32 | 64 | 128;
config.only_detect_misalignment_via_page_table_on_page_boundary = true; config.only_detect_misalignment_via_page_table_on_page_boundary = true;
config.fastmem_exclusive_access = true;
config.fastmem_pointer = page_table->fastmem_arena;
config.fastmem_exclusive_access = config.fastmem_pointer != nullptr;
config.recompile_on_exclusive_fastmem_failure = true; config.recompile_on_exclusive_fastmem_failure = true;
}
// Multi-process state // Multi-process state
config.processor_id = core_index; config.processor_id = core_index;
@ -254,6 +256,7 @@ std::shared_ptr<Dynarmic::A32::Jit> ARM_Dynarmic_32::MakeJit(Common::PageTable*
} }
if (!Settings::values.cpuopt_fastmem) { if (!Settings::values.cpuopt_fastmem) {
config.fastmem_pointer = nullptr; config.fastmem_pointer = nullptr;
config.fastmem_exclusive_access = false;
} }
if (!Settings::values.cpuopt_fastmem_exclusives) { if (!Settings::values.cpuopt_fastmem_exclusives) {
config.fastmem_exclusive_access = false; config.fastmem_exclusive_access = false;

View File

@ -250,7 +250,7 @@ std::shared_ptr<Dynarmic::A64::Jit> ARM_Dynarmic_64::MakeJit(Common::PageTable*
config.fastmem_address_space_bits = address_space_bits; config.fastmem_address_space_bits = address_space_bits;
config.silently_mirror_fastmem = false; config.silently_mirror_fastmem = false;
config.fastmem_exclusive_access = true; config.fastmem_exclusive_access = config.fastmem_pointer != nullptr;
config.recompile_on_exclusive_fastmem_failure = true; config.recompile_on_exclusive_fastmem_failure = true;
} }
@ -314,6 +314,7 @@ std::shared_ptr<Dynarmic::A64::Jit> ARM_Dynarmic_64::MakeJit(Common::PageTable*
} }
if (!Settings::values.cpuopt_fastmem) { if (!Settings::values.cpuopt_fastmem) {
config.fastmem_pointer = nullptr; config.fastmem_pointer = nullptr;
config.fastmem_exclusive_access = false;
} }
if (!Settings::values.cpuopt_fastmem_exclusives) { if (!Settings::values.cpuopt_fastmem_exclusives) {
config.fastmem_exclusive_access = false; config.fastmem_exclusive_access = false;