Skip to content

Commit

Permalink
fix(riscv): add low order bits to faulting address
Browse files Browse the repository at this point in the history
Signed-off-by: Jose Martins <[email protected]>
  • Loading branch information
josecm authored and danielRep committed Nov 4, 2024
1 parent 6df80f4 commit 9bfb820
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/arch/riscv/sync_exceptions.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ static inline bool is_pseudo_ins(uint32_t ins)

static size_t guest_page_fault_handler(void)
{
vaddr_t addr = csrs_htval_read() << 2;
vaddr_t addr = (csrs_htval_read() << 2) | (csrs_stval_read() & 0x3);

emul_handler_t handler = vm_emul_get_mem(cpu()->vcpu->vm, addr);
if (handler != NULL) {
Expand Down

0 comments on commit 9bfb820

Please sign in to comment.