|
@@ -1662,9 +1662,11 @@ static int get_physical_address(CPURISCVState *env, hwaddr *physical,
|
|
target_ulong *pte_pa = qemu_map_ram_ptr(mr->ram_block, addr1);
|
|
target_ulong *pte_pa = qemu_map_ram_ptr(mr->ram_block, addr1);
|
|
target_ulong old_pte;
|
|
target_ulong old_pte;
|
|
if (riscv_cpu_sxl(env) == MXL_RV32) {
|
|
if (riscv_cpu_sxl(env) == MXL_RV32) {
|
|
- old_pte = qatomic_cmpxchg((uint32_t *)pte_pa, pte, updated_pte);
|
|
|
|
|
|
+ old_pte = qatomic_cmpxchg((uint32_t *)pte_pa, cpu_to_le32(pte), cpu_to_le32(updated_pte));
|
|
|
|
+ old_pte = le32_to_cpu(old_pte);
|
|
} else {
|
|
} else {
|
|
- old_pte = qatomic_cmpxchg(pte_pa, pte, updated_pte);
|
|
|
|
|
|
+ old_pte = qatomic_cmpxchg(pte_pa, cpu_to_le64(pte), cpu_to_le64(updated_pte));
|
|
|
|
+ old_pte = le64_to_cpu(old_pte);
|
|
}
|
|
}
|
|
if (old_pte != pte) {
|
|
if (old_pte != pte) {
|
|
goto restart;
|
|
goto restart;
|