From: Alexander Graf <agraf@suse.de>
To: qemu-devel@nongnu.org
Cc: waldi@debian.org, Carsten Otte <carsteno@de.ibm.com>,
aurelien@aurel32.net
Subject: [Qemu-devel] [PATCH 5/6] [S390] Implement virtio reset
Date: Thu, 1 Apr 2010 18:42:40 +0200 [thread overview]
Message-ID: <1270140161-17216-6-git-send-email-agraf@suse.de> (raw)
In-Reply-To: <1270140161-17216-1-git-send-email-agraf@suse.de>
The guest may issue a RESET command for virtio. So far we didn't bother
to implement it, but with my new bootloader we actually need it for Linux
to get back to a safe state.
Signed-off-by: Alexander Graf <agraf@suse.de>
---
hw/s390-virtio-bus.c | 3 +--
hw/s390-virtio-bus.h | 1 +
hw/s390-virtio.c | 9 +++++----
3 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/hw/s390-virtio-bus.c b/hw/s390-virtio-bus.c
index 9fc01e9..b52d08d 100644
--- a/hw/s390-virtio-bus.c
+++ b/hw/s390-virtio-bus.c
@@ -56,7 +56,6 @@ typedef struct {
static const VirtIOBindings virtio_s390_bindings;
static ram_addr_t s390_virtio_device_num_vq(VirtIOS390Device *dev);
-static void s390_virtio_device_sync(VirtIOS390Device *dev);
VirtIOS390Bus *s390_virtio_bus_init(ram_addr_t *ram_size)
{
@@ -185,7 +184,7 @@ static ram_addr_t s390_virtio_next_ring(VirtIOS390Bus *bus)
return r;
}
-static void s390_virtio_device_sync(VirtIOS390Device *dev)
+void s390_virtio_device_sync(VirtIOS390Device *dev)
{
VirtIOS390Bus *bus = DO_UPCAST(VirtIOS390Bus, bus, dev->qdev.parent_bus);
ram_addr_t cur_offs;
diff --git a/hw/s390-virtio-bus.h b/hw/s390-virtio-bus.h
index 0ea8f54..333fea8 100644
--- a/hw/s390-virtio-bus.h
+++ b/hw/s390-virtio-bus.h
@@ -65,3 +65,4 @@ extern VirtIOS390Device *s390_virtio_bus_find_vring(VirtIOS390Bus *bus,
int *vq_num);
extern VirtIOS390Device *s390_virtio_bus_find_mem(VirtIOS390Bus *bus,
ram_addr_t mem);
+extern void s390_virtio_device_sync(VirtIOS390Device *dev);
diff --git a/hw/s390-virtio.c b/hw/s390-virtio.c
index ad3386f..c36a8b2 100644
--- a/hw/s390-virtio.c
+++ b/hw/s390-virtio.c
@@ -99,10 +99,11 @@ int s390_virtio_hypercall(CPUState *env)
break;
case KVM_S390_VIRTIO_RESET:
{
- /* Virtio_reset resets the internal addresses, so we'd have to sync
- them up again. We don't want to reallocate a vring though, so let's
- just not reset. */
- /* virtio_reset(dev->vdev); */
+ VirtIOS390Device *dev;
+
+ dev = s390_virtio_bus_find_mem(s390_bus, mem);
+ virtio_reset(dev->vdev);
+ s390_virtio_device_sync(dev);
break;
}
case KVM_S390_VIRTIO_SET_STATUS:
--
1.6.0.2
next prev parent reply other threads:[~2010-04-01 16:42 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-01 16:42 [Qemu-devel] [PATCH 0/6] S390 April patch round Alexander Graf
2010-04-01 16:42 ` [Qemu-devel] [PATCH 1/6] S390: Add stub for cpu_get_phys_page_debug Alexander Graf
2010-04-01 16:42 ` [Qemu-devel] [PATCH 2/6] S390: Tell user why VM creation failed Alexander Graf
2010-04-01 16:42 ` [Qemu-devel] [PATCH 3/6] Make char muxer more robust wrt small FIFOs Alexander Graf
2010-04-05 3:40 ` Amit Shah
2010-04-07 14:32 ` Alexander Graf
2010-04-07 14:43 ` Amit Shah
2010-04-01 16:42 ` [Qemu-devel] [PATCH 4/6] Always notify consumers of char devices if they're open Alexander Graf
2010-04-05 3:43 ` Amit Shah
2010-04-09 20:09 ` Aurelien Jarno
2010-04-01 16:42 ` Alexander Graf [this message]
2010-04-09 20:09 ` [Qemu-devel] [PATCH 5/6] [S390] Implement virtio reset Aurelien Jarno
2010-04-01 16:42 ` [Qemu-devel] [PATCH 6/6] [S390] Add firmware code Alexander Graf
2010-04-01 21:18 ` [Qemu-devel] " Bastian Blank
2010-04-01 22:10 ` Alexander Graf
2010-04-09 20:17 ` [Qemu-devel] " Aurelien Jarno
2010-04-09 23:29 ` Alexander Graf
2010-04-10 0:00 ` Aurelien Jarno
2010-04-10 9:22 ` Alexander Graf
2010-04-10 15:03 ` Aurelien Jarno
2010-04-12 8:43 ` Carsten Otte
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1270140161-17216-6-git-send-email-agraf@suse.de \
--to=agraf@suse.de \
--cc=aurelien@aurel32.net \
--cc=carsteno@de.ibm.com \
--cc=qemu-devel@nongnu.org \
--cc=waldi@debian.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).