From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51836) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z8UgP-0000IO-Ji for qemu-devel@nongnu.org; Fri, 26 Jun 2015 10:32:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z8UgO-0001IW-M0 for qemu-devel@nongnu.org; Fri, 26 Jun 2015 10:32:45 -0400 Date: Fri, 26 Jun 2015 15:32:37 +0100 From: Stefan Hajnoczi Message-ID: <20150626143237.GB31186@stefanha-thinkpad.redhat.com> References: <1435018875-22527-1-git-send-email-jsnow@redhat.com> <1435018875-22527-2-git-send-email-jsnow@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ZoaI/ZTpAVc4A5k6" Content-Disposition: inline In-Reply-To: <1435018875-22527-2-git-send-email-jsnow@redhat.com> Subject: Re: [Qemu-devel] [PATCH 01/16] ide: add limit to .prepare_buf() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: John Snow Cc: kwolf@redhat.com, pbonzini@redhat.com, qemu-devel@nongnu.org, qemu-block@nongnu.org --ZoaI/ZTpAVc4A5k6 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Jun 22, 2015 at 08:21:00PM -0400, John Snow wrote: > diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c > index 95d228f..f873ab1 100644 > --- a/hw/ide/ahci.c > +++ b/hw/ide/ahci.c > @@ -49,7 +49,7 @@ static int handle_cmd(AHCIState *s,int port,int slot); > static void ahci_reset_port(AHCIState *s, int port); > static void ahci_write_fis_d2h(AHCIDevice *ad, uint8_t *cmd_fis); > static void ahci_init_d2h(AHCIDevice *ad); > -static int ahci_dma_prepare_buf(IDEDMA *dma, int is_write); > +static int ahci_dma_prepare_buf(IDEDMA *dma, int64_t limit, int is_write); Why int64_t? Types involved here are uint64_t, dma_addr_t, size_t, and int. Out of these, uint64_t seems like a good candidate but I'm not sure why it needs to be signed. > diff --git a/hw/ide/pci.c b/hw/ide/pci.c > index 4afd0cf..a295baa 100644 > --- a/hw/ide/pci.c > +++ b/hw/ide/pci.c > @@ -55,8 +55,11 @@ static void bmdma_start_dma(IDEDMA *dma, IDEState *s, > /** > * Return the number of bytes successfully prepared. > * -1 on error. > + * BUG?: Does not currently heed the 'limit' parameter because > + * it is not clear what the correct behavior here is, > + * see tests/ide-test.c QEMU implements both short and long PRDT cases for IDE in ide_dma_cb() and the tests check them. I saw nothing indicating that existing behavior might not correspond to real hardware behavior. Why do you say the correct behavior is unclear? --ZoaI/ZTpAVc4A5k6 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJVjWKFAAoJEJykq7OBq3PIaA4IAKcXPJ9kdBl8SjwvM3QhazKS huvNCyHUwbUmLDs9pmU9lF6Qgg68ByG/5F+wlaNffDFMJ3R0UgHDng0m4LWMToih NSOA7qxwuasgYzAr4peIsIFIp/WoTiu6nyJkbx+o9F9/rYG8JeaOEKShDrnOVtvd NkF9s2wJrJr/7q31xx7ZaUV8rioFaQ2kdSjUKL92w6SLFp7Sv2yi1VhiTRghqq0C jjd2aqFwH1sBNW8XZCILb4eKwn1qnVlxCHGYM9qDc88vqjEgL/cDAPLz3soPFYEO gCHrvfyI/EgT7arqbW+gfJ8GrJs5VoqVxG3mrKK1INsvVc0SA5HsBT2yUY38CnQ= =KNj7 -----END PGP SIGNATURE----- --ZoaI/ZTpAVc4A5k6--