Skip to content

Commit 59ff63a

Browse files
committed
Fix cr3
1 parent b20dc83 commit 59ff63a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tests/unit/test_x86.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1489,7 +1489,9 @@ static void test_x86_mmu_prepare_tlb(uc_engine *uc, uint64_t vaddr,
14891489
OK(uc_mem_write(uc, tlb_base + pml4o, &pml4e_mem, sizeof(pml4o)));
14901490
OK(uc_mem_write(uc, tlb_base + 0x1000 + pdpo, &pdpe_mem, sizeof(pdpe)));
14911491
OK(uc_mem_write(uc, tlb_base + 0x2000 + pdo, &pde_mem, sizeof(pde)));
1492-
OK(uc_reg_write(uc, UC_X86_REG_CR3, &tlb_base));
1492+
uint32_t cr3 = tlb_base & 0xFFFFFFFF;
1493+
cr3 = LEINT32(cr3);
1494+
OK(uc_reg_write(uc, UC_X86_REG_CR3, &cr3));
14931495
OK(uc_reg_read(uc, UC_X86_REG_CR0, &cr0));
14941496
OK(uc_reg_read(uc, UC_X86_REG_CR4, &cr4));
14951497
OK(uc_reg_read(uc, UC_X86_REG_MSR, &msr));

0 commit comments

Comments
 (0)