* [PATCH] fix APIC errors on oprofile restore
@ 2002-11-01 4:07 John Levon
0 siblings, 0 replies; only message in thread
From: John Levon @ 2002-11-01 4:07 UTC (permalink / raw)
To: torvalds; +Cc: linux-kernel, oprofile-list
See comment. Please apply. By Philippe Elie
tested on two UP boxen and my SMP box
thanks
john
diff -Naur -X dontdiff linux-linus/arch/i386/oprofile/nmi_int.c linux/arch/i386/oprofile/nmi_int.c
--- linux-linus/arch/i386/oprofile/nmi_int.c Wed Oct 30 03:28:21 2002
+++ linux/arch/i386/oprofile/nmi_int.c Wed Oct 30 03:51:58 2002
@@ -135,9 +135,19 @@
static void nmi_cpu_shutdown(void * dummy)
{
+ unsigned int v;
int cpu = smp_processor_id();
struct op_msrs * msrs = &cpu_msrs[cpu];
+
+ /* restoring APIC_LVTPC can trigger an apic error because the delivery
+ * mode and vector nr combination can be illegal. That's by design: on
+ * power on apic lvt contain a zero vector nr which are legal only for
+ * NMI delivery mode. So inhibit apic err before restoring lvtpc
+ */
+ v = apic_read(APIC_LVTERR);
+ apic_write(APIC_LVTERR, v | APIC_LVT_MASKED);
apic_write(APIC_LVTPC, saved_lvtpc[cpu]);
+ apic_write(APIC_LVTERR, v);
nmi_restore_registers(msrs);
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2002-11-01 4:01 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-11-01 4:07 [PATCH] fix APIC errors on oprofile restore John Levon
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®