xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86/HAP: drop pointless assertions
@ 2014-04-22 11:30 Jan Beulich
  2014-04-22 12:32 ` Andrew Cooper
  2014-04-24 11:47 ` Tim Deegan
  0 siblings, 2 replies; 3+ messages in thread
From: Jan Beulich @ 2014-04-22 11:30 UTC (permalink / raw)
  To: xen-devel; +Cc: Tim Deegan

[-- Attachment #1: Type: text/plain, Size: 927 bytes --]

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>

--- 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],




[-- Attachment #2: x86-HAP-pointless-asserts.patch --]
[-- Type: text/plain, Size: 959 bytes --]

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().

Signed-off-by: Jan Beulich <jbeulich@suse.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],

[-- Attachment #3: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] x86/HAP: drop pointless assertions
  2014-04-22 11:30 [PATCH] x86/HAP: drop pointless assertions Jan Beulich
@ 2014-04-22 12:32 ` Andrew Cooper
  2014-04-24 11:47 ` Tim Deegan
  1 sibling, 0 replies; 3+ messages in thread
From: Andrew Cooper @ 2014-04-22 12:32 UTC (permalink / raw)
  To: Jan Beulich; +Cc: xen-devel, Tim Deegan


[-- Attachment #1.1: Type: text/plain, Size: 1188 bytes --]

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


[-- Attachment #1.2: Type: text/html, Size: 2060 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] x86/HAP: drop pointless assertions
  2014-04-22 11:30 [PATCH] x86/HAP: drop pointless assertions Jan Beulich
  2014-04-22 12:32 ` Andrew Cooper
@ 2014-04-24 11:47 ` Tim Deegan
  1 sibling, 0 replies; 3+ messages in thread
From: Tim Deegan @ 2014-04-24 11:47 UTC (permalink / raw)
  To: Jan Beulich; +Cc: xen-devel

At 12:30 +0100 on 22 Apr (1398166233), 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>

Applied, thanks.

Tim.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-04-24 11:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-22 11:30 [PATCH] x86/HAP: drop pointless assertions Jan Beulich
2014-04-22 12:32 ` Andrew Cooper
2014-04-24 11:47 ` Tim Deegan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).