ia64/xen-unstable
changeset 3926:256ed63cbd2c
bitkeeper revision 1.1236.3.1 (421f2a35S4BT09otLbDXG1U-Qs355g)
Added some defensive code to notice when we're run out of
map cache entries.
Signed-off-by: michael.fetterman@cl.cam.ac.uk
Added some defensive code to notice when we're run out of
map cache entries.
Signed-off-by: michael.fetterman@cl.cam.ac.uk
author | maf46@burn.cl.cam.ac.uk |
---|---|
date | Fri Feb 25 13:37:57 2005 +0000 (2005-02-25) |
parents | 1e288d225372 |
children | 55293083a741 |
files | xen/arch/x86/x86_32/domain_page.c |
line diff
1.1 --- a/xen/arch/x86/x86_32/domain_page.c Tue Feb 22 15:04:00 2005 +0000 1.2 +++ b/xen/arch/x86/x86_32/domain_page.c Fri Feb 25 13:37:57 2005 +0000 1.3 @@ -44,6 +44,9 @@ void *map_domain_mem(unsigned long pa) 1.4 unsigned long va; 1.5 unsigned int idx, cpu = smp_processor_id(); 1.6 unsigned long *cache = mapcache; 1.7 +#ifndef NDEBUG 1.8 + unsigned flush_count = 0; 1.9 +#endif 1.10 1.11 ASSERT(!in_irq()); 1.12 perfc_incrc(map_domain_mem_count); 1.13 @@ -66,6 +69,13 @@ void *map_domain_mem(unsigned long pa) 1.14 perfc_incrc(domain_page_tlb_flush); 1.15 local_flush_tlb(); 1.16 shadow_epoch[cpu] = ++epoch; 1.17 +#ifndef NDEBUG 1.18 + if ( unlikely(flush_count++) ) 1.19 + { 1.20 + // we've run out of map cache entries... 1.21 + BUG(); 1.22 + } 1.23 +#endif 1.24 } 1.25 } 1.26 while ( cache[idx] != 0 );