On Wed, Mar 01, 2023 at 04:55:34PM +0100, Robert Schwebel wrote: >On Tue, Jan 31, 2023 at 07:50:40AM +0100, Jan Lübbe wrote: >> On Mon, 2023-01-30 at 23:03 +0100, Michael Grzeschik wrote: >> > copy the qemu 9p rule from platform v7a and make 9p the default >> > >> > Signed-off-by: Michael Grzeschik >> > --- >> > configs/platform-x86_64/run | 23 ++++++++++++++++++++++- >> > 1 file changed, 22 insertions(+), 1 deletion(-) >> > >> > diff --git a/configs/platform-x86_64/run b/configs/platform-x86_64/run >> > index c39d5a7b..96322292 100755 >> > --- a/configs/platform-x86_64/run >> > +++ b/configs/platform-x86_64/run >> > @@ -67,6 +67,12 @@ fi >> > >> > BASE_CMDLINE="console=ttyS0,115200 loglevel=5 systemd.log_level=warning systemd.show_status=auto" >> > >> > +if [ -d "${PTXDIST_PLATFORMDIR}/root/.virtfs_metadata" ]; then >> > + security_model="mapped-file" >> > +else >> > + security_model="none" >> > +fi >> > + >> > # Machine to emulate >> > QEMU_ARGS=( -L ${PTXDIST_PLATFORMDIR}/sysroot-host/share/qemu/ -machine pc-q35-2.12 -smp 2 -cpu host -accel kvm -m 1G -s ) >> > # disable graphics output >> > @@ -97,7 +103,22 @@ run_qemu_hda() { >> > -append "root=/dev/vda console=ttyS0,115200 rw ${BASE_CMDLINE}" >> > } >> > >> > -target="${1:-hda}" >> > +# >> > +# This needs: >> > +# CONFIG_NET_9P_VIRTIO=y >> > +# CONFIG_9P_FS=y >> > +# >> > +run_qemu_9p() { >> > + exec ${QEMU_EXEC} \ >> > + "${QEMU_ARGS[@]}" \ >> > + -fsdev local,id=rootfs,path=${PTXDIST_PLATFORMDIR}/root,security_model="${security_model}" \ >> > + -device virtio-9p-pci,fsdev=rootfs,mount_tag=/dev/root \ >> > + "${QEMU_EXTRA_ARGS[@]}" \ >> > + "${QEMU_LINUX_ARGS[@]}" \ >> > + -append "root=/dev/root rw rootfstype=9p rootflags=trans=virtio ${BASE_CMDLINE}" >> >> You should set msize explicitly do make it less likely that some userspace tools >> are confused by short reads from 9pfs (nginx for example). > >Care to re-send? Sure! But: @jluebbe: I found your discussion about setting explicit msize in the qemu virtio parameters. https://gitlab.com/qemu-project/qemu/-/issues/409 However I did not find out which reasonable value to set from the thread, since the discussion is talking about different causes to trigger the issues. e.g. tar without O_PARTIAL in the kernel headers. Would msize=104857600 be something to work with? I also found some patches that are there to solve the issue probably, but they got not mainlined yet. https://lore.kernel.org/netdev/cover.1640870037.git.linux_oss@crudebyte.com/ mgr >> > +} >> > + >> > +target="${1:-9p}" >> > >> > #set -x >> > run_qemu_${target} > >rsc >-- >Pengutronix e.K. | Dipl.-Ing. Robert Schwebel | >Steuerwalder Str. 21 | https://www.pengutronix.de/ | >31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | >Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-9 | > -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |