From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47511) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZxGEC-0002Tl-CF for qemu-devel@nongnu.org; Fri, 13 Nov 2015 10:25:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZxGE9-00050O-4z for qemu-devel@nongnu.org; Fri, 13 Nov 2015 10:25:28 -0500 Received: from e06smtp07.uk.ibm.com ([195.75.94.103]:49031) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZxGE8-0004zh-SL for qemu-devel@nongnu.org; Fri, 13 Nov 2015 10:25:25 -0500 Received: from localhost by e06smtp07.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 13 Nov 2015 15:25:22 -0000 Received: from b06cxnps3074.portsmouth.uk.ibm.com (d06relay09.portsmouth.uk.ibm.com [9.149.109.194]) by d06dlp02.portsmouth.uk.ibm.com (Postfix) with ESMTP id CEF832190066 for ; Fri, 13 Nov 2015 15:25:15 +0000 (GMT) Received: from d06av07.portsmouth.uk.ibm.com (d06av07.portsmouth.uk.ibm.com [9.149.37.248]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id tADFPKRB12452142 for ; Fri, 13 Nov 2015 15:25:20 GMT Received: from d06av07.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av07.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id tADFPKFD028030 for ; Fri, 13 Nov 2015 08:25:20 -0700 Date: Fri, 13 Nov 2015 16:25:15 +0100 From: Greg Kurz Message-ID: <20151113162515.41cb5e4d@bahia.local> In-Reply-To: <20151113154253.22335196.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> <20151113102831.0459d0d9@bahia.local> <20151113154253.22335196.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 Fri, 13 Nov 2015 15:42:53 +0100 Cornelia Huck wrote: > On Fri, 13 Nov 2015 10:28:31 +0100 > Greg Kurz wrote: > > > 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 ? > > My hunch is that the impact is small anyway. > Yeah... even when running TCG I don't see any difference. > > > > > > 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 ? > > I think that would be better as it does not raise expectations :) > Ok I'll revert to the original name then. Thanks for the review. -- Greg > > > > > > > > > > Signed-off-by: Greg Kurz > > > > --- > > > > include/hw/virtio/virtio-access.h | 43 ++++++++++++++++++++----------------- > > > > 1 file changed, 23 insertions(+), 20 deletions(-) > > >