From owner-freebsd-virtualization@freebsd.org Fri Jun 1 09:38:14 2018 Return-Path: Delivered-To: freebsd-virtualization@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 5F12EF7C59F for ; Fri, 1 Jun 2018 09:38:14 +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 DB1586E39D; Fri, 1 Jun 2018 09:38:13 +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 w519cCol071151; Fri, 1 Jun 2018 11:38:12 +0200 (CEST) (envelope-from freebsd@omnilan.de) Received: from titan.inop.mo1.omnilan.net (s1.omnilan.de [217.91.127.234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mh0.gentlemail.de (Postfix) with ESMTPSA id 7A036F69; Fri, 1 Jun 2018 11:38:12 +0200 (CEST) Subject: Re: pci_virtio_block.c Assertion failed: line 216 From: Harry Schmalzbauer To: Peter Grehan Cc: freebsd-virtualization@freebsd.org References: <586BFC91.4090404@omnilan.de> <2a8308c3-1570-08a3-a993-0f699fcd267d@freebsd.org> <5A0C4CFF.7040902@omnilan.de> Organization: OmniLAN Message-ID: <45bce0fc-c6a5-9b9e-9e74-312c2814a31e@omnilan.de> Date: Fri, 1 Jun 2018 11:38:12 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <5A0C4CFF.7040902@omnilan.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Greylist: ACL 130 matched, not delayed by milter-greylist-4.2.7 (mx0.gentlemail.de [78.138.80.130]); Fri, 01 Jun 2018 11:38:12 +0200 (CEST) X-Milter: Spamilter (Reciever: mx0.gentlemail.de; Sender-ip: 78.138.80.135; Sender-helo: mh0.gentlemail.de; ) X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.26 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: Fri, 01 Jun 2018 09:38:14 -0000 Am 15.11.2017 um 15:19 schrieb Harry Schmalzbauer: > Bezüglich Peter Grehan's Nachricht vom 03.01.2017 20:36 (localtime): >> Hi Harry, >> >>> trying to use bhyve(8) with virtio-blk and Windows guest results in core >>> dump: >>> Assertion failed: (n >= 2 && n <= BLOCKIF_IOV_MAX + 2), function >>> pci_vtblk_proc, file usr.sbin/bhyve/pci_virtio_block.c, line >>> 216. >>> Abort trap (core dumped) >>> >>> Unfortunately this is on a production-test machine which lacks gdb etc. >>> Will try to reproduce on antoher machine, but maybe someone already >>> knows that problem? >> virtio-blk isn't currently supported with Windows guests. You'll need >> to use ahci-hd for now. >> >> However, I do have a fix that can hopefully be committed shortly. > … > > Mising in another reply: > >>> Wiadomość napisana przez Harry Schmalzbauer >> > w dniu 03.01.2017, o godz. 20:33: > … >>> Will try to reproduce on antoher machine, but maybe someone already >>> knows that problem? >> I've seen that problem and fixed it, will upstream the patch later today. >> >> JFYI, fixing >> commit: > https://github.com/freenas/os/commit/0e4d6e1826f8aa7041cbeeb4365c797eeec5c5f4 > > Thanks Jakub for the info. > > I can confirm that increasing BLOCKIF_IOV_MAX from 33 to 128, like the > diff shows, solved the problem for me. > I've successfully done some performace tests on Windows7 (virtio-blk vs. > ahci,hd:) and also migrated one Server 2012R2 to bhyve using virtio-blk. > > Peter, is your mentioned fix different from just increasing BLOCKIF_IOV_MAX? > If not, would you commit that please? I hope that I don't bug people knowing better, but this simple diff makes virtio-blk usable for Windows 7. Is there any reason not to commit? Index: src/usr.sbin/bhyve/block_if.h =================================================================== --- usr.sbin/bhyve/block_if.h       (Revision 325745) +++ usr.sbin/bhyve/block_if.h       (Arbeitskopie) @@ -39,7 +39,7 @@  #include  #include -#define BLOCKIF_IOV_MAX                33      /* not practical to be IOV_MAX */ +#define BLOCKIF_IOV_MAX                128     /* not practical to be IOV_MAX */  struct blockif_req {         struct iovec    br_iov[BLOCKIF_IOV_MAX]; Thanks, -harry