Received: from eggs.gnu.org ([2001:4830:134:3::10]:44968) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aIh3X-0005Ly-6X for qemu-devel@nongnu.org; Mon, 11 Jan 2016 13:19:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aIh3S-0001jf-6R for qemu-devel@nongnu.org; Mon, 11 Jan 2016 13:19:03 -0500 Received: from e06smtp07.uk.ibm.com ([195.75.94.103]:53287) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aIh3R-0001jZ-TD for qemu-devel@nongnu.org; Mon, 11 Jan 2016 13:18:58 -0500 Received: from localhost by e06smtp07.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 11 Jan 2016 18:18:56 -0000 Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by d06dlp02.portsmouth.uk.ibm.com (Postfix) with ESMTP id 971702190019 for ; Mon, 11 Jan 2016 18:18:43 +0000 (GMT) Received: from d06av03.portsmouth.uk.ibm.com (d06av03.portsmouth.uk.ibm.com [9.149.37.213]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u0BIIs0S1704320 for ; Mon, 11 Jan 2016 18:18:54 GMT Received: from d06av03.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av03.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u0BIIruY004146 for ; Mon, 11 Jan 2016 11:18:54 -0700 Date: Mon, 11 Jan 2016 19:18:52 +0100 From: Cornelia Huck Message-ID: <20160111191852.65839a70.cornelia.huck@de.ibm.com> In-Reply-To: <20160111161317.17428.44013.stgit@bahia.huguette.org> References: <20160111161156.17428.20668.stgit@bahia.huguette.org> <20160111161317.17428.44013.stgit@bahia.huguette.org> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 5/5] virtio: optimize virtio_access_is_big_endian() for little-endian targets List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Greg Kurz Cc: qemu-devel@nongnu.org, "Michael S. Tsirkin" On Mon, 11 Jan 2016 17:18:06 +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, always little-endian targets stop checking for virtio 1.0, > since the result is little-endian in all cases. > > Signed-off-by: Greg Kurz > --- > v2: > - simplified the logic as suggested by Laurent Vivier > --- > include/hw/virtio/virtio-access.h | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) Reviewed-by: Cornelia Huck