Patchwork A bit optimization for tlb_set_page()

login
register
mail settings
Submitter Jun Koi
Date April 27, 2010, 3:25 a.m.
Message ID <z2jfdaac4d51004262025o432d94f2xe474e09efd1fd634@mail.gmail.com>
Download mbox | patch
Permalink /patch/51029/
State New
Headers show

Comments

Jun Koi - April 27, 2010, 3:25 a.m.
It is not necessary to continue searching for watchpoint when we
already found one and setup for handling watchpoint in a search loop
in tlb_set_page().
This patch breaks that search loop on then.

Signed-off-by: Jun Koi <junkoi2004@gmail.com>
Jan Kiszka - April 27, 2010, 6:36 p.m.
Jun Koi wrote:
> It is not necessary to continue searching for watchpoint when we
> already found one and setup for handling watchpoint in a search loop
> in tlb_set_page().
> This patch breaks that search loop on then.

Acked-by: Jan Kiszka <jan.kiszka@siemens.com>

> 
> Signed-off-by: Jun Koi <junkoi2004@gmail.com>
> 
> diff --git a/exec.c b/exec.c
> index 14d1fd7..6329775 100644
> --- a/exec.c
> +++ b/exec.c
> @@ -2240,6 +2240,7 @@ void tlb_set_page(CPUState *env, target_ulong vaddr,
>              /* TODO: The memory case can be optimized by not trapping
>                 reads of pages with a write breakpoint.  */

PS: Don't you also want to address this todo while you are at it? :)

>              address |= TLB_MMIO;
> +            break;
>          }
>      }
> 
> 
>
Jun Koi - April 27, 2010, 11:48 p.m.
On Wed, Apr 28, 2010 at 3:36 AM, Jan Kiszka <jan.kiszka@web.de> wrote:
> Jun Koi wrote:
>> It is not necessary to continue searching for watchpoint when we
>> already found one and setup for handling watchpoint in a search loop
>> in tlb_set_page().
>> This patch breaks that search loop on then.
>
> Acked-by: Jan Kiszka <jan.kiszka@siemens.com>
>
>>
>> Signed-off-by: Jun Koi <junkoi2004@gmail.com>
>>
>> diff --git a/exec.c b/exec.c
>> index 14d1fd7..6329775 100644
>> --- a/exec.c
>> +++ b/exec.c
>> @@ -2240,6 +2240,7 @@ void tlb_set_page(CPUState *env, target_ulong vaddr,
>>              /* TODO: The memory case can be optimized by not trapping
>>                 reads of pages with a write breakpoint.  */
>
> PS: Don't you also want to address this todo while you are at it? :)
>

OK, I will look at that in my little spare time.

Thanks,
J

Patch

diff --git a/exec.c b/exec.c
index 14d1fd7..6329775 100644
--- a/exec.c
+++ b/exec.c
@@ -2240,6 +2240,7 @@  void tlb_set_page(CPUState *env, target_ulong vaddr,
             /* TODO: The memory case can be optimized by not trapping
                reads of pages with a write breakpoint.  */
             address |= TLB_MMIO;
+            break;
         }
     }