Beata Michalska <beata.michal...@linaro.org> writes:
> On Wed, 6 Nov 2019 at 12:20, Richard Henderson > <richard.hender...@linaro.org> wrote: >> >> On 11/6/19 12:40 AM, Beata Michalska wrote: >> > +void qemu_ram_writeback(RAMBlock *block, ram_addr_t start, ram_addr_t >> > length) >> > +{ >> > + void *addr = ramblock_ptr(block, start); >> > + >> > + /* >> > + * The requested range might spread up to the very end of the block >> > + */ >> > + if ((start + length) > block->used_length) { >> > + qemu_log("%s: sync range outside the block boundaries: " >> > + "start: " RAM_ADDR_FMT " length: " RAM_ADDR_FMT >> > + " block length: " RAM_ADDR_FMT " Narrowing down ..." >> > , >> > + __func__, start, length, block->used_length); >> > + length = block->used_length - start; >> > + } >> >> qemu_log_mask w/ GUEST_ERROR? How do we expect the length to overflow? > > In theory it shouldn't, at least with current usage. > I guess the probe_access will make sure of that. > This was more of a precaution to enable catching potential/future misuses > aka debugging purpose. I can get rid of that it that's playing too > safe. If the internal code might get it wrong and that would be a bug then the g_assert(), if the values are ultimately from the guest then log with GUEST_ERROR as Richard suggests. <snip> -- Alex Bennée