mirror of https://github.com/xemu-project/xemu.git
A bit optimization for tlb_set_page()
This patch avoids handling write watchpoints on read-only memory access. It also breaks the searching loop for watchpoint once the setup for handling watchpoint later is done. Signed-off-by: Jun Koi <junkoi2004@gmail.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
This commit is contained in:
parent
6fbab86925
commit
bf298f83c3
10
exec.c
10
exec.c
|
@ -2209,10 +2209,12 @@ void tlb_set_page(CPUState *env, target_ulong vaddr,
|
||||||
watchpoint trap routines. */
|
watchpoint trap routines. */
|
||||||
QTAILQ_FOREACH(wp, &env->watchpoints, entry) {
|
QTAILQ_FOREACH(wp, &env->watchpoints, entry) {
|
||||||
if (vaddr == (wp->vaddr & TARGET_PAGE_MASK)) {
|
if (vaddr == (wp->vaddr & TARGET_PAGE_MASK)) {
|
||||||
iotlb = io_mem_watch + paddr;
|
/* Avoid trapping reads of pages with a write breakpoint. */
|
||||||
/* TODO: The memory case can be optimized by not trapping
|
if ((prot & PAGE_WRITE) || (wp->flags & BP_MEM_READ)) {
|
||||||
reads of pages with a write breakpoint. */
|
iotlb = io_mem_watch + paddr;
|
||||||
address |= TLB_MMIO;
|
address |= TLB_MMIO;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue