From owner-freebsd-arm@freebsd.org Fri Jun 15 12:06:30 2018 Return-Path: Delivered-To: freebsd-arm@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B5E7B101F696 for ; Fri, 15 Jun 2018 12:06:30 +0000 (UTC) (envelope-from rb743@hermes.cam.ac.uk) Received: from ppsw-32.csi.cam.ac.uk (ppsw-32.csi.cam.ac.uk [131.111.8.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5696569C3A for ; Fri, 15 Jun 2018 12:06:30 +0000 (UTC) (envelope-from rb743@hermes.cam.ac.uk) X-Cam-AntiVirus: no malware found X-Cam-ScannerInfo: http://help.uis.cam.ac.uk/email-scanner-virus Received: from sc1.bsdpad.com ([163.172.212.18]:13567) by ppsw-32.csi.cam.ac.uk (smtp.hermes.cam.ac.uk [131.111.8.158]:587) with esmtpsa (LOGIN:rb743) (TLSv1:ECDHE-RSA-AES256-SHA:256) id 1fTnUr-000Z7o-07 (Exim 4.91) (return-path ); Fri, 15 Jun 2018 13:06:29 +0100 Date: Fri, 15 Jun 2018 12:56:02 +0100 From: Ruslan Bukin To: Mark Rutland Cc: Andrea Bolognani , freebsd-arm@freebsd.org, "Robert N. M. Watson" Subject: Re: virtio-net issues on aarch64 QEMU/KVM Message-ID: <20180615115602.GA29619@bsdpad.com> References: <1501165794.4378.8.camel@redhat.com> <20170804132950.GA9477@remoulade> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20170804132950.GA9477@remoulade> User-Agent: Mutt/1.6.1 (2016-04-27) Sender: "R. Bukin" X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jun 2018 12:06:30 -0000 Hi Mark, Thanks for the stacktrace -- it was helpful. I found an issue: virtqueues have to be reinitialized any time we reset virtio controller, because QEMU now clears pointers to virtqueue. I have a patch: https://reviews.freebsd.org/D15821 This allows me to use QEMU's virtio-net-device just fine in FreeBSD/RISC-V. Thanks Ruslan On Fri, Aug 04, 2017 at 02:29:51PM +0100, Mark Rutland wrote: > On Thu, Jul 27, 2017 at 04:29:54PM +0200, Andrea Bolognani wrote: > > Hi all, > > Hi, > > > I'm trying 11.1-RELEASE on QEMU/KVM, and I'm having some > > trouble with VirtIO networking. > > Likewise on both counts. > > As a (vaguely-related) heads-up, you will find that 11.1 will not work as an > SMP KVM guest, as it doesn't enable SGIs for the boot CPU in the GIC > distributor, leading to a lockup later in the boot process. I think Andrew > Turner is currently looking at fixing that. > > > I've imported the official qcow2 image into libvirt by > > running > > > >   # virt-install \ > >     --name freebsd \ > >     --arch aarch64 \ > >     --machine virt \ > >     --ram 2048 \ > >     --vcpus 1 \ > >     --accelerate \ > >     --graphics none \ > >     --features acpi=off \ > >     --os-variant freebsd11.0 \ > >     --import \ > >     --disk path=/var/lib/libvirt/images/freebsd.qcow2,bus=virtio,address.type=virtio-mmio \ > >     --network network=default,model=virtio,address.type=virtio-mmio > > > > and the system comes up succesfully; however, when I > > try to activate the network interface by running > > > >   # dhclient vtnet0 > > > > the process seems to pretty much just sit there. ^C > > doesn't help. Needless to say, if I configure vtnet0 to > > be brought up at boot I never get to the prompt. > > I see the same thing with or without KVM using QEMU 2.9.0, upstream EDK2 > (commit ef3d1df77bbd5227), and the same 11.1-RELEASE VM image. I'm not using > libvirt, but I see issues when pasing QEMU: > > -device virtio-net-device,netdev=net0 netdev user,id=net0 > > At boot time, FreeBSD stops making progress after "Feeding entropy: .", and if > I send SIGINFO with ^T, I see: > > load: 1.55 cmd: ifconfig 233 [runnable] 124.01r 0.00u 123.88s 100% 2768k > > I dumped a stacktrace using QEMU's gdbserver; it looks like FreeBSD is polling > the virtio queue waiting for something: > > #0 0xffff000000170294 in VIRTIO_BUS_POLL (dev=0xfffffd00005ab900) at ./virtio_bus_if.h:159 > #1 virtqueue_poll (vq=0xffff00004083e000, len=0x0) at /usr/src/sys/dev/virtio/virtqueue.c:573 > #2 0xffff00000017707c in vtnet_ctrl_mac_cmd (sc=0xfffffd00004fa000, hwaddr=) at /usr/src/sys/dev/virtio/network/if_vtnet.c:3163 > #3 vtnet_set_hwaddr (sc=0xfffffd00004fa000) at /usr/src/sys/dev/virtio/network/if_vtnet.c:3588 > #4 0xffff000000176568 in vtnet_reinit (sc=0xfffffd00004fa000) at /usr/src/sys/dev/virtio/network/if_vtnet.c:3022 > #5 vtnet_init_locked (sc=0xfffffd00004fa000) at /usr/src/sys/dev/virtio/network/if_vtnet.c:3069 > #6 0xffff000000175ff8 in vtnet_ioctl (ifp=0xfffffd000058f000, cmd=, data=) at /usr/src/sys/dev/virtio/network/if_vtnet.c:1107 > #7 0xffff000000373e60 in ifhwioctl (cmd=, ifp=, td=, data=) at /usr/src/sys/net/if.c:2456 > #8 ifioctl (so=, cmd=2149607696, data=0xffff000054ae1888 "vtnet0", td=) at /usr/src/sys/net/if.c:2836 > #9 0xffff0000002f3b14 in fo_ioctl (fp=, com=2149607696, active_cred=, td=, data=) at /usr/src/sys/sys/file.h:323 > #10 kern_ioctl (td=0xfffffd0000a7f000, fd=3, com=2149607696, data=0xffff000054ae1888 "vtnet0") at /usr/src/sys/kern/sys_generic.c:836 > #11 0xffff0000002f377c in sys_ioctl (td=0xfffffd0000a7f000, uap=0xffff000054ae1978) at /usr/src/sys/kern/sys_generic.c:745 > #12 0xffff000000555408 in syscallenter (td=, sa=) at /usr/src/sys/arm64/arm64/../../kern/subr_syscall.c:135 > #13 svc_handler (frame=, td=) at /usr/src/sys/arm64/arm64/trap.c:139 > #14 do_el0_sync (td=0xfffffd0000a7f000, frame=) at /usr/src/sys/arm64/arm64/trap.c:366 > > ... unfortunately I'm not all that familiar with how virtio works, so I'm not > sure which end is doing the wrong thing. > > Thanks, > Mark. > _______________________________________________ > freebsd-arm@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-arm > To unsubscribe, send any mail to "freebsd-arm-unsubscribe@freebsd.org"