Re: K6-2-400 CXT (K6-3 core) / MTRR (write combining)

Kurt Garloff (garloff@kg1.ping.de)
Wed, 23 Dec 1998 23:51:28 +0100


--d6Gm4EdcadzBjdND
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

On Wed, Dec 23, 1998 at 08:00:16PM +0100, Dieter Nützel wrote:
> Hello,
>
> I've greped this very nice
> ftp://ftp.heise.de/pub/ct/pcconfig/setk6v2.zip tool from the German's
> "c't" magazine's site (sorry, only for Winbloze) but hey, there must be
> someone out there who should hack this into the kernel?!!!!!!
>
> I set this up with an Elsa VICTORY II (Banshee, AGP, 16 MB SGRAM) and
> got nearly 2.5 times for 2D graphics operation and a huge bus transfer
> speedup!!! It offers the same as the Pentium II does.

You don't have to hack the utility. Just get the docs from AMD's website and
set the MSRs (machine specific regs) accordingly. Very easy.

I wrote a module which did enable Write Allocation for the old K6/K6-2 core.
It's really very easy.

You will however, have a hard time to convince Linus to integrate it into
the kernel. CPU setup is the task of the BIOS.
But if you do it with beautiful, generic code, he might be convinced ...

-- 
Kurt Garloff <K.Garloff@ping.de>  (Dortmund, FRG)
PGP key on http://student.physik.uni-dortmund.de/homepages/garloff

There is something frustrating about the quality and speed of Linux development. I.e. the quality is too high and the speed is too high, in other words, I can implement this XXXX feature, but I bet someone else has already done it and is just about to release his patch to Linus soon... [From a posting of Tigran Aivazian to linux-kernel, XXXX = disk stat]

--d6Gm4EdcadzBjdND Content-Type: text/plain; charset=us-ascii Content-Description: k6mod.c Content-Disposition: attachment; filename="k6mod.c"

/* k6mod */

/* Sets write allocation on AMD K6(-2) processor */ /* (w) Kurt Garloff <K.Garloff@ping.de> 9/98 * (c) GNU GPL */

/* Compile with * gcc -O2 -fomit-frame-pointer -D__KERNEL__ -I/usr/src/linux/include -c k6mod.c * * and insmod with insmod k6mod.o * or * copy to /lib/modules/2.1.125/misc * and depmod -a and modprobe k6mod */

#define MODULE #include <linux/module.h> #include <linux/kernel.h>

#define rdmsr(msr,val1,val2) \ __asm__ __volatile__("rdmsr" \ : "=a" (val1), "=d" (val2) \ : "c" (msr))

#define wrmsr(msr,val1,val2) \ __asm__ __volatile__("wrmsr" \ : /* no outputs */ \ : "c" (msr), "a" (val1), "d" (val2))

int init_module (void) { unsigned v1, v2; printk (KERN_INFO "Inserting K6 module ... \n"); rdmsr (0xc0000080, v1, v2); printk (KERN_INFO "EFER: %08x\n", v1); /* Syscall Extension (not currently used) */ v1 |= 1; wrmsr (0xc0000080, v1, v2); rdmsr (0xc0000080, v1, v2); printk (KERN_INFO "EFER: %08x\n", v1); rdmsr (0xc0000082, v1, v2); printk (KERN_INFO "WHCR: %08x\n", v1); /* 128 MB Write Allocation w/o 15M mem. hole */ v1 = 0x41; wrmsr (0xc0000082, v1, v2); rdmsr (0xc0000082, v1, v2); printk (KERN_INFO "WHCR: %08x\n", v1); return 1; };

void cleanup_module (void) { printk (KERN_INFO "Removing K6 module ... \n"); };

--d6Gm4EdcadzBjdND--

- 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/