All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86: don't open-code vmap_to_mfn()
@ 2020-10-26 15:53 Jan Beulich
  2020-10-26 15:59 ` Wei Liu
  0 siblings, 1 reply; 2+ messages in thread
From: Jan Beulich @ 2020-10-26 15:53 UTC (permalink / raw)
  To: xen-devel@lists.xenproject.org
  Cc: Andrew Cooper, Wei Liu, Roger Pau Monné

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

--- a/xen/arch/x86/domain_page.c
+++ b/xen/arch/x86/domain_page.c
@@ -333,21 +333,14 @@ void unmap_domain_page_global(const void
 mfn_t domain_page_map_to_mfn(const void *ptr)
 {
     unsigned long va = (unsigned long)ptr;
-    const l1_pgentry_t *pl1e;
 
     if ( va >= DIRECTMAP_VIRT_START )
         return _mfn(virt_to_mfn(ptr));
 
     if ( va >= VMAP_VIRT_START && va < VMAP_VIRT_END )
-    {
-        pl1e = virt_to_xen_l1e(va);
-        BUG_ON(!pl1e);
-    }
-    else
-    {
-        ASSERT(va >= MAPCACHE_VIRT_START && va < MAPCACHE_VIRT_END);
-        pl1e = &__linear_l1_table[l1_linear_offset(va)];
-    }
+        return vmap_to_mfn(va);
 
-    return l1e_get_mfn(*pl1e);
+    ASSERT(va >= MAPCACHE_VIRT_START && va < MAPCACHE_VIRT_END);
+
+    return l1e_get_mfn(__linear_l1_table[l1_linear_offset(va)]);
 }


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

end of thread, other threads:[~2020-10-26 16:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-10-26 15:53 [PATCH] x86: don't open-code vmap_to_mfn() Jan Beulich
2020-10-26 15:59 ` Wei Liu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.