From nobody Tue Apr 28 19:35:51 2026 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4g4rJW0Bsdz6c0Kd; Tue, 28 Apr 2026 19:35:55 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4g4rJV4TdDz470f; Tue, 28 Apr 2026 19:35:54 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1777404954; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Y/HT7luo67E4B52ZF/k0atknEv3X/Dn5yIHUhDlcAF4=; b=AMJ1rQNmavGce9fpmuabRPcO/gPVYobsc73iuu7aD4iHteHBov1a974ZKzT1IMe/KIdpT6 xQjI2gvrZYHRY+f30Iay9wwOcnRdXctNmBxLecyCifxE+T5kDbDc848zMDa0NAZnMYcqCs fe9LgSZVTTuTko8mkDO35Icgx65KATVBHCgjJfcWucfg8fUHTKrKRyrvBzvzVfRUN9PZhn QCsGoMK3cuSM/UTN6KsmIG8v8VMgHTwsInhPc1IijrkwRd1obZ2INnAyeWM9S3HpeRkPoH bPKt8MJ5CmV/z1Im2GnDZTlJT2tQ7iPPHW0xhdcTJA6Yv4ya9NDVd48P8LbYDg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1777404954; a=rsa-sha256; cv=none; b=GbNyatHaNUCwJxnK04us6S0WPn0XXkAQrddk4sGBUNJJjOkSDEwbyBoFfPLbR3we+qWRqx zNW/X31zCV5Z5ZJd7JPUwiLkxswyxxIYP65LeZpiCB5D3g79Q/YSkWZADG5KaQ4nV/plIM FtO6YuGtn4hT+UCgTvuSdV01bs/Wdp4/0ofBk0HEASEk4P1akKX7DLE0VqkDw88P7dDiXA T5yKXXCT5HMOOfpQTwf0NaqqNLm/nBfo+3K4n9IZozNfxfsn9f4fqGAsq10h2DLcDR9AdM 8PEEQJ+CEJe9d8Zfx3UNvfk9qTA4kNAeqONrNxfydvFsDdxtUfXIIbR3slzeJg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1777404954; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Y/HT7luo67E4B52ZF/k0atknEv3X/Dn5yIHUhDlcAF4=; b=FYCWZO+lMPwDw4cvKn2OmfrGqBy2WgG4dVrw8nejq+2fnE21D0E7Lmj7bk8WltYByHYuFH a1Q1+WoazAo+MyLG2sVuEplDMlKYQDwqWKQo1jSBA8ls2PDymIXnPPnU+rYUw6pOdE0vlw kmdzBgqx8mUl8PIlu4MfRQGJWCJw+ULOeA8BGBWrJ+auDJ76JlwN9gGK/N8woXqyBWUXuL vJsPkjD90yqxdZkGOH4AZId4VbqPhz5xBVUuSCihagBI6CVuCSeKTz+xUMnzHkqgdbKUuL t0OZgoxtjp6ASMl2xqqyxNTNgRZ2yzZvzsDuc5rR9XaIDDSXhWvm3Kw3m64jdw== Received: from smtpclient.apple (unknown [IPv6:2a02:8109:1101:be00:f081:7b05:e2fa:ce31]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: tuexen) by smtp.freebsd.org (Postfix) with ESMTPSA id 4g4rJT5znczkrv; Tue, 28 Apr 2026 19:35:53 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Content-Type: text/plain; charset=utf-8 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3864.500.181\)) Subject: Re: git: 0b39d72d0491 - main - virtio: use modern mode for transitional device by default From: Michael Tuexen In-Reply-To: Date: Tue, 28 Apr 2026 21:35:51 +0200 Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org, =?utf-8?Q?Timo_V=C3=B6lker?= Content-Transfer-Encoding: quoted-printable Message-Id: <9DE75A83-7A39-4BE1-9663-DCF08D146584@FreeBSD.org> References: <69d12614.3d42a.5c3f48a2@gitrepo.freebsd.org> To: Adrian Chadd X-Mailer: Apple Mail (2.3864.500.181) > On 28. Apr 2026, at 18:54, Adrian Chadd wrote: >=20 > hi! >=20 > FWIW, this has broken virtio on qemu ppc64 pseries VMs: >=20 > ``` > vtnet0: numa-domain 0 on virtio_pci0 > virtio_pci0: virtqueue 1 (vtnet0-tx0) does not exist (size is zero) > virtio_pci0: cannot allocate virtqueue 1: 19 > vtnet0: cannot allocate virtqueues > device_attach: vtnet0 attach returned 19 > virtio_pci1: port 0x100-0x17f mem > 0x81040000-0x81040fff,0x210000010000-0x210000013fff irq 4611 at device > 3.0 numa-domain 0 on pci0 > vtblk0: numa-domain 0 on virtio_pci1 > qemu-system-ppc64: wrong value for queue_enable 100 > ``` >=20 > Is there any way to detect that we're running in an environment where > the new way won't work? >=20 > The snippet in my qemu setup is: >=20 > ``` > -drive file=3Dppc64be-1.qcow2,format=3Dqcow2,id=3Dhd0,if=3Dnone = \ > -device virtio-blk-pci,drive=3Dhd0 \ > -drive file=3Dppc64be-data.qcow2,format=3Dqcow2,id=3Dhd1,if=3Dnon= e \ > -device virtio-blk-pci,drive=3Dhd1 \ > -netdev tap,id=3Dnd0,ifname=3Dtap1 -device > virtio-net,netdev=3Dnd0,mac=3D00:08:01:13:00:01 > ``` >=20 Hi Adrian, we are aware of the problem and Timo is investigating it. It seems to be a bug in the modern mode in FreeBSD and the bug is related to the guest OS being big endian. Until there is a fix, you can work around the problem by setting hw.virtio.pci.transitional=3D0 in /boot/loader.conf of the guest OS. Best regards Michael >=20 > -adrian >=20 > On Sat, 4 Apr 2026 at 07:54, Michael Tuexen = wrote: >>=20 >> The branch main has been updated by tuexen: >>=20 >> URL: = https://cgit.FreeBSD.org/src/commit/?id=3D0b39d72d0491c77e3e9883015b1fac46= 663c71de >>=20 >> commit 0b39d72d0491c77e3e9883015b1fac46663c71de >> Author: Timo V=C3=B6lker >> AuthorDate: 2026-04-04 14:49:54 +0000 >> Commit: Michael Tuexen >> CommitDate: 2026-04-04 14:49:54 +0000 >>=20 >> virtio: use modern mode for transitional device by default >>=20 >> This patch changes the default value of the loader tunable >> hw.virtio.pci.transitional to 1. This means, virtio uses the >> modern mode for transitional devices by default. >>=20 >> The return values of vtpci_modern_probe() and = vtpci_legacy_probei() >> were chosen to prefer modern mode, but = hw.virtio.pci.transitional=3D0 >> prevents modern mode. >> Setting hw.virtio.pci.transitional to 1 by default seems a better = fit. >>=20 >> Reviewed by: tuexen >> Differential Revision: https://reviews.freebsd.org/D55894 >> --- >> share/man/man4/virtio.4 | 2 +- >> sys/dev/virtio/pci/virtio_pci_modern.c | 2 +- >> 2 files changed, 2 insertions(+), 2 deletions(-) >>=20 >> diff --git a/share/man/man4/virtio.4 b/share/man/man4/virtio.4 >> index 8252cc1b7954..6af6300b1cee 100644 >> --- a/share/man/man4/virtio.4 >> +++ b/share/man/man4/virtio.4 >> @@ -114,7 +114,7 @@ use the legacy >> .Nm >> driver >> .Pq 0 . >> -The default value is 0. >> +The default value is 1. >> .El >> .Sh SEE ALSO >> .Xr virtio_balloon 4 , >> diff --git a/sys/dev/virtio/pci/virtio_pci_modern.c = b/sys/dev/virtio/pci/virtio_pci_modern.c >> index 108fd2b5f8e9..baf7c448bb95 100644 >> --- a/sys/dev/virtio/pci/virtio_pci_modern.c >> +++ b/sys/dev/virtio/pci/virtio_pci_modern.c >> @@ -191,7 +191,7 @@ static void vtpci_modern_write_device_8(struct = vtpci_modern_softc *, >> /* Tunables. */ >> SYSCTL_DECL(_hw_virtio_pci); >>=20 >> -static int vtpci_modern_transitional =3D 0; >> +static int vtpci_modern_transitional =3D 1; >> SYSCTL_INT(_hw_virtio_pci, OID_AUTO, transitional, CTLFLAG_RDTUN, >> &vtpci_modern_transitional, 0, >> "If 0, a transitional VirtIO device is used in legacy mode; = otherwise, in modern mode."); >>=20