AMD K6 patch

Alexey Vyskubov (alexey@alv.stud.pu.ru)
Sun, 17 Jan 1999 01:44:11 +0300 (MSK)


Hello.

This is a bad patch for enabling "write allocation" on AMD K6 model 6,7 and
(maybe) K6-2 model 8. This stuff is in a wrong file, doesn't check CPU type
and needs some hand tuning. But I wish to know people's opinion about
performance with this patch.

*YOU SHOULD NOT APPLY THIS PATCH IF YOUR CPU IS NOT AMD K6 model 6 or 7!!!*

The number in line

FIXME! movl $0x19, %eax

should not be 0x19. It should be <your memory size>/2 + 1.
I have 48 MB, so 48/2 + 1 = 24 + 1 = 25 = 16 + 9 = 0x19.
(Do not forget to remove "FIXME!" :) )

If anybody find "write allocation" for K6 useful, I'll put all this code in
more appropriate place and will add support for K5 & K6-2. And will do a
lot of cosmetic changes.

It seems for me that overall system speed is up to 5-7%.

(make -j 8 zImage takes ~8:15 instead of ~8:50).

Patch is against 2.2.0pre7.

-------------- begin: badpatch --------------
--- arch/i386/kernel/head.S.was Sat Jan 16 23:41:08 1999
+++ arch/i386/kernel/head.S Sun Jan 17 00:27:11 1999
@@ -196,7 +196,26 @@
andb $0x0f,%cl # mask mask revision
movb %cl,X86_MASK
movl %edx,X86_CAPABILITY
-
+/* Trying to enable write allocation */
+ pushfl
+ pushl %eax
+ pushl %ebx
+ pushl %ecx
+ pushl %edx
+ cli
+ wbinvd
+ movl $0xc0000082, %ecx
+ FIXME! movl $0x19, %eax
+ xorl %edx, %edx
+ wrmsr
+ popl %edx
+ popl %ecx
+ popl %ebx
+ popl %eax
+ popfl
+/* Write allocation fun end */
is486:
movl %cr0,%eax # 486 or better
andl $0x80000011,%eax # Save PG,PE,ET
--------------- end: badpatch ---------------

--
With best wishes,
Alexey Vyskubov.
This is a message. Or something silly like that.

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/