[PATCH v3 4/5] virtio: blk: Fix converting the vendor id to a string

Kuan-Wei Chiu visitorckw at gmail.com
Mon Apr 13 00:00:17 CEST 2026


Hi Daniel,

On Mon, Apr 13, 2026 at 06:47:37AM +0900, Daniel Palmer wrote:
> Hi Kuan-Wei,
> 
> On Mon, 13 Apr 2026 at 06:34, Kuan-Wei Chiu <visitorckw at gmail.com> wrote:
> > Is there a chance that other non qemu virtio-mmio devices also use a
> > 4 character string for their vendor ID? If so, this patch will regress
> > their output from a human-readable string to a raw hex value.
> 
> There might be other implementations of virtio but probably not used
> together with u-boot.
> I think this goes the other way too, we are assuming the ids are
> printable ascii chars and it's possible to have an id that isn't.
> What is currently happening looks like luck and seems unsafe to me so
> I think regressing to printing hex is better.

I just took a quick look through the virtio spec, and indeed it never
mentions that the mmio vendor id should be a string.

Given this, should we even treat qemu as a special case here?
Perhaps the simplest and most spec-compliant approach is to never
assume it's a string, and just uniformly print the hex value for all
devices. What do you think?

Regards,
Kuan-Wei


More information about the U-Boot mailing list