Remove MMU hacks
Unicorn has included some ugly hacks to provide a envirement where vaddr == paddr. These hacks where to use the full 64 bit mappings on x86 without init the mmu and some memory redirect for MIPS. The UC_TLB_CPU mode defaults to vaddr == paddr, therfor these hacks aren't required anymore.
This commit is contained in:
@@ -416,6 +416,7 @@ static void test_arm64_mmu(void)
|
||||
TEST_CHECK(data != NULL);
|
||||
|
||||
OK(uc_open(UC_ARCH_ARM64, UC_MODE_ARM, &uc));
|
||||
OK(uc_ctl_tlb_mode(uc, UC_TLB_CPU));
|
||||
OK(uc_mem_map(uc, 0, 0x2000, UC_PROT_ALL));
|
||||
OK(uc_mem_write(uc, 0, code, sizeof(code) - 1));
|
||||
|
||||
|
||||
@@ -689,6 +689,7 @@ static void test_riscv_mmu(void)
|
||||
char code_s[] = "\xb7\x42\x41\x41" "\x9b\x82\x12\x14" "\x37\x63\x01\x00" "\x23\x20\x53\x00" "\x13\x00\x00\x00";
|
||||
|
||||
OK(uc_open(UC_ARCH_RISCV, UC_MODE_RISCV64, &uc));
|
||||
OK(uc_ctl_tlb_mode(uc, UC_TLB_CPU));
|
||||
OK(uc_hook_add(uc, &h, UC_HOOK_CODE, test_riscv_mmu_hook_code, NULL, 1, 0));
|
||||
OK(uc_mem_map(uc, 0x1000, 0x1000, UC_PROT_ALL));
|
||||
OK(uc_mem_map(uc, code_address, 0x1000, UC_PROT_ALL));
|
||||
|
||||
@@ -1090,6 +1090,7 @@ static void test_x86_correct_address_in_long_jump_hook(void)
|
||||
uc_hook hook;
|
||||
|
||||
uc_common_setup(&uc, UC_ARCH_X86, UC_MODE_64, code, sizeof(code) - 1);
|
||||
OK(uc_ctl_tlb_mode(uc, UC_TLB_VIRTUAL));
|
||||
OK(uc_hook_add(uc, &hook, UC_HOOK_MEM_UNMAPPED,
|
||||
test_x86_correct_address_in_long_jump_hook_callback, NULL, 1,
|
||||
0));
|
||||
@@ -1348,6 +1349,7 @@ static void test_x86_mmu(void)
|
||||
char code[] = "\xB8\x39\x00\x00\x00\x0F\x05\x48\x85\xC0\x74\x0F\xB8\x3C\x00\x00\x00\x48\x89\x04\x25\x00\x40\x00\x00\x0F\x05\xB9\x2A\x00\x00\x00\x48\x89\x0C\x25\x00\x40\x00\x00\xB8\x3C\x00\x00\x00\x0F\x05";
|
||||
|
||||
OK(uc_open(UC_ARCH_X86, UC_MODE_64, &uc));
|
||||
OK(uc_ctl_tlb_mode(uc, UC_TLB_CPU));
|
||||
OK(uc_hook_add(uc, &h1, UC_HOOK_INSN, &test_x86_mmu_callback, &parrent_done, 1, 0, UC_X86_INS_SYSCALL));
|
||||
OK(uc_context_alloc(uc, &context));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user