]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/dde/fbsd/examples/l4ata/uxbench/patches/rdtsc_rdpmc_Linux26.patch
Inital import
[l4.git] / l4 / pkg / dde / fbsd / examples / l4ata / uxbench / patches / rdtsc_rdpmc_Linux26.patch
1 diff -r -u arch/i386/kernel/cpu/amd.c /home/yaron/diplom/linuxpatch/amd.c
2 --- arch/i386/kernel/cpu/amd.c  2005-06-17 21:48:29.000000000 +0200
3 +++ /home/yaron/diplom/linuxpatch/amd.c 2005-11-21 18:27:46.000000000 +0100
4 @@ -175,6 +175,12 @@
5                                         wrmsr(MSR_K7_CLK_CTL, (l & 0x000fffff)|0x20000000, h);
6                                 }
7                         }
8 +
9 +                       // allow rdpmc from userland */
10 +                       set_in_cr4(X86_CR4_PCE);
11 +                       // CPU load for K7
12 +                       asm volatile ("wrmsr" : : "A"(0x0000000000430076), "c"(0xC0010000));
13 +
14                         break;
15         }
16  
17 diff -r -u arch/i386/kernel/cpu/intel.c /home/yaron/diplom/linuxpatch/intel.c
18 --- arch/i386/kernel/cpu/intel.c        2005-06-17 21:48:29.000000000 +0200
19 +++ /home/yaron/diplom/linuxpatch/intel.c       2005-11-21 18:25:12.000000000 +0100
20 @@ -189,6 +189,19 @@
21                 set_bit(X86_FEATURE_P4, c->x86_capability);
22         if (c->x86 == 6) 
23                 set_bit(X86_FEATURE_P3, c->x86_capability);
24 +
25 +       if (c->x86 == 6) {
26 +               // allow rdpmc from userland
27 +               set_in_cr4(X86_CR4_PCE);
28 +               // CPU load for P6
29 +               asm volatile ("wrmsr" : : "A"(0x0000000000430079), "c"(0x186));
30 +       } else if (c->x86 == 15) {
31 +               // allow rdpmc from userland */
32 +               set_in_cr4(X86_CR4_PCE);
33 +               // CPU load for P4
34 +               asm volatile ("wrmsr" : : "A"(0x000000002600020c), "c"(0x3a2));
35 +               asm volatile ("wrmsr" : : "A"(0x000000000003d000), "c"(0x360));
36 +       }
37  }
38  
39