From patchwork Mon Dec 28 16:09:48 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Avi Kivity X-Patchwork-Id: 70011 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.2) with ESMTP id nBSG9xFn029231 for ; Mon, 28 Dec 2009 16:09:59 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751337AbZL1QJ5 (ORCPT ); Mon, 28 Dec 2009 11:09:57 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751298AbZL1QJ4 (ORCPT ); Mon, 28 Dec 2009 11:09:56 -0500 Received: from mx1.redhat.com ([209.132.183.28]:56462 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751199AbZL1QJ4 (ORCPT ); Mon, 28 Dec 2009 11:09:56 -0500 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id nBSG9o8Q007555 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 28 Dec 2009 11:09:50 -0500 Received: from cleopatra.tlv.redhat.com (cleopatra.tlv.redhat.com [10.35.255.11]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id nBSG9nZd004608; Mon, 28 Dec 2009 11:09:49 -0500 Received: from localhost.localdomain (dhcp-1-27.tlv.redhat.com [10.35.1.27]) by cleopatra.tlv.redhat.com (Postfix) with ESMTP id EC9A925004D; Mon, 28 Dec 2009 18:09:48 +0200 (IST) From: Avi Kivity To: Rusty Russell Cc: virtualization@lists.linux-foundation.org, kvm@vger.kernel.org, qemu-devel@nongnu.org Subject: [PATCH] virtio-blk physical block size Date: Mon, 28 Dec 2009 18:09:48 +0200 Message-Id: <1262016588-15136-1-git-send-email-avi@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org --- virtio-spec-0.8.3.lyx.orig 2009-12-28 17:42:40.000000000 +0200 +++ virtio-spec-0.8.3.lyx 2009-12-28 18:05:17.000000000 +0200 @@ -4131,6 +4131,19 @@ \end_layout \begin_layout Description +VIRTIO_BLK_F_PHYS_BLK_SIZE(7) Physical block size of disk (writes aligned + to this will not trigger read-modify-write cycles) is in +\begin_inset Quotes erd +\end_inset + +phys_blk_size +\begin_inset Quotes erd +\end_inset + +. +\end_layout + +\begin_layout Description VIRTIO_BLK_F_SECTOR_MAX \begin_inset space ~ \end_inset @@ -4214,6 +4227,11 @@ \begin_layout Plain Layout + u32 phys_blk_size; +\end_layout + +\begin_layout Plain Layout + }; \end_layout @@ -4241,9 +4259,9 @@ \begin_layout Enumerate If the VIRTIO_BLK_F_BLK_SIZE feature is negotiated, the blk_size field can - be read to determine the optimal sector size for the driver to use. + be read to determine the sector size for the driver to use. This does not effect the units used in the protocol (always 512 bytes), - but awareness of the correct value can effect performance. + but requests must be aligned to this size. \end_layout \begin_layout Enumerate @@ -4257,6 +4275,13 @@ No requests should be submitted which go beyond this limit. \end_layout +\begin_layout Enumerate +If the VIRTIO_BLK_F_PHYS_BLK_SIZE feature is negotiated, the phys_blk_size + field should be read to determine the hardware block size. + Smaller writes are liable to require read-modify-write cycles on behalf + of the underlying hardware, however they are still supported. +\end_layout + \begin_layout Section* Device Operation \end_layout