From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41683) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z9aP6-0000UX-DL for qemu-devel@nongnu.org; Mon, 29 Jun 2015 10:51:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z9aP2-00075n-2i for qemu-devel@nongnu.org; Mon, 29 Jun 2015 10:51:24 -0400 Date: Mon, 29 Jun 2015 15:51:15 +0100 From: Stefan Hajnoczi Message-ID: <20150629145115.GJ32151@stefanha-thinkpad.redhat.com> References: <1435018875-22527-1-git-send-email-jsnow@redhat.com> <1435018875-22527-15-git-send-email-jsnow@redhat.com> <20150626155949.GF31186@stefanha-thinkpad.redhat.com> <558D8C60.3040105@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="q5r20fdKX+PFtYHw" Content-Disposition: inline In-Reply-To: <558D8C60.3040105@redhat.com> Subject: Re: [Qemu-devel] [PATCH 14/16] ahci: Do not map cmd_fis to generate response List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: John Snow Cc: kwolf@redhat.com, pbonzini@redhat.com, qemu-block@nongnu.org, qemu-devel@nongnu.org, Stefan Hajnoczi --q5r20fdKX+PFtYHw Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jun 26, 2015 at 01:31:12PM -0400, John Snow wrote: > On 06/26/2015 11:59 AM, Stefan Hajnoczi wrote: > > On Mon, Jun 22, 2015 at 08:21:13PM -0400, John Snow wrote: > >> @@ -744,8 +722,8 @@ static void ahci_write_fis_pio(AHCIDevice > >> *ad, uint16_t len) pio_fis[9] =3D s->hob_lcyl; pio_fis[10] =3D > >> s->hob_hcyl; pio_fis[11] =3D 0; - pio_fis[12] =3D cmd_fis[12]; - > >> pio_fis[13] =3D cmd_fis[13]; + pio_fis[12] =3D s->nsector & 0xFF;= =20 > >> + pio_fis[13] =3D (s->nsector >> 8) & 0xFF; > >=20 > > hw/ide/core.c decreases s->nsector until it reaches 0 and the > > request ends. > >=20 > > Will the values reported back to the guest be correct if we use=20 > > s->nsector? > >=20 >=20 > See the commit message for justification of this one. Ultimately, it > doesn't matter what gets put in here (for data transfer commands) -- > but getting RID of the cmd_fis mapping is a strong positive. Getting rid of cmd_fis mapping is good. Putting s->nsector into the undefined fields makes the code confusing. It is clearer to zero the bytes with a comment saying the value does not matter according to the spec. --q5r20fdKX+PFtYHw Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJVkVtjAAoJEJykq7OBq3PIGw8H/086i9Vkpo8/PqXxGVSwNJLu UWfwaqXY+vD2lmWaP6f8FhOQyFGU85/p5IE2ZgNNFHnQgHFn4+3vWhzkNqi0e0Zy hL3Kjx3CvimWbFoHTGMaElXlAENmLlKO9BozRCRuMV/yVkuxm0kOV67Ek9XHpaYh V/W22MJgJG0VT+531f1jz+uhhGl3yvPNFP03PfE2s8LWHJKm76zUmqxUbfkOHXxm gkpIgn67DR/NO74oMMlSgrdzUEwP4Gk1Gqof54x3AHzJZ87xOgfk0t2gwt2vvjGF KiyjvLVzZQk7jTHPyhFFnXfZqDxtK+Jt6hZLR4RQUlYJh5bIabcTErRCnm28EWc= =L9Rs -----END PGP SIGNATURE----- --q5r20fdKX+PFtYHw--