From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38071) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XHyG7-0003Y0-6r for qemu-devel@nongnu.org; Thu, 14 Aug 2014 12:52:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XHyG1-0007rp-2Z for qemu-devel@nongnu.org; Thu, 14 Aug 2014 12:52:15 -0400 Received: from mx1.redhat.com ([209.132.183.28]:9458) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XHyG0-0007rl-Oo for qemu-devel@nongnu.org; Thu, 14 Aug 2014 12:52:08 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s7EGq7Oq029761 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 14 Aug 2014 12:52:07 -0400 Date: Thu, 14 Aug 2014 17:52:05 +0100 From: Stefan Hajnoczi Message-ID: <20140814165205.GH24132@stefanha-thinkpad.redhat.com> References: <1407966975-3723-1-git-send-email-jsnow@redhat.com> <1407966975-3723-9-git-send-email-jsnow@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="dMyqICaxQaaUjrCL" Content-Disposition: inline In-Reply-To: <1407966975-3723-9-git-send-email-jsnow@redhat.com> Subject: Re: [Qemu-devel] [PATCH v3 32/32] ahci: Add test_identify case to ahci-test. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: John Snow Cc: mst@redhat.com, qemu-devel@nongnu.org, armbru@redhat.com --dMyqICaxQaaUjrCL Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Aug 13, 2014 at 05:56:15PM -0400, John Snow wrote: > + /* Copy the existing Command #0 structure from the CLB into local memory, > + * and build a new command #0. */ > + memread(clb, &cmd, sizeof(cmd)); > + cmd.b1 = 5; /* reg_h2d_fis is 5 double-words long */ > + cmd.b2 = 0x04; /* clear PxTFD.STS.BSY when done */ > + cmd.prdtl = 1; /* One PRD table entry. */ What about endianness? This will be copied into guest memory, we should use cpu_to_X() to ensure the correct endianness. > + cmd.prdbc = 0; > + cmd.ctba = table; > + cmd.ctbau = 0; > + > + /* Construct our PRD, noting that DBC is 0-indexed. */ > + prd.dba = data_ptr; Endianness > + reg = px_rreg(i, AHCI_PX_TFD); > + g_assert_cmphex((reg & AHCI_PX_TFD_ERR), ==, pio->error); > + g_assert_cmphex((reg & AHCI_PX_TFD_STS), ==, pio->status); > + /* PIO FIS contains a "bytes read" field, it should match up. */ > + g_assert_cmphex(pio->res4, ==, cmd.prdbc); Endianness --dMyqICaxQaaUjrCL Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJT7Ok1AAoJEJykq7OBq3PI6GgH/3wt0lndYT0cr4yqHoUXH9Kp EzSitKygBBsy1SQeLc8OzSVOF8tFNP3BYyM+cCjFyr7to+lTeGuVLUJGUCWZiu+X HE48hsU1+70o5ZlZK66iW2kuR0+bEfuOXKPvbD6L0UqON3HUf5jorz5jTs1Umicw LThrudI/gymgsu40aflSLLQjB1d7k5jHZgh7xdSHPau6kmleBSb6fMDwjTeTQuHJ +oBitYiyz2nDhwWf6cfB3aWDzLNTmelUtKrR7aUgTl6FXW1YWFOJ0j8jMi5Sapss tjMhl+LaeVB/ciluTdjOEs57+2Wu997d7u0z/TZqGiGS4RHZtRcM8rkKz4/OhcA= =ItC5 -----END PGP SIGNATURE----- --dMyqICaxQaaUjrCL--