Skip to content

Commit df2b69b

Browse files
authored
Merge pull request #1866 from chihminchao/prioritize-misaligned-superpage
mmu: raise the prioity of misaligned superpage
2 parents 7812eab + 6fd2bc9 commit df2b69b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

riscv/mmu.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -553,6 +553,8 @@ reg_t mmu_t::walk(mem_access_info_t access_info)
553553
// not shadow stack access xwr=110 or xwr=010 page cause page fault
554554
// shadow stack access with PTE_X moved to following check
555555
break;
556+
} else if ((ppn & ((reg_t(1) << ptshift) - 1)) != 0) {
557+
break;
556558
} else if (ss_page && ((type == STORE && !ss_access) || access_info.flags.clean_inval)) {
557559
// non-shadow-stack store or CBO with xwr = 010 causes access-fault
558560
throw trap_store_access_fault(virt, addr, 0, 0);
@@ -566,8 +568,6 @@ reg_t mmu_t::walk(mem_access_info_t access_info)
566568
type == LOAD ? !(sse && ss_page) && !(pte & PTE_R) && !(mxr && (pte & PTE_X)) :
567569
!(pte & PTE_W)) {
568570
break;
569-
} else if ((ppn & ((reg_t(1) << ptshift) - 1)) != 0) {
570-
break;
571571
} else {
572572
reg_t ad = PTE_A | ((type == STORE) * PTE_D);
573573

0 commit comments

Comments
 (0)