From: Dave J. <da...@su...> - 2003-01-31 00:12:29
|
I think I've nailed the bug on x86-64 which causes reboots. Can someone comment on whether this looks sane or not ? (And test it still works on an athlon would be great). With this diff, things seem to work fine again.. (CVS diff, cut-n-pasted, probably tab damaged). (First hunk is the important one) Dave diff -u -p -u -r1.2 op_model_athlon.c --- module/x86/op_model_athlon.c 23 Sep 2002 00:03:45 -0000 1.2 +++ module/x86/op_model_athlon.c 31 Jan 2003 00:11:33 -0000 @@ -17,7 +17,8 @@ #define NUM_CONTROLS 4 #define CTR_READ(l,h,msrs,c) do {rdmsr(msrs->counters.addrs[(c)], (l), (h));} while (0) -#define CTR_WRITE(l,msrs,c) do {wrmsr(msrs->counters.addrs[(c)], -(u32)(l), -1);} while (0) +//#define CTR_WRITE(l,msrs,c) do {wrmsr(msrs->counters.addrs[(c)], -(u32)(l), -1);} while (0) +#define CTR_WRITE(l,msrs,c) do {wrmsr(msrs->counters.addrs[(c)], (u32)(l), -1);} while (0) #define CTR_OVERFLOWED(n) (!((n) & (1U<<31))) #define CTRL_READ(l,h,msrs,c) do {rdmsr(msrs->controls.addrs[(c)], (l), (h));} while (0) @@ -86,16 +87,16 @@ static void athlon_check_ctrs(uint const struct op_msrs const * const msrs, struct pt_regs * const regs) { - ulong low, high; + uint low, high; int i; for (i = 0 ; i < NUM_COUNTERS; ++i) { CTR_READ(low, high, msrs, i); if (CTR_OVERFLOWED(low)) { op_do_profile(cpu, regs, i); + printk (KERN_INFO "msrs=%x\n", msrs->counters.addrs[(i)]); CTR_WRITE(oprof_data[cpu].ctr_count[i], msrs, i); } } - } -- | Dave Jones. http://www.codemonkey.org.uk | SuSE Labs |