From nobody Tue May 5 13:03:50 2026 X-Original-To: freebsd-virtualization@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 4g8zHF2zlzz6c4NJ for ; Tue, 05 May 2026 13:04:09 +0000 (UTC) (envelope-from osidorkin@gmail.com) Received: from mail-qv1-xf2b.google.com (mail-qv1-xf2b.google.com [IPv6:2607:f8b0:4864:20::f2b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4g8zHD4fJkz3JXQ for ; Tue, 05 May 2026 13:04:08 +0000 (UTC) (envelope-from osidorkin@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20251104 header.b=lw16NVl0; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of osidorkin@gmail.com designates 2607:f8b0:4864:20::f2b as permitted sender) smtp.mailfrom=osidorkin@gmail.com; arc=pass ("google.com:s=arc-20240605:i=1") Received: by mail-qv1-xf2b.google.com with SMTP id 6a1803df08f44-8b5232009a6so41899206d6.1 for ; Tue, 05 May 2026 06:04:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1777986243; cv=none; d=google.com; s=arc-20240605; b=kl7fHvbLA3VgArHghNRRCjVbJfUPlvD7m/zx/8/E3iu/aytHCQ5hIlBLSV9LJ8Mq0H xWur/UzZ+buJm3L5F11jKMNoMW03Rdt1G3XFSlSn2psM5SHfMYvzQmCJ6JoIW1mZA+u+ RzwODmFs3qvShZMvtNbuzoea4dTgWfpMZ+ugSUqKGeHgqLFq2jqgDm3HACcG3DMwtjJ1 MMNok83DsumWP/mPV8GW59/ek80zKLOuIIQGtob/1zCyVPMuM+uCh8K+ATsNdBAhrrkp wXkyYyYRb2Cqq3QZrbXJUHroz9miuWX2yqM2jEaY1PLjVq+eG4fQepmm5WKZgltLfMbR 3xOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=DMm73e1xUVIN1lE8xgUvfe8CIswuy+pQz/Lx8zxtkvI=; fh=V17odkOVVz9v/5jaerU1o4WtWCOxcO/j2n5IPvPLaHE=; b=MHqWZKsMncjx1Mcp35NtUz/F0G7uwX4mnTbuCFkPHKHuqEMAU1h4PqyynKQUglMyYm 6FrVaxeRiqNN3w/XE1dkf2stoENzSOFroXDzyL+hFJsep33U/XAFhqR9jFxA0SMDokLo RZKzyh6Cfo6BNHLlZ0XZV/eI2cxAxX+J/pwP8LRhb2CeF0vjWRnfs9CwkbabJUYWnsoX OhkbNGB3Dk7eY5CQ9J3Ra2cyRHSReNPDWgx/iW5R0YGjJfrFhyJoKKRAhm8EDLMjmQI4 CS0aCn8Rb5zGOoGgoX+ULBS62XQxskrTX3OOQ2qWrYCSOqJxQrLjBg+92u20I/1uJaEs U13g==; darn=freebsd.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1777986243; x=1778591043; darn=freebsd.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=DMm73e1xUVIN1lE8xgUvfe8CIswuy+pQz/Lx8zxtkvI=; b=lw16NVl05NmzrpvYsXpMo1zBZr6rKWVhJR/DQUahTBSI6TR+Lj9PyDRjjOgBfLvLzN nO55XmcWUwvE+3cLdrTvrgKnq+PIJo5SqN4y563TXYj+w8ccewZCXJCGiLcDK07hTy8a Cd/t3b8fsbC3z5v3NrAR2U5H40T8sraKS+8dBqFR4rlhV/TrTqRS/Ot54jQjjqghIoYW w6JLtEJDagyKyqBh0esmIkhw55BzNNQVeOcN8c/jhfQYUPf7Ip+fldYPwVg7Q6rS7etx 9ofsB0DvLLL35T48eOjfrPZd/cgTReq6iNJO/Ny6BxlBi0O+zN+QxnHiUpSshbM+fOY+ cnNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777986243; x=1778591043; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=DMm73e1xUVIN1lE8xgUvfe8CIswuy+pQz/Lx8zxtkvI=; b=namaxPDTv8X1o6C2R6gzZTvOcJF+qfkURAK/cs/l8MHG5mQUCDSXYQFt2RplRUZcSU UWVh5zMIt8UVoVhfdlWFirsDIRFPmUbZnPJbcsqjEeW05fe4Uhb4XCxqxNWITk/fZ8y8 zhJg5Wvd+yvHS17MD5wna9ooehdxcbscHMMT5lSKwhrPSM8ihax7onbKtqSR99CjAHV7 w6YELB3RmI2q0Ntr9QrrhunkKeqnpUrX/QX1F3an/RflZ4vol7cf0XGwxF3+tlYdqlT6 iufECm0wKrd6D68PNcBzZIYUzJ9bLm2cTb9SXxZFr76wVbVlq0KCUWajPX4vuec8n1qp In1A== X-Gm-Message-State: AOJu0Yx+FHVTO2j/k0UvxYK5sWkRfAKw2ED0bDA7Xf0kuCXxP5bwdR3k gHuJtZz7tNcpLn3UwFsglciVVEWN4GwkP/Bpde+y6YWcKHQLUZYWLfNNBRDkwh43uXAM70mfBoM XVKdFhdfJjMGpspO/cH5Z9ld/twf4Tmb1sc/f X-Gm-Gg: AeBDieshACvE4SWNuiiirnVD8wUeMEO0SKsFpnzn1eKyo3J60T/jmco1S/PJFvXTTzq xB64jLxdn8g5U/n6JaAkxSpXIwBIEFQpvEtfp4o0Oa4HPT5PCZlyze1V6dXr5MHhMIH0/dD7mkz /+ZLkaUf47CUaqV/XGO33vEpKCM4++ch5Hz774LKoi0bogMzJkLKHbEwfGLMhMIqLfTq9gDiPhw qZZ164s8uwfqzOKhcJSXXeRQc1ZbccxxCt8aALl3H8XtPhnhrv2zBSq/XYLURnlXLw0leb/5Myk SkCF1fGDicask0coX73y+oFFEIQYs2nQf5t7/89gGp6coTDvqslP2fVUB14UPU7HsBQ9ZVDFa28 8JXMQB6atUr8aFvQAn8KaBYgdms6K/8tnTxqw X-Received: by 2002:a05:6214:5342:b0:8ac:b4d5:50ec with SMTP id 6a1803df08f44-8b668a1fafbmr226389626d6.38.1777986242517; Tue, 05 May 2026 06:04:02 -0700 (PDT) List-Id: Discussion List-Archive: https://lists.freebsd.org/archives/freebsd-virtualization List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: freebsd-virtualization@freebsd.org Sender: owner-freebsd-virtualization@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 References: In-Reply-To: From: Oleg Sidorkin Date: Tue, 5 May 2026 16:03:50 +0300 X-Gm-Features: AVHnY4ID_f-6DWvQEMNrm6vLu2YSn65Njxnw06nMWe6mnMYdvxIgpaaXp03xRqs Message-ID: Subject: Re: RFC: Kernel virtiofs driver To: Emil Tsalapatis Cc: FreeBSD virtualization Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spamd-Result: default: False [-4.97 / 15.00]; ARC_ALLOW(-1.00)[google.com:s=arc-20240605:i=1]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.97)[-0.972]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20251104]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4864::/56:c]; MIME_GOOD(-0.10)[text/plain]; TO_DN_ALL(0.00)[]; RCVD_TLS_LAST(0.00)[]; FROM_HAS_DN(0.00)[]; MIME_TRACE(0.00)[0:+]; RCPT_COUNT_TWO(0.00)[2]; FREEMAIL_ENVFROM(0.00)[gmail.com]; FREEMAIL_FROM(0.00)[gmail.com]; DKIM_TRACE(0.00)[gmail.com:+]; RCVD_COUNT_ONE(0.00)[1]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; TO_MATCH_ENVRCPT_SOME(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; MISSING_XM_UA(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[freebsd-virtualization@freebsd.org]; MLMMJ_DEST(0.00)[freebsd-virtualization@freebsd.org]; MID_RHS_MATCH_FROMTLD(0.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::f2b:from] X-Spamd-Bar: ---- X-Rspamd-Queue-Id: 4g8zHD4fJkz3JXQ =D0=BF=D1=82, 13 =D1=84=D0=B5=D0=B2=D1=80. 2026=E2=80=AF=D0=B3. =D0=B2 05:0= 1, Emil Tsalapatis : > > On Thu, Feb 12, 2026 at 9:01=E2=80=AFAM Oleg Sidorkin wrote: >> >> Hello. >> >> My favorite test to run in bhyve guest: >> >> root@:/usr/src # uname -a >> FreeBSD 16.0-CURRENT FreeBSD 16.0-CURRENT #1 >> main-n283712-16c902f05853: Sat Feb 7 02:10:47 MSK 2026 >> olsi@:/usr/obj/usr/src/amd64.amd64/sys/QUADKERNEL amd64 >> root@:/usr/src # mount >> /dev/vtbd0p2 on / (ufs, local, soft-updates, journaled soft-updates) >> devfs on /dev (devfs) >> obj on /usr/obj (p9fs, local) >> 192.168.2.1:/vms/freebsd-current/usr/home on /usr/home (nfs) >> 192.168.2.1:/vms/freebsd-current/usr/src on /usr/src (nfs) >> 192.168.2.1:/vms/freebsd-current/usr/lib/debug on /usr/lib/debug (nfs) >> 192.168.2.1:/usr/ports/distfiles on /usr/ports/distfiles (nfs) >> root@:/usr/src # make -j4 buildworld buildkernel >> >> Panics guest system in a few minutes (everything is ok when /obj is >> mounted over nfs): >> >> db> bt >> Tracing pid 2248 tid 100165 td 0xfffff80100eb8780 >> kdb_enter() at kdb_enter+0x33/frame 0xfffffe006833e560 >> panic() at panic+0x43/frame 0xfffffe006833e5c0 >> freevnode() at freevnode+0x2d5/frame 0xfffffe006833e620 >> vput_final() at vput_final+0x96/frame 0xfffffe006833e670 >> vfs_hash_insert() at vfs_hash_insert+0x226/frame 0xfffffe006833e6c0 >> p9fs_vget_common() at p9fs_vget_common+0x39b/frame 0xfffffe006833e770 >> p9fs_lookup() at p9fs_lookup+0x4ad/frame 0xfffffe006833e8c0 >> VOP_LOOKUP_APV() at VOP_LOOKUP_APV+0x57/frame 0xfffffe006833e8f0 >> vfs_lookup() at vfs_lookup+0x5aa/frame 0xfffffe006833e980 >> namei() at namei+0x35d/frame 0xfffffe006833e9e0 >> kern_execve() at kern_execve+0x2d1/frame 0xfffffe006833ed80 >> sys_execve() at sys_execve+0x54/frame 0xfffffe006833ee00 >> amd64_syscall() at amd64_syscall+0x169/frame 0xfffffe006833ef30 >> fast_syscall_common() at fast_syscall_common+0xf8/frame 0xfffffe006833ef= 30 >> --- syscall (59, FreeBSD ELF64, execve), rip =3D 0x2cc73682f46a, rsp =3D >> 0x2cc731eb2028, rbp =3D 0x2cc731eb2170 --- >> db> >> >> I'll be really happy to test virtiofs and I hope it will do better. >> > > If you hit any bugs, let me know! I'd be happy to take a look. Please inc= lude some additional patches apart from the two diffs (https://github.com/e= tsal/freebsd-src/tree/virtiofs), that handle some issues virtiofs was trigg= ering in the FUSE layer (D55047, D55046). > > Also, if you could try running with a debugging kernel I'd really appreci= ate it - it will help us better interpret any issues. For example, with a c= onfig like this: > > include GENERIC > > ident DEBUG > > options KDB # Enable kernel debugger support. > options KDB_TRACE # Print a stack trace for a panic= . > options DDB > options DDB_NUMSYM > options GDB > > options INVARIANTS > options INVARIANT_SUPPORT > options DIAGNOSTIC > > # KTR > options KTR > options ALQ > options KTR_ALQ > > # KASAN > options KASAN > > > Thanks, > Emil > > > >> >> Thanks >> >> =D0=B2=D1=82, 10 =D1=84=D0=B5=D0=B2=D1=80. 2026=E2=80=AF=D0=B3. =D0=B2 0= 9:57, Mario Marietto : >> > >> > Hello Emil, >> > >> > Inside a FreeBSD guest OS (15.0-RELEASE) I do : >> > >> > kldload virtio_p9fs >> > >> > kldload p9fs_load >> > >> > mount -t p9fs sharename /mnt/host >> > >> > This works for me,I can share files between FreeBSD 15.0 guest and Fre= eBSD 14.3 host os. So,what's missing in this case and which features you ad= ded ? >> > >> > Thanks. >> > >> > >> > >> > On Tue, Feb 10, 2026 at 4:05=E2=80=AFAM Emil Tsalapatis wrote: >> >> >> >> Hi everyone, >> >> >> >> I recently finished the virtiofs driver and it is now ready for r= eview. The device allows for sharing directories between a FreeBSD guest an= d a host. >> >> >> >> The driver really is two components: >> >> >> >> 1) The virtio device that sends FUSE tickets to and from the host: D4= 6295 >> >> 2) The file system that gets mounted in the guest: D46296. >> >> >> >> To test it you need a couple additional fixes/workarounds for FUSE-re= lated issues. You can grab a working tree here or apply diffs D55047 and D5= 5046. D55046 is a workaround, but still prevents an assertion failure relat= ed to FUSE caching until the underlying issue is properly fixed on HEAD. >> >> >> >> To use it, make sure you are creating virtiofs device on the host the= n from the FreeBSD guest run >> >> >> >> mount -t virtiofs >> >> >> >> where is the name tag you gave to the virtiofs device in the ho= st VMM. >> >> >> >> Reviews and testing welcome! >> >> >> >> Thanks, >> >> Emil >> >> >> >> >> > >> > >> > -- >> > Mario. >> >> >> >> -- >> Oleg Sidorkin Hi, I finally was able to set up an appropriate VM to test it. I applied 3 of 4 patches (all except https://reviews.freebsd.org/D55046 that seems to be already applied in a different way). It worked fine for simple file operations like creating and editing text files, but when I tried to use virtiofs mount as /usr/obj, it panicked almost instantly with the following backtrace #11 0xffffffff80bdc0a3 in panic ( fmt=3D0xffffffff81da22a0 "\017\344\"\201\377\377\377\377") at /usr/src/sys/kern/kern_shutdown.c:887 #12 0xffffffff82e3a7c9 in fuse_vnop_close (ap=3D) at /usr/src/sys/fs/fuse/fuse_vnops.c:910 #13 0xffffffff81211c22 in VOP_CLOSE_APV (vop=3D0xffffffff82e467a8 , a=3Da@entry=3D0xfffffe0068343ce8) at vnode_if.c:469 rc =3D #14 0xffffffff80b82411 in VOP_CLOSE (vp=3D, fflag=3D1, cred= =3D0x12, #15 do_execve (td=3D0xfffff80100bc3000, args=3D0xfffffe0068343d98, mac_p=3D, oldvmspace=3D) at /usr/src/sys/kern/kern_exec.c:978 (I can paste the entire stracktrace if needed). It looks like this assert: https://github.com/freebsd/freebsd-src/blob/dc00f118405e8638ceb13b288e14164= a8a9ba669/sys/fs/fuse/fuse_vnops.c#L910 added to recent -CURRENT, however I couldn't find where the lock should be taken. Thanks Oleg Sidorkin