Skip to contentSkip to conversation

xen/arm: domheap mappings can have avail > 0

PATCH Stefano Stabellini 2 participants 3 messages Apr 1, 2013 – Apr 4, 2013

lore
Share & tools
lore
#0 lore raw

We use 2 MB slots to map domain pages. As a consequence one slot can be used for more than one 4k page mapping.

Change the ASSERT to reflect that.

xen/arch/arm/mm.c +2 -2
index ae0394c..03e9083 100644
@@ -216,7 +216,7 @@ void unmap_domain_page(const void *va)
     local_irq_save(flags);
 
     ASSERT(slot >= 0 && slot < DOMHEAP_ENTRIES);
-    ASSERT(map[slot].pt.avail != 0);
+    ASSERT(map[slot].pt.avail > 0);
 
     map[slot].pt.avail--;
 
@@ -230,7 +230,7 @@ unsigned long domain_page_map_to_mfn(const void *va)
     unsigned long offset = ((unsigned long)va>>THIRD_SHIFT) & LPAE_ENTRY_MASK;
 
     ASSERT(slot >= 0 && slot < DOMHEAP_ENTRIES);
-    ASSERT(map[slot].pt.avail != 0);
+    ASSERT(map[slot].pt.avail > 0);
 
     return map[slot].pt.base + offset;
 }
#1 lore raw
Quoted 4 lines · Stefano Stabellini

We use 2 MB slots to map domain pages. As a consequence one slot can be used for more than one 4k page mapping.

Change the ASSERT to reflect that.

But it already does -- AFAICT this patch has no effect.

Tim.

Quoted 29 lines
xen/arch/arm/mm.c +2 -2
index ae0394c..03e9083 100644
@@ -216,7 +216,7 @@ void unmap_domain_page(const void *va)
     local_irq_save(flags);
 
     ASSERT(slot >= 0 && slot < DOMHEAP_ENTRIES);
-    ASSERT(map[slot].pt.avail != 0);
+    ASSERT(map[slot].pt.avail > 0);
 
     map[slot].pt.avail--;
 
@@ -230,7 +230,7 @@ unsigned long domain_page_map_to_mfn(const void *va)
     unsigned long offset = ((unsigned long)va>>THIRD_SHIFT) & LPAE_ENTRY_MASK;
 
     ASSERT(slot >= 0 && slot < DOMHEAP_ENTRIES);
-    ASSERT(map[slot].pt.avail != 0);
+    ASSERT(map[slot].pt.avail > 0);
 
     return map[slot].pt.base + offset;
 }

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#2 lore raw
Quoted 8 lines · Tim Deegan
Quoted 4 lines · Stefano Stabellini

We use 2 MB slots to map domain pages. As a consequence one slot can be used for more than one 4k page mapping.

Change the ASSERT to reflect that.

But it already does -- AFAICT this patch has no effect.

Yes, you are right, sorry

Quoted 31 lines
Quoted 30 lines
xen/arch/arm/mm.c +2 -2
index ae0394c..03e9083 100644
@@ -216,7 +216,7 @@ void unmap_domain_page(const void *va)
     local_irq_save(flags);
 
     ASSERT(slot >= 0 && slot < DOMHEAP_ENTRIES);
-    ASSERT(map[slot].pt.avail != 0);
+    ASSERT(map[slot].pt.avail > 0);
 
     map[slot].pt.avail--;
 
@@ -230,7 +230,7 @@ unsigned long domain_page_map_to_mfn(const void *va)
     unsigned long offset = ((unsigned long)va>>THIRD_SHIFT) & LPAE_ENTRY_MASK;
 
     ASSERT(slot >= 0 && slot < DOMHEAP_ENTRIES);
-    ASSERT(map[slot].pt.avail != 0);
+    ASSERT(map[slot].pt.avail > 0);
 
     return map[slot].pt.base + offset;
 }

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel