[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] Re: [PATCH] A bit optimization for tlb_set_page() (resend)
From: |
Jan Kiszka |
Subject: |
[Qemu-devel] Re: [PATCH] A bit optimization for tlb_set_page() (resend) |
Date: |
Sat, 08 May 2010 20:53:09 +0200 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666 |
Jun Koi wrote:
> 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 <address@hidden>
>
Works fine.
Acked-by: Jan Kiszka <address@hidden>
>
> diff --git a/exec.c b/exec.c
> index 14d1fd7..6fd859f 100644
> --- a/exec.c
> +++ b/exec.c
> @@ -2236,10 +2236,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;
> + }
> }
> }
signature.asc
Description: OpenPGP digital signature