Remove e a redundant layer of function calling in the event handling path

This commit is contained in:
cherry 2012-11-10 16:28:06 +00:00
parent 0002c266f0
commit d204c4c45c
3 changed files with 13 additions and 59 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: spl.S,v 1.25 2012/11/02 08:31:28 yamt Exp $ */ /* $NetBSD: spl.S,v 1.26 2012/11/10 16:28:06 cherry Exp $ */
/* /*
* Copyright (c) 2003 Wasabi Systems, Inc. * Copyright (c) 2003 Wasabi Systems, Inc.
@ -344,18 +344,3 @@ doreti_checkast:
call _C_LABEL(do_pmap_load) call _C_LABEL(do_pmap_load)
CLI(si) CLI(si)
jmp doreti_checkast /* recheck ASTs */ jmp doreti_checkast /* recheck ASTs */
#ifdef XEN
NENTRY(call_evtchn_do_event)
incl CPUVAR(IDEPTH)
call _C_LABEL(evtchn_do_event)
decl CPUVAR(IDEPTH)
ret
#ifdef DOM0OPS
NENTRY(call_xenevt_event)
incl CPUVAR(IDEPTH)
call _C_LABEL(xenevt_event)
decl CPUVAR(IDEPTH)
ret
#endif /* DOM0OPS */
#endif /* XEN */

View File

@ -1,4 +1,4 @@
/* $NetBSD: spl.S,v 1.37 2012/06/15 14:09:26 yamt Exp $ */ /* $NetBSD: spl.S,v 1.38 2012/11/10 16:28:06 cherry Exp $ */
/* /*
* Copyright (c) 1998, 2007, 2008 The NetBSD Foundation, Inc. * Copyright (c) 1998, 2007, 2008 The NetBSD Foundation, Inc.
@ -30,7 +30,7 @@
*/ */
#include <machine/asm.h> #include <machine/asm.h>
__KERNEL_RCSID(0, "$NetBSD: spl.S,v 1.37 2012/06/15 14:09:26 yamt Exp $"); __KERNEL_RCSID(0, "$NetBSD: spl.S,v 1.38 2012/11/10 16:28:06 cherry Exp $");
#include "opt_vm86.h" #include "opt_vm86.h"
#include "opt_ddb.h" #include "opt_ddb.h"
@ -322,42 +322,6 @@ doreti_checkast:
#endif /* defined(DEBUG) */ #endif /* defined(DEBUG) */
IDTVEC_END(doreti) IDTVEC_END(doreti)
#ifdef XEN
/*
* void evtchn_do_event(int evtch, struct intrframe *regs)
*/
ENTRY(call_evtchn_do_event)
IDEPTH_INCR
/*
* IDEPTH_INCR leaves old %esp in %eax.
*/
pushl 8(%eax) /* regs */
pushl 4(%eax) /* evtch */
call _C_LABEL(evtchn_do_event)
addl $8, %esp
IDEPTH_DECR
ret
END(call_evtchn_do_event)
#ifdef DOM0OPS
/*
* void xenevt_event(int port)
*/
ENTRY(call_xenevt_event)
IDEPTH_INCR
/*
* IDEPTH_INCR leaves old %esp in %eax.
*/
pushl 4(%eax) /* evtch */
call _C_LABEL(xenevt_event)
addl $4, %esp
IDEPTH_DECR
ret
END(call_xenevt_event)
#endif /* DOM0OPS */
#endif /* XEN */
#ifndef XEN #ifndef XEN
/* /*
* Xsoftintr() * Xsoftintr()

View File

@ -1,4 +1,4 @@
/* $NetBSD: hypervisor_machdep.c,v 1.21 2011/12/27 07:47:00 cherry Exp $ */ /* $NetBSD: hypervisor_machdep.c,v 1.22 2012/11/10 16:28:06 cherry Exp $ */
/* /*
* *
@ -54,7 +54,7 @@
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: hypervisor_machdep.c,v 1.21 2011/12/27 07:47:00 cherry Exp $"); __KERNEL_RCSID(0, "$NetBSD: hypervisor_machdep.c,v 1.22 2012/11/10 16:28:06 cherry Exp $");
#include <sys/param.h> #include <sys/param.h>
#include <sys/systm.h> #include <sys/systm.h>
@ -226,15 +226,20 @@ evt_do_hypervisor_callback(struct cpu_info *ci, unsigned int port,
if (port == PORT_DEBUG) if (port == PORT_DEBUG)
printf("do_hypervisor_callback event %d\n", port); printf("do_hypervisor_callback event %d\n", port);
#endif #endif
if (evtsource[port]) if (evtsource[port]) {
call_evtchn_do_event(port, regs); ci->ci_idepth++;
evtchn_do_event(port, regs);
ci->ci_idepth--;
}
#ifdef DOM0OPS #ifdef DOM0OPS
else { else {
if (ci->ci_ilevel < IPL_HIGH) { if (ci->ci_ilevel < IPL_HIGH) {
/* fast path */ /* fast path */
int oipl = ci->ci_ilevel; int oipl = ci->ci_ilevel;
ci->ci_ilevel = IPL_HIGH; ci->ci_ilevel = IPL_HIGH;
call_xenevt_event(port); ci->ci_idepth++;
xenevt_event(port);
ci->ci_idepth--;
ci->ci_ilevel = oipl; ci->ci_ilevel = oipl;
} else { } else {
/* set pending event */ /* set pending event */