From owner-freebsd-virtualization@FreeBSD.ORG Mon Feb 25 11:06:58 2013 Return-Path: Delivered-To: freebsd-virtualization@FreeBSD.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 4A83C18F for ; Mon, 25 Feb 2013 11:06:58 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 3D8ACE92 for ; Mon, 25 Feb 2013 11:06:58 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.6/8.14.6) with ESMTP id r1PB6wb2066799 for ; Mon, 25 Feb 2013 11:06:58 GMT (envelope-from owner-bugmaster@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.6/8.14.6/Submit) id r1PB6v0m066797 for freebsd-virtualization@FreeBSD.org; Mon, 25 Feb 2013 11:06:57 GMT (envelope-from owner-bugmaster@FreeBSD.org) Date: Mon, 25 Feb 2013 11:06:57 GMT Message-Id: <201302251106.r1PB6v0m066797@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: gnats set sender to owner-bugmaster@FreeBSD.org using -f From: FreeBSD bugmaster To: freebsd-virtualization@FreeBSD.org Subject: Current problem reports assigned to freebsd-virtualization@FreeBSD.org X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.14 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, 25 Feb 2013 11:06:58 -0000 Note: to view an individual PR, use: http://www.freebsd.org/cgi/query-pr.cgi?pr=(number). The following is a listing of current problems submitted by FreeBSD users. These represent problem reports covering all versions including experimental development code and obsolete releases. S Tracker Resp. Description -------------------------------------------------------------------------------- o kern/170096 virtualization[vimage] Dynamically-attached network interface will c o kern/169991 virtualization[run] [vimage] panic after device plugged in o kern/165252 virtualization[vimage] [pf] [panic] kernel panics with VIMAGE and PF o kern/161094 virtualization[vimage] [pf] [panic] kernel panic with pf + VIMAGE wh o kern/160541 virtualization[vimage][pf][patch] panic: userret: Returning on td 0x o kern/160496 virtualization[vimage] [pf] [patch] kernel panic with pf + VIMAGE o kern/148155 virtualization[vimage] [pf] Kernel panic with PF/IPFilter + VIMAGE k a kern/147950 virtualization[vimage] [carp] VIMAGE + CARP = kernel crash s kern/143808 virtualization[pf] pf does not work inside jail a kern/141696 virtualization[rum] [vimage] [panic] rum(4)+ vimage = kernel panic 10 problems total. From owner-freebsd-virtualization@FreeBSD.ORG Fri Mar 1 00:49:41 2013 Return-Path: Delivered-To: freebsd-virtualization@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C2BB4363 for ; Fri, 1 Mar 2013 00:49:41 +0000 (UTC) (envelope-from torek@torek.net) Received: from elf.torek.net (50-73-42-1-utah.hfc.comcastbusiness.net [50.73.42.1]) by mx1.freebsd.org (Postfix) with ESMTP id A0CC8C2D for ; Fri, 1 Mar 2013 00:49:40 +0000 (UTC) Received: from elf.torek.net (localhost [127.0.0.1]) by elf.torek.net (8.14.5/8.14.5) with ESMTP id r210Sdd8039430 for ; Thu, 28 Feb 2013 17:28:39 -0700 (MST) (envelope-from torek@torek.net) Message-Id: <201303010028.r210Sdd8039430@elf.torek.net> From: Chris Torek To: freebsd-virtualization@freebsd.org Subject: trivial improvement for usr.sbin/bhyve/pci_virtio_block.c Date: Thu, 28 Feb 2013 17:28:39 -0700 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.7 (elf.torek.net [127.0.0.1]); Thu, 28 Feb 2013 17:28:39 -0700 (MST) X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.14 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 Mar 2013 00:49:41 -0000 I was looking through the bhyve code and noticed an obvious easy (if trivial) code improvement. Tested "standalone" rather than inside bhyve (with both gcc and clang, on FreeBSD 9.0). Not sure where/how diffs should go, so I figured I would send this here as a test. :-) Chris Index: pci_virtio_block.c =================================================================== --- pci_virtio_block.c (revision 247510) +++ pci_virtio_block.c (working copy) @@ -164,14 +164,19 @@ static int hq_num_avail(struct vring_hqueue *hq) { - int ndesc; + uint16_t ndesc; - if (*hq->hq_avail_idx >= hq->hq_cur_aidx) - ndesc = *hq->hq_avail_idx - hq->hq_cur_aidx; - else - ndesc = UINT16_MAX - hq->hq_cur_aidx + *hq->hq_avail_idx + 1; + /* + * We're just computing (a-b) in GF(2^16). + * + * The only glitch here is that in standard C, + * uint16_t promotes to (signed) int when int has + * more than 16 bits (pretty much always now), so + * we have to force it back to unsigned. + */ + ndesc = (unsigned)*hq->hq_avail_idx - (unsigned)hq->hq_cur_aidx; - assert(ndesc >= 0 && ndesc <= hq->hq_size); + assert(ndesc <= hq->hq_size); return (ndesc); } From owner-freebsd-virtualization@FreeBSD.ORG Fri Mar 1 01:23:26 2013 Return-Path: Delivered-To: freebsd-virtualization@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 10887247 for ; Fri, 1 Mar 2013 01:23:26 +0000 (UTC) (envelope-from grehan@freebsd.org) Received: from alto.onthenet.com.au (alto.OntheNet.com.au [203.13.68.12]) by mx1.freebsd.org (Postfix) with ESMTP id BDF78DC3 for ; Fri, 1 Mar 2013 01:23:25 +0000 (UTC) Received: from dommail.onthenet.com.au (dommail.OntheNet.com.au [203.13.70.57]) by alto.onthenet.com.au (Postfix) with ESMTPS id 1310511BE7; Fri, 1 Mar 2013 11:15:58 +1000 (EST) Received: from Peter-Grehans-MacBook-Pro.local (c-67-190-11-104.hsd1.co.comcast.net [67.190.11.104]) by dommail.onthenet.com.au (MOS 4.2.4-GA) with ESMTP id BKH22119 (AUTH peterg@ptree32.com.au); Fri, 1 Mar 2013 11:15:56 +1000 Message-ID: <5130014A.3030607@freebsd.org> Date: Thu, 28 Feb 2013 18:15:54 -0700 From: Peter Grehan User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.28) Gecko/20120306 Thunderbird/3.1.20 MIME-Version: 1.0 To: Chris Torek Subject: Re: trivial improvement for usr.sbin/bhyve/pci_virtio_block.c References: <201303010028.r210Sdd8039430@elf.torek.net> In-Reply-To: <201303010028.r210Sdd8039430@elf.torek.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-virtualization@freebsd.org X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.14 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 Mar 2013 01:23:26 -0000 Hi Chris, > I was looking through the bhyve code and noticed an obvious > easy (if trivial) code improvement. > > Tested "standalone" rather than inside bhyve (with both gcc and > clang, on FreeBSD 9.0). Thanks; I'll apply it. > Not sure where/how diffs should go, so I figured I would send this > here as a test. :-) This is as good a place as any :) later, Peter.