From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:49805) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SwWDD-0004FQ-Ow for qemu-devel@nongnu.org; Wed, 01 Aug 2012 06:31:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SwWDC-0005IL-U1 for qemu-devel@nongnu.org; Wed, 01 Aug 2012 06:31:31 -0400 Received: from mail-bk0-f45.google.com ([209.85.214.45]:43443) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SwWDC-0005Hd-ML for qemu-devel@nongnu.org; Wed, 01 Aug 2012 06:31:30 -0400 Received: by bkcji1 with SMTP id ji1so3264246bkc.4 for ; Wed, 01 Aug 2012 03:31:29 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <1343816872.2362.2.camel@pasglop> References: <1343796869.16975.48.camel@pasglop> <1343816872.2362.2.camel@pasglop> Date: Wed, 1 Aug 2012 11:31:29 +0100 Message-ID: From: Stefan Hajnoczi Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [Qemu-devel] virtio-blk: Something bizarre with VIRTIO_BLK_T_GET_ID List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Benjamin Herrenschmidt Cc: Anthony Liguori , qemu-devel@nongnu.org On Wed, Aug 1, 2012 at 11:27 AM, Benjamin Herrenschmidt wrote: > On Wed, 2012-08-01 at 11:16 +0100, Stefan Hajnoczi wrote: > >> The len field is mostly informational. The virtio device driver >> inside the guest may make use of it. In many cases it doesn't so an >> incorrect len value has no effect. In >> drivers/block/virtio_blk.c:blk_done() the len variable is unused. > > Right but arguably the guest reading more than the len passed back into > the descriptor is itself a bug :-) > >> QEMU should call cpu_physical_memory_unmap() with the correct size >> value in hw/virtio.c:virtqueue_fill() so that the memory dirty bitmap >> is kept up-to-date. This is the only bad side-effect I can see here. > > With the current guest driver ... another one adhering strictly to the > spec might get bitten :-) Anyway, it's minor, but probably somebody > should fix. I don't have time right now, but if you don't beat me to it > I might try to give it a spin tomorrow. Added to my TODO list but I probably won't get a chance before tomorrow either because I need to focus on QEMU 1.2 soft freeze. Stefan