vtlb only cache access permisions required for the operation

see #1845
This commit is contained in:
Takacs, Philipp
2023-07-13 10:28:41 +02:00
parent e88264c658
commit f6cfe1092b
2 changed files with 32 additions and 1 deletions

View File

@@ -74,7 +74,20 @@ bool unicorn_fill_tlb(CPUState *cs, vaddr address, int size,
if (!handled) {
e.paddr = address & TARGET_PAGE_MASK;
e.perms = UC_PROT_READ|UC_PROT_WRITE|UC_PROT_EXEC;
switch (rw) {
case MMU_DATA_LOAD:
e.perms = UC_PROT_READ;
break;
case MMU_DATA_STORE:
e.perms = UC_PROT_WRITE;
break;
case MMU_INST_FETCH:
e.perms = UC_PROT_EXEC;
break;
default:
e.perms = 0;
break;
}
}
switch (rw) {