e2k: Fix performance regression.

Signed-off-by: Denis Drakhnya <numas13@gmail.com>
This commit is contained in:
Denis Drakhnia 2021-03-16 23:20:25 +02:00 committed by Denis Drakhnia
parent c03d91b7c0
commit 5301939d1f
1 changed files with 3 additions and 7 deletions

View File

@ -8,22 +8,18 @@
static int e2k_probe_access(CPUE2KState *env, target_ulong addr, int size, static int e2k_probe_access(CPUE2KState *env, target_ulong addr, int size,
MMUAccessType access_type, int mmu_idx) MMUAccessType access_type, int mmu_idx)
{ {
target_ulong addr_end = addr + size;
int flags; int flags;
void *ignore; void *ignore;
flags = probe_access_flags(env, addr, access_type, mmu_idx, flags = probe_access_flags(env, addr, access_type, mmu_idx,
true, &ignore, 0); true, &ignore, 0);
if (flags & TLB_INVALID_MASK) { if ((addr & (size - 1)) && !(flags & TLB_INVALID_MASK)) {
return 0; flags = probe_access_flags(env, addr + size, access_type, mmu_idx,
} else if ((addr & ~TARGET_PAGE_MASK) != (addr_end & ~TARGET_PAGE_MASK)) {
flags = probe_access_flags(env, addr_end, access_type, mmu_idx,
true, &ignore, 0); true, &ignore, 0);
return !(flags & TLB_INVALID_MASK);
} }
return 1; return !(flags & TLB_INVALID_MASK);
} }
int HELPER(probe_read_access)(CPUE2KState *env, target_ulong addr, int HELPER(probe_read_access)(CPUE2KState *env, target_ulong addr,