From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [PATCH] x86/HAP: drop pointless assertions Date: Tue, 22 Apr 2014 13:32:16 +0100 Message-ID: <53566150.5050704@citrix.com> References: <53566EF9020000780000AB5A@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2409070338324279009==" Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WcZsE-0007lM-Ic for xen-devel@lists.xenproject.org; Tue, 22 Apr 2014 12:32:30 +0000 In-Reply-To: <53566EF9020000780000AB5A@nat28.tlf.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich Cc: xen-devel , Tim Deegan List-Id: xen-devel@lists.xenproject.org --===============2409070338324279009== Content-Type: multipart/alternative; boundary="------------010202080304070603010604" --------------010202080304070603010604 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit On 22/04/14 12:30, Jan Beulich wrote: > 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(). > > Signed-off-by: Jan Beulich Reviewed-by: Andrew Cooper > > --- a/xen/arch/x86/mm/hap/hap.c > +++ b/xen/arch/x86/mm/hap/hap.c > @@ -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 > Xen-devel@lists.xen.org > http://lists.xen.org/xen-devel --------------010202080304070603010604 Content-Type: text/html; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit
On 22/04/14 12:30, Jan Beulich wrote:
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().

Signed-off-by: Jan Beulich <jbeulich@suse.com>

Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>


--- a/xen/arch/x86/mm/hap/hap.c
+++ b/xen/arch/x86/mm/hap/hap.c
@@ -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
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

--------------010202080304070603010604-- --===============2409070338324279009== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --===============2409070338324279009==--