Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F144529988
D35535.1775259275.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
3 KB
Referenced Files
None
Subscribers
None
D35535.1775259275.diff
View Options
Index: sys/dev/xen/bus/xen_intr.c
===================================================================
--- sys/dev/xen/bus/xen_intr.c
+++ sys/dev/xen/bus/xen_intr.c
@@ -563,8 +563,10 @@
("Received unexpected event on vCPU#%u, event bound to vCPU#%u",
PCPU_GET(cpuid), isrc->xi_cpu));
- intr_execute_handlers(first_evtchn_irq + port,
- &isrc->xi_arch, trap_frame);
+ intr_execute_handlers(&isrc->xi_arch, trap_frame,
+ "stray Xen event on channel %u\n",
+ "too many stray Xen event %u's: not logging anymore\n",
+ port);
/*
* If this is the final port processed,
Index: sys/x86/include/intr_machdep.h
===================================================================
--- sys/x86/include/intr_machdep.h
+++ sys/x86/include/intr_machdep.h
@@ -66,6 +66,15 @@
#ifndef LOCORE
+/*
+ * Standard format strings for the stray interrupt messages. The value should
+ * be the IRQ.
+ */
+
+#define INTR_EXECUTE_STRAYMSG "stray irq %u\n"
+
+#define INTR_EXECUTE_MAXSTRAY "too many stray irq %u's: not logging anymore\n"
+
typedef void inthand_t(void);
#define IDTVEC(name) __CONCAT(X,name)
@@ -148,8 +157,9 @@
int intr_config_intr(struct intsrc *isrc, enum intr_trigger trig,
enum intr_polarity pol);
int intr_describe(struct intsrc *isrc, void *ih, const char *descr);
-u_long intr_execute_handlers(u_int vector, struct intsrc *isrc,
- struct trapframe *frame);
+u_long intr_execute_handlers(struct intsrc *isrc, struct trapframe *frame,
+ const char *straymsg, const char *maxstray, ...) __printflike(3, 5)
+ __printflike(4, 5);
u_int intr_next_cpu(int domain);
struct intsrc *intr_lookup_source(int vector);
int intr_register_pic(struct pic *pic);
Index: sys/x86/isa/atpic.c
===================================================================
--- sys/x86/isa/atpic.c
+++ sys/x86/isa/atpic.c
@@ -549,7 +549,8 @@
if ((isr & IRQ_MASK(7)) == 0)
return;
}
- intr_execute_handlers(atpic_vector(isrc), isrc, frame);
+ intr_execute_handlers(isrc, frame, INTR_EXECUTE_STRAYMSG,
+ INTR_EXECUTE_MAXSTRAY, vector);
}
#ifdef DEV_ISA
Index: sys/x86/x86/intr_machdep.c
===================================================================
--- sys/x86/x86/intr_machdep.c
+++ sys/x86/x86/intr_machdep.c
@@ -60,6 +60,7 @@
#include <machine/clock.h>
#include <machine/intr_machdep.h>
#include <machine/smp.h>
+#include <machine/stdarg.h>
#ifdef DDB
#include <ddb/ddb.h>
#endif
@@ -316,10 +317,11 @@
}
u_long
-intr_execute_handlers(u_int vector, struct intsrc *isrc,
- struct trapframe *frame)
+intr_execute_handlers(struct intsrc *isrc, struct trapframe *frame,
+ const char *straymsg, const char *maxstray, ...)
{
struct intr_event *ie;
+ va_list args;
/*
* We count software interrupts when we process them. The
@@ -346,12 +348,15 @@
if (intr_event_handle(ie, frame) != 0) {
isrc->is_pic->pic_disable_source(isrc, PIC_EOI);
(*isrc->is_straycount)++;
- if (*isrc->is_straycount < INTR_STRAY_LOG_MAX)
- log(LOG_ERR, "stray irq%d\n", vector);
- else if (*isrc->is_straycount == MAX_STRAY_LOG)
- log(LOG_CRIT,
- "too many stray irq %d's: not logging anymore\n",
- vector);
+ va_start(args, maxstray);
+ if (*isrc->is_straycount < INTR_STRAY_LOG_MAX) {
+ if (straymsg != NULL)
+ vlog(LOG_ERR, straymsg, args);
+ } else if (*isrc->is_straycount == MAX_STRAY_LOG) {
+ if (maxstray != NULL)
+ vlog(LOG_CRIT, maxstray, args);
+ }
+ va_end(args);
return (*isrc->is_straycount);
}
return (0);
Index: sys/x86/x86/local_apic.c
===================================================================
--- sys/x86/x86/local_apic.c
+++ sys/x86/x86/local_apic.c
@@ -1296,7 +1296,8 @@
irq = apic_idt_to_irq(PCPU_GET(apic_id), vector);
isrc = intr_lookup_source(irq);
- intr_execute_handlers(irq, isrc, frame);
+ intr_execute_handlers(isrc, frame, INTR_EXECUTE_STRAYMSG,
+ INTR_EXECUTE_MAXSTRAY, irq);
}
void
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Apr 3, 11:34 PM (4 h, 19 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28256318
Default Alt Text
D35535.1775259275.diff (3 KB)
Attached To
Mode
D35535: intr/x86: allow passing stray message into intr_execute_handlers()
Attached
Detach File
Event Timeline
Log In to Comment