From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59531) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bsUXE-0008WC-Vz for qemu-devel@nongnu.org; Fri, 07 Oct 2016 08:45:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bsUXA-0008Jb-Pj for qemu-devel@nongnu.org; Fri, 07 Oct 2016 08:45:55 -0400 Received: from 15.mo6.mail-out.ovh.net ([188.165.39.161]:50511) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bsUXA-0008J3-JM for qemu-devel@nongnu.org; Fri, 07 Oct 2016 08:45:52 -0400 Received: from player738.ha.ovh.net (b7.ovh.net [213.186.33.57]) by mo6.mail-out.ovh.net (Postfix) with ESMTP id 814B034A29 for ; Fri, 7 Oct 2016 14:45:51 +0200 (CEST) Date: Fri, 7 Oct 2016 14:45:42 +0200 From: Greg Kurz Message-ID: <20161007144542.118082e2@bahia> In-Reply-To: References: <1475835267-7300-1-git-send-email-lvivier@redhat.com> <20161007124849.7c867d79@bahia> <20161007142738.73a94338@bahia> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2] qtest: ask endianness of the target in qtest_init() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Laurent Vivier , QEMU Developers , David Gibson On Fri, 7 Oct 2016 13:31:10 +0100 Peter Maydell wrote: > On 7 October 2016 at 13:27, Greg Kurz wrote: > > Indeed but my suggestion is to open code this in qvirtio_is_big_endian(), > > and even rename QTestState::big_endian to virtio_big_endian to make it > > really obvious it should not be used elsewhere. > > > > I now remember this is what I was resolutely suggested to do in > > include/qom/cpu.h at the time we started to support ppc64le: > > > > bool (*virtio_is_big_endian)(CPUState *cpu); > > Not really the same thing though -- virtio_is_big_endian > in QEMU is indeed used only in virtio, because it makes > dubious use of the internals of the CPU state. The > equivalent of this proposed qtest function is the #define > TARGET_BIG_ENDIAN, which is global to all of QEMU and > reasonably widely used (because it's not a property of > the CPU's internals). > Indeed but is it expected to be used in other tests than virtio ? $ git grep qtest_big_endian tests/ tests/libqos/virtio-pci.c: if (qtest_big_endian()) { tests/libqtest.c:bool qtest_big_endian(void) tests/libqtest.h: * qtest_big_endian: tests/libqtest.h:bool qtest_big_endian(void); tests/virtio-blk-test.c: if (qtest_big_endian() != host_endian) { > thanks > -- PMM Cheers. -- Greg