From owner-freebsd-virtualization@freebsd.org Mon Apr 6 07:45:20 2020 Return-Path: Delivered-To: freebsd-virtualization@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D4AEA2A7325 for ; Mon, 6 Apr 2020 07:45:20 +0000 (UTC) (envelope-from me@anatoli.ws) Received: from mailman.nyi.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 48wjJ0416mz4fh9 for ; Mon, 6 Apr 2020 07:45:20 +0000 (UTC) (envelope-from me@anatoli.ws) Received: by mailman.nyi.freebsd.org (Postfix) id 877452A7324; Mon, 6 Apr 2020 07:45:20 +0000 (UTC) Delivered-To: virtualization@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 873C82A7323 for ; Mon, 6 Apr 2020 07:45:20 +0000 (UTC) (envelope-from me@anatoli.ws) Received: from out-mx.anatoli.ws (out-mx.anatoli.ws [177.54.157.124]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "out-mx.anatoli.ws", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48wjHz2jB2z4fh7 for ; Mon, 6 Apr 2020 07:45:16 +0000 (UTC) (envelope-from me@anatoli.ws) Received: from [192.168.0.1] (unknown [192.168.0.1]) by out-mx.oprbox.com (Postfix) with ESMTPSA id 69AC11E00139 for ; Mon, 6 Apr 2020 07:45:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=anatoli.ws; s=vnptcm0lqn; t=1586159108; bh=VvK8/WUDfN+lrT3T6KW+qDkxEiIew1djI8X8jk7b2vo=; h=Subject:To:References:From:Date:In-Reply-To; b=GaViEipFI3jjtfceWrK6NrfJR+mLHLT1DU+ITqjjutS2vswhMWD+1ikz2ojEFkR35 MDWgrs4edCn4dFCyrDkhvC0MDDcvGY50Zj6iqwxd4C6DGd3BZIvaOEikTQUm5gWrG8 kocSpWSTW26T5v4iF9qDx6G1+NQbfkVvNzwszpd4E8y44EKIlSICZb4HWqTCqy6iLS QrM8W6yvFoVd3uHFz2w4giWRDC6U9MAMpUhMnhS38nAuCPP2quZMZkmgBeHtTCVXre sn1NMquRVA/pWNUhXCRhs+PG4rR2+hQ8YRc85e8cjIUpxvfLM2n+J4zl3cZldqNIPr JyFc0py6v9ZnQ== Subject: Re: [Bug 245392] bhyve PCI passthru built-in rtl8168 to OpenBSD no packets (AMD Ryzen 3 1200) To: virtualization@FreeBSD.org References: From: Anatoli Message-ID: Date: Mon, 6 Apr 2020 04:45:06 -0300 Mime-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: es-AR Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 48wjHz2jB2z4fh7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none (invalid DKIM record) header.d=anatoli.ws header.s=vnptcm0lqn header.b=GaViEipF; dmarc=pass (policy=reject) header.from=anatoli.ws; spf=pass (mx1.freebsd.org: domain of me@anatoli.ws designates 177.54.157.124 as permitted sender) smtp.mailfrom=me@anatoli.ws X-Spamd-Result: default: False [-2.29 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+a:out-mx.anatoli.ws]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[virtualization@freebsd.org]; TO_DN_NONE(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MV_CASE(0.50)[]; DKIM_TRACE(0.00)[anatoli.ws:~]; DMARC_POLICY_ALLOW(-0.50)[anatoli.ws,reject]; R_DKIM_PERMFAIL(0.00)[anatoli.ws:s=vnptcm0lqn]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; IP_SCORE(0.01)[country: BR(0.07)]; ASN(0.00)[asn:262287, ipnet:177.54.156.0/23, country:BR]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Apr 2020 07:45:20 -0000 Hi, I just submitted a bug as to not send here all the attachments. Is this something known? Or maybe I'm missing some configuration option? Should I submit more details? Thanks, Anatoli On 6/4/20 04:29, bugzilla-noreply@freebsd.org wrote: > https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=245392 > > Bug ID: 245392 > Summary: bhyve PCI passthru built-in rtl8168 to OpenBSD no > packets (AMD Ryzen 3 1200) > Product: Base System > Version: 12.1-RELEASE > Hardware: amd64 > OS: Any > Status: New > Severity: Affects Only Me > Priority: --- > Component: bhyve > Assignee: virtualization@FreeBSD.org > Reporter: me@anatoli.ws > > Created attachment 213114 > --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=213114&action=edit > a dmesg from FreeBSD 12.1-RELEASE r354233 running on the machine > > Trying to PCI passthru a built-in NIC on 12.1-RELEASE r354233 to OpenBSD 6.6 > inside bhyve on a AMD Ryzen 3 1200. > > OpenBSD sees the NIC (re0 Realtek 8168), it can even detect the link state > correctly, but it can't send/receive packets. > > /boot/loader.conf contains hw.vmm.amdvi.enable="1". > > I launch the instance this way: > > sudo bhyve -c 4 -m 4G -wuHP \ > -s 0,amd_hostbridge \ > -S \ > -s 2,passthru,5/0/0 \ > -s 3,virtio-blk,/vm/ppt/disk.img \ > -s 5,virtio-net,tap0 \ > -s 31,lpc -l com1,/dev/nmdm0A \ > -l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd \ > ppt > > When OpenBSD runs on the machine without virtualization, the nic works > correctly. When virtualized with passthru, it can't send/receive data on the > nic, but it detects the link correctly. > > Another (possibly related) issue is if I execute the command above without -w > (same happens with or without PCI passthru), OpenBSD fails at initialization > with "protection fault trap, code=0; Stopped at identifycpu+0xa5c: wrmsr". > > Please find attached the following files: > * dmesg.freebsd: a dmesg from FreeBSD 12.1-RELEASE r354233 running on the > machine. > * dmesg.openbsd.native: a dmesg from OpenBSD 6.6 running on the maching > without virtualization. > * dmesg.openbsd.bhyve: a dmesg from OpenBSD 6.6 running inside bhyve, lauched > from the FreeBSD (the first dmesg) with the command mentioned above. > * pcidump.native: a result of the pcidump command under OpenBSD 6.6 running on > the machine without virtualization (5:0:0 is the device in question). > * pcidump.bhyve: a result of the pcidump command under OpenBSD 6.6 inside > bhyve (0:2:0). > * vm-bhyve.passthru: a result of the vm-bhyve passthru command right before > launching an OpenBSD bhyve instance. > * boot.crash: the OpenBSD boot sequence that leads to a crash when bhyve is > invoked without the -w option. >