Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(store): make cross-page access consistent with XiangShan behavior #66

Merged
merged 1 commit into from
Dec 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions riscv/mmu.cc
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,14 @@ void mmu_t::store_slow_path(reg_t original_addr, reg_t len, const uint8_t* bytes
throw trap_store_access_fault(gva, transformed_addr, 0, 0);

reg_t len_page0 = std::min(len, PGSIZE - transformed_addr % PGSIZE);

#if defined(DIFFTEST) && defined(CPU_XIANGSHAN)
    if (len_page0 != len){
      store_slow_path_intrapage(len_page0, bytes, access_info, false);
      store_slow_path_intrapage(len - len_page0, bytes + len_page0, access_info.split_misaligned_access(len_page0), false);
    }
#endif // defined(DIFFTEST) && defined(CPU_XIANGSHAN)

store_slow_path_intrapage(len_page0, bytes, access_info, actually_store);
if (len_page0 != len)
store_slow_path_intrapage(len - len_page0, bytes + len_page0, access_info.split_misaligned_access(len_page0), actually_store);
Expand Down
Loading