ia64/xen-unstable
changeset 18724:efc0a4065ee1
x86_32: Lock in map_domain_page() may be taken with IRQs disabled, and
hence must *always* disable IRQs.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
hence must *always* disable IRQs.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author | Keir Fraser <keir.fraser@citrix.com> |
---|---|
date | Mon Oct 27 10:49:20 2008 +0000 (2008-10-27) |
parents | b99ab7f88a82 |
children | 9e47e72fd03e |
files | xen/arch/x86/x86_32/domain_page.c |
line diff
1.1 --- a/xen/arch/x86/x86_32/domain_page.c Mon Oct 27 10:29:39 2008 +0000 1.2 +++ b/xen/arch/x86/x86_32/domain_page.c Mon Oct 27 10:49:20 2008 +0000 1.3 @@ -43,7 +43,7 @@ static inline struct vcpu *mapcache_curr 1.4 void *map_domain_page(unsigned long mfn) 1.5 { 1.6 unsigned long va; 1.7 - unsigned int idx, i; 1.8 + unsigned int idx, i, flags; 1.9 struct vcpu *v; 1.10 struct mapcache_domain *dcache; 1.11 struct mapcache_vcpu *vcache; 1.12 @@ -69,7 +69,7 @@ void *map_domain_page(unsigned long mfn) 1.13 goto out; 1.14 } 1.15 1.16 - spin_lock(&dcache->lock); 1.17 + spin_lock_irqsave(&dcache->lock, flags); 1.18 1.19 /* Has some other CPU caused a wrap? We must flush if so. */ 1.20 if ( unlikely(dcache->epoch != vcache->shadow_epoch) ) 1.21 @@ -105,7 +105,7 @@ void *map_domain_page(unsigned long mfn) 1.22 set_bit(idx, dcache->inuse); 1.23 dcache->cursor = idx + 1; 1.24 1.25 - spin_unlock(&dcache->lock); 1.26 + spin_unlock_irqrestore(&dcache->lock, flags); 1.27 1.28 l1e_write(&dcache->l1tab[idx], l1e_from_pfn(mfn, __PAGE_HYPERVISOR)); 1.29