diff options
author | bde <bde@FreeBSD.org> | 2003-12-02 15:02:12 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 2003-12-02 15:02:12 +0000 |
commit | ba4ca33c01ba85e79f06f405a94bb55195f730c9 (patch) | |
tree | 32c9eec2760f0e1dde5734c5a0456bffbcf0cad5 /sys | |
parent | 9eb4aeb90375ea7c50090fda28b39e83f7077085 (diff) | |
download | FreeBSD-src-ba4ca33c01ba85e79f06f405a94bb55195f730c9.zip FreeBSD-src-ba4ca33c01ba85e79f06f405a94bb55195f730c9.tar.gz |
Fixed panics in apic interrupt handlers if kernel profiling is turned
on. MCOUNT and FAKE_MCOUNT() may clobber all the call-used registers,
and one FAKE_MCOUNT() was placed so that an active %eax was clobbered.
The fix is to move this FAKE_MCOUNT() earlier where it should have
been anyway.
Fixed 3 layers of bitrot in the comment about why this FAKE_MCOUNT()
was where it was by removing the comment. (mcount() should be called
as early as possible after entering a new level, but an implementation
detail got in the way until 3 layers of changes ago.)
Kernel profiling still gives wrong results because the new interrupt
code rearranged object files too much. mcount() depends on trap,
syscall and interrupt handlers being between certain magic labels with
interrupt handlers last, and on nothing else being there. Splitting
up exception.o moved the magic labels to effectively random places
relative to what they are supposed to delimit. This mainly broke the
call graph; the flat profile is still usable.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/i386/i386/apic_vector.s | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/i386/i386/apic_vector.s b/sys/i386/i386/apic_vector.s index ecc4c67..871fd79 100644 --- a/sys/i386/i386/apic_vector.s +++ b/sys/i386/i386/apic_vector.s @@ -81,13 +81,13 @@ IDTVEC(vec_name) ; \ mov %ax, %es ; \ movl $KPSEL, %eax ; /* reload with per-CPU data segment */ \ mov %ax, %fs ; \ + FAKE_MCOUNT(13*4(%esp)) ; \ movl lapic, %edx ; /* pointer to local APIC */ \ movl LA_ISR + 16 * (index)(%edx), %eax ; /* load ISR */ \ bsrl %eax, %eax ; /* index of highset set bit in ISR */ \ jz 2f ; \ addl $(32 * index),%eax ; \ 1: ; \ - FAKE_MCOUNT(13*4(%esp)) ; /* XXX avoid double count */ \ pushl %eax ; /* pass the IRQ */ \ call lapic_handle_intr ; \ addl $4, %esp ; /* discard parameter */ \ |