From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:39524) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SwW9s-0001m5-Tx for qemu-devel@nongnu.org; Wed, 01 Aug 2012 06:28:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SwW9n-0004MB-3p for qemu-devel@nongnu.org; Wed, 01 Aug 2012 06:28:04 -0400 Received: from gate.crashing.org ([63.228.1.57]:56058) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SwW9m-0004M2-Qk for qemu-devel@nongnu.org; Wed, 01 Aug 2012 06:27:59 -0400 Message-ID: <1343816872.2362.2.camel@pasglop> From: Benjamin Herrenschmidt Date: Wed, 01 Aug 2012 20:27:52 +1000 In-Reply-To: References: <1343796869.16975.48.camel@pasglop> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Mime-Version: 1.0 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: Stefan Hajnoczi Cc: Anthony Liguori , qemu-devel@nongnu.org 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. Cheers, Ben.