<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;"> arch/i386/mm/fault.c |   21 +++++++++++++++++++++
 1 files changed, 21 insertions(+)

diff -puN arch/i386/mm/fault.c~4g4g-athlon-prefetch-handling-fix arch/i386/mm/fault.c
--- 25/arch/i386/mm/fault.c~4g4g-athlon-prefetch-handling-fix	2003-10-11 21:35:07.000000000 -0700
+++ 25-akpm/arch/i386/mm/fault.c	2003-10-11 21:37:28.000000000 -0700
@@ -27,6 +27,7 @@
 #include &lt;asm/pgalloc.h&gt;
 #include &lt;asm/hardirq.h&gt;
 #include &lt;asm/desc.h&gt;
+#include &lt;asm/tlbflush.h&gt;
 
 extern void die(const char *,struct pt_regs *,long);
 
@@ -104,8 +105,17 @@ static inline unsigned long get_segment_
 	if (seg &amp; (1&lt;&lt;2)) {
 		/* Must lock the LDT while reading it. */
 		down(&amp;current-&gt;mm-&gt;context.sem);
+#if 1
+		/* horrible hack for 4/4 disabled kernels.
+		   I'm not quite sure what the TLB flush is good for,
+		   it's mindlessly copied from the read_ldt code */
+		__flush_tlb_global();
+		desc = kmap(current-&gt;mm-&gt;context.ldt_pages[(seg&amp;~7)/PAGE_SIZE]);
+		desc = (void *)desc + ((seg &amp; ~7) % PAGE_SIZE);
+#else
 		desc = current-&gt;mm-&gt;context.ldt;
 		desc = (void *)desc + (seg &amp; ~7);
+#endif
 	} else {
 		/* Must disable preemption while reading the GDT. */
 		desc = (u32 *)&amp;cpu_gdt_table[get_cpu()];
@@ -118,6 +128,9 @@ static inline unsigned long get_segment_
 		 (desc[1] &amp; 0xff000000);
 
 	if (seg &amp; (1&lt;&lt;2)) { 
+#if 1
+		kunmap((void *)((unsigned long)desc &amp; PAGE_MASK));
+#endif
 		up(&amp;current-&gt;mm-&gt;context.sem);
 	} else
 		put_cpu();
@@ -243,6 +256,13 @@ asmlinkage void do_page_fault(struct pt_
 	 * (error_code &amp; 4) == 0, and that the fault was not a
 	 * protection error (error_code &amp; 1) == 0.
 	 */
+#ifdef CONFIG_X86_4G
+	/*
+	 * On 4/4 all kernels faults are either bugs, vmalloc or prefetch
+	 */
+	if (unlikely((regs-&gt;xcs &amp; 3) == 0))
+ 		goto vmalloc_fault;
+#else
 	if (unlikely(address &gt;= TASK_SIZE)) { 
 		if (!(error_code &amp; 5))
 			goto vmalloc_fault;
@@ -252,6 +272,7 @@ asmlinkage void do_page_fault(struct pt_
 		 */
 		goto bad_area_nosemaphore;
 	} 
+#endif
 
 	mm = tsk-&gt;mm;
 

_
</pre></body></html>