Skip to content

Commit

Permalink
fix(rva, trigger): For rva instr, raise BP from trigger prior to misa…
Browse files Browse the repository at this point in the history
…ligned.
  • Loading branch information
NewPaulWalker committed Oct 28, 2024
1 parent 6a83d0c commit 5c63a0e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions riscv/mmu.cc
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,8 @@ void mmu_t::store_slow_path(reg_t original_addr, reg_t len, const uint8_t* bytes
{
auto access_info = generate_access_info(original_addr, STORE, xlate_flags);
reg_t transformed_addr = access_info.transformed_vaddr;
check_triggers(triggers::OPERATION_STORE, transformed_addr, access_info.effective_virt);

if (actually_store) {
reg_t trig_len = len;
const uint8_t* trig_bytes = bytes;
Expand Down
6 changes: 6 additions & 0 deletions riscv/mmu.h
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,12 @@ class mmu_t
template<typename T, typename op>
T amo(reg_t addr, op f) {
convert_load_traps_to_store_traps({

xlate_flags_t xlate_flags = {};
auto access_info = generate_access_info(addr, LOAD, xlate_flags);
reg_t transformed_addr = access_info.transformed_vaddr;
check_triggers(triggers::OPERATION_LOAD, transformed_addr, access_info.effective_virt);

store_slow_path(addr, sizeof(T), nullptr, {}, false, true);
auto lhs = load<T>(addr);
sim->is_amo = true;
Expand Down

0 comments on commit 5c63a0e

Please sign in to comment.