* [Qemu-devel] [PATCH] virtio-ccw: Check indicators location.
2013-04-23 16:27 [Qemu-devel] [PATCH] virtio-ccw: Indicators fix Cornelia Huck
@ 2013-04-23 16:27 ` Cornelia Huck
0 siblings, 0 replies; 3+ messages in thread
From: Cornelia Huck @ 2013-04-23 16:27 UTC (permalink / raw)
To: qemu-devel; +Cc: Cornelia Huck, qemu-stable
If a guest neglected to register (secondary) indicators but still runs
with notifications enabled, we might end up writing to guest zero;
avoid this by checking for valid indicators and only writing to the
guest and generating an interrupt if indicators have been setup.
Cc: qemu-stable@nongnu.org
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
---
hw/s390x/virtio-ccw.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c
index 56539d3..1c6bd21 100644
--- a/hw/s390x/virtio-ccw.c
+++ b/hw/s390x/virtio-ccw.c
@@ -752,10 +752,16 @@ static void virtio_ccw_notify(DeviceState *d, uint16_t vector)
}
if (vector < VIRTIO_PCI_QUEUE_MAX) {
+ if (!dev->indicators) {
+ return;
+ }
indicators = ldq_phys(dev->indicators);
indicators |= 1ULL << vector;
stq_phys(dev->indicators, indicators);
} else {
+ if (!dev->indicators2) {
+ return;
+ }
vector = 0;
indicators = ldq_phys(dev->indicators2);
indicators |= 1ULL << vector;
--
1.7.9.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [Qemu-devel] [PULL] virtio-ccw: indicators fix.
@ 2013-04-25 9:06 Cornelia Huck
2013-04-25 9:06 ` [Qemu-devel] [PATCH] virtio-ccw: Check indicators location Cornelia Huck
0 siblings, 1 reply; 3+ messages in thread
From: Cornelia Huck @ 2013-04-25 9:06 UTC (permalink / raw)
To: qemu-devel
Cc: Blue Swirl, Cornelia Huck, Anthony Liguori, Aurélien Jarno
One bugfix to make sure guests that didn't set up indicators are
handled correctly.
Please pull.
The following changes since commit 9953f8822cc316eec9962f0a2858c3439a80adec:
pc: Kill the "use flash device for BIOS unless KVM" misfeature (2013-04-24 13:23:51 -0500)
are available in the git repository at:
git://github.com/cohuck/qemu virtio-ccw-upstr
for you to fetch changes up to 7c4869761d7f2e0a3f806a5359eea5d2473ec5d5:
virtio-ccw: Check indicators location. (2013-04-25 10:43:30 +0200)
Cornelia Huck (1):
virtio-ccw: Check indicators location.
hw/s390x/virtio-ccw.c | 6 ++++++
1 file changed, 6 insertions(+)
--
1.7.9.5
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Qemu-devel] [PATCH] virtio-ccw: Check indicators location.
2013-04-25 9:06 [Qemu-devel] [PULL] virtio-ccw: indicators fix Cornelia Huck
@ 2013-04-25 9:06 ` Cornelia Huck
0 siblings, 0 replies; 3+ messages in thread
From: Cornelia Huck @ 2013-04-25 9:06 UTC (permalink / raw)
To: qemu-devel
Cc: Blue Swirl, Cornelia Huck, Anthony Liguori, qemu-stable,
Aurélien Jarno
If a guest neglected to register (secondary) indicators but still runs
with notifications enabled, we might end up writing to guest zero;
avoid this by checking for valid indicators and only writing to the
guest and generating an interrupt if indicators have been setup.
Cc: qemu-stable@nongnu.org
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
---
hw/s390x/virtio-ccw.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c
index 56e4872..b857413 100644
--- a/hw/s390x/virtio-ccw.c
+++ b/hw/s390x/virtio-ccw.c
@@ -742,10 +742,16 @@ static void virtio_ccw_notify(DeviceState *d, uint16_t vector)
}
if (vector < VIRTIO_PCI_QUEUE_MAX) {
+ if (!dev->indicators) {
+ return;
+ }
indicators = ldq_phys(dev->indicators);
indicators |= 1ULL << vector;
stq_phys(dev->indicators, indicators);
} else {
+ if (!dev->indicators2) {
+ return;
+ }
vector = 0;
indicators = ldq_phys(dev->indicators2);
indicators |= 1ULL << vector;
--
1.7.9.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-04-25 9:07 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-25 9:06 [Qemu-devel] [PULL] virtio-ccw: indicators fix Cornelia Huck
2013-04-25 9:06 ` [Qemu-devel] [PATCH] virtio-ccw: Check indicators location Cornelia Huck
-- strict thread matches above, loose matches on Subject: below --
2013-04-23 16:27 [Qemu-devel] [PATCH] virtio-ccw: Indicators fix Cornelia Huck
2013-04-23 16:27 ` [Qemu-devel] [PATCH] virtio-ccw: Check indicators location Cornelia Huck
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).