qemu-devel
[Top][All Lists]
Advanced

[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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]