From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:43214) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S1lw2-00048p-Iq for qemu-devel@nongnu.org; Sun, 26 Feb 2012 16:47:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S1lw1-0006jZ-8r for qemu-devel@nongnu.org; Sun, 26 Feb 2012 16:47:14 -0500 Received: from mail-iy0-f173.google.com ([209.85.210.173]:43544) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S1lw1-0006jV-3R for qemu-devel@nongnu.org; Sun, 26 Feb 2012 16:47:13 -0500 Received: by iahk25 with SMTP id k25so6629456iah.4 for ; Sun, 26 Feb 2012 13:47:12 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <20120224045736.GR16796@truffala.fritz.box> References: <1330054063-16860-1-git-send-email-david@gibson.dropbear.id.au> <1330054063-16860-9-git-send-email-david@gibson.dropbear.id.au> <20120224045736.GR16796@truffala.fritz.box> From: Blue Swirl Date: Sun, 26 Feb 2012 21:46:52 +0000 Message-ID: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 8/8] Make dma_addr_t 64 bit always List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: anthony@codemonkey.ws, qemu-devel@nongnu.org On Fri, Feb 24, 2012 at 04:57, David Gibson w= rote: > On Fri, Feb 24, 2012 at 02:27:43PM +1100, David Gibson wrote: > > Oops, ignore this one folks. =C2=A0As is probably obvious, this was a > testing patch not meant to go into the main series. Actually I'm not sure what would be the correct way to calculate the size. For example, on Sparc32 the virtual address space and CPU registers are 32 bits, physical address space 36 bits, but device virtual memory address space (DVMA, used by devices to talk to IOMMU) is only 32 bits. >> --- >> =C2=A0dma.h | =C2=A0 =C2=A09 ++++++--- >> =C2=A01 files changed, 6 insertions(+), 3 deletions(-) >> >> diff --git a/dma.h b/dma.h >> index b8cfd1d..ee540f4 100644 >> --- a/dma.h >> +++ b/dma.h >> @@ -18,10 +18,13 @@ >> =C2=A0typedef struct ScatterGatherEntry ScatterGatherEntry; >> >> =C2=A0#if defined(TARGET_PHYS_ADDR_BITS) >> -typedef target_phys_addr_t dma_addr_t; >> +/* Bus addresses can be different size from CPU physical addresses, >> + * and indeed they can be different on different busses. =C2=A0So make >> + * these always 64-bit which should handle every usual case */ >> +typedef uint64_t dma_addr_t; >> >> -#define DMA_ADDR_BITS TARGET_PHYS_ADDR_BITS >> -#define DMA_ADDR_FMT TARGET_FMT_plx >> +#define DMA_ADDR_BITS 64 >> +#define DMA_ADDR_FMT "%" PRIx64 >> >> =C2=A0typedef enum { >> =C2=A0 =C2=A0 =C2=A0DMA_DIRECTION_TO_DEVICE =3D 0, > > -- > David Gibson =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0| I'll have my music baroque, and my code > david AT gibson.dropbear.id.au =C2=A0| minimalist, thank you. =C2=A0NOT _= the_ _other_ > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| _way_ _around_! > http://www.ozlabs.org/~dgibson >