[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 2/8] exec: Factor out core logic of check_wat
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [Qemu-devel] [PATCH v2 2/8] exec: Factor out core logic of check_watchpoint() |
Date: |
Fri, 30 Aug 2019 19:52:25 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 |
On 8/30/19 3:21 AM, Richard Henderson wrote:
> On 8/29/19 10:26 AM, Philippe Mathieu-Daudé wrote:
>>> - wp->hitaddr = vaddr;
>>> + wp->hitaddr = MAX(addr, wp->vaddr);
>>
>> When is addr > wp->vaddr?
>
> Both the watchpoint and the access are arbitrary ranges.
>
> wp: [ 1000 - 1008 ]
> store: [ 1002 - 1004 ]
>
> wp: [ 1004 - 1008 ]
> store: [ 1000 - 1008 ]
>
> The old code would, for the first case, return 1002 and not the 1000 of the
> watch point, which seems reasonable. For the second case, we would set 1000,
> an address outside of the watchpoint.
>
> David's change makes sure that the address signaled is inside the watchpoint.
> I.e. leaving the first case unchanged and making the second set 1004.
>
> It seems very reasonable to me.
Thanks for the very clear explanation :)
If you have time, few lines of comment around would be very appreciated...
Now that it is clearer:
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Regards,
Phil.
- [Qemu-devel] [PATCH v2 0/8] exec: Cleanup watchpoints, Richard Henderson, 2019/08/28
- [Qemu-devel] [PATCH v2 3/8] cputlb: Fold TLB_RECHECK into TLB_INVALID_MASK, Richard Henderson, 2019/08/28
- [Qemu-devel] [PATCH v2 4/8] exec: Factor out cpu_watchpoint_address_matches, Richard Henderson, 2019/08/28
- [Qemu-devel] [PATCH v2 5/8] cputlb: Fix size operand for tlb_fill on unaligned store, Richard Henderson, 2019/08/28
- [Qemu-devel] [PATCH v2 6/8] cputlb: Remove double-alignment in store_helper, Richard Henderson, 2019/08/28