From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O0Lu4-00040t-H6 for qemu-devel@nongnu.org; Fri, 09 Apr 2010 17:38:16 -0400 Received: from [140.186.70.92] (port=56133 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O0Lu1-0003zf-5C for qemu-devel@nongnu.org; Fri, 09 Apr 2010 17:38:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O0Ltz-0000TU-1t for qemu-devel@nongnu.org; Fri, 09 Apr 2010 17:38:12 -0400 Received: from hall.aurel32.net ([88.191.82.174]:40754) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O0Lty-0000TN-SY for qemu-devel@nongnu.org; Fri, 09 Apr 2010 17:38:11 -0400 Date: Fri, 9 Apr 2010 22:09:02 +0200 From: Aurelien Jarno Subject: Re: [Qemu-devel] [PATCH 5/6] [S390] Implement virtio reset Message-ID: <20100409200902.GK21042@volta.aurel32.net> References: <1270140161-17216-1-git-send-email-agraf@suse.de> <1270140161-17216-6-git-send-email-agraf@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <1270140161-17216-6-git-send-email-agraf@suse.de> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Graf Cc: waldi@debian.org, Carsten Otte , qemu-devel@nongnu.org On Thu, Apr 01, 2010 at 06:42:40PM +0200, Alexander Graf wrote: > 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. Thanks, applied. > Signed-off-by: Alexander Graf > --- > 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 > > > > -- Aurelien Jarno GPG: 1024D/F1BCDB73 aurelien@aurel32.net http://www.aurel32.net