From mboxrd@z Thu Jan 1 00:00:00 1970 From: Cornelia Huck Subject: Re: [PATCH RFC v5 10/19] s390x/virtio-ccw: add virtio set-revision call Date: Thu, 4 Dec 2014 17:43:52 +0100 Message-ID: <20141204174352.4c8bfc65.cornelia.huck@de.ibm.com> References: <1417525227-14051-1-git-send-email-cornelia.huck@de.ibm.com> <1417525227-14051-11-git-send-email-cornelia.huck@de.ibm.com> <20141204162005.GA23214@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: thuth@linux.vnet.ibm.com, qemu-devel@nongnu.org, kvm@vger.kernel.org, virtualization@lists.linux-foundation.org To: "Michael S. Tsirkin" Return-path: In-Reply-To: <20141204162005.GA23214@redhat.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: virtualization-bounces@lists.linux-foundation.org Errors-To: virtualization-bounces@lists.linux-foundation.org List-Id: kvm.vger.kernel.org On Thu, 4 Dec 2014 18:20:05 +0200 "Michael S. Tsirkin" wrote: > On Tue, Dec 02, 2014 at 02:00:18PM +0100, Cornelia Huck wrote: > > From: Thomas Huth > > > > Handle the virtio-ccw revision according to what the guest sets. > > When revision 1 is selected, we have a virtio-1 standard device > > with byteswapping for the virtio rings. > > > > When a channel gets disabled, we have to revert to the legacy behavior > > in case the next user of the device does not negotiate the revision 1 > > anymore (e.g. the boot firmware uses revision 1, but the operating > > system only uses the legacy mode). > > > > Note that revisions > 0 are still disabled. > > > > Signed-off-by: Thomas Huth > > Signed-off-by: Cornelia Huck > > --- > > hw/s390x/virtio-ccw.c | 52 +++++++++++++++++++++++++++++++++++++++++++++++++ > > hw/s390x/virtio-ccw.h | 5 +++++ > > 2 files changed, 57 insertions(+) > > @@ -747,6 +797,8 @@ static int virtio_ccw_device_init(VirtioCcwDevice *dev, VirtIODevice *vdev) > > sch->id.cu_type = VIRTIO_CCW_CU_TYPE; > > sch->id.cu_model = vdev->device_id; > > > > + dev->revision = -1; > > + > > /* Set default feature bits that are offered by the host. */ > > dev->host_features = 0; > > virtio_add_feature(&dev->host_features, VIRTIO_F_NOTIFY_ON_EMPTY); > > You should also clear it on device reset. Nope, revision survives reset and can only be cleared by disabling and reenabling the device. From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38084) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XwZVh-0004B6-UA for qemu-devel@nongnu.org; Thu, 04 Dec 2014 11:44:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XwZVX-0007Ly-6f for qemu-devel@nongnu.org; Thu, 04 Dec 2014 11:44:09 -0500 Received: from e06smtp17.uk.ibm.com ([195.75.94.113]:51103) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XwZVW-0007Lq-Ue for qemu-devel@nongnu.org; Thu, 04 Dec 2014 11:43:59 -0500 Received: from /spool/local by e06smtp17.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 4 Dec 2014 16:43:57 -0000 Received: from b06cxnps3074.portsmouth.uk.ibm.com (d06relay09.portsmouth.uk.ibm.com [9.149.109.194]) by d06dlp02.portsmouth.uk.ibm.com (Postfix) with ESMTP id A9EB02190045 for ; Thu, 4 Dec 2014 16:43:26 +0000 (GMT) Received: from d06av09.portsmouth.uk.ibm.com (d06av09.portsmouth.uk.ibm.com [9.149.37.250]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id sB4Ghtjs62324876 for ; Thu, 4 Dec 2014 16:43:55 GMT Received: from d06av09.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av09.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id sB4Ghs3S031077 for ; Thu, 4 Dec 2014 09:43:54 -0700 Date: Thu, 4 Dec 2014 17:43:52 +0100 From: Cornelia Huck Message-ID: <20141204174352.4c8bfc65.cornelia.huck@de.ibm.com> In-Reply-To: <20141204162005.GA23214@redhat.com> References: <1417525227-14051-1-git-send-email-cornelia.huck@de.ibm.com> <1417525227-14051-11-git-send-email-cornelia.huck@de.ibm.com> <20141204162005.GA23214@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH RFC v5 10/19] s390x/virtio-ccw: add virtio set-revision call List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" Cc: thuth@linux.vnet.ibm.com, rusty@rustcorp.com.au, qemu-devel@nongnu.org, kvm@vger.kernel.org, virtualization@lists.linux-foundation.org On Thu, 4 Dec 2014 18:20:05 +0200 "Michael S. Tsirkin" wrote: > On Tue, Dec 02, 2014 at 02:00:18PM +0100, Cornelia Huck wrote: > > From: Thomas Huth > > > > Handle the virtio-ccw revision according to what the guest sets. > > When revision 1 is selected, we have a virtio-1 standard device > > with byteswapping for the virtio rings. > > > > When a channel gets disabled, we have to revert to the legacy behavior > > in case the next user of the device does not negotiate the revision 1 > > anymore (e.g. the boot firmware uses revision 1, but the operating > > system only uses the legacy mode). > > > > Note that revisions > 0 are still disabled. > > > > Signed-off-by: Thomas Huth > > Signed-off-by: Cornelia Huck > > --- > > hw/s390x/virtio-ccw.c | 52 +++++++++++++++++++++++++++++++++++++++++++++++++ > > hw/s390x/virtio-ccw.h | 5 +++++ > > 2 files changed, 57 insertions(+) > > @@ -747,6 +797,8 @@ static int virtio_ccw_device_init(VirtioCcwDevice *dev, VirtIODevice *vdev) > > sch->id.cu_type = VIRTIO_CCW_CU_TYPE; > > sch->id.cu_model = vdev->device_id; > > > > + dev->revision = -1; > > + > > /* Set default feature bits that are offered by the host. */ > > dev->host_features = 0; > > virtio_add_feature(&dev->host_features, VIRTIO_F_NOTIFY_ON_EMPTY); > > You should also clear it on device reset. Nope, revision survives reset and can only be cleared by disabling and reenabling the device.