Re: [PATCH] [2/8] CPA: Flush the caches when setting pages not present

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Andi Kleen
Date: Monday, February 11, 2008 - 5:26 am

On Monday 11 February 2008 12:00:25 Ingo Molnar wrote:

It is safer in my opinion, but I have not seen a concrete bug triggered by
it so I qualified it.

Also it is quite common to qualify technical arguments this way BTW.
 

The GART is unmapped to avoid a cache coherency problem. AGP 
normally requires cache flushes and changing to uncached to map  
pages into the GART. Otherwise you could have cache incoherence
between the original page and the remapped page.
Since it would be very expensive to call cpa on each pci_map_* 
to turn the pages uncached the  IOMMU part of the GART is unmapped instead 
so that the CPU only ever sees the original memory; never the remapped
part.


If it wouldn't deal with cache coherency surely it wouldn't need to flush
caches ...

I started pageattr.c originally to deal with a concrete cache coherency
bugs (AGP cache corruptions between GART and original page on Athlon K7).
This is so that when a page is remapped in the GART it is changed in the 
direct mapping to uncached. Without that there was a reproducible cache corruption
on some systems which was very hard to track down and debug.

Even with all your changes it still does that.

All the other uses like DEBUG_RODATA or DEBUG_PAGEALLOC only came later.

 

Hmm, that's true. It needs to force WBINVD for this case. 
I'll revise. Thanks.

-Andi
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] [0/8] Various kernel mapping bug fixes, Andi Kleen, (Mon Feb 11, 2:34 am)
[PATCH] [4/8] CPA: Fix set_memory_x for ioremap, Andi Kleen, (Mon Feb 11, 2:34 am)
[PATCH] [5/8] Fix logic error in 64bit memory hotadd, Andi Kleen, (Mon Feb 11, 2:34 am)
[PATCH] [8/8] RFC: Fix some EFI problems, Andi Kleen, (Mon Feb 11, 2:34 am)
Re: [PATCH] [2/8] CPA: Flush the caches when setting pages ..., Andi Kleen, (Mon Feb 11, 5:26 am)
Re: [PATCH] [4/8] CPA: Fix set_memory_x for ioremap, Ingo Molnar, (Mon Feb 11, 5:27 am)
Re: [PATCH] [4/8] CPA: Fix set_memory_x for ioremap, Andi Kleen, (Mon Feb 11, 5:45 am)
Re: [PATCH] [6/8] Account overlapped mappings in end_pfn_map, Arjan van de Ven, (Mon Feb 11, 8:12 am)
Re: [PATCH] [5/8] Fix logic error in 64bit memory hotadd, Yasunori Goto, (Tue Feb 12, 3:35 am)
Re: [PATCH] [7/8] Implement true end_pfn_mapped for 32bit, Thomas Gleixner, (Tue Feb 12, 12:39 pm)
Re: [PATCH] [8/8] RFC: Fix some EFI problems, Thomas Gleixner, (Tue Feb 12, 1:04 pm)
Re: [PATCH] [8/8] RFC: Fix some EFI problems, Andi Kleen, (Tue Feb 12, 1:23 pm)
Re: [PATCH] [7/8] Implement true end_pfn_mapped for 32bit, Thomas Gleixner, (Tue Feb 12, 1:25 pm)
Re: [PATCH] [8/8] RFC: Fix some EFI problems, Thomas Gleixner, (Tue Feb 12, 1:48 pm)
Re: [PATCH] [8/8] RFC: Fix some EFI problems, Andi Kleen, (Wed Feb 13, 4:05 am)