From nobody Mon Oct 17 23:07:44 2022 X-Original-To: freebsd-hackers@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 4Mrt26459Lz4g0XX for ; Mon, 17 Oct 2022 23:07:58 +0000 (UTC) (envelope-from nparhar@gmail.com) Received: from mail-yw1-f177.google.com (mail-yw1-f177.google.com [209.85.128.177]) (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 "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Mrt255BHJz4Ljf for ; Mon, 17 Oct 2022 23:07:57 +0000 (UTC) (envelope-from nparhar@gmail.com) Received: by mail-yw1-f177.google.com with SMTP id 00721157ae682-35ceeae764dso121952637b3.4 for ; Mon, 17 Oct 2022 16:07:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=/08S024Hh6P0lXYpC+H/xKFNBsYTIurt9TVTyMM/vJI=; b=FVL280aF5/bFyf1n/qEQ0WbqA3qTzyFbTGD1ENPd4YC+8RYRC2ZJuNnUGGvbXJjC30 jhOlTyIOx9igLmE55oiYutf+AWMw6s0W/YCdV8+w73clU12wjROKxPxqoFN6nx8CkJZ2 6L4Mgl2F32I4fB2hq2f7LP3zP/njBpZ+ynhHCV7kdgZBXBzWu6vPgjujJB837ub6IhNQ PqoE3V6L7cZmmscyJb0zMAOXFHT5y6WQnIrz0urpSkG8LG0NEeJrZ4+r1XvCVngVLJ+p 1E4AHiv5Kpc67gNmqqHxrNiuXYQCwR/aA0mUGSHgjhN873zVOYUYbyOIfddMLrLgepbo lETg== X-Gm-Message-State: ACrzQf3aSdXjucgy7CNdvIXf0EdRnSNK5gdNj6hdWUJYJy1akriIFzct /gaXCe63E/fPK+52bovegzMQbjfA/GkYvUROs60= X-Google-Smtp-Source: AMsMyM6FfbkMeqXLlDn62Qt28iN31y7NsnF8U7SVeo7Nl+TwEAZcT5aVYnetqouJkimhK37o4Hq12fzk35Gnkdp82Go= X-Received: by 2002:a81:4f84:0:b0:358:1be1:8fd2 with SMTP id d126-20020a814f84000000b003581be18fd2mr142861ywb.32.1666048075688; Mon, 17 Oct 2022 16:07:55 -0700 (PDT) List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@freebsd.org MIME-Version: 1.0 References: <75ACE8B8-A41F-4742-95DA-3CFB3B97746A@dons.net.au> <20220714101214.sju2rpsngqjyuvsb@nexus.home.palmen-it.de> <20220715131656.f2epy732npgbgrf5@nexus.home.palmen-it.de> <20220715151509.d2v6kqkjsnrxtprj@nexus.home.palmen-it.de> <45451C7B-7A12-420F-B6B0-19F2FA98D056@dons.net.au> <20220718065304.cx2o24tshzgpxmqw@nexus.home.palmen-it.de> <3E450927-1932-412E-A568-A2F84582BD26@dons.net.au> <0C98D486-6A8F-4DF6-8AFF-F3B84E631A84@iitbombay.org> In-Reply-To: <0C98D486-6A8F-4DF6-8AFF-F3B84E631A84@iitbombay.org> From: Navdeep Parhar Date: Mon, 17 Oct 2022 16:07:44 -0700 Message-ID: Subject: Re: VFS mount rollback for virtio 9pfs To: Bakul Shah Cc: "Daniel O'Connor" , Felix Palmen , freebsd-hackers@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4Mrt255BHJz4Ljf X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of nparhar@gmail.com designates 209.85.128.177 as permitted sender) smtp.mailfrom=nparhar@gmail.com X-Spamd-Result: default: False [-2.93 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-0.93)[-0.929]; FORGED_SENDER(0.30)[np@freebsd.org,nparhar@gmail.com]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c]; MIME_GOOD(-0.10)[text/plain]; MLMMJ_DEST(0.00)[freebsd-hackers@freebsd.org]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.128.177:from]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; R_DKIM_NA(0.00)[]; FROM_NEQ_ENVFROM(0.00)[np@freebsd.org,nparhar@gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; RCVD_IN_DNSWL_NONE(0.00)[209.85.128.177:from]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_SOME(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; FROM_HAS_DN(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[freebsd.org]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; RCVD_COUNT_TWO(0.00)[2] X-ThisMailContainsUnwantedMimeParts: N On Mon, Oct 17, 2022 at 3:33 PM Bakul Shah wrote: > > On Oct 13, 2022, at 6:01 PM, Daniel O'Connor wrote: > > > > It's come to my attention that someone else also ported this: > > https://github.com/swills/virtfs-9p-kmod > > > > I was wondering if you would be interesting in trying and seeing how it fairs. Unfortunately I am not in a position to do a test poudriere with it as yet. > > FWIW I played with swills port a few months ago. It worked on -12 but > failed on -13 and -current (panics on kldload). I didn't investigate > it further. Tested in bhyve. I tried the github.com/swills/virtfs-9p-kmod repository very recently and had better luck with it. I had to make these changes to the code to get it to compile on latest main: https://people.freebsd.org/~np/9pfs/ After that I was able to mount /usr/{src,obj} read-only in the FreeBSD VM. I've done a number of installworld/installkernel inside the VM since then without any apparent problems (except the warnings about read-only /usr/src during installkernel -- those have nothing to do with 9pfs) These are the entries in the vm.conf file on the host that export these directories (I use vm-bhyve): disk2_type="virtio-9p" disk2_dev="custom" disk2_name="src=/usr/src,ro" disk3_type="virtio-9p" disk3_dev="custom" disk3_name="obj=/usr/obj,ro" This is what I have in the VM's /etc/fstab: src /usr/src virtfs trans=virtio,ro,late 0 0 obj /usr/obj virtfs trans=virtio,ro,late 0 0 This in /etc/rc.conf in the VM: kld_list="virtio_9pfs" Regards, Navdeep > > Note that bhyve on 13.1-stable does work with a linux guest: > ubuntu# mount -t 9p -o trans=virtio,version=9p2000.L,rw,cache=mmap sharename /opt > ubuntu# dd < largefile >/dev/null bs=1M count=1000 > 1000+0 records in > 1000+0 records out > 1048576000 bytes (1.0 GB, 1000 MiB) copied, 3.65227 s, 287 MB/s > > I took your port & copied relevant files to a -current tree > (8cee2ebac54a). I had to hack a few things to compile[1]. kldload > doesn't crash as with swills port but mount fails: > > # mount -t virtio -o trans=virtio sharename /mnt > mount: sharename: Operation not supported by device > > Note that the same line works fine on -12, with swill's changes. > > Relevant bhyve line: > -s 8,virtio-9p,sharename=mydir \ > > Given that mount on ubuntu works seems the problem must be elsewhere > and not 9p2000.L vs 9p2000.u (as you surmised in the original msg in > this thread). I even changed code in the driver to unconditionally > pass 9p2000.L but that didn't help. > > [1] Fixed up module Makefiles and had to add > #define SAVENAME 0x00000400 /* save pathname buffer */ > to 9pfs/virtiofs_vnops.c > > As only this define from namei.h seemed to be somehow lost. > > > > > >