[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] x86/pv: Fold adjacent paths in dom0_construct_pv()


  • To: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Mon, 19 Apr 2021 15:45:40 +0100
  • Authentication-results: esa3.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Jan Beulich <JBeulich@xxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Mon, 19 Apr 2021 14:45:57 +0000
  • Ironport-hdrordr: A9a23:4tO3i6Gau51hla97pLqEDseALOonbusQ8zAX/mpaICY1TuWzkc eykPMHkSLugDEKV3063fyGMq+MQXTTnKQFh7U5F7GkQQXgpS+UPJhvhLGSpAHINiXi+odmpM RdWodkDtmYNzdHpOLbxCX9LNo62tmA98mT9IPj5lNgVxtjZa0lzyoRMHf4LmRMSANLBYU0Gf Onj6ItzVfNRV0tYtmmHX5AZuDfprTw5evbSCQbDB0q4hTmt1OVwYP9eiL34j4uFxdGwbIv6g H+4mnE2pk=
  • Ironport-sdr: lmefLMuL0TWaSLNn1CmkCHo/heNOMhdehFGMFTk3fL0AGWjO/ypUVFnX3L9Z29NcV1HGFykjDU /FQCdATxDkRUPwoOkRu9Do7yUMa4crmEeDkETeb29Ss1Gfrhsm2D+KZARpbi2wYxc7bCiZJYPw 49uMmbRJHnU1FvAxdBtQjawxmAk+H9Sh1ZpbscuppUeYk5sAerRzxYVnltWEMkrUlBfdn1k3f4 2b8ULalUCc9ysXLBRhWQ3mtExvkb726pbfacSi69l63WQmhDgxFD+rvyNwVyvBA/qNep5kOI4Y gmo=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

This removes a visually-werid layout of conditionals.

Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
CC: Jan Beulich <JBeulich@xxxxxxxx>
CC: Roger Pau Monné <roger.pau@xxxxxxxxxx>
CC: Wei Liu <wl@xxxxxxx>
---
 xen/arch/x86/pv/dom0_build.c | 17 +++++++----------
 1 file changed, 7 insertions(+), 10 deletions(-)

diff --git a/xen/arch/x86/pv/dom0_build.c b/xen/arch/x86/pv/dom0_build.c
index e0801a9e6d..0ea906d6f8 100644
--- a/xen/arch/x86/pv/dom0_build.c
+++ b/xen/arch/x86/pv/dom0_build.c
@@ -615,9 +615,14 @@ int __init dom0_construct_pv(struct domain *d,
     {
         v->arch.pv.failsafe_callback_cs = FLAT_COMPAT_KERNEL_CS;
         v->arch.pv.event_callback_cs    = FLAT_COMPAT_KERNEL_CS;
-    }
 
-    if ( !compat )
+        /* Monitor table already created by switch_compat(). */
+        l4start = l4tab = __va(pagetable_get_paddr(v->arch.guest_table));
+        /* See public/xen.h on why the following is needed. */
+        maddr_to_page(mpt_alloc)->u.inuse.type_info = PGT_l3_page_table;
+        l3start = __va(mpt_alloc); mpt_alloc += PAGE_SIZE;
+    }
+    else
     {
         maddr_to_page(mpt_alloc)->u.inuse.type_info = PGT_l4_page_table;
         l4start = l4tab = __va(mpt_alloc); mpt_alloc += PAGE_SIZE;
@@ -626,14 +631,6 @@ int __init dom0_construct_pv(struct domain *d,
                           d, INVALID_MFN, true);
         v->arch.guest_table = pagetable_from_paddr(__pa(l4start));
     }
-    else
-    {
-        /* Monitor table already created by switch_compat(). */
-        l4start = l4tab = __va(pagetable_get_paddr(v->arch.guest_table));
-        /* See public/xen.h on why the following is needed. */
-        maddr_to_page(mpt_alloc)->u.inuse.type_info = PGT_l3_page_table;
-        l3start = __va(mpt_alloc); mpt_alloc += PAGE_SIZE;
-    }
 
     l4tab += l4_table_offset(v_start);
     pfn = alloc_spfn;
-- 
2.11.0




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.