From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46942) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZxAew-000087-SF for qemu-devel@nongnu.org; Fri, 13 Nov 2015 04:28:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZxAet-00065W-Jo for qemu-devel@nongnu.org; Fri, 13 Nov 2015 04:28:42 -0500 Received: from e06smtp17.uk.ibm.com ([195.75.94.113]:54691) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZxAet-00063g-Al for qemu-devel@nongnu.org; Fri, 13 Nov 2015 04:28:39 -0500 Received: from localhost by e06smtp17.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 13 Nov 2015 09:28:36 -0000 Received: from b06cxnps3074.portsmouth.uk.ibm.com (d06relay09.portsmouth.uk.ibm.com [9.149.109.194]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id 5B44B17D8056 for ; Fri, 13 Nov 2015 09:28:55 +0000 (GMT) Received: from d06av10.portsmouth.uk.ibm.com (d06av10.portsmouth.uk.ibm.com [9.149.37.251]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id tAD9SZHY10158486 for ; Fri, 13 Nov 2015 09:28:35 GMT Received: from d06av10.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av10.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id tAD8Safc000656 for ; Fri, 13 Nov 2015 01:28:36 -0700 Date: Fri, 13 Nov 2015 10:28:31 +0100 From: Greg Kurz Message-ID: <20151113102831.0459d0d9@bahia.local> In-Reply-To: <20151112190859.74c49785.cornelia.huck@de.ibm.com> References: <20151109175333.4076.49180.stgit@bahia.huguette.org> <20151109175834.4076.53346.stgit@bahia.huguette.org> <20151112190859.74c49785.cornelia.huck@de.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 3/3] virtio: optimize virtio_access_is_big_endian() for little-endian targets List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Cornelia Huck Cc: qemu-devel@nongnu.org, "Michael S. Tsirkin" On Thu, 12 Nov 2015 19:08:59 +0100 Cornelia Huck wrote: > On Mon, 09 Nov 2015 18:58:34 +0100 > Greg Kurz wrote: > > > When adding cross-endian support, we introduced the TARGET_IS_BIENDIAN macro > > and the virtio_access_is_big_endian() helper to have a branchless fast path > > in the virtio memory accessors for targets that don't switch endian. > > > > This was considered as a strong requirement at the time. > > > > Now we have added a runtime check for virtio 1.0, which ruins the benefit > > of the virtio_access_is_big_endian() helper for always little-endian targets. > > > > With this patch, fixed little-endian targets stop checking for virtio 1.0, > > since the result is little-endian in all cases. > > So always-LE gets optimized, while always-BE and bi-endian stay the same? > Yes. > (Is there a measurable impact?) > I tried to measure using iperf between host and guest but I could not find any significant change... do you think about another test I could try ? > > The helper also gets renamed > > so it is clear it is optimized for fast paths. > > Even if it isn't actually 'fast' on anything other than fixed-LE? Yes this is definitely a fixed-LE only optimization... should I drop the name change and add a comment instead ? > > > > Signed-off-by: Greg Kurz > > --- > > include/hw/virtio/virtio-access.h | 43 ++++++++++++++++++++----------------- > > 1 file changed, 23 insertions(+), 20 deletions(-)