From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:56212) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UG5HV-0001dO-5g for qemu-devel@nongnu.org; Thu, 14 Mar 2013 06:21:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UG5HS-00048n-54 for qemu-devel@nongnu.org; Thu, 14 Mar 2013 06:21:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:27857) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UG5HR-00048i-T3 for qemu-devel@nongnu.org; Thu, 14 Mar 2013 06:21:02 -0400 Date: Thu, 14 Mar 2013 12:21:19 +0200 From: "Michael S. Tsirkin" Message-ID: <20130314102119.GA16859@redhat.com> References: <1363069782-10735-1-git-send-email-asias@redhat.com> <20130314042514.GA28504@hj.localdomain> <20130314092542.GB7892@hj.localdomain> <20130314094643.GD14977@redhat.com> <51419FB8.6010805@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <51419FB8.6010805@redhat.com> Subject: Re: [Qemu-devel] [PATCH V2 WIP 0/2] vhost-scsi: new device supporting the tcm_vhost Linux kernel module List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: kvm@vger.kernel.org, Rusty Russell , qemu-devel@nongnu.org, Nicholas Bellinger , virtualization@lists.linux-foundation.org, target-devel@vger.kernel.org, Stefan Hajnoczi , Asias He On Thu, Mar 14, 2013 at 11:00:24AM +0100, Paolo Bonzini wrote: > > >> --------------- 8 ---------------> seabios patch: > >> diff --git a/src/virtio-scsi.c b/src/virtio-scsi.c > >> index 879ddfb..4de1255 100644 > >> --- a/src/virtio-scsi.c > >> +++ b/src/virtio-scsi.c > >> @@ -147,6 +147,9 @@ init_virtio_scsi(struct pci_device *pci) > >> goto fail; > >> } > >> > >> + vp_set_status(ioaddr, VIRTIO_CONFIG_S_ACKNOWLEDGE | > >> + VIRTIO_CONFIG_S_DRIVER | VIRTIO_CONFIG_S_DRIVER_OK); > >> + > >> int i, tot; > >> for (tot = 0, i = 0; i < 256; i++) > >> tot += virtio_scsi_scan_target(pci, ioaddr, vq, i); > >> @@ -154,8 +157,6 @@ init_virtio_scsi(struct pci_device *pci) > >> if (!tot) > >> goto fail; > >> > >> - vp_set_status(ioaddr, VIRTIO_CONFIG_S_ACKNOWLEDGE | > >> - VIRTIO_CONFIG_S_DRIVER | VIRTIO_CONFIG_S_DRIVER_OK); > >> return; > >> > >> fail: > > ACK. > > >> diff --git a/src/virtio-scsi.h b/src/virtio-scsi.h > >> index bbfbf30..96c3701 100644 > >> --- a/src/virtio-scsi.h > >> +++ b/src/virtio-scsi.h > >> @@ -26,7 +26,7 @@ struct virtio_scsi_req_cmd { > >> u8 prio; > >> u8 crn; > >> char cdb[VIRTIO_SCSI_CDB_SIZE]; > >> -}; > >> +} __attribute__((packed)); > >> > >> /* This is the first element of the "in" scatter-gather list. */ > >> struct virtio_scsi_resp_cmd { > >> @@ -36,7 +36,7 @@ struct virtio_scsi_resp_cmd { > >> u8 status; > >> u8 response; > >> u8 sense[VIRTIO_SCSI_SENSE_SIZE]; > >> -}; > >> +} __attribute__((packed)); > >> > >> #define VIRTIO_SCSI_S_OK 0 > > > > I see, the padding creates the problem? > > Looks like it does for req_cmd (which has length 51 and is padded to > 56). QEMU incorrectly relies on the framing. That's bad though. Let's fix this in qemu. > Both of these are SeaBIOS bugs, please do submit the patch. > > Paolo Right but in parallel we can use the old BIOS to make sure qemu does not rely on framing. -- MST