Skip to content

Commit

Permalink
Ignore the Upper Bits of Physical Address, due to T-Head MMU Flags
Browse files Browse the repository at this point in the history
  • Loading branch information
lupyuen committed Jul 17, 2024
1 parent 873f6ad commit 6e32784
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions riscv_cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,9 @@ static int get_phys_addr(RISCVCPUState *s,
}
vaddr_mask = ((target_ulong)1 << vaddr_shift) - 1;
*ppaddr = (vaddr & vaddr_mask) | (paddr & ~vaddr_mask);
//// Begin Test: Ignore the Upper Bits of Physical Address, due to T-Head MMU Flags
*ppaddr &= 0xfffffffffffful; ////
//// End Test
return 0;
} else {
pte_addr = paddr;
Expand Down Expand Up @@ -1171,6 +1174,7 @@ static void raise_exception2(RISCVCPUState *s, uint32_t cause,
log_printf("\n");
printf("raise_exception2: cause=%d, tval=%p, pc=%p\n", cause, (void *)tval, s->pc);////
dump_regs(s);
exit(1);
}
}
#endif
Expand Down

0 comments on commit 6e32784

Please sign in to comment.