[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 01/16] ide: add limit to .prepare_buf()
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [PATCH 01/16] ide: add limit to .prepare_buf() |
Date: |
Fri, 26 Jun 2015 15:32:37 +0100 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
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?
pgpIuJafydF3p.pgp
Description: PGP signature
- Re: [Qemu-devel] [PATCH 06/16] ahci: record ncq failures, (continued)
- Re: [Qemu-devel] [PATCH 06/16] ahci: record ncq failures, John Snow, 2015/06/26
- Re: [Qemu-devel] [Qemu-block] [PATCH 06/16] ahci: record ncq failures, Stefan Hajnoczi, 2015/06/29
- Re: [Qemu-devel] [Qemu-block] [PATCH 06/16] ahci: record ncq failures, Stefan Hajnoczi, 2015/06/29
- Re: [Qemu-devel] [Qemu-block] [PATCH 06/16] ahci: record ncq failures, John Snow, 2015/06/29
- Re: [Qemu-devel] [Qemu-block] [PATCH 06/16] ahci: record ncq failures, John Snow, 2015/06/29
[Qemu-devel] [PATCH 07/16] ahci: kick NCQ queue, John Snow, 2015/06/22
[Qemu-devel] [PATCH 08/16] ahci: correct types in NCQTransferState, John Snow, 2015/06/22
[Qemu-devel] [PATCH 09/16] ahci: correct ncq sector count, John Snow, 2015/06/22
[Qemu-devel] [PATCH 10/16] qtest/ahci: halted NCQ test, John Snow, 2015/06/22
[Qemu-devel] [PATCH 01/16] ide: add limit to .prepare_buf(), John Snow, 2015/06/22
- Re: [Qemu-devel] [PATCH 01/16] ide: add limit to .prepare_buf(),
Stefan Hajnoczi <=
[Qemu-devel] [PATCH 13/16] ahci: add get_cmd_header helper, John Snow, 2015/06/22
[Qemu-devel] [PATCH 11/16] ahci: add cmd header to ncq transfer state, John Snow, 2015/06/22
[Qemu-devel] [PATCH 12/16] ahci: ncq migration, John Snow, 2015/06/22