qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v2 for-1.6 0/2] virtio-mmio: fixes to QueueNum, QueueNumMax
@ 2013-07-26 15:41 Peter Maydell
  2013-07-26 15:41 ` [Qemu-devel] [PATCH v2 for-1.6 1/2] hw/virtio/virtio: Don't allow guests to add/remove queues Peter Maydell
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Peter Maydell @ 2013-07-26 15:41 UTC (permalink / raw)
  To: qemu-devel
  Cc: KONRAD Frederic, Anthony Liguori, Michael S. Tsirkin, kvmarm,
	patches

These patches fix a couple of bugs in virtio-mmio's
handling of the registers that deal with the queue size:

 * as mst points out, letting the guest flip a queue between
   "exists" and "doesn't exist" is a bad idea
 * QueueNumMax wasn't reading the correct value for nonexistent
   queues

This doesn't include any change to the behaviour of queuesize
on reset (discussed in other thread); the current behaviour is
not a problem for well-behaved guests, and safe in the face
of badly-behaved guests, and currently improving the reset
behaviour is blocked by an unrelated bug.

v1->v2: changes as per mst review:
 * avoid explicit "== 0" comparisons
 * avoid unnecessary parens round comparison ops
 * do the "don't flip between existent and nonexistent" check
   with "!!num != !!oldnum" (and add a comment noting why we're
   doing this check)

Peter Maydell (2):
  hw/virtio/virtio: Don't allow guests to add/remove queues
  hw/virtio/virtio-mmio: Make QueueNumMax read 0 for unavailable queues

 hw/virtio/virtio-mmio.c |    3 +++
 hw/virtio/virtio.c      |   12 +++++++++---
 2 files changed, 12 insertions(+), 3 deletions(-)

-- 
1.7.9.5

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2013-08-11 13:46 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-26 15:41 [Qemu-devel] [PATCH v2 for-1.6 0/2] virtio-mmio: fixes to QueueNum, QueueNumMax Peter Maydell
2013-07-26 15:41 ` [Qemu-devel] [PATCH v2 for-1.6 1/2] hw/virtio/virtio: Don't allow guests to add/remove queues Peter Maydell
2013-08-11 13:45   ` Michael S. Tsirkin
2013-07-26 15:41 ` [Qemu-devel] [PATCH v2 for-1.6 2/2] hw/virtio/virtio-mmio: Make QueueNumMax read 0 for unavailable queues Peter Maydell
2013-08-11 13:47   ` Michael S. Tsirkin
2013-08-09 15:47 ` [Qemu-devel] [PATCH v2 for-1.6 0/2] virtio-mmio: fixes to QueueNum, QueueNumMax Peter Maydell
2013-08-11 13:47   ` Michael S. Tsirkin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).