Re: [PATCH 1/1] virtio-blk: Add description for blk_size field

Max Gurtovoy <[email protected]> Sun, 6 Oct 2024 14:35:49 +0300
Newsgroups dev.linux.lists.virtio-dev,dev.linux.lists.virtualization
Message-ID <[email protected]>
On 03/10/2024 2:56, Daniel Verkamp wrote:
> On Mon, Sep 30, 2024 at 6:45 PM Daniel Verkamp <[email protected]> wrote:
>> On Wed, Sep 25, 2024 at 4:42 PM Max Gurtovoy <[email protected]> wrote:
> [...]
>>> I'm curious if you've encountered any actual implementations where
>>> drivers send non-block-size-aligned requests to block devices. I never
>>> saw such implementation.
>> I don't know of any real-world implementations like this, but the
>> point of the spec is to allow interoperability without having to know
>> about every implementation.
> I did find at least one existing real-world driver implementation that
> ignores blk_size and VIRTIO_BLK_F_BLK_SIZE - the u-boot virtio-blk
> driver: https://github.com/u-boot/u-boot/blob/master/drivers/virtio/virtio_blk.c
>
> So this is not just spec language lawyering; this driver depends on
> the ability to read/write at arbitrary 512-byte sector addresses and
> data sizes, and it seems like it should be allowed to do that based on
> my reading of the spec.
>
> (Perhaps u-boot's driver does not work with the QEMU's virtio-blk
> device with certain storage configurations, per Stefan's note, but
> that is again just one device implementation.)

Vague specifications and inconsistent interpretations should be avoided.

I'm trying to make the situation better.

I'll send a V2 according to the comments.

BTW, Are you familiar with some virtio-blk device that implements the 
buffer-cache logic you've described ? or is it only a theoretical 
discussion ?


>
> -- Daniel