Re: [PATCH] Xen/i386 cleanups - AGP bus/phys cleanups

From: Jesse Barnes
Date: Wed Mar 16 2005 - 17:13:03 EST


On Wednesday, March 16, 2005 1:24 pm, Paul Mackerras wrote:
> Keir Fraser writes:
> > This patch cleans up AGP driver treatment of bus/device memory. Every
> > use of virt_to_phys/phys_to_virt should properly be converting between
> > virtual and bus addresses: this distinction really matters for the Xen
> > hypervisor.
>
> I think you are misunderstanding the distinction between physical
> addresses and bus addresses. Specifically, it seems wrong to me to be
> putting bus addresses into the GATT rather than physical addresses.
>
> For example, on my G5, physical addresses are 36 bits (in the
> hardware) but bus addresses are only 32 bits. Using bus addresses in
> the GATT would mean that I couldn't put any memory above the 4GB point
> into the GATT.
>
> The distinction is that physical addresses are what are used to access
> physical memory, whereas bus addresses are what appears on some
> external bus (usually PCI). The GATT sits between an external (AGP)
> bus and memory, so while the GATT is indexed using bus addresses, its
> entries contain physical addresses. So in fact virt_to_phys is the
> correct thing to use to calculate values to put in GATT entries.

Thanks for the explanation Paul, now the code actually makes sense.
Converting to the DMA mapping API doesn't make sense at all in this context
then, since we're basically programming the GATT (an IOMMU type table) with
physical addresses. Ken, are you sure you need to make these changes at all?
Does Xen break w/o them?

Jesse
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/