On Thu, Jul 20, 2017 at 11:22:10 -1000, Richard Henderson wrote: > >Perhaps we should then enlarge both the first and last regions so that we > >fully use the buffer. > > I really like the idea. That's a lot of space recovered for 64k page hosts. > > I do think we can make the computation clearer. How about
(snip) > > static inline void tcg_region_bounds(TCGContext *s, size_t curr_region, > void **pstart, void **pend) > { > void *start, *end; > > /* ??? Maybe store "aligned" precomputed. */ > start = QEMU_ALIGN_PTR_UP(region.start, qemu_real_host_page_size); > /* ??? Maybe store "stride" precomputed. */ > start += curr_region * (region.size + qemu_real_host_page_size); > end = start + region.size; > > if (curr_region == 0) { > start = region.start; > } > if (curr_region == region.n - 1) { > end = region.end; > } > > *pstart = start; > *pend = end; > } That's a nice helper -- will do it this way. For v4, should I send all patches again, or just the handful of patches that are changing from v3? E.