提交 bf298f83 编写于 作者: J Jun Koi 提交者: Aurelien Jarno

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: NJun Koi <junkoi2004@gmail.com>
Signed-off-by: NAurelien Jarno <aurelien@aurel32.net>
上级 6fbab869
......@@ -2209,10 +2209,12 @@ void tlb_set_page(CPUState *env, target_ulong vaddr,
watchpoint trap routines. */
QTAILQ_FOREACH(wp, &env->watchpoints, entry) {
if (vaddr == (wp->vaddr & TARGET_PAGE_MASK)) {
iotlb = io_mem_watch + paddr;
/* TODO: The memory case can be optimized by not trapping
reads of pages with a write breakpoint. */
address |= TLB_MMIO;
/* Avoid trapping reads of pages with a write breakpoint. */
if ((prot & PAGE_WRITE) || (wp->flags & BP_MEM_READ)) {
iotlb = io_mem_watch + paddr;
address |= TLB_MMIO;
break;
}
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册