Re: [Qemu-devel] [PATCH for-4.1] target/arm: Stop using variable length array in dc_zva

2019-03-29 Thread Peter Maydell
On Thu, 28 Mar 2019 at 19:14, Richard Henderson wrote: > > On 3/28/19 7:30 AM, Peter Maydell wrote: > > -void *hostaddr[maxidx]; > > +void *hostaddr[DIV_ROUND_UP(2 * KiB, 1 << TARGET_PAGE_BITS_MIN)]; > > A very fancy way of writing "2". Yes, but I thought this made the relationshi

Re: [Qemu-devel] [PATCH for-4.1] target/arm: Stop using variable length array in dc_zva

2019-03-28 Thread Richard Henderson
On 3/28/19 7:30 AM, Peter Maydell wrote: > -void *hostaddr[maxidx]; > +void *hostaddr[DIV_ROUND_UP(2 * KiB, 1 << TARGET_PAGE_BITS_MIN)]; A very fancy way of writing "2". > int try, i; > unsigned mmu_idx = cpu_mmu_index(env, false); > TCGMemOpIdx oi = mak

[Qemu-devel] [PATCH for-4.1] target/arm: Stop using variable length array in dc_zva

2019-03-28 Thread Peter Maydell
Currently the dc_zva helper function uses a variable length array. In fact we know (as the comment above remarks) that the length of this array is bounded because the architecture limits the block size and QEMU limits the target page size. Use a fixed array size and assert that we don't run off it.