Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-5]: src/sys/arch/alpha/alpha Pull up revision 1.60 (via patch, ...



details:   https://anonhg.NetBSD.org/src/rev/3d41c71e6570
branches:  netbsd-1-5
changeset: 491769:3d41c71e6570
user:      he <he%NetBSD.org@localhost>
date:      Tue May 15 22:50:23 2001 +0000

description:
Pull up revision 1.60 (via patch, requested by ross):
  Deal with stray machine checks.

diffstat:

 sys/arch/alpha/alpha/interrupt.c |  27 +++++++++++++++++++++++----
 1 files changed, 23 insertions(+), 4 deletions(-)

diffs (74 lines):

diff -r 27a50e476f59 -r 3d41c71e6570 sys/arch/alpha/alpha/interrupt.c
--- a/sys/arch/alpha/alpha/interrupt.c  Tue May 15 22:43:03 2001 +0000
+++ b/sys/arch/alpha/alpha/interrupt.c  Tue May 15 22:50:23 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: interrupt.c,v 1.48 2000/06/05 21:47:11 thorpej Exp $ */
+/* $NetBSD: interrupt.c,v 1.48.2.1 2001/05/15 22:50:23 he Exp $ */
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -79,7 +79,7 @@
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: interrupt.c,v 1.48 2000/06/05 21:47:11 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: interrupt.c,v 1.48.2.1 2001/05/15 22:50:23 he Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -87,6 +87,7 @@
 #include <sys/vmmeter.h>
 #include <sys/sched.h>
 #include <sys/malloc.h>
+#include <sys/time.h>
 
 #include <machine/cpuvar.h>
 
@@ -234,7 +235,8 @@
        case ALPHA_INTR_ERROR:  /* Machine Check or Correctable Error */
                atomic_add_ulong(&ci->ci_intrdepth, 1);
                a0 = alpha_pal_rdmces();
-               if (platform.mcheck_handler)
+               if (platform.mcheck_handler != NULL &&
+                   (void *)framep->tf_regs[FRAME_PC] != XentArith)
                        (*platform.mcheck_handler)(a0, framep, a1, a2);
                else
                        machine_check(a0, framep, a1, a2);
@@ -298,6 +300,7 @@
 {
        const char *type;
        struct mchkinfo *mcp;
+       static struct timeval ratelimit[1];
 
        mcp = &curcpu()->ci_mcinfo;
        /* Make sure it's an error we know about. */
@@ -330,8 +333,11 @@
        return;
 
 fatal:
-       /* Clear pending machine checks and correctable errors */
        alpha_pal_wrmces(mces);
+       if ((void *)framep->tf_regs[FRAME_PC] == XentArith) {
+               rlprintf(ratelimit, "Stray machine check\n");
+               return;
+       }
 
        printf("\n");
        printf("%s:\n", type);
@@ -579,3 +585,16 @@
 
        free(sih, M_DEVBUF);
 }
+
+/*
+ * Security sensitive rate limiting printf
+ */
+void
+rlprintf(struct timeval *t, const char *fmt, ...)
+{
+       va_list ap;
+       static const struct timeval msgperiod[1] = {{ 5, 0 }};
+
+       if (ratecheck(t, msgperiod))
+               vprintf(fmt, ap);
+}



Home | Main Index | Thread Index | Old Index