Skip to contentSkip to conversation

x86/HAP: drop pointless assertions

PATCH Applied Jan Beulich 3 participants 3 messages Apr 22, 2014 – Apr 24, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/HAP: drop pointless assertions

Just like for shadow code, hap_map_domain_page() is just a thin wrapper around map_domain_page(), which cannot fail. Asserting its success is redundant.

hap_unmap_domain_page() should also not be used for something not mapped through hap_map_domain_page().

xen/arch/x86/mm/hap/hap.c +1 -3
@@ -233,9 +233,8 @@ static struct page_info *hap_alloc(struc
     d->arch.paging.hap.free_pages--;
 
     p = __map_domain_page(pg);
-    ASSERT(p != NULL);
     clear_page(p);
-    hap_unmap_domain_page(p);
+    unmap_domain_page(p);
 
     return pg;
 }
@@ -375,7 +374,6 @@ static void hap_install_xen_entries_in_l
     l4_pgentry_t *l4e;
 
     l4e = hap_map_domain_page(l4mfn);
-    ASSERT(l4e != NULL);
 
     /* Copy the common Xen mappings from the idle domain */
     memcpy(&l4e[ROOT_PAGETABLE_FIRST_XEN_SLOT],

x86/HAP: drop pointless assertions

Just like for shadow code, hap_map_domain_page() is just a thin wrapper around map_domain_page(), which cannot fail. Asserting its success is redundant.

hap_unmap_domain_page() should also not be used for something not mapped through hap_map_domain_page().

xen/arch/x86/mm/hap/hap.c +1 -3
@@ -233,9 +233,8 @@ static struct page_info *hap_alloc(struc
     d->arch.paging.hap.free_pages--;
 
     p = __map_domain_page(pg);
-    ASSERT(p != NULL);
     clear_page(p);
-    hap_unmap_domain_page(p);
+    unmap_domain_page(p);
 
     return pg;
 }
@@ -375,7 +374,6 @@ static void hap_install_xen_entries_in_l
     l4_pgentry_t *l4e;
 
     l4e = hap_map_domain_page(l4mfn);
-    ASSERT(l4e != NULL);
 
     /* Copy the common Xen mappings from the idle domain */
     memcpy(&l4e[ROOT_PAGETABLE_FIRST_XEN_SLOT],

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

Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Jan Beulich

Just like for shadow code, hap_map_domain_page() is just a thin wrapper around map_domain_page(), which cannot fail. Asserting its success is redundant.

hap_unmap_domain_page() should also not be used for something not mapped through hap_map_domain_page().

Quoted 27 lines
xen/arch/x86/mm/hap/hap.c +1 -3
@@ -233,9 +233,8 @@ static struct page_info *hap_alloc(struc
     d->arch.paging.hap.free_pages--;
 
     p = __map_domain_page(pg);
-    ASSERT(p != NULL);
     clear_page(p);
-    hap_unmap_domain_page(p);
+    unmap_domain_page(p);
 
     return pg;
 }
@@ -375,7 +374,6 @@ static void hap_install_xen_entries_in_l
     l4_pgentry_t *l4e;
 
     l4e = hap_map_domain_page(l4mfn);
-    ASSERT(l4e != NULL);
 
     /* Copy the common Xen mappings from the idle domain */
     memcpy(&l4e[ROOT_PAGETABLE_FIRST_XEN_SLOT],
Quoted 4 lines

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

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

Applied
#2 lore raw
In reply to Jan Beulich
Quoted 8 lines · Jan Beulich

Just like for shadow code, hap_map_domain_page() is just a thin wrapper around map_domain_page(), which cannot fail. Asserting its success is redundant.

hap_unmap_domain_page() should also not be used for something not mapped through hap_map_domain_page().

Applied, thanks.

Tim.