public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Athlon/AGP issue update
@ 2002-01-23  9:52 Daniel Robbins
  2002-01-23 10:18 ` David S. Miller
       [not found] ` <200201231010.g0NAAuE05886@Port.imtp.ilyichevsk.odessa.ua>
  0 siblings, 2 replies; 30+ messages in thread
From: Daniel Robbins @ 2002-01-23  9:52 UTC (permalink / raw)
  To: linux-kernel
  Cc: andrea, alan, Andrew Morton, davem, vherva, Linux Weekly News

Hi All,

Sorry for the delay in getting this information out.  I'll post this
info on gentoo.org as soon as I have time and some sleep.  

Today, I had a conference call with Sean Cleveland and Wayne Meritsky of
AMD and Rik van Riel and William Lee Irwin of kernelhackerdom. Here is
what we know so far.  There *is* an Athlon/AGP issue.  This issue has
*not* been tied to a bug with the Athlon/Duron processors.  The initial
reports of an Athlon CPU bug were based on information that I received
from an NVIDIA employee; this information turned out to be incorrect. 
In all fairness, he simply misunderstood the technical details of this
issue and told me that it was due to a "Athlon CPU bug" rather than
saying that it was a "potential cache coherency interaction between
Athlon speculative writes and the GART".  A mistake and misundestanding
of the details, but his heart was in the right place.  He was trying to
get this problem out in the open so that it could be addressed by the
Linux community.

AMD's educated guess is that these Athlon/AGP stability problems have to
do with speculative writes by the CPU and how they can cause indavertent
trashing of AGP memory if pages are mapped with indiscretion by the OS
and drivers.  The following explanation from AMD describes the issue in
detail:

-- AMD explanation follows ---

This note documents a subtle problem that AMD has seen in the field.

The operating system has created a 4MB translation that has attribute
bits that allow it to be cacheable.  GART also contains translations to
part of the underlying physical memory of this 4MB translation.

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.

The problem that has been experienced is caused by a speculative store
instruction that is not ultimately executed.  The logical address of the
store is through the 4MB translation to physical memory also translated
by GART and used by the AGP processor.

The effect of the store is to write-allocate a cache line in the data
cache and fill that cache line with data from the underlying physical
memory. Because the line was write-allocated it is subsequently written
back to physical memory even though the bits have not been changed by
the processor.  This write-back occurs when the cache-line is
re-allocated based upon replacement policy and is far removed in time
from the point at which the bits were read.

Between the time of the read and the time of the write, the AGP
processor has modified the bits in physical memory and the bits in the
data cache are stale.  This is happens because GART, being non-coherent,
does not snoop the processor caches for modified data.

When the cache-line eviction occurs the stale data written to physical
memory has fatal side effects.

Our conclusion is that the operating system is creating coherency
problems within the system by creating cacheable translation to AGP
GART-mapped physical memory.

-- end of AMD explanation --

Best Regards,

-- 
Daniel Robbins                                  <drobbins@gentoo.org>
Chief Architect/President                       http://www.gentoo.org 
Gentoo Technologies, Inc.


^ permalink raw reply	[flat|nested] 30+ messages in thread
* Re: Athlon/AGP issue update
@ 2002-01-23 10:38 Studierende der Universitaet des Saarlandes
  2002-01-23 11:44 ` David S. Miller
  2002-01-23 11:44 ` David Woodhouse
  0 siblings, 2 replies; 30+ messages in thread
From: Studierende der Universitaet des Saarlandes @ 2002-01-23 10:38 UTC (permalink / raw)
  To: Daniel Robbins; +Cc: linux-kernel

> 
> The effect of the store is to write-allocate a cache line in the data
> cache and fill that cache line with data from the underlying physical
> memory. Because the line was write-allocated it is subsequently written
> back to physical memory even though the bits have not been changed by
> the processor. 

I'm not sure if I understand you correctly:

speculative write operations always set the cache line dirty bit, even
if the write operations is not executed (e.g. discarded due to a
mispredicted jump)

memory mapped by GART is not cache coherent, and the write-back of the
cache causes data corruptions.

Result: data corruption.

Is that correct?

Then "nopentium" only works by chance: I assume that speculative
operations do not walk the page tables, thus the probability that a
valid TLB entry is found for the GART mapped page is slim. But if there
is an entry, then the corruption would still occur.

How could we work around it?
a) At GART mapping time, we'd have to
- flush the cache
- unmap the pte entries that point to the pages that will be mapped by
GART
- create a new, uncached, ioremap mapping to the pages.

Obviously that won't work with 4 MB pages.

b) abuse highmem.
highmem memory is not mapped. If we only use highmem pages for GART, and
ensure that page->virtual is 0, then we know that no valid pte points
into the GART pages.

^ permalink raw reply	[flat|nested] 30+ messages in thread

end of thread, other threads:[~2002-01-27 19:32 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox