[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen-unstable] [IA64] Use rcu where possible.
# HG changeset patch # User Alex Williamson <alex.williamson@xxxxxx> # Date 1200689726 25200 # Node ID 0ace9a451a25fe56fbdaef8a8fbd5f9c7bb00c2b # Parent a868bd4236e6da06dd8dad88b66ad4f55dcc4b50 [IA64] Use rcu where possible. This is for consistency. Signed-off-by: Isaku Yamahata <yamahata@xxxxxxxxxxxxx> --- xen/arch/ia64/vmx/vmx_hypercall.c | 14 +++++++------- xen/arch/ia64/xen/dom0_ops.c | 25 ++++++++++++------------- xen/arch/ia64/xen/mm.c | 19 +++++++++---------- 3 files changed, 28 insertions(+), 30 deletions(-) diff -r a868bd4236e6 -r 0ace9a451a25 xen/arch/ia64/vmx/vmx_hypercall.c --- a/xen/arch/ia64/vmx/vmx_hypercall.c Fri Jan 18 13:49:48 2008 -0700 +++ b/xen/arch/ia64/vmx/vmx_hypercall.c Fri Jan 18 13:55:26 2008 -0700 @@ -53,7 +53,7 @@ static int hvmop_set_isa_irq_level( if ( op.isa_irq > 15 ) return -EINVAL; - d = get_domain_by_id(op.domid); + d = rcu_lock_domain_by_id(op.domid); if ( d == NULL ) return -ESRCH; @@ -65,7 +65,7 @@ static int hvmop_set_isa_irq_level( viosapic_set_irq(d, op.isa_irq, op.level); out: - put_domain(d); + rcu_unlock_domain(d); return rc; } @@ -85,7 +85,7 @@ static int hvmop_set_pci_intx_level( if ( (op.domain > 0) || (op.bus > 0) || (op.device > 31) || (op.intx > 3) ) return -EINVAL; - d = get_domain_by_id(op.domid); + d = rcu_lock_domain_by_id(op.domid); if ( d == NULL ) return -ESRCH; @@ -97,7 +97,7 @@ static int hvmop_set_pci_intx_level( viosapic_set_pci_irq(d, op.device, op.intx, op.level); out: - put_domain(d); + rcu_unlock_domain(d); return rc; } @@ -122,10 +122,10 @@ do_hvm_op(unsigned long op, XEN_GUEST_HA return -EINVAL; if (a.domid == DOMID_SELF) { - d = get_current_domain(); + d = rcu_lock_current_domain(); } else if (IS_PRIV(current->domain)) { - d = get_domain_by_id(a.domid); + d = rcu_lock_domain_by_id(a.domid); if (d == NULL) return -ESRCH; } @@ -167,7 +167,7 @@ do_hvm_op(unsigned long op, XEN_GUEST_HA rc = copy_to_guest(arg, &a, 1) ? -EFAULT : 0; } - put_domain(d); + rcu_unlock_domain(d); break; } diff -r a868bd4236e6 -r 0ace9a451a25 xen/arch/ia64/xen/dom0_ops.c --- a/xen/arch/ia64/xen/dom0_ops.c Fri Jan 18 13:49:48 2008 -0700 +++ b/xen/arch/ia64/xen/dom0_ops.c Fri Jan 18 13:55:26 2008 -0700 @@ -44,7 +44,7 @@ long arch_do_domctl(xen_domctl_t *op, XE case XEN_DOMCTL_getmemlist: { unsigned long i; - struct domain *d = get_domain_by_id(op->domain); + struct domain *d = rcu_lock_domain_by_id(op->domain); unsigned long start_page = op->u.getmemlist.start_pfn; unsigned long nr_pages = op->u.getmemlist.max_pfns; uint64_t mfn; @@ -72,15 +72,14 @@ long arch_do_domctl(xen_domctl_t *op, XE op->u.getmemlist.num_pfns = i; if (copy_to_guest(u_domctl, op, 1)) ret = -EFAULT; - - put_domain(d); + rcu_unlock_domain(d); } break; case XEN_DOMCTL_arch_setup: { xen_domctl_arch_setup_t *ds = &op->u.arch_setup; - struct domain *d = get_domain_by_id(op->domain); + struct domain *d = rcu_lock_domain_by_id(op->domain); if ( d == NULL) { ret = -EINVAL; @@ -155,7 +154,7 @@ long arch_do_domctl(xen_domctl_t *op, XE } } - put_domain(d); + rcu_unlock_domain(d); } break; @@ -163,11 +162,11 @@ long arch_do_domctl(xen_domctl_t *op, XE { struct domain *d; ret = -ESRCH; - d = get_domain_by_id(op->domain); + d = rcu_lock_domain_by_id(op->domain); if ( d != NULL ) { ret = shadow_mode_control(d, &op->u.shadow_op); - put_domain(d); + rcu_unlock_domain(d); if (copy_to_guest(u_domctl, op, 1)) ret = -EFAULT; } @@ -182,7 +181,7 @@ long arch_do_domctl(xen_domctl_t *op, XE unsigned int lp = fp + np - 1; ret = -ESRCH; - d = get_domain_by_id(op->domain); + d = rcu_lock_domain_by_id(op->domain); if (unlikely(d == NULL)) break; @@ -195,7 +194,7 @@ long arch_do_domctl(xen_domctl_t *op, XE ret = ioports_deny_access(d, fp, lp); } - put_domain(d); + rcu_unlock_domain(d); } break; @@ -205,7 +204,7 @@ long arch_do_domctl(xen_domctl_t *op, XE struct vcpu *v; ret = -ESRCH; - d = get_domain_by_id(op->domain); + d = rcu_lock_domain_by_id(op->domain); if ( d == NULL ) break; @@ -234,7 +233,7 @@ long arch_do_domctl(xen_domctl_t *op, XE } sendtrigger_out: - put_domain(d); + rcu_unlock_domain(d); } break; @@ -347,7 +346,7 @@ long arch_do_domctl(xen_domctl_t *op, XE case XEN_DOMCTL_set_opt_feature: { struct xen_ia64_opt_feature *optf = &op->u.set_opt_feature.optf; - struct domain *d = get_domain_by_id(op->domain); + struct domain *d = rcu_lock_domain_by_id(op->domain); if (d == NULL) { ret = -EINVAL; @@ -355,7 +354,7 @@ long arch_do_domctl(xen_domctl_t *op, XE } ret = domain_opt_feature(d, optf); - put_domain(d); + rcu_unlock_domain(d); } break; diff -r a868bd4236e6 -r 0ace9a451a25 xen/arch/ia64/xen/mm.c --- a/xen/arch/ia64/xen/mm.c Fri Jan 18 13:49:48 2008 -0700 +++ b/xen/arch/ia64/xen/mm.c Fri Jan 18 13:55:26 2008 -0700 @@ -1473,7 +1473,7 @@ __dom0vp_add_physmap(struct domain* d, u if (flags & (ASSIGN_nocache | ASSIGN_pgc_allocated)) return -EINVAL; - rd = get_domain_by_id(domid); + rd = rcu_lock_domain_by_id(domid); if (unlikely(rd == NULL)) { switch (domid) { case DOMID_XEN: @@ -1489,7 +1489,7 @@ __dom0vp_add_physmap(struct domain* d, u return -ESRCH; } BUG_ON(rd == NULL); - get_knownalive_domain(rd); + rcu_lock_domain(rd); } if (unlikely(rd == d)) @@ -1512,7 +1512,7 @@ __dom0vp_add_physmap(struct domain* d, u //don't update p2m table because this page belongs to rd, not d. perfc_incr(dom0vp_add_physmap); out1: - put_domain(rd); + rcu_unlock_domain(rd); return error; } @@ -2785,17 +2785,16 @@ arch_memory_op(int op, XEN_GUEST_HANDLE( if (copy_from_guest(&xatp, arg, 1)) return -EFAULT; - if (xatp.domid == DOMID_SELF) { - d = get_current_domain(); - } + if (xatp.domid == DOMID_SELF) + d = rcu_lock_current_domain(); else if (!IS_PRIV(current->domain)) return -EPERM; - else if ((d = get_domain_by_id(xatp.domid)) == NULL) + else if ((d = rcu_lock_domain_by_id(xatp.domid)) == NULL) return -ESRCH; /* This hypercall is used for VT-i domain only */ if (!VMX_DOMAIN(d->vcpu[0])) { - put_domain(d); + rcu_unlock_domain(d); return -ENOSYS; } @@ -2821,7 +2820,7 @@ arch_memory_op(int op, XEN_GUEST_HANDLE( } if (mfn == 0) { - put_domain(d); + rcu_unlock_domain(d); return -EINVAL; } @@ -2853,7 +2852,7 @@ arch_memory_op(int op, XEN_GUEST_HANDLE( out: UNLOCK_BIGLOCK(d); - put_domain(d); + rcu_unlock_domain(d); break; } _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |