Browse Source

Fix trigger never fire on executing an instruction on plugin devices (#1084)

The trigger matching only checks on TLB hit (after refill_tlb()).
However, instructions on plugin devices will never be filled into
the TLB; thus, triggers cannot fire when executing instructions on
the plugin devices.

The PR removes the if-condition of TLB hit for trigger checking.

Co-authored-by: Howard Yen-Hao Chen <yhchen@andestech.com>
pull/1137/head
YenHaoChen 4 years ago
committed by GitHub
parent
commit
ccc9791807
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 12
      riscv/mmu.h

12
riscv/mmu.h

@ -477,13 +477,11 @@ private:
} else {
result = tlb_data[vpn % TLB_ENTRIES];
}
if (unlikely(tlb_insn_tag[vpn % TLB_ENTRIES] == (vpn | TLB_CHECK_TRIGGERS))) {
target_endian<uint16_t>* ptr = (target_endian<uint16_t>*)(tlb_data[vpn % TLB_ENTRIES].host_offset + addr);
triggers::action_t action;
auto match = proc->TM.memory_access_match(&action, triggers::OPERATION_EXECUTE, addr, from_target(*ptr));
if (match != triggers::MATCH_NONE) {
throw triggers::matched_t(triggers::OPERATION_EXECUTE, addr, from_target(*ptr), action);
}
target_endian<uint16_t>* ptr = (target_endian<uint16_t>*)(result.host_offset + addr);
triggers::action_t action;
auto match = proc->TM.memory_access_match(&action, triggers::OPERATION_EXECUTE, addr, from_target(*ptr));
if (match != triggers::MATCH_NONE) {
throw triggers::matched_t(triggers::OPERATION_EXECUTE, addr, from_target(*ptr), action);
}
return result;
}

Loading…
Cancel
Save