From: <benh@kernel.crashing.org>
To: <drobbins@gentoo.org>, "David S. Miller" <davem@redhat.com>
Cc: <linux-kernel@vger.kernel.org>, <andrea@suse.de>,
<alan@redhat.com>, <akpm@zip.com.au>, <vherva@niksula.hut.fi>,
<lwn@lwn.net>, <paulus@samba.org>
Subject: Re: Athlon/AGP issue update
Date: Wed, 23 Jan 2002 03:46:10 +0100 [thread overview]
Message-ID: <20020123024610.30988@mailhost.mipsys.com> (raw)
In-Reply-To: <20020123.021819.21955581.davem@redhat.com>
In-Reply-To: <20020123.021819.21955581.davem@redhat.com>
>
>This means that the fix belongs in the DRM drivers, specifically
>DRM(mmap_dma) should clear the cacheability bits in the
>vma->vm_page_prot at mmap time.
I'm afraid there might be more to this, see below.
>I always thought the idea was that the AGP device accessed main memory
>through GART with full cache coherency with the processor. This
>should be pretty easy to implement since the PCI controller has to do
>this already.
AFAIK, most (if not all) AGP bridges do not enforce cache coherency
for AGP transactions (while they do for PCI transactions through the
AGP port). AGP memory has to be mapped uncacheable.?
>I'm really surprised that both the NVIDIA driver and DRM both get this
>wrong.
>
>Actually, the AMD guys say this:
>
> This situation is fundamentally illegal because GART is non-coherent and
> all translations that the processor could use to access the AGP memory
> must, therefore, be non-cacheable. Although we have seen no intentional
> access to the AGP memory by the processor via the 4MB cacheable
> translation we have seen legitimate, speculative, accesses performed by
> the processor.
>
>"access by the processor" to the 4MB cacheable translation or
>somewhere else? This needs clarification.
I'm not sure exactly about the AMD case, but there is at least a potential
problem with PPC in this regard. The issue is that in addition to the
non-cacheable mapping setup by the AGP driver (both the vma setup for
userland clients and the ioremap or whatever mapping setup for in kernel
clients), there is the kernel's own mapping of entire physical memory
(at least in non-highmem setup) which is cacheable. That means that there
is the theorical possibility of getting some AGP mapped cache lines
polluting the cache and causing coherency problem if
- That memory is accessed via the kernel mapping of physical memory
(which shouldn't happen, but we should still make sure we properly
invalidate that memory from the cache when we actually setup the
AGP mapping)
- That memory becomes the target of a speculative access by the CPU
(either read or write). This _can_ actually happen if the CPU can do
speculative accesses accross page boundaries. A 4k page mapped to AGP
can very well be physically located between 2 completely unrelated pages
that are used by the kernel via the kernel main RAM mapping. Accessing
some datas at the end of the previous page could cause the CPU to do
a speculative access to the next page as the mapping exist and is cacheable
and non-guarded.
The workaround here would be for AGP to also _unmap_ the AGP pages from
the main kernel mapping, which isn't always possible, for example on PPC
we use the BATs to map the kernel lowmem, we can't easily make "holes" in
a BAT mapping. That's one reason why I did some experiments to make the
PPC kernel able to disable it's BAT mapping.
Now the question is: Which CPUs can do speculative access accross page
boundaries ?
Ben.
next prev parent reply other threads:[~2002-01-23 13:53 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-01-23 9:52 Athlon/AGP issue update Daniel Robbins
2002-01-23 10:18 ` David S. Miller
2002-01-23 2:46 ` benh [this message]
2002-01-23 14:08 ` David S. Miller
2002-01-23 15:47 ` benh
2002-01-25 18:34 ` Val Henson
2002-01-26 0:20 ` Benjamin Herrenschmidt
2002-01-27 19:22 ` Val Henson
2002-01-27 19:32 ` Benjamin Herrenschmidt
2002-01-23 16:31 ` Albert D. Cahalan
2002-01-23 16:57 ` Daniel Robbins
2002-01-23 17:14 ` benh
2002-01-23 23:14 ` Albert D. Cahalan
2002-01-25 18:17 ` Val Henson
2002-01-23 19:20 ` Oliver Neukum
[not found] ` <200201231010.g0NAAuE05886@Port.imtp.ilyichevsk.odessa.ua>
2002-01-23 10:24 ` David S. Miller
2002-01-23 10:31 ` Rik van Riel
2002-01-23 11:39 ` David S. Miller
2002-01-23 11:39 ` William Lee Irwin III
2002-01-23 11:47 ` David S. Miller
2002-01-23 17:09 ` Albert D. Cahalan
2002-01-23 18:38 ` David S. Miller
-- strict thread matches above, loose matches on Subject: below --
2002-01-23 10:38 Studierende der Universitaet des Saarlandes
2002-01-23 11:44 ` David S. Miller
2002-01-23 12:32 ` Momchil Velikov
2002-01-23 12:34 ` David S. Miller
2002-01-23 12:41 ` Momchil Velikov
2002-01-23 14:50 ` Manfred Spraul
2002-01-23 11:44 ` David Woodhouse
2002-01-23 11:49 ` David S. Miller
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=20020123024610.30988@mailhost.mipsys.com \
--to=benh@kernel.crashing.org \
--cc=akpm@zip.com.au \
--cc=alan@redhat.com \
--cc=andrea@suse.de \
--cc=davem@redhat.com \
--cc=drobbins@gentoo.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lwn@lwn.net \
--cc=paulus@samba.org \
--cc=vherva@niksula.hut.fi \
/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