Performance counter and NMI handling

Jugwan Eom zugwan at postech.ac.kr
Wed Nov 15 12:34:56 CET 2006


Udo A. Steinberg 쓴 글:
> It's rather unlikely that anyone will be able to help, unless you make your code
> and configuration available.
>   
Ok, Udo. I'd like to show small patches instead of showing my code but I 
think it's operation is the same with my code and it reproduced the same 
result.
-------------------------------------------------------------------------------------------------------------------
Index: src/kern/shared/thread-ia32-ux.cpp
===================================================================
RCS file: 
/home/remote-cvs/l4/kernel/fiasco/src/kern/shared/thread-ia32-ux.cpp,v
retrieving revision 1.138
diff -u -r1.138 thread-ia32-ux.cpp
--- src/kern/shared/thread-ia32-ux.cpp 7 Nov 2006 18:34:03 -0000 1.138
+++ src/kern/shared/thread-ia32-ux.cpp 15 Nov 2006 11:04:33 -0000
@@ -40,6 +40,7 @@
#include "timer.h"
#include "trap_state.h"
#include "vmem_alloc.h"
+#include "watchdog.h"

#ifdef CONFIG_KDB
extern unsigned gdb_trap_recover; // in gdb_trap.c
@@ -294,6 +295,15 @@
if (!check_trap13_kernel (ts, from_user))
return 0;

+ if (ts->_trapno == 2) { // NMI
+#if 0
+ printf ("%d: CS=%lx %x.%02x IP="L4_PTR_FMT" Trap=%02lx \n",
+ __LINE__, ts->cs(), d_taskno(), d_threadno(), ts->ip (), ts->_trapno);
+#endif
+ Watchdog::enable();
+ goto success;
+ }
+
if (EXPECT_FALSE (!from_user))
{
// small space faults can be raised in kernel mode, too (long IPC)

Index: src/kern/shared/thread-ia32-amd64.cpp
===================================================================
RCS file: 
/home/remote-cvs/l4/kernel/fiasco/src/kern/shared/thread-ia32-amd64.cpp,v
retrieving revision 1.14
diff -u -r1.14 thread-ia32-amd64.cpp
--- src/kern/shared/thread-ia32-amd64.cpp 23 Oct 2006 12:12:38 -0000 1.14
+++ src/kern/shared/thread-ia32-amd64.cpp 15 Nov 2006 11:04:23 -0000
@@ -104,12 +104,13 @@
if(Kconsole::console()->char_avail()==1)
kdb_ke("SERIAL_ESC");
}
-
+#if 0
if (Config::watchdog)
{
// tell doggy that we are alive
Watchdog::touch();
}
+#endif
}

IMPLEMENTATION[ia32]:

Index: src/kern/shared/perf_cnt-ia32-ux.cpp
===================================================================
RCS file: 
/home/remote-cvs/l4/kernel/fiasco/src/kern/shared/perf_cnt-ia32-ux.cpp,v
retrieving revision 1.15
diff -u -r1.15 perf_cnt-ia32-ux.cpp
--- src/kern/shared/perf_cnt-ia32-ux.cpp 21 Dec 2005 17:38:28 -0000 1.15
+++ src/kern/shared/perf_cnt-ia32-ux.cpp 15 Nov 2006 11:04:00 -0000
@@ -749,13 +749,13 @@
// is 0x7ffffffff. The 31st bit is extracted to the bits 32-39 (see
// "IA-32 Intel Architecture Software Developer's Manual. Volume 3:
// Programming Guide" section 14.10.2: PerfCtr0 and PerfCtr1 MSRs.
- if (hold_watchdog > 0x7fffffff)
- hold_watchdog = 0x7fffffff;
+ //if (hold_watchdog > 0x7fffffff)
+ hold_watchdog = 3000; // oprofile: P4 GLOBAL_POWER_EVENTS default
hold_watchdog = -hold_watchdog;
init_watchdog();
touch_watchdog();
- start_watchdog();
- start_pmc(pmc_watchdog);
+ //start_watchdog();
+ //start_pmc(pmc_watchdog);
}
}

---------------------------------------------------------------------------------------------------------------------
GRUB Menulist

kernel (nd)/l4/bin/bootstrap -serial
modaddr 0x02000000
module (nd)/l4/fiasco/fiasco -nokdb -serial -serial_esc -comport 1 -watchdog
module (nd)/l4/bin/sigma0
module (nd)/l4/bin/roottask
module (nd)/l4/bin/names
module (nd)/l4/bin/log --prio 0xA1
module (nd)/l4/bin/dm_phys
module (nd)/l4/bin/enable_watchdog
module (nd)/l4/bin/hello

The watchdog is enabled by enable_watchdog via fiasco_watchdog_enable() 
in sys/kdebug.h. The kernel configuration file is attached. Is this 
enough that someone helps me? :) Please, give me any advice.

Regards,
--
Jugwan Eom
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: globalconfig.out
URL: <http://os.inf.tu-dresden.de/pipermail/l4-hackers/attachments/20061115/55990c49/attachment.ksh>


More information about the l4-hackers mailing list