mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
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
This commit is contained in:
1 parent
2a022479a2
commit
e5dc435210
1 file changed
+10
@@ -44,6 +44,9 @@ void *map_domain_mem(unsigned long pa)
|
||||
unsigned long va;
|
||||
unsigned int idx, cpu = smp_processor_id();
|
||||
unsigned long *cache = mapcache;
|
||||
#ifndef NDEBUG
|
||||
unsigned flush_count = 0;
|
||||
#endif
|
||||
|
||||
ASSERT(!in_irq());
|
||||
perfc_incrc(map_domain_mem_count);
|
||||
@@ -66,6 +69,13 @@ void *map_domain_mem(unsigned long pa)
|
||||
perfc_incrc(domain_page_tlb_flush);
|
||||
local_flush_tlb();
|
||||
shadow_epoch[cpu] = ++epoch;
|
||||
#ifndef NDEBUG
|
||||
if ( unlikely(flush_count++) )
|
||||
{
|
||||
// we've run out of map cache entries...
|
||||
BUG();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
while ( cache[idx] != 0 );
|
||||
|
||||