Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/xen Revert these commits from november 2012:
details: https://anonhg.NetBSD.org/src/rev/798f3f3a7691
branches: trunk
changeset: 783929:798f3f3a7691
user: bouyer <bouyer%NetBSD.org@localhost>
date: Sat Jan 12 21:09:10 2013 +0000
description:
Revert these commits from november 2012:
http://mail-index.netbsd.org/source-changes/2012/11/25/msg039125.html
http://mail-index.netbsd.org/source-changes/2012/11/25/msg039126.html
http://mail-index.netbsd.org/source-changes/2012/11/25/msg039142.html
they cause a i386PAE domU to hang while running ATF tests, as shown in
http://www-soc.lip6.fr/~bouyer/NetBSD-tests/xen/HEAD/
(we should pay more attention to test results, myself first).
diffstat:
sys/arch/xen/include/hypervisor.h | 5 ++-
sys/arch/xen/x86/hypervisor_machdep.c | 46 ++++++++++++++++------------------
sys/arch/xen/xen/evtchn.c | 16 +++++++----
3 files changed, 35 insertions(+), 32 deletions(-)
diffs (226 lines):
diff -r 3d1e58430496 -r 798f3f3a7691 sys/arch/xen/include/hypervisor.h
--- a/sys/arch/xen/include/hypervisor.h Sat Jan 12 20:33:59 2013 +0000
+++ b/sys/arch/xen/include/hypervisor.h Sat Jan 12 21:09:10 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: hypervisor.h,v 1.41 2013/01/12 17:39:46 bouyer Exp $ */
+/* $NetBSD: hypervisor.h,v 1.42 2013/01/12 21:09:10 bouyer Exp $ */
/*
* Copyright (c) 2006 Manuel Bouyer.
@@ -142,7 +142,8 @@
void hypervisor_mask_event(unsigned int);
void hypervisor_clear_event(unsigned int);
void hypervisor_enable_ipl(unsigned int);
-void hypervisor_set_ipending(uint32_t, int, int);
+void hypervisor_set_ipending(struct cpu_info *,
+ uint32_t, int, int);
void hypervisor_machdep_attach(void);
void hypervisor_machdep_resume(void);
diff -r 3d1e58430496 -r 798f3f3a7691 sys/arch/xen/x86/hypervisor_machdep.c
--- a/sys/arch/xen/x86/hypervisor_machdep.c Sat Jan 12 20:33:59 2013 +0000
+++ b/sys/arch/xen/x86/hypervisor_machdep.c Sat Jan 12 21:09:10 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: hypervisor_machdep.c,v 1.25 2013/01/12 17:39:46 bouyer Exp $ */
+/* $NetBSD: hypervisor_machdep.c,v 1.26 2013/01/12 21:09:10 bouyer Exp $ */
/*
*
@@ -54,7 +54,7 @@
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: hypervisor_machdep.c,v 1.25 2013/01/12 17:39:46 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hypervisor_machdep.c,v 1.26 2013/01/12 21:09:10 bouyer Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -87,11 +87,11 @@
// #define EARLY_DEBUG_EVENT
/* callback function type */
-typedef void (*iterate_func_t)(unsigned int, unsigned int,
- unsigned int, void *);
+typedef void (*iterate_func_t)(struct cpu_info *, unsigned int,
+ unsigned int, unsigned int, void *);
static inline void
-evt_iterate_bits(volatile unsigned long *pendingl1,
+evt_iterate_bits(struct cpu_info *ci, volatile unsigned long *pendingl1,
volatile unsigned long *pendingl2,
volatile unsigned long *mask,
iterate_func_t iterate_pending, void *iterate_args)
@@ -109,7 +109,7 @@
l1 &= ~(1UL << l1i);
l2 = pendingl2[l1i] & (mask != NULL ? ~mask[l1i] : -1UL);
- l2 &= curcpu()->ci_evtmask[l1i];
+ l2 &= ci->ci_evtmask[l1i];
if (mask != NULL) xen_atomic_setbits_l(&mask[l1i], l2);
xen_atomic_clearbits_l(&pendingl2[l1i], l2);
@@ -120,7 +120,7 @@
port = (l1i << LONG_SHIFT) + l2i;
- iterate_pending(port, l1i, l2i, iterate_args);
+ iterate_pending(ci, port, l1i, l2i, iterate_args);
}
}
}
@@ -131,18 +131,20 @@
*/
static inline void
-evt_set_pending(unsigned int port, unsigned int l1i,
+evt_set_pending(struct cpu_info *ci, unsigned int port, unsigned int l1i,
unsigned int l2i, void *args)
{
KASSERT(args != NULL);
+ KASSERT(ci != NULL);
int *ret = args;
if (evtsource[port]) {
- hypervisor_set_ipending(evtsource[port]->ev_imask, l1i, l2i);
+ hypervisor_set_ipending(evtsource[port]->ev_cpu,
+ evtsource[port]->ev_imask, l1i, l2i);
evtsource[port]->ev_evcnt.ev_count++;
- if (*ret == 0 && curcpu()->ci_ilevel <
+ if (*ret == 0 && ci->ci_ilevel <
evtsource[port]->ev_maxlevel)
*ret = 1;
}
@@ -191,7 +193,7 @@
vci->evtchn_upcall_pending = 0;
- evt_iterate_bits(&vci->evtchn_pending_sel,
+ evt_iterate_bits(ci, &vci->evtchn_pending_sel,
s->evtchn_pending, s->evtchn_mask,
evt_set_pending, &ret);
@@ -212,12 +214,12 @@
/* Iterate through pending events and call the event handler */
static inline void
-evt_do_hypervisor_callback(unsigned int port, unsigned int l1i,
- unsigned int l2i, void *args)
+evt_do_hypervisor_callback(struct cpu_info *ci, unsigned int port,
+ unsigned int l1i, unsigned int l2i, void *args)
{
KASSERT(args != NULL);
+ KASSERT(ci == curcpu());
- struct cpu_info *ci = curcpu();
struct intrframe *regs = args;
#ifdef PORT_DEBUG
@@ -271,7 +273,7 @@
while (vci->evtchn_upcall_pending) {
vci->evtchn_upcall_pending = 0;
- evt_iterate_bits(&vci->evtchn_pending_sel,
+ evt_iterate_bits(ci, &vci->evtchn_pending_sel,
s->evtchn_pending, s->evtchn_mask,
evt_do_hypervisor_callback, regs);
}
@@ -388,9 +390,10 @@
}
static inline void
-evt_enable_event(unsigned int port, unsigned int l1i,
- unsigned int l2i, void *args)
+evt_enable_event(struct cpu_info *ci, unsigned int port,
+ unsigned int l1i, unsigned int l2i, void *args)
{
+ KASSERT(ci != NULL);
KASSERT(args == NULL);
hypervisor_enable_event(port);
}
@@ -406,21 +409,16 @@
* we know that all callback for this event have been processed.
*/
- evt_iterate_bits(&ci->ci_isources[ipl]->ipl_evt_mask1,
+ evt_iterate_bits(ci, &ci->ci_isources[ipl]->ipl_evt_mask1,
ci->ci_isources[ipl]->ipl_evt_mask2, NULL,
evt_enable_event, NULL);
}
void
-hypervisor_set_ipending(uint32_t iplmask, int l1, int l2)
+hypervisor_set_ipending(struct cpu_info *ci, uint32_t iplmask, int l1, int l2)
{
-
- /* This function is not re-entrant */
- KASSERT(x86_read_psl() != 0);
-
int ipl;
- struct cpu_info *ci = curcpu();
/* set pending bit for the appropriate IPLs */
ci->ci_ipending |= iplmask;
diff -r 3d1e58430496 -r 798f3f3a7691 sys/arch/xen/xen/evtchn.c
--- a/sys/arch/xen/xen/evtchn.c Sat Jan 12 20:33:59 2013 +0000
+++ b/sys/arch/xen/xen/evtchn.c Sat Jan 12 21:09:10 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: evtchn.c,v 1.67 2013/01/12 17:39:46 bouyer Exp $ */
+/* $NetBSD: evtchn.c,v 1.68 2013/01/12 21:09:10 bouyer Exp $ */
/*
* Copyright (c) 2006 Manuel Bouyer.
@@ -54,7 +54,7 @@
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: evtchn.c,v 1.67 2013/01/12 17:39:46 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: evtchn.c,v 1.68 2013/01/12 21:09:10 bouyer Exp $");
#include "opt_xen.h"
#include "isa.h"
@@ -282,7 +282,8 @@
printf("evtsource[%d]->ev_maxlevel %d <= ilevel %d\n",
evtch, evtsource[evtch]->ev_maxlevel, ilevel);
#endif
- hypervisor_set_ipending(evtsource[evtch]->ev_imask,
+ hypervisor_set_ipending(evtsource[evtch]->ev_cpu,
+ evtsource[evtch]->ev_imask,
evtch >> LONG_SHIFT,
evtch & LONG_MASK);
@@ -297,18 +298,21 @@
ih = evtsource[evtch]->ev_handlers;
while (ih != NULL) {
if (ih->ih_cpu != ci) {
- hypervisor_send_event(ih->ih_cpu, evtch);
+ hypervisor_set_ipending(ih->ih_cpu, 1 << ih->ih_level,
+ evtch >> LONG_SHIFT, evtch & LONG_MASK);
iplmask &= ~IUNMASK(ci, ih->ih_level);
ih = ih->ih_evt_next;
continue;
}
if (ih->ih_level <= ilevel) {
+ hypervisor_set_ipending(ih->ih_cpu, iplmask,
+ evtch >> LONG_SHIFT, evtch & LONG_MASK);
#ifdef IRQ_DEBUG
if (evtch == IRQ_DEBUG)
printf("ih->ih_level %d <= ilevel %d\n", ih->ih_level, ilevel);
#endif
cli();
- hypervisor_set_ipending(iplmask,
+ hypervisor_set_ipending(ih->ih_cpu, iplmask,
evtch >> LONG_SHIFT, evtch & LONG_MASK);
/* leave masked */
mutex_spin_exit(&evtlock[evtch]);
@@ -694,7 +698,7 @@
* is more explicitly implemented.
*/
evts->ev_cpu = ci;
- mutex_init(&evtlock[evtch], MUTEX_DEFAULT, IPL_NONE);
+ mutex_init(&evtlock[evtch], MUTEX_DEFAULT, IPL_HIGH);
evtsource[evtch] = evts;
if (evname)
strncpy(evts->ev_evname, evname,
Home |
Main Index |
Thread Index |
Old Index