diff options
author | kmacy <kmacy@FreeBSD.org> | 2008-12-29 06:31:03 +0000 |
---|---|---|
committer | kmacy <kmacy@FreeBSD.org> | 2008-12-29 06:31:03 +0000 |
commit | 9198d09682e0ff9e4b99c1a500c60ec311f33516 (patch) | |
tree | 78f4ff4cfc0d598fd6e8ccc01fa628fc8ded089f /sys/i386/xen | |
parent | e46dfc4a1843e8da9da2fceed45ebc43d45d62b1 (diff) | |
download | FreeBSD-src-9198d09682e0ff9e4b99c1a500c60ec311f33516.zip FreeBSD-src-9198d09682e0ff9e4b99c1a500c60ec311f33516.tar.gz |
merge 186535, 186537, and 186538 from releng_7_xen
Log:
- merge in latest xenbus from dfr's xenhvm
- fix race condition in xs_read_reply by converting tsleep to mtx_sleep
Log:
unmask evtchn in bind_{virq, ipi}_to_irq
Log:
- remove code for handling case of not being able to sleep
- eliminate tsleep - make sleeps atomic
Diffstat (limited to 'sys/i386/xen')
-rw-r--r-- | sys/i386/xen/clock.c | 33 | ||||
-rw-r--r-- | sys/i386/xen/mp_machdep.c | 21 | ||||
-rw-r--r-- | sys/i386/xen/mptable.c | 2 | ||||
-rw-r--r-- | sys/i386/xen/pmap.c | 2 | ||||
-rw-r--r-- | sys/i386/xen/xen_machdep.c | 2 |
5 files changed, 32 insertions, 28 deletions
diff --git a/sys/i386/xen/clock.c b/sys/i386/xen/clock.c index 3b4b6f3..db5b09c 100644 --- a/sys/i386/xen/clock.c +++ b/sys/i386/xen/clock.c @@ -78,11 +78,11 @@ __FBSDID("$FreeBSD$"); #include <i386/isa/isa.h> #include <isa/rtc.h> -#include <machine/xen/xen_intr.h> +#include <xen/xen_intr.h> #include <vm/vm.h> #include <vm/pmap.h> #include <machine/pmap.h> -#include <machine/xen/hypervisor.h> +#include <xen/hypervisor.h> #include <machine/xen/xen-os.h> #include <machine/xen/xenfunc.h> #include <xen/interface/vcpu.h> @@ -791,18 +791,20 @@ static struct vcpu_set_periodic_timer xen_set_periodic_tick; void cpu_initclocks(void) { - int time_irq; - + unsigned int time_irq; + int error; + xen_set_periodic_tick.period_ns = NS_PER_TICK; HYPERVISOR_vcpu_op(VCPUOP_set_periodic_timer, 0, &xen_set_periodic_tick); - - if ((time_irq = bind_virq_to_irqhandler(VIRQ_TIMER, 0, "clk", - clkintr, NULL, - INTR_TYPE_CLK | INTR_FAST)) < 0) { + + error = bind_virq_to_irqhandler(VIRQ_TIMER, 0, "clk", + clkintr, NULL, NULL, + INTR_TYPE_CLK | INTR_FAST, &time_irq); + if (error) panic("failed to register clock interrupt\n"); - } + /* should fast clock be enabled ? */ @@ -811,18 +813,19 @@ cpu_initclocks(void) int ap_cpu_initclocks(int cpu) { - int time_irq; + unsigned int time_irq; + int error; xen_set_periodic_tick.period_ns = NS_PER_TICK; HYPERVISOR_vcpu_op(VCPUOP_set_periodic_timer, cpu, &xen_set_periodic_tick); - - if ((time_irq = bind_virq_to_irqhandler(VIRQ_TIMER, cpu, "clk", - clkintr2, NULL, - INTR_TYPE_CLK | INTR_FAST)) < 0) { + error = bind_virq_to_irqhandler(VIRQ_TIMER, 0, "clk", + clkintr, NULL, NULL, + INTR_TYPE_CLK | INTR_FAST, &time_irq); + if (error) panic("failed to register clock interrupt\n"); - } + return (0); } diff --git a/sys/i386/xen/mp_machdep.c b/sys/i386/xen/mp_machdep.c index 4b6c77c..874cde8 100644 --- a/sys/i386/xen/mp_machdep.c +++ b/sys/i386/xen/mp_machdep.c @@ -85,9 +85,9 @@ __FBSDID("$FreeBSD$"); #include <machine/xen/xen-os.h> -#include <machine/xen/evtchn.h> -#include <machine/xen/xen_intr.h> -#include <machine/xen/hypervisor.h> +#include <xen/evtchn.h> +#include <xen/xen_intr.h> +#include <xen/hypervisor.h> #include <xen/interface/vcpu.h> #define stop_cpus_with_nmi 0 @@ -464,7 +464,8 @@ static int xen_smp_intr_init(unsigned int cpu) { int rc; - + unsigned int irq; + per_cpu(resched_irq, cpu) = per_cpu(callfunc_irq, cpu) = -1; sprintf(resched_name[cpu], "resched%u", cpu); @@ -472,22 +473,22 @@ xen_smp_intr_init(unsigned int cpu) cpu, resched_name[cpu], smp_reschedule_interrupt, - INTR_FAST|INTR_TYPE_TTY|INTR_MPSAFE); + INTR_FAST|INTR_TYPE_TTY|INTR_MPSAFE, &irq); printf("cpu=%d irq=%d vector=%d\n", cpu, rc, RESCHEDULE_VECTOR); - per_cpu(resched_irq, cpu) = rc; + per_cpu(resched_irq, cpu) = irq; sprintf(callfunc_name[cpu], "callfunc%u", cpu); rc = bind_ipi_to_irqhandler(CALL_FUNCTION_VECTOR, cpu, callfunc_name[cpu], smp_call_function_interrupt, - INTR_FAST|INTR_TYPE_TTY|INTR_MPSAFE); + INTR_FAST|INTR_TYPE_TTY|INTR_MPSAFE, &irq); if (rc < 0) goto fail; - per_cpu(callfunc_irq, cpu) = rc; + per_cpu(callfunc_irq, cpu) = irq; printf("cpu=%d irq=%d vector=%d\n", cpu, rc, CALL_FUNCTION_VECTOR); @@ -500,9 +501,9 @@ xen_smp_intr_init(unsigned int cpu) fail: if (per_cpu(resched_irq, cpu) >= 0) - unbind_from_irqhandler(per_cpu(resched_irq, cpu), NULL); + unbind_from_irqhandler(per_cpu(resched_irq, cpu)); if (per_cpu(callfunc_irq, cpu) >= 0) - unbind_from_irqhandler(per_cpu(callfunc_irq, cpu), NULL); + unbind_from_irqhandler(per_cpu(callfunc_irq, cpu)); return rc; } diff --git a/sys/i386/xen/mptable.c b/sys/i386/xen/mptable.c index 99edc50..c6c7d53 100644 --- a/sys/i386/xen/mptable.c +++ b/sys/i386/xen/mptable.c @@ -45,7 +45,7 @@ __FBSDID("$FreeBSD$"); #include <machine/mptable.h> #include <machine/specialreg.h> -#include <machine/xen/hypervisor.h> +#include <xen/hypervisor.h> #include <machine/xen/xen-os.h> #include <machine/smp.h> #include <xen/interface/vcpu.h> diff --git a/sys/i386/xen/pmap.c b/sys/i386/xen/pmap.c index d646458..6ad67ff 100644 --- a/sys/i386/xen/pmap.c +++ b/sys/i386/xen/pmap.c @@ -154,7 +154,7 @@ __FBSDID("$FreeBSD$"); #endif #include <xen/interface/xen.h> -#include <machine/xen/hypervisor.h> +#include <xen/hypervisor.h> #include <machine/xen/hypercall.h> #include <machine/xen/xenvar.h> #include <machine/xen/xenfunc.h> diff --git a/sys/i386/xen/xen_machdep.c b/sys/i386/xen/xen_machdep.c index 9f48702..0c86c62 100644 --- a/sys/i386/xen/xen_machdep.c +++ b/sys/i386/xen/xen_machdep.c @@ -59,7 +59,7 @@ __FBSDID("$FreeBSD$"); -#include <machine/xen/hypervisor.h> +#include <xen/hypervisor.h> #include <machine/xen/xenvar.h> #include <machine/xen/xenfunc.h> #include <machine/xen/xenpmap.h> |