Browse Source

Apply pointer masking to *tval on failing SC

check_load_reservation's reservable-fault throw was passing the raw
rs1 value to *tval. Compute the transformed vaddr via
generate_access_info and use its transformed_vaddr/effective_virt
for the trap, per zpm.adoc pm_csr_hw_apply.
pull/2306/head
James Robinson 2 months ago
parent
commit
e354c25576
  1. 6
      riscv/mmu.h

6
riscv/mmu.h

@ -268,8 +268,10 @@ public:
if (sim->reservable(paddr))
return load_reservation_address == paddr;
else
throw trap_store_access_fault((proc) ? proc->state.v : false, vaddr, 0, 0);
// SC to non-reservable region: report the PMM-masked effective vaddr.
auto access_info = generate_access_info(vaddr, STORE, {});
throw trap_store_access_fault(access_info.effective_virt, access_info.transformed_vaddr, 0, 0);
}
template<typename T>

Loading…
Cancel
Save