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

From: Paul Mackerras
Date: Wed Mar 16 2005 - 16:29:28 EST


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.

Paul.
-
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/