mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Keir Fraser <Keir.Fraser@cl.cam.ac.uk>
To: Jesse Barnes <jbarnes@engr.sgi.com>
Cc: Paul Mackerras <paulus@samba.org>,
	akpm@osdl.org, linux-kernel@vger.kernel.org, riel@redhat.com,
	Ian.Pratt@cl.cam.ac.uk, kurt@garloff.de,
	Christian.Limpach@cl.cam.ac.uk
Subject: Re: [PATCH] Xen/i386 cleanups - AGP bus/phys cleanups
Date: Thu, 17 Mar 2005 09:16:55 +0000	[thread overview]
Message-ID: <29ab1884ee5724e9efcfe43f14d13376@cl.cam.ac.uk> (raw)
In-Reply-To: <200503161406.01788.jbarnes@engr.sgi.com>


On 16 Mar 2005, at 22:06, Jesse Barnes wrote:

>> 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?

Yes, Xen will break w/o them, because physical addresses are an 
illusory trick that the guest OS plays on itself to give itself the 
impression of a contiguous memory map. We use _to_machine and _to_bus 
macros to get 'real' physical addresses.

For allocating the GATT itself, using dma_alloc_coherent() as done in 
my patch certainly seems sane -- the bus base address of that table is 
poked into a chipset register, right?

As for poking entries into the GATT, I guess I'm not sure what ought to 
be used. virt_to_phys() doesn't sound right to me: the GART is a bridge 
between two buses, so some sort of bus mapping would still be in order 
imo. Perhaps Linux should allow mapping requests to be tagged with a 
bridge id, like in *BSD? :-)

So: I would very much like you to take the patches I made to generic.c 
that replace __get_free_pages() calls with dma_alloc_coherent(). For 
now, the patch lines that poke into the GATT I guess stay as they are. 
We can maintain an out-of-tree patch for Xen, or perhaps if 
virt_to_phys() is not used very much we can override its definition.

  -- Keir


  parent reply	other threads:[~2005-03-17  9:14 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-16 11:48 Keir Fraser
2005-03-16 14:31 ` Christoph Hellwig
2005-03-16 14:58   ` Keir Fraser
2005-03-16 15:01   ` Rik van Riel
2005-03-16 18:10     ` Christoph Hellwig
2005-03-16 18:35       ` Keir Fraser
2005-03-16 18:42         ` Jesse Barnes
2005-03-16 19:08           ` Keir Fraser
2005-03-16 19:06         ` Christoph Hellwig
2005-03-16 19:11           ` Keir Fraser
2005-03-16 17:40   ` Alan Cox
2005-03-16 17:54 ` Jesse Barnes
2005-03-16 21:24 ` Paul Mackerras
2005-03-16 22:06   ` Jesse Barnes
2005-03-16 23:55     ` Rik van Riel
2005-03-17  0:39       ` Paul Mackerras
2005-03-17  1:05         ` Tupshin Harper
2005-03-17  3:44         ` Rik van Riel
2005-03-17  4:42       ` Christoph Hellwig
2005-03-17  4:58         ` Rik van Riel
2005-03-17  9:16     ` Keir Fraser [this message]
2005-03-17  9:34       ` Paul Mackerras
2005-03-17 10:56         ` Keir Fraser
2005-03-19 10:07           ` Eric W. Biederman
2005-03-19 10:56             ` Christian Limpach
2005-03-19 13:01               ` Keir Fraser
2005-03-17 13:53         ` Alan Cox
2005-03-18  0:16           ` Paul Mackerras
2005-03-18  4:23             ` Rik van Riel
2005-03-18  9:05             ` Keir Fraser

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=29ab1884ee5724e9efcfe43f14d13376@cl.cam.ac.uk \
    --to=keir.fraser@cl.cam.ac.uk \
    --cc=Christian.Limpach@cl.cam.ac.uk \
    --cc=Ian.Pratt@cl.cam.ac.uk \
    --cc=akpm@osdl.org \
    --cc=jbarnes@engr.sgi.com \
    --cc=kurt@garloff.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paulus@samba.org \
    --cc=riel@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®