Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/xen/xen Fixes port-xen/53267



details:   https://anonhg.NetBSD.org/src/rev/e764cbcd2826
branches:  trunk
changeset: 361781:e764cbcd2826
user:      cherry <cherry%NetBSD.org@localhost>
date:      Fri May 11 13:24:46 2018 +0000

description:
Fixes port-xen/53267
re-educate xen_clock_handler() how to use the interrupt stackframe.
The current regs value passed in is *ci, and thus invalid.

Reported and tested by kre@. See PR 53267 for more details.

diffstat:

 sys/arch/xen/xen/clock.c |  12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diffs (50 lines):

diff -r 6cbbc02f0695 -r e764cbcd2826 sys/arch/xen/xen/clock.c
--- a/sys/arch/xen/xen/clock.c  Fri May 11 12:54:56 2018 +0000
+++ b/sys/arch/xen/xen/clock.c  Fri May 11 13:24:46 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: clock.c,v 1.65 2017/11/06 15:27:09 cherry Exp $        */
+/*     $NetBSD: clock.c,v 1.66 2018/05/11 13:24:46 cherry Exp $        */
 
 /*
  *
@@ -29,7 +29,7 @@
 #include "opt_xen.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.65 2017/11/06 15:27:09 cherry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.66 2018/05/11 13:24:46 cherry Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -49,7 +49,8 @@
 #include <dev/clock_subr.h>
 #include <x86/rtc.h>
 
-static int xen_timer_handler(void *);
+static int xen_timer_handler(void *, struct intrframe *);
+static int (*xen_timer_handler_stub)(void *) = (void *) xen_timer_handler;
 static struct intrhand *ih;
 
 /* A timecounter: Xen system_time extrapolated with a TSC. */
@@ -524,7 +525,7 @@
        KASSERT(evtch != -1);
 
        ih = intr_establish_xname(0, &xen_pic, evtch, IST_LEVEL, IPL_CLOCK,
-           xen_timer_handler, ci, true, "clock");
+           xen_timer_handler_stub, ci, true, "clock");
 
        KASSERT(ih != NULL);
 
@@ -535,11 +536,10 @@
 
 /* ARGSUSED */
 static int
-xen_timer_handler(void *arg)
+xen_timer_handler(void *arg, struct intrframe *regs)
 {
        int64_t delta;
        struct cpu_info *ci = curcpu();
-       struct intrframe *regs = arg;
 
        int err;
 again:



Home | Main Index | Thread Index | Old Index