From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48630) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bxNY8-0005WS-Gv for qemu-devel@nongnu.org; Thu, 20 Oct 2016 20:19:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bxNY5-0007No-Bq for qemu-devel@nongnu.org; Thu, 20 Oct 2016 20:19:04 -0400 Date: Fri, 21 Oct 2016 10:49:55 +1100 From: David Gibson Message-ID: <20161020234955.GR11140@umbus.fritz.box> References: <1476934994-5515-1-git-send-email-david@gibson.dropbear.id.au> <1476934994-5515-9-git-send-email-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="kAOhhqH5290wydqT" Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [PATCHv3 08/11] tests: Clean up IO handling in ide-test List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Laurent Vivier Cc: pbonzini@redhat.com, qemu-devel@nongnu.org, qemu-ppc@nongnu.org, agraf@suse.de, stefanha@redhat.com, mst@redhat.com, aik@ozlabs.ru, mdroth@linux.vnet.ibm.com, groug@kaod.org, thuth@redhat.com --kAOhhqH5290wydqT Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Oct 20, 2016 at 11:54:42AM +0200, Laurent Vivier wrote: >=20 >=20 > On 20/10/2016 05:43, David Gibson wrote: > > ide-test uses many explicit inb() / outb() operations for its IO, which > > means it's not portable to non-x86 platforms. This cleans it up to use > > the libqos PCI accessors instead. > >=20 > > Signed-off-by: David Gibson > > --- > > tests/ide-test.c | 181 ++++++++++++++++++++++++++++++++++++-----------= -------- > > 1 file changed, 119 insertions(+), 62 deletions(-) > >=20 > > diff --git a/tests/ide-test.c b/tests/ide-test.c > > index a8a4081..454fcf8 100644 > > --- a/tests/ide-test.c > > +++ b/tests/ide-test.c > ... > > @@ -494,7 +523,7 @@ static void test_identify(void) > > g_assert(ret =3D=3D 0); > > =20 > > /* Write cache enabled bit */ > > - assert_bit_set(buf[85], 0x20); > > + assert_bit_set(le16_to_cpu(buf[85]), 0x20); > > =20 > > ide_test_quit(); > > } >=20 > This assert breaks the test on BE host. >=20 > TEST: tests/ide-test... (pid=3D7945) > /i386/ide/identify: ** > ERROR:/home/laurent/Projects/qemu/tests/ide-test.c:525:test_identify: > assertion failed ((le16_to_cpu(buf[85])) & (0x20) =3D=3D (0x20)): > (0x00000000 =3D=3D 0x00000020) > FAIL Bother. Yes, that's a leftover from when I was trying to treat the identify block as a bytestream, rather than an array of 16-bit words. Oh.. duh. I just realized I'm an idiot. I thought I'd tested these by running the tests on the Power machine. But it turns out it was installed LE, thus defeating the purpose. --=20 David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson --kAOhhqH5290wydqT Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJYCVggAAoJEGw4ysog2bOSRGkP/A3ISj6KFjOhDG9GruCbXg3f 2nFRJU+Toymk5Ino303czx93QvyZfEpc933GA4eGEhWC3OjMVVb2vCLrJEzvRnoQ EwnUAGSabuc1xLzJrhWMzYlGtK74LerzfrpSFjp4ZqVBN4xfUyQhyDvgfMZQzt4D JQyTl2riKtZEaw1KSzjnsql+NJc1ydnz4AdbxAe8te5N0HmhRUOig0Om1INVVdRz 8Yk20l7ejrnyNPQhh3tHtz6cgzgEOOOee2TKPINg2GFmGJt4nZ54/cwy0NIzoPEG Rc549eEwLbpdgCpnhbWKv8Jx4XTB7f59CuMP3zrHV/4IsH2hfqoLyBRUd4CUHoiC 8HSdjetLEHZP7+YKbnWgZCBc1n0E0HVhZIqd9cQToDD50UrS/e4kitqvTIOzAwec WPeRQIYZc9q51NR8p/1i/+CjkF9nt/1BNItTTKIfRntz4SNqFJOkt5M82Mt5fywR pONpprbw75A0DW+h496E/SoDOODMFtLX3KTaHxrQ0bPgS0Wx/4/EN8DovdhVdBF4 jJ7wNLBj3+H4keVRhspj9B26gp8+uTvYTwDwNOq/bd1J0dGvgY1PTEiMST2LeuQZ 4nZ8vbtNPhYytaejlKR7L1dvxNO9jtnurPjyQRqSnJt/l4Xon4lPSRaUFwLCDujL yXpnr8aoRAf1KpZ5KDoe =Foqx -----END PGP SIGNATURE----- --kAOhhqH5290wydqT--