Re: [Qemu-devel] [PATCH v2 4/8] exec: Factor out cpu_watchpoint_address_matches

2019-08-29 Thread Richard Henderson
On 8/29/19 10:20 AM, Philippe Mathieu-Daudé wrote: >> +/* Avoid trapping reads of pages with a write breakpoint. */ >> +match = (prot & PAGE_READ ? BP_MEM_READ : 0) >> + | (prot & PAGE_WRITE ? BP_MEM_WRITE : 0); > > Isn't it cheaper to do here: > >if (!match) { >

Re: [Qemu-devel] [PATCH v2 4/8] exec: Factor out cpu_watchpoint_address_matches

2019-08-29 Thread Philippe Mathieu-Daudé
On 8/29/19 1:16 AM, Richard Henderson wrote: > We want to move the check for watchpoints from > memory_region_section_get_iotlb to tlb_set_page_with_attrs. > Isolate the loop over watchpoints to an exported function. > > Rename the existing cpu_watchpoint_address_matches to > watchpoint_address_ma