[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] xhci: Fix some DMA host endian bugs
From: |
Gerd Hoffmann |
Subject: |
Re: [Qemu-devel] [PATCH] xhci: Fix some DMA host endian bugs |
Date: |
Fri, 02 Nov 2012 08:31:23 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:10.0.10) Gecko/20121026 Thunderbird/10.0.10 |
Hi,
> +static inline void xhci_dma_write_u32s(XHCIState *xhci, dma_addr_t addr,
> + uint32_t *buf, size_t len)
> +{
> + int i;
> +
> + for (i = 0; i < (len / sizeof(uint32_t)); i++) {
> + buf[i] = cpu_to_le32(buf[i]);
> + }
> + pci_dma_write(&xhci->pci_dev, addr, buf, len);
> +}
I think we should use a temporary buffer here, otherwise you leave the
values byteswapped in buf which likely has unwanted side effects.
cheers,
Gerd
- [Qemu-devel] [PATCH] xhci: Fix some DMA host endian bugs, David Gibson, 2012/11/01
- Re: [Qemu-devel] [PATCH] xhci: Fix some DMA host endian bugs,
Gerd Hoffmann <=
- Re: [Qemu-devel] [PATCH] xhci: Fix some DMA host endian bugs, David Gibson, 2012/11/02
- Re: [Qemu-devel] [PATCH] xhci: Fix some DMA host endian bugs, David Gibson, 2012/11/04
- Re: [Qemu-devel] [PATCH] xhci: Fix some DMA host endian bugs, Gerd Hoffmann, 2012/11/05
- [Qemu-devel] xhci and ehci qemu emulation performance, Stefano Panella, 2012/11/08
- Re: [Qemu-devel] xhci and ehci qemu emulation performance, Gerd Hoffmann, 2012/11/08
- Re: [Qemu-devel] xhci and ehci qemu emulation performance, Stefano Panella, 2012/11/08
- Re: [Qemu-devel] xhci and ehci qemu emulation performance, Gerd Hoffmann, 2012/11/08