diff options
author | Keir Fraser <keir@xen.org> | 2011-05-02 12:00:40 +0100 |
---|---|---|
committer | Keir Fraser <keir@xen.org> | 2011-05-02 12:00:40 +0100 |
commit | d0ef88916f3ab8bda754b175b299e3d5a73fe851 (patch) | |
tree | 1ca943cf84f69289ffda79497151277a64c35583 /xen/arch/x86/physdev.c | |
parent | 76ce27755b87aa5a91ce0f5a02e560ab5c0515e4 (diff) | |
download | xen-d0ef88916f3ab8bda754b175b299e3d5a73fe851.tar.gz xen-d0ef88916f3ab8bda754b175b299e3d5a73fe851.tar.bz2 xen-d0ef88916f3ab8bda754b175b299e3d5a73fe851.zip |
Revert 23295:4891f1f41ba5 and 23296:24346f749826
Fails current lock checking mechanism in spinlock.c in debug=y builds.
Signed-off-by: Keir Fraser <keir@xen.org>
Diffstat (limited to 'xen/arch/x86/physdev.c')
-rw-r--r-- | xen/arch/x86/physdev.c | 36 |
1 files changed, 8 insertions, 28 deletions
diff --git a/xen/arch/x86/physdev.c b/xen/arch/x86/physdev.c index fe3a39c098..e15dd0a95d 100644 --- a/xen/arch/x86/physdev.c +++ b/xen/arch/x86/physdev.c @@ -258,28 +258,20 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE(void) arg) { case PHYSDEVOP_eoi: { struct physdev_eoi eoi; - struct pirq *pirq; - ret = -EFAULT; if ( copy_from_guest(&eoi, arg, 1) != 0 ) break; ret = -EINVAL; if ( eoi.irq >= v->domain->nr_pirqs ) break; - spin_lock(&v->domain->event_lock); - pirq = pirq_info(v->domain, eoi.irq); - if ( !pirq ) { - spin_unlock(&v->domain->event_lock); - break; - } if ( !is_hvm_domain(v->domain) && v->domain->arch.pv_domain.pirq_eoi_map ) - evtchn_unmask(pirq->evtchn); + evtchn_unmask(v->domain->pirq_to_evtchn[eoi.irq]); if ( !is_hvm_domain(v->domain) || - pirq->arch.hvm.emuirq == IRQ_PT ) - pirq_guest_eoi(v->domain, pirq); - spin_unlock(&v->domain->event_lock); - ret = 0; + domain_pirq_to_emuirq(v->domain, eoi.irq) == IRQ_PT ) + ret = pirq_guest_eoi(v->domain, eoi.irq); + else + ret = 0; break; } @@ -572,23 +564,11 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE(void) arg) break; spin_lock(&d->event_lock); - ret = get_free_pirq(d, out.type, 0); - if ( ret >= 0 ) - { - struct pirq *info = pirq_get_info(d, ret); - - if ( info ) - info->arch.irq = PIRQ_ALLOCATED; - else - ret = -ENOMEM; - } + out.pirq = get_free_pirq(d, out.type, 0); + d->arch.pirq_irq[out.pirq] = PIRQ_ALLOCATED; spin_unlock(&d->event_lock); - if ( ret >= 0 ) - { - out.pirq = ret; - ret = copy_to_guest(arg, &out, 1) ? -EFAULT : 0; - } + ret = copy_to_guest(arg, &out, 1) ? -EFAULT : 0; rcu_unlock_domain(d); break; |