[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 17/28] ahci: construct PIO Setup FIS for PIO com
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [PATCH 17/28] ahci: construct PIO Setup FIS for PIO commands |
Date: |
Thu, 31 Jul 2014 13:32:12 +0100 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
On Mon, Jul 07, 2014 at 02:17:58PM -0400, John Snow wrote:
> +static void ahci_write_fis_pio(AHCIDevice *ad, uint16_t len)
> +{
> + AHCIPortRegs *pr = &ad->port_regs;
> + uint8_t *pio_fis, *cmd_fis;
> + uint64_t tbl_addr;
> + dma_addr_t cmd_len = 0x80;
> +
> + if (!ad->res_fis || !(pr->cmd & PORT_CMD_FIS_RX)) {
> + return;
> + }
> +
> + /* map cmd_fis */
> + tbl_addr = le64_to_cpu(ad->cur_cmd->tbl_addr);
> + cmd_fis = dma_memory_map(ad->hba->as, tbl_addr, &cmd_len,
> + DMA_DIRECTION_TO_DEVICE);
We should check cmd_len == 0x80 and cmd_fis != NULL to avoid undefined
behavior when accessing cmd_fis.
pgpgNQW5Rp1Jq.pgp
Description: PGP signature
- Re: [Qemu-devel] [PATCH 09/28] ide: wrap start_dma callback, (continued)
- [Qemu-devel] [PATCH 13/28] ide: move retry constants out of BM_STATUS_* namespace, John Snow, 2014/07/07
- [Qemu-devel] [PATCH 16/28] ide: make all commands go through cmd_done, John Snow, 2014/07/07
- [Qemu-devel] [PATCH 10/28] ide: remove wrong setting of BM_STATUS_INT, John Snow, 2014/07/07
- [Qemu-devel] [PATCH 15/28] ide: stop PIO transfer on errors, John Snow, 2014/07/07
- [Qemu-devel] [PATCH 17/28] ahci: construct PIO Setup FIS for PIO commands, John Snow, 2014/07/07
- Re: [Qemu-devel] [PATCH 17/28] ahci: construct PIO Setup FIS for PIO commands,
Stefan Hajnoczi <=
- [Qemu-devel] [PATCH 18/28] q35: Enable the ioapic device to be seen by qtest., John Snow, 2014/07/07
- [Qemu-devel] [PATCH 21/28] libqtest: Correct small memory leak., John Snow, 2014/07/07
- [Qemu-devel] [PATCH 27/28] ahci: Add test_hba_enable to ahci-test., John Snow, 2014/07/07
- [Qemu-devel] [PATCH 22/28] libqos: Fixes a small memory leak., John Snow, 2014/07/07
- [Qemu-devel] [PATCH 20/28] libqos: Correct memory leak, John Snow, 2014/07/07