Re: [PATCH] hw/block/dataplane/virtio-block: Avoid dynamic stack allocation

2023-08-29 Thread Peter Maydell
On Thu, 24 Aug 2023 at 18:15, Stefan Hajnoczi wrote: > > On Thu, Aug 24, 2023 at 05:57:40PM +0100, Peter Maydell wrote: > > Instead of using a variable length array in notify_guest_bh(), always > > use a fixed sized bitmap (this will be 128 bytes). This means we > > need to avoid assuming that

Re: [PATCH] hw/block/dataplane/virtio-block: Avoid dynamic stack allocation

2023-08-24 Thread Stefan Hajnoczi
On Thu, Aug 24, 2023 at 05:57:40PM +0100, Peter Maydell wrote: > Instead of using a variable length array in notify_guest_bh(), always > use a fixed sized bitmap (this will be 128 bytes). This means we > need to avoid assuming that bitmap and the s->batch_notify_vqs bitmap > are the same size;

[PATCH] hw/block/dataplane/virtio-block: Avoid dynamic stack allocation

2023-08-24 Thread Peter Maydell
Instead of using a variable length array in notify_guest_bh(), always use a fixed sized bitmap (this will be 128 bytes). This means we need to avoid assuming that bitmap and the s->batch_notify_vqs bitmap are the same size; the neatest way to do this is to switch to using bitmap.h APIs to