From owner-freebsd-stable@freebsd.org Sun Oct 30 16:32:47 2016 Return-Path: Delivered-To: freebsd-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CC4DAC2624A for ; Sun, 30 Oct 2016 16:32:47 +0000 (UTC) (envelope-from freebsd@omnilan.de) Received: from mx0.gentlemail.de (mx0.gentlemail.de [IPv6:2a00:e10:2800::a130]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E5D0A1532; Sun, 30 Oct 2016 16:32:46 +0000 (UTC) (envelope-from freebsd@omnilan.de) Received: from mh0.gentlemail.de (mh0.gentlemail.de [78.138.80.135]) by mx0.gentlemail.de (8.14.5/8.14.5) with ESMTP id u9UGWhcd035758; Sun, 30 Oct 2016 17:32:44 +0100 (CET) (envelope-from freebsd@omnilan.de) Received: from titan.inop.mo1.omnilan.net (titan.inop.mo1.omnilan.net [IPv6:2001:a60:f0bb:1::3:1]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mh0.gentlemail.de (Postfix) with ESMTPSA id 9F863DA7; Sun, 30 Oct 2016 17:32:43 +0100 (CET) Message-ID: <581620AB.3050203@omnilan.de> Date: Sun, 30 Oct 2016 17:32:43 +0100 From: Harry Schmalzbauer Organization: OmniLAN User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; de-DE; rv:1.9.2.8) Gecko/20100906 Lightning/1.0b2 Thunderbird/3.1.2 MIME-Version: 1.0 To: freebsd-stable@freebsd.org CC: Alexander Motin Subject: bhyve(8) passthru affects ahci-hd with device backend [Was: Re: Unexpected ahci-hd bytes when running in bhyve(8)] References: <58124200.5080306@omnilan.de> <5814C101.90805@omnilan.de> <5814DDDC.60104@omnilan.de> In-Reply-To: <5814DDDC.60104@omnilan.de> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Greylist: ACL 119 matched, not delayed by milter-greylist-4.2.7 (mx0.gentlemail.de [78.138.80.130]); Sun, 30 Oct 2016 17:32:44 +0100 (CET) X-Milter: Spamilter (Reciever: mx0.gentlemail.de; Sender-ip: 78.138.80.135; Sender-helo: mh0.gentlemail.de; ) X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Oct 2016 16:32:47 -0000 Bez=C3=BCglich Harry Schmalzbauer's Nachricht vom 29.10.2016 19:35 (loca= ltime): > Bez=C3=BCglich Harry Schmalzbauer's Nachricht vom 29.10.2016 17:32 (lo= caltime): > > =E2=80=A6 >> Like mentioned, while reading the first 448 bytes on the host, I get >> identical results from /usr/local/guest.img and /dev/ada4, but when >> attaching /dev/ada4 to ahci-hd (-s 7,ahci-hd,/dev/ada4) and inspecting= >> inside vmm, all I see is 0x0, while ahci-hd attached >> /usr/local/guest.img shows the same pmbr as on the host!? >> >> Do I have to exclude /dev/ada4 on the host from geom? As soon as bhyve= >> opens /dev/ada4, all partitions vanish from the host =E2=80=93 probabl= y ada4 >> itself gets blocked somehow? =E2=80=A6 > Just another symptom I can only describe, not debug: > Opening /dev/adaX on the host works by 'hd /dev/ada4 | less', > but not inside the guest, where it just leads to endless IO when trying= > the same on the ahci-hd attached /dev/ada4 The described defects only happen when passthru is used with bhyve(8)!!! If I simply don't attach the passthru-device (keeping memory wired), everything works the way it's supposed to do. Opening the guest-ada1-device with hexdump works, geom tastes GPT and the first 448 bytes show exactly the pMBR like on the host. As soon as I start the guest with the passthru device (doesn't matter which slot, tested with a 82574L), the ahci-hd can't be read nymore, just returning 0x0 when dumped. Shall I file a bug report? Anybody aware of that or any idea where to start fixing? To summarize: FreeBSD-11-RELEASE hosting a bhyve(8) guest with a physical device as storage backend (regardless if accessed through virtio-blk or ahci-hd) corrupts guest-disk access if there's also a passthrough device attached.= If you use a file-backed ahci-hd (or virtio-blk) device, the problem doesn't show up, regardelss if there's passthru involved or not. Thanks, -Harry