From: John L. <mov...@us...> - 2001-08-11 01:13:41
|
Update of /cvsroot/oprofile/oprofile In directory usw-pr-cvs1:/tmp/cvs-serv25358 Modified Files: ChangeLog oprofile.c Log Message: use cli/sti instead of explicit masking for installing the NMI. Hopefully this should solve SMP problems. Index: ChangeLog =================================================================== RCS file: /cvsroot/oprofile/oprofile/ChangeLog,v retrieving revision 1.69 retrieving revision 1.70 diff -u -d -r1.69 -r1.70 --- ChangeLog 2001/08/10 13:36:37 1.69 +++ ChangeLog 2001/08/11 01:13:37 1.70 @@ -1,3 +1,8 @@ +2001-08-11 John Levon <mo...@co...> + + * oprofile.c: use a simple cli/sti when installing the NMI + handler. It should work and avoids the unmasking problem. + 2001-08-10 John Levon <mo...@co...> * dae/oprofiled.h: fix header include (from Dave Jones) Index: oprofile.c =================================================================== RCS file: /cvsroot/oprofile/oprofile/oprofile.c,v retrieving revision 1.67 retrieving revision 1.68 diff -u -d -r1.67 -r1.68 --- oprofile.c 2001/08/10 02:04:08 1.67 +++ oprofile.c 2001/08/11 01:13:37 1.68 @@ -127,31 +127,6 @@ /* ---------------- NMI handler setup ------------ */ -void mask_LVT_NMIs(void) -{ - ulong v; - - /* LVT0,1,PC can generate NMIs on APIC */ - v = apic_read(APIC_LVT0); - apic_write(APIC_LVT0, v | APIC_LVT_MASKED); - v = apic_read(APIC_LVT1); - apic_write(APIC_LVT1, v | APIC_LVT_MASKED); - v = apic_read(APIC_LVTPC); - apic_write(APIC_LVTPC, v | APIC_LVT_MASKED); -} - -void unmask_LVT_NMIs(void) -{ - ulong v; - - v = apic_read(APIC_LVT0); - apic_write(APIC_LVT0, v & ~APIC_LVT_MASKED); - v = apic_read(APIC_LVT1); - apic_write(APIC_LVT1, v & ~APIC_LVT_MASKED); - v = apic_read(APIC_LVTPC); - apic_write(APIC_LVTPC, v & ~APIC_LVT_MASKED); -} - static ulong idt_addr; static ulong kernel_nmi; @@ -160,7 +135,7 @@ volatile struct _descr descr = { 0, 0,}; volatile struct _idt_descr *de; - mask_LVT_NMIs(); + __cli(); store_idt(descr); idt_addr = descr.base; de = (struct _idt_descr *)idt_addr; @@ -170,14 +145,14 @@ kernel_nmi = (de->a & 0xffff) | (de->b & 0xffff0000); _set_gate(de, 14, 0, &op_nmi); - unmask_LVT_NMIs(); + __sti(); } static void restore_nmi(void) { - mask_LVT_NMIs(); + __cli(); _set_gate(((char *)(idt_addr)) + 16, 14, 0, kernel_nmi); - unmask_LVT_NMIs(); + __sti(); } /* ---------------- APIC setup ------------------ */ |