2001-03-26 19:23:33

by Dinesh Nagpure

[permalink] [raw]
Subject: hooking APIC timer doesnt work?

Hello all,
I am trying to use the LAPIC timer to generate interrupt for some kernel
profiling work I am doing...but the timer ISR isnt invoking atall....here is
what I have done....
1)Initialized a interrupt gate modifying the trap_init function in traps.c
to use vector 0x32
set_intr_gate(0x32,&inthtooltimer);

2) Added a handler in entry.s

ENTRY(inthtooltimer)
pushl %eax
SAVE_ALL
movl %esp,%edx
pushl $0
pushl %edx
call SYMBOL_NAME(do_inthtooltimer)
addl $8,%esp
RESTORE_ALL

3) Added a high level C function do_inthtooltimer in traps.c with all proper
asmlinkage declerations and all

4) In my driver module I initialize the LAPIC timer register for
ONE_SHOT, NOT_MASKED, VECTOR32 and SEND_PENDING as given in the intel
architecture manual and also set the divide config register to divide by
1....and the initial count register is also set...

Problem is my timer handler isnt getting called atall...

I am disabling the SMP support and APIC support options in menuconfig

I assume rest of the APIC initialization is done properly because I am
instrumenting the APIC Performance Counter interrupt also for delivery mode
NMI and it seems to be getting called properly as I see /proc/interrupts
showing increment in NMI count..

Am i missing out something...
Thanks
Dinesh
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com


2001-03-27 11:39:02

by John Levon

[permalink] [raw]
Subject: Re: hooking APIC timer doesnt work?

On Mon, 26 Mar 2001, Dinesh Nagpure wrote:

> Hello all,
> I am trying to use the LAPIC timer to generate interrupt for some kernel
> profiling work I am doing...but the timer ISR isnt invoking atall....here is
> what I have done....
>

Have you seen Vincent Oberle's APIC timers module ? There is a link at kernelnewbies.org

Also, what are you doing with the perfctr interrupt ? Are you aware of perfctr and oprofile ?

john

--
"Stop telling God what to do."
- Niels Bohr

2001-03-27 18:24:28

by Dinesh Nagpure

[permalink] [raw]
Subject: Re: hooking APIC timer doesnt work?

John,

First of all let me thank you for pointing to Vincent Oberle's APIC timer
module, I am trying to understand how the timer is hooked in it. BTW
forgive my ignorance but what is oprofile? the reason I am trying to hook
perfctr is, well let me tell you what I am trying to do here, I want to
measure time spent between a cli and the corresponding sti, I am using the
performance monitoring event CYCLES_INT_MASKED and setting the perfctr MSR
to overflow on the first cycle after a cli, this overflow will generate
PCINT from the APIC which I am programming in delivery mode NMI, here I will
take my initial TSC reading, and also program the APIC timer initial count
register to to trigger on the next clock, but this timer interrupt will be
kept pending as long as the interrupts are disabled in the system, and will
get serviced after a sti occurs, here I take my second TSC reading,
any comments?

Dinesh

----Original Message Follows----
From: John Levon <[email protected]>
To: Dinesh Nagpure <[email protected]>
CC: [email protected]
Subject: Re: hooking APIC timer doesnt work?
Date: Tue, 27 Mar 2001 12:38:01 +0100 (BST)

On Mon, 26 Mar 2001, Dinesh Nagpure wrote:

> Hello all,
> I am trying to use the LAPIC timer to generate interrupt for some kernel
> profiling work I am doing...but the timer ISR isnt invoking atall....here
is
> what I have done....
>

Have you seen Vincent Oberle's APIC timers module ? There is a link at
kernelnewbies.org

Also, what are you doing with the perfctr interrupt ? Are you aware of
perfctr and oprofile ?

john

--
"Stop telling God what to do."
- Niels Bohr


_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com