[{"id":3673816,"web_url":"http://patchwork.ozlabs.org/comment/3673816/","msgid":"<adPlWa9YE9_FZJXe@google.com>","list_archive_url":null,"date":"2026-04-06T16:54:49","subject":"Re: [PATCH v2 3/5] virtio: mmio: Keep vendor id little endian","submitter":{"id":87364,"url":"http://patchwork.ozlabs.org/api/people/87364/","name":"Kuan-Wei Chiu","email":"visitorckw@gmail.com"},"content":"Hi Daniel,\n\nOn Mon, Apr 06, 2026 at 11:24:09PM +0900, Daniel Palmer wrote:\n> The vendor id is used as a little endian value but it gets\n> swapped to the CPU endian in readl(). Swap it back to le\n> to avoid the below weird output from `virtio info`.\n> \n> Device 0: UMEQ VirtIO Block Device\n>             Type: Hard Disk\n>             Capacity: 1.0 MB = 0.0 GB (2056 x 512)\n> \n> Signed-off-by: Daniel Palmer <daniel@thingy.jp>\n> ---\n>  drivers/virtio/virtio_mmio.c | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n> \n> diff --git a/drivers/virtio/virtio_mmio.c b/drivers/virtio/virtio_mmio.c\n> index 1cd737aca249..ddf873fa96fb 100644\n> --- a/drivers/virtio/virtio_mmio.c\n> +++ b/drivers/virtio/virtio_mmio.c\n> @@ -374,7 +374,7 @@ static int virtio_mmio_probe(struct udevice *udev)\n>  \t\t */\n>  \t\treturn 0;\n>  \t}\n> -\tuc_priv->vendor = readl(priv->base + VIRTIO_MMIO_VENDOR_ID);\n> +\tuc_priv->vendor = cpu_to_le32(readl(priv->base + VIRTIO_MMIO_VENDOR_ID));\n\nHi Daniel,\n\nThanks for the patch!\n\nWhile using cpu_to_le32() here does fix the visual output, it feels a\nbit hacky because it alters the actual core data value just to satisfy\na display quirk.\n\nFor example, if someone in the future writes hardware specific logic\nlike if (uc_priv->vendor == 0x554D4551), it would silently fail on\nm68k.\n\nIt looks more like a issue in virtio-blk driver to me.\nThe code currently does this:\n\nsprintf(desc->vendor, \"%s\", (char *)&uc_priv->vendor);\n\nThis direct memory cast relies on little endian byte ordering to spell\n\"QEMU\". On big endian machines, the memory layout naturally spells\n\"UMEQ\".\n\nSo maybe we can extract the characters safely using bitwise shifts like\nthis?\n\ndiff --git a/drivers/virtio/virtio_blk.c b/drivers/virtio/virtio_blk.c\nindex 3dd0cf36268..af61939270d 100644\n--- a/drivers/virtio/virtio_blk.c\n+++ b/drivers/virtio/virtio_blk.c\n@@ -168,10 +168,15 @@ static int virtio_blk_bind(struct udevice *dev)\n         * virtio mmio transport supplies string identification for us,\n         * while pci trnasport uses a 2-byte subvendor value.\n         */\n-       if (uc_priv->vendor >> 16)\n-               sprintf(desc->vendor, \"%s\", (char *)&uc_priv->vendor);\n-       else\n+       if (uc_priv->vendor >> 16) {\n+               desc->vendor[0] = (uc_priv->vendor >>  0) & 0xff;\n+               desc->vendor[1] = (uc_priv->vendor >>  8) & 0xff;\n+               desc->vendor[2] = (uc_priv->vendor >> 16) & 0xff;\n+               desc->vendor[3] = (uc_priv->vendor >> 24) & 0xff;\n+               desc->vendor[4] = '\\0';\n+       } else {\n                sprintf(desc->vendor, \"%04x\", uc_priv->vendor);\n+       }\n        desc->bdev = dev;\n\n        /* Indicate what driver features we support */\n\nRegards,\nKuan-Wei","headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20251104 header.b=QAmsDJ6D;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de\n (client-ip=85.214.62.61; helo=phobos.denx.de;\n envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org)","phobos.denx.de;\n dmarc=pass (p=none dis=none) header.from=gmail.com","phobos.denx.de;\n spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de","phobos.denx.de;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=gmail.com header.i=@gmail.com header.b=\"QAmsDJ6D\";\n\tdkim-atps=neutral","phobos.denx.de;\n dmarc=pass (p=none dis=none) header.from=gmail.com","phobos.denx.de;\n spf=pass smtp.mailfrom=visitorckw@gmail.com"],"Received":["from phobos.denx.de (phobos.denx.de [85.214.62.61])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fqFn04kQ5z1y2d\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 07 Apr 2026 02:55:00 +1000 (AEST)","from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id E9B6583C2B;\n\tMon,  6 Apr 2026 18:54:57 +0200 (CEST)","by phobos.denx.de (Postfix, from userid 109)\n id D919C84034; Mon,  6 Apr 2026 18:54:56 +0200 (CEST)","from mail-pl1-x636.google.com (mail-pl1-x636.google.com\n [IPv6:2607:f8b0:4864:20::636])\n (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits))\n (No client certificate requested)\n by phobos.denx.de (Postfix) with ESMTPS id A5D148352B\n for <u-boot@lists.denx.de>; Mon,  6 Apr 2026 18:54:54 +0200 (CEST)","by mail-pl1-x636.google.com with SMTP id\n d9443c01a7336-2b24fede2acso22801825ad.3\n for <u-boot@lists.denx.de>; Mon, 06 Apr 2026 09:54:54 -0700 (PDT)","from google.com (61-230-33-2.dynamic-ip.hinet.net. [61.230.33.2])\n by smtp.gmail.com with ESMTPSA id\n d9443c01a7336-2b27475bc2asm149958175ad.19.2026.04.06.09.54.51\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Mon, 06 Apr 2026 09:54:52 -0700 (PDT)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=-1.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,\n DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_GMAIL_RCVD,FREEMAIL_FROM,\n RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=no\n autolearn_force=no version=3.4.2","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=gmail.com; s=20251104; t=1775494493; x=1776099293; darn=lists.denx.de;\n h=in-reply-to:content-disposition:mime-version:references:message-id\n :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to;\n bh=ZsZQnSha/3vyLhDab+YEm6TOPSoF34A92lnmWs6GWZo=;\n b=QAmsDJ6D7T3RxgllfyS+DdkEPV8GUnq1kxqQt6o2EGggzpKZW+qIcZKv3f0a+SpruW\n F81+l7nI36iGpXJySM/2Ou7q391TYS6AYyV1Nk/jmSNLSIJq5CG0qP++nkOteqvcKg4s\n Gj82ZbSh66/EQlG5+LcZx1Pr4j0/Fcuh8m4MqmDgR3cJpgPjg2vcmnmUskUYuNG2CEYc\n XxfnxX/ie1PeOypGg5jBghRdEoRfePq5Haaf1yB6+Bew66tkEghTJJoBYfXaqeefPm9z\n ttDVPyWsMz3K3KGDlaNytYS0VPWjz/inddPEg55jKe+MowNhYKJ1rxMrsHJ5K6r1pnwe\n AIWQ==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1775494493; x=1776099293;\n h=in-reply-to:content-disposition:mime-version:references:message-id\n :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc\n :subject:date:message-id:reply-to;\n bh=ZsZQnSha/3vyLhDab+YEm6TOPSoF34A92lnmWs6GWZo=;\n b=AmVtYzRa/Lq4aJRp0+C/FnopM5UUz3+jasJ8KmwfuZfuUQpZJDMSXNr+O5JhhEem89\n 64YL9wkVIdZvarPzV6Xx/6EnV9fxbtKIWPnXqyTJj9vVGBZYdPsvzVAof5oj9MILRjj8\n 3w28ciBuJRjdYgWp3NkaEED4K6u59JWpTgE+HZOzw7ZbJoj0ddW12yGqoYX+9RG6Lsrz\n JGW6EL1zTYYIX6yYdWDVNn7shv9g0YtAt3cDqrzrl7gSWI7dCaj8hQ8gitcDrwq8SV+6\n nfKUMSMDqXJrcweHGAXQ1GKCcpfZsPIGLqjDMqr4o2P8IxmDVbI6RrDbj9dsZUhhnYzv\n kPeg==","X-Forwarded-Encrypted":"i=1;\n AJvYcCVzJosFaCrfXVftzn56lV4MAFX4mAyWUOpJx5Wi7oF/fU0UOmy1/tBDNXOXKnBmXAwup+a1TzA=@lists.denx.de","X-Gm-Message-State":"AOJu0YxXpwbbXZtauAzv3pCjtgRaAuX8NXK6eIZTV9d/dz2d6JWdUhac\n wWQFH+MmR7yKlP/R9/lVJ4mBSZKfYHx2vx5W/vJj8qfZR5Nm8LQs0791PHartg==","X-Gm-Gg":"AeBDieuXZdvrvKVpzfgs0FpkBe94rBHpzKFFLCzUutwKINwlEImz+sblhpGlH6BaReg\n rrKWprDBlmR50FB5pqhElfYZB4ClPXoUC6lRtEiyGP+hKCXyhdrepjh94/zQEnK06PveIK7joTy\n fX/fti4eF7HEawy8SwAhWJUNRKTUOEE0eW8IVuVwxtiKK82Xsgj3URHk0i1lXgvlqAZJApnmB7W\n LOMeyLrNbp0pZ5G5rx6+9xMEb5xz6ZcluHqoWuCDAQ9oypzcc4YCSW0Mm2Tvb91jKzrMMHj5ytg\n yUjz08pOOqoN74874GaqPFcyVQ6Rn+EfGfckxNZB08R3plGGaI12TnBw1Y2VHdDRGwdSwYn5BOV\n VeVM0+XOec+co0LaU6nt98U6Cm51QBkzOuvEY8Y4IqhFSqh4wKI/m6x22hLms/dvW/famkTIHsM\n KcPRxni65QfUrbW8wfmQAufXzUhX2r2GtXNDk05J382T4qkuQ94o9oWf+ik8PnOgdB","X-Received":"by 2002:a17:902:d585:b0:2b0:6b98:59ec with SMTP id\n d9443c01a7336-2b2818e55cemr141755655ad.34.1775494493004;\n Mon, 06 Apr 2026 09:54:53 -0700 (PDT)","Date":"Tue, 7 Apr 2026 00:54:49 +0800","From":"Kuan-Wei Chiu <visitorckw@gmail.com>","To":"Daniel Palmer <daniel@thingy.jp>","Cc":"angelo@kernel-space.org, bmeng.cn@gmail.com, u-boot@lists.denx.de","Subject":"Re: [PATCH v2 3/5] virtio: mmio: Keep vendor id little endian","Message-ID":"<adPlWa9YE9_FZJXe@google.com>","References":"<20260406142411.2992618-1-daniel@thingy.jp>\n <20260406142411.2992618-4-daniel@thingy.jp>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<20260406142411.2992618-4-daniel@thingy.jp>","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.39","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<https://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=subscribe>","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>","X-Virus-Scanned":"clamav-milter 0.103.8 at phobos.denx.de","X-Virus-Status":"Clean"}},{"id":3673913,"web_url":"http://patchwork.ozlabs.org/comment/3673913/","msgid":"<CAFr9PXnPvje0K8kZ-zgo_Xx0OMZCYCYkhddEYSUEgZ=5jhYv8Q@mail.gmail.com>","list_archive_url":null,"date":"2026-04-07T01:00:25","subject":"Re: [PATCH v2 3/5] virtio: mmio: Keep vendor id little endian","submitter":{"id":85408,"url":"http://patchwork.ozlabs.org/api/people/85408/","name":"Daniel Palmer","email":"daniel@thingy.jp"},"content":"Hi Kuan-Wei,\n\nOn Tue, 7 Apr 2026 at 01:54, Kuan-Wei Chiu <visitorckw@gmail.com> wrote:\n> For example, if someone in the future writes hardware specific logic\n> like if (uc_priv->vendor == 0x554D4551), it would silently fail on\n> m68k.\n\nYeah, you're totally right. I did think \"hmmm, maybe it's actually\njust an issue with whatever is doing the printing\" right after sending\nthe patch. :)\nI will move the fix to virtio-blk for v3.\n\nThanks\n\nDaniel","headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=thingy.jp header.i=@thingy.jp header.a=rsa-sha256\n header.s=google header.b=RaIZjl/M;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de\n (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de;\n envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org)","phobos.denx.de;\n dmarc=none (p=none dis=none) header.from=thingy.jp","phobos.denx.de;\n spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de","phobos.denx.de;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=thingy.jp header.i=@thingy.jp header.b=\"RaIZjl/M\";\n\tdkim-atps=neutral","phobos.denx.de;\n dmarc=none (p=none dis=none) header.from=thingy.jp","phobos.denx.de; spf=pass smtp.mailfrom=daniel@0x0f.com"],"Received":["from phobos.denx.de (phobos.denx.de\n [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fqSYc0vS7z1yGM\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 07 Apr 2026 11:00:52 +1000 (AEST)","from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id 550988352B;\n\tTue,  7 Apr 2026 03:00:44 +0200 (CEST)","by phobos.denx.de (Postfix, from userid 109)\n id 5DBF883EC6; Tue,  7 Apr 2026 03:00:42 +0200 (CEST)","from mail-dl1-x1231.google.com (mail-dl1-x1231.google.com\n [IPv6:2607:f8b0:4864:20::1231])\n (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits))\n (No client certificate requested)\n by phobos.denx.de (Postfix) with ESMTPS id 9A6E48341A\n for <u-boot@lists.denx.de>; Tue,  7 Apr 2026 03:00:39 +0200 (CEST)","by mail-dl1-x1231.google.com with SMTP id\n a92af1059eb24-12776bebe9fso10318112c88.1\n for <u-boot@lists.denx.de>; Mon, 06 Apr 2026 18:00:39 -0700 (PDT)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,\n DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,\n RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=no\n autolearn_force=no version=3.4.2","ARC-Seal":"i=1; a=rsa-sha256; t=1775523638; cv=none;\n d=google.com; s=arc-20240605;\n b=j7NRIij5uHxwV4xQNIJqR3LyOVJGsfw4nUrsm8vQoySWpxk2UcTIIuc0C3i4kTNxLz\n aL7oVHFsbXQHAtTSvtmF5Cet3RmtptkywZ5xq0kd2F2aO1cb4JwmCDfJi76R5OphwPIb\n m8Vsp4mOHYNcnb7qRFMVqvwLnGZWDIwWWzabhwokI6SnbL0b9L7ee0rk7RlV+D0xVQGI\n nsxDc441v4owxoMFynWyWvmYwoIwx1zHIigdO2Y9wZvvl3ic4O2Bck2xK4o1gdkgVpQC\n Cibkqs9xVTpRZgDK8WGEjVQNBsahYaRGFAA/bj5e1EQaWl7igf6RE+tVLalxPEJbPSeG\n pEWA==","ARC-Message-Signature":"i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com;\n s=arc-20240605;\n h=cc:to:subject:message-id:date:from:in-reply-to:references\n :mime-version:dkim-signature;\n bh=U12V4bWGLE4/PugN/2vXrreKGABbB6akVYH4BJa6g28=;\n fh=Vi9N85O35269yefhoiZhkMxNkLg8OSdM7sXwjNRCm3w=;\n b=Xvl0nPSIajkKg8q1gb2o0fYQTB/23xo27a/UfVWxrnz0ahqazV6TA+qTFyECXrvWa+\n iAOe9QQPjG2UoaqOfgoCel90cwEPRyYthylx5sqxMWfdnAYHevnjNSByWFG1FIlbKs5j\n RT+qM8UgGlW/Te5V3MVi2gZgEfjg7I9nlUJ7Eol7txzUl0rbHLoIxbLFyAwamVu0Ue4P\n fmqCJHMAJRZVsEY7P/C/Zi33xDa+egGe6C7Zly5mgflwun4QmZDBmr0eDIzNcSeNyfum\n 0aC1xbeHPX/vmPi7Lk3d/1rSNh3/igw/IL7gF+7xlwLMqUZ7ga3BspqRb/iiX7QsTxCp\n 59AA==; darn=lists.denx.de","ARC-Authentication-Results":"i=1; mx.google.com; arc=none","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=thingy.jp; s=google; t=1775523638; x=1776128438; darn=lists.denx.de;\n h=cc:to:subject:message-id:date:from:in-reply-to:references\n :mime-version:from:to:cc:subject:date:message-id:reply-to;\n bh=U12V4bWGLE4/PugN/2vXrreKGABbB6akVYH4BJa6g28=;\n b=RaIZjl/MI7UUyAPQycuoRuq9fEiWT6hvMApwlsUAsNIFPCtr/Ov1MnJE9uACpkM+2J\n aOFa7N2D9swv/M5pDIyB7JvJHvAcOnLt6kesfCErERTuuGrJzaz/xnFd2Adar4xCeBgW\n z63bR8XZpqXule38hj7viRlDuPmVRHRtSeNeQ=","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1775523638; x=1776128438;\n h=cc:to:subject:message-id:date:from:in-reply-to:references\n :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date\n :message-id:reply-to;\n bh=U12V4bWGLE4/PugN/2vXrreKGABbB6akVYH4BJa6g28=;\n b=o57W8kDAQx18IZnIb0b0bCZ2e5XnRP9yKr05wJk/eFcs+iEmTqqy9yWHHblBFmzIkB\n qHrE6rZoewvHk4pzCG97EonEG/emhOHVOkXAqBAOGD846Qd2tXKmZZgoAKZE/vrRcfu6\n QRsYEC9rRS5nxyXxJsSZ+GmHvrNzUvqpAdttDSeVu7lYHJg4TdWnIun+VWa8cfNzgtQp\n 77ZHUYzaA26+un6eEIxtHhuXvJ3qzuSDgH7kadE84vcuFRI7DOM50UyL+xMLewACsHVo\n Chh43z3NBlmbwG5pnedkvj0ytGL1X8WhrkIYB7MhNMhi2cIy4RwLpCvUsoXtbWOgHK1Z\n b2Jg==","X-Forwarded-Encrypted":"i=1;\n AJvYcCUY/FjS83CCo3DYowrvBlzGUZApSvN2UGoA/WYpBdZGSuGgmpQU0nrTvLsVpbI1+uOfK6TCjKk=@lists.denx.de","X-Gm-Message-State":"AOJu0YwZtUiCQX9+rNld4QVvW5/kqLdoFEfb1eZkRB5F3KqecFSPJpxM\n fJ1tq+IwRpakyZgodA8IKxuOm8mJsSZawdKz+vq9Tl9MxfTtGuqFNoMAsMLQNVrb8HDibrZI6ij\n HuesGvMNhEE6uvH3N+Un7dI5gnmmovcHuSaPEd+JlTA==","X-Gm-Gg":"AeBDieujCH7q2XChPZEL3/NT3w/DXMxAJpyBpNvXnGGy7bsSzG9hNlIQGuAP0p9WooQ\n l7GBj1iSmebpqyrG86XqWkSN6apNoKmyo8G4wsqw0liYmItnrJYr1AEb7+nzz+pwLL8ItVDWHJQ\n DPRAd22uxZ7KoXX95U8erzlpmuWL5oAM9qiF2r67dZVOFOmbjwacISWOjv7XD3uwWl3/7ftXqaX\n QhNBZr9DYKPXF6BvLhFbe/51+20qru7k50bljDLf2Aq1iM5WEJV27d035WPbVY13ep0ImbrfGo3\n boSj","X-Received":"by 2002:a05:7022:fe04:b0:11e:161:c008 with SMTP id\n a92af1059eb24-12bfb75edc1mr8077649c88.26.1775523637642; Mon, 06 Apr 2026\n 18:00:37 -0700 (PDT)","MIME-Version":"1.0","References":"<20260406142411.2992618-1-daniel@thingy.jp>\n <20260406142411.2992618-4-daniel@thingy.jp>\n <adPlWa9YE9_FZJXe@google.com>","In-Reply-To":"<adPlWa9YE9_FZJXe@google.com>","From":"Daniel Palmer <daniel@thingy.jp>","Date":"Tue, 7 Apr 2026 10:00:25 +0900","X-Gm-Features":"AQROBzDIuJLz-Vd7Bt694gu39YwWdC6uTDjKDLBW9zZ6NX6FehlgEmDgvMpQdKk","Message-ID":"\n <CAFr9PXnPvje0K8kZ-zgo_Xx0OMZCYCYkhddEYSUEgZ=5jhYv8Q@mail.gmail.com>","Subject":"Re: [PATCH v2 3/5] virtio: mmio: Keep vendor id little endian","To":"Kuan-Wei Chiu <visitorckw@gmail.com>","Cc":"angelo@kernel-space.org, bmeng.cn@gmail.com, u-boot@lists.denx.de","Content-Type":"text/plain; charset=\"UTF-8\"","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.39","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<https://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=subscribe>","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>","X-Virus-Scanned":"clamav-milter 0.103.8 at phobos.denx.de","X-Virus-Status":"Clean"}},{"id":3674001,"web_url":"http://patchwork.ozlabs.org/comment/3674001/","msgid":"<CAFr9PXkwLWHCbXwdLFFTZYLRV5Ak_f0m_r1nDbq=qs0verKMsA@mail.gmail.com>","list_archive_url":null,"date":"2026-04-07T08:20:47","subject":"Re: [PATCH v2 3/5] virtio: mmio: Keep vendor id little endian","submitter":{"id":85408,"url":"http://patchwork.ozlabs.org/api/people/85408/","name":"Daniel Palmer","email":"daniel@thingy.jp"},"content":"Hi Kuan-Wei,\n\nOn Tue, 7 Apr 2026 at 01:54, Kuan-Wei Chiu <visitorckw@gmail.com> wrote:\n> This direct memory cast relies on little endian byte ordering to spell\n> \"QEMU\". On big endian machines, the memory layout naturally spells\n> \"UMEQ\".\n>\n> So maybe we can extract the characters safely using bitwise shifts like\n> this?\n\nI think this has uncovered a more important bug..\n\n /*\n  * virtio mmio transport supplies string identification for us,\n  * while pci trnasport uses a 2-byte subvendor value.\n   */\n if (uc_priv->vendor >> 16)\n      sprintf(desc->vendor, \"%s\", (char *)&uc_priv->vendor);\n\nThe comment makes no sense. uc_priv->vendor is a u32. The id might be\nASCII chars but it's not a C-string. It's only working right now\nbecause by luck after the chars in the u32 there is a 0.\n\nAnyhow, I think I've fixed this properly so I will send that in v3.\n\nCheers,\n\nDaniel","headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=thingy.jp header.i=@thingy.jp header.a=rsa-sha256\n header.s=google header.b=j1AOOlMu;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de\n (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de;\n envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org)","phobos.denx.de;\n dmarc=none (p=none dis=none) header.from=thingy.jp","phobos.denx.de;\n spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de","phobos.denx.de;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=thingy.jp header.i=@thingy.jp header.b=\"j1AOOlMu\";\n\tdkim-atps=neutral","phobos.denx.de;\n dmarc=none (p=none dis=none) header.from=thingy.jp","phobos.denx.de; spf=pass smtp.mailfrom=daniel@0x0f.com"],"Received":["from phobos.denx.de (phobos.denx.de\n [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fqfKl20Ypz1xy1\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 07 Apr 2026 18:21:15 +1000 (AEST)","from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id A55F883A41;\n\tTue,  7 Apr 2026 10:21:06 +0200 (CEST)","by phobos.denx.de (Postfix, from userid 109)\n id 87F8D84034; Tue,  7 Apr 2026 10:21:05 +0200 (CEST)","from mail-dl1-x1233.google.com (mail-dl1-x1233.google.com\n [IPv6:2607:f8b0:4864:20::1233])\n (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits))\n (No client certificate requested)\n by phobos.denx.de (Postfix) with ESMTPS id 1CE1B8352B\n for <u-boot@lists.denx.de>; Tue,  7 Apr 2026 10:21:00 +0200 (CEST)","by mail-dl1-x1233.google.com with SMTP id\n a92af1059eb24-12732e6a123so2888026c88.1\n for <u-boot@lists.denx.de>; Tue, 07 Apr 2026 01:20:59 -0700 (PDT)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,\n DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,\n RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=no\n autolearn_force=no version=3.4.2","ARC-Seal":"i=1; a=rsa-sha256; t=1775550058; cv=none;\n d=google.com; s=arc-20240605;\n b=R3RRYg7jW7WJMq8PrMTnGKuR85/FeBJbUd4ID6A6eEObIeuqI2iptShhcZGWh1gtDa\n 2NzMwzP7Dnh9IAWnpQke2E7DHx5vm2RbNc+2eOTdD+LhNc9N2pxKJRYLAfD/h8sim44n\n RK2GRyRMmbkR86M2wbwrDusKN71yn6bsJ+vOD8+R7MMslSucCj+42pTVK0vy5dC/NATC\n 0Rf1J4USZFS6Cfp0Ua5rizmHF6zVm3lmAIXB8VOmbMpfrbCF6vLCjm5GQuCC3oTyMxEu\n 24nTqowb5tvQIfb/bLyVamuq5RE4RRykI1EpznkncOtHGOxdAKGPnzW5mOJGmJEosrZj\n qUPg==","ARC-Message-Signature":"i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com;\n s=arc-20240605;\n h=cc:to:subject:message-id:date:from:in-reply-to:references\n :mime-version:dkim-signature;\n bh=IhgX3GHSXLhwqh2osTjt9O5Khj47SJzxXyq5I5V/Zds=;\n fh=X7ZiQQ3sOOg74reXPFineJ1Pq6aEJ23foYWvJiKUtS8=;\n b=Rl78e56WJZrPfA4oKSsttohmVY8vDkCK8bnCx3blvBmccH5CyVigSt2dRy4xUXsIEJ\n gkuDggXNm/ZlauwGnAY4gUEPnNAE8fKjiAx7g7aFz5g5vulTgUjREaoECkrQnz76rxey\n SXPerB38rsrycYQc3kGKAXSe5rByUGKrF7H/TVNhflO3smDDBEPexdP7Oj2eG/fh1pkT\n 71RF9B/aDUhplKL04GggecSKrJYbMgGL3iEFdFcTOw+nVtWmQ8I5g3s/XBxstzglcLC1\n ILUd07ljGeX0iFouFZxYiQIW9Qa4M7eQuhMEo8LftAUiIRl9Cin9wuvHaXibHd6Zzu91\n W4xg==; darn=lists.denx.de","ARC-Authentication-Results":"i=1; mx.google.com; arc=none","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=thingy.jp; s=google; t=1775550058; x=1776154858; darn=lists.denx.de;\n h=cc:to:subject:message-id:date:from:in-reply-to:references\n :mime-version:from:to:cc:subject:date:message-id:reply-to;\n bh=IhgX3GHSXLhwqh2osTjt9O5Khj47SJzxXyq5I5V/Zds=;\n b=j1AOOlMuZ/x3f1r/Du3Z9FICk4VMu1tT8//DU53+M4NdrukCeDIfxAi5N1HzScuLRP\n M4RK5g1PQOW/qty/uygSnWRT0eL9sZXTseq+nY/y3juJH3VZPAuoYw/4lPEGivHtSmRT\n eg9mUJBLfFBrkbcTu30WkrC8J6TJiPAsWA7rg=","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1775550058; x=1776154858;\n h=cc:to:subject:message-id:date:from:in-reply-to:references\n :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date\n :message-id:reply-to;\n bh=IhgX3GHSXLhwqh2osTjt9O5Khj47SJzxXyq5I5V/Zds=;\n b=FFFyVNx4k9Nj5uwhymyfHN0GaDMAG5XU4R5132nu14tKEgVFpfnYY7LTah9IDA6yAt\n yFvnF4NLmCIaS5L1isoB9QuMDKHuUvi+ezuAC/uz9R1U3IosX6csAJY6yXDtoTski34E\n psqrRkzYd/EeVZYnYXVxenFYpNkygAnvBrGAXIhm+ujkuZgFWCtthUk1HVE+KRACesKE\n z98tARU9GAYZNsOG8AcIldK/9rcaEb+6qjQUGADTb9gOjXIan0Bq7cMK7t+yB9wUzDeZ\n qNOFwrFPDc5qzs0/0XWbVi1z9oaoG3+0kQ0Tn+MyikyvggtoJXPJ7mn6mi3PGMDCXD+P\n 3ZrA==","X-Forwarded-Encrypted":"i=1;\n AJvYcCVPBsuWHAGZp1ngxBWz0C1nyf1jg7Mr9NOqM/v+P1IHEkSJ9sFQZ5QpcyoFbWN9NB779LW9Kc4=@lists.denx.de","X-Gm-Message-State":"AOJu0Yw+Tzd7VQZqwZ/76AJwLml4AkKGLmuvyH9EAv4zovJoBO/67RYY\n LeO/J11+FXmJx70Skzjf3Yy/MtUwlhukLOIxABLRaI/bn4nyDz9jDoUSLR1fkBqb8/0O+bBd3/T\n mO/O57KBYKV+3cr6Vhc5gVq+ZGNQJx0u8g87NQ43wRg==","X-Gm-Gg":"AeBDietRuO5TwIvrnEDV7LpTvubtFbco5BcbKlY83LePlx6Mu33HJ+LUeEs8pYHm8Zx\n EUzmP9zlk8PmcU0d6WsivmbT0EE+t6zy0Rfdz1+T5gpd7T81zTpId1ZxdGzIolGo6s/k88wQPCX\n 4MDEdI2WOkSCnnN5RcI35vRnEYCtfUTbc37nKqkg4kOAHCSQIS0/gFK2eDahBN6wwzR46xQl3Pa\n 4stZg8bHJmqeQIC1fxdoNI+Ica+nUXMiX5caLlgA4oLDaVDwErwmD8kVSsccSuxIgyv1oEX0Uxw\n SK0N","X-Received":"by 2002:a05:7022:23a4:b0:12a:7165:7405 with SMTP id\n a92af1059eb24-12bfb6ec47cmr8742987c88.8.1775550058130; Tue, 07 Apr 2026\n 01:20:58 -0700 (PDT)","MIME-Version":"1.0","References":"<20260406142411.2992618-1-daniel@thingy.jp>\n <20260406142411.2992618-4-daniel@thingy.jp>\n <adPlWa9YE9_FZJXe@google.com>","In-Reply-To":"<adPlWa9YE9_FZJXe@google.com>","From":"Daniel Palmer <daniel@thingy.jp>","Date":"Tue, 7 Apr 2026 17:20:47 +0900","X-Gm-Features":"AQROBzAxdFeUQx32JQOTMHu0W1M4PeGpMjWVDJzWLG8djgML0SyktqYzgZxFd10","Message-ID":"\n <CAFr9PXkwLWHCbXwdLFFTZYLRV5Ak_f0m_r1nDbq=qs0verKMsA@mail.gmail.com>","Subject":"Re: [PATCH v2 3/5] virtio: mmio: Keep vendor id little endian","To":"Kuan-Wei Chiu <visitorckw@gmail.com>","Cc":"angelo@kernel-space.org, bmeng.cn@gmail.com, u-boot@lists.denx.de","Content-Type":"text/plain; charset=\"UTF-8\"","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.39","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<https://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=subscribe>","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>","X-Virus-Scanned":"clamav-milter 0.103.8 at phobos.denx.de","X-Virus-Status":"Clean"}}]