On Tue, 2003-08-26 at 19:11, David Mosberger wrote: 
> >>>>> On Tue, 26 Aug 2003 17:58:55 +0200, Benjamin Herrenschmidt <[EMAIL PROTECTED]> 
> >>>>> said:
> 
>   Benjamin> flush_tlb_kernel_range((unsigned long) addr, (unsigned long) addr + 
> size);
> 
>   Benjamin> Why this flush ? I don't see why one would need to flush
>   Benjamin> TLBs on a region obtained from vmap()... vmap will give
>   Benjamin> you virtual addresses that weren't allocated before, so
>   Benjamin> that shouldn't be in your tlb (if they were used by a
>   Benjamin> previous vmalloc, then vfree would have cleared them...
> 
> Yes, I think you're right.  I checked my earlier patches and the
> flush_tlb_kernel_range() was there as early as 9/28/2002 and shouldn't
> have been needed even then (things worked differently then, but
> eventually, it called vunmap() which also flushes the TLB).  I suspect
> when I wrote the code I just forgot that vfree/vunmap take care of
> flushing the TLB.

So I take it you guys want me to commit this patch to DRI CVS? :)


-- 
Earthling Michel Dänzer   \  Debian (powerpc), XFree86 and DRI developer
Software libre enthusiast  \     http://svcs.affero.net/rm.php?r=daenzer
Index: programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm_memory.h
===================================================================
RCS file: /cvsroot/dri/xc/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm_memory.h,v
retrieving revision 1.16
diff -p -u -r1.16 drm_memory.h
--- programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm_memory.h	25 Jul 2003 10:50:39 -0000	1.16
+++ programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm_memory.h	26 Aug 2003 20:36:13 -0000
@@ -59,13 +59,10 @@
 # endif
 #endif
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
-# include <asm/tlbflush.h>
-#else
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
 # define pte_offset_kernel(dir, address)	pte_offset(dir, address)
 # define pte_pfn(pte)				(pte_page(pte) - mem_map)
 # define pfn_to_page(pfn)			(mem_map + (pfn))
-# define flush_tlb_kernel_range(s,e)		flush_tlb_all()
 #endif
 
 /*
@@ -128,7 +125,6 @@ agp_remap (unsigned long offset, unsigne
 	if (!addr)
 		return NULL;
 
-	flush_tlb_kernel_range((unsigned long) addr, (unsigned long) addr + size);
 	return addr;
 }
 

Reply via email to