diff options
author | Keir Fraser <keir@xen.org> | 2010-11-18 12:26:27 +0000 |
---|---|---|
committer | Keir Fraser <keir@xen.org> | 2010-11-18 12:26:27 +0000 |
commit | 6020fcb84859f63343a74f46bf2f2d3d8e5a195c (patch) | |
tree | 1bdf67153b6ed3e95b111e4f6b5d23a8a959041f /xen/arch/x86/physdev.c | |
parent | 652ec2d1ec8c2c79dce01dc9136c0dfefeabc13e (diff) | |
download | xen-6020fcb84859f63343a74f46bf2f2d3d8e5a195c.tar.gz xen-6020fcb84859f63343a74f46bf2f2d3d8e5a195c.tar.bz2 xen-6020fcb84859f63343a74f46bf2f2d3d8e5a195c.zip |
rcu_lock(current->domain) does not need to disable preemption.
If the guest sleeps in hypervisor context, it should not be destroyed
until execution reaches a safe point (i.e., guest context). This is
not implemented yet. :-) But the next patch will rely on it, to allow
an HVM guest to execute hypercalls that indirectly invoke __hvm_copy()
within an rcu_lock_current_domain() region.
Signed-off-by: Keir Fraser <keir@xen.org>
Diffstat (limited to 'xen/arch/x86/physdev.c')
-rw-r--r-- | xen/arch/x86/physdev.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/xen/arch/x86/physdev.c b/xen/arch/x86/physdev.c index 6a12f0013e..7f8e71a28b 100644 --- a/xen/arch/x86/physdev.c +++ b/xen/arch/x86/physdev.c @@ -37,10 +37,8 @@ static int physdev_map_pirq(struct physdev_map_pirq *map) if ( !map ) return -EINVAL; - if ( map->domid == DOMID_SELF ) - d = rcu_lock_domain(current->domain); - else - d = rcu_lock_domain_by_id(map->domid); + d = (map->domid == DOMID_SELF) ? rcu_lock_current_domain() + : rcu_lock_domain_by_id(map->domid); if ( d == NULL ) return -ESRCH; @@ -165,10 +163,8 @@ static int physdev_unmap_pirq(struct physdev_unmap_pirq *unmap) struct domain *d; int ret; - if ( unmap->domid == DOMID_SELF ) - d = rcu_lock_domain(current->domain); - else - d = rcu_lock_domain_by_id(unmap->domid); + d = (unmap->domid == DOMID_SELF) ? rcu_lock_current_domain() + : rcu_lock_domain_by_id(unmap->domid); if ( d == NULL ) return -ESRCH; |