All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86/pv: Fold adjacent paths in dom0_construct_pv()
@ 2021-04-19 14:45 Andrew Cooper
  2021-04-19 15:58 ` Jan Beulich
  0 siblings, 1 reply; 2+ messages in thread
From: Andrew Cooper @ 2021-04-19 14:45 UTC (permalink / raw)
  To: Xen-devel; +Cc: Andrew Cooper, Jan Beulich, Roger Pau Monné, Wei Liu

This removes a visually-werid layout of conditionals.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Roger Pau Monné <roger.pau@citrix.com>
CC: Wei Liu <wl@xen.org>
---
 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



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

* Re: [PATCH] x86/pv: Fold adjacent paths in dom0_construct_pv()
  2021-04-19 14:45 [PATCH] x86/pv: Fold adjacent paths in dom0_construct_pv() Andrew Cooper
@ 2021-04-19 15:58 ` Jan Beulich
  0 siblings, 0 replies; 2+ messages in thread
From: Jan Beulich @ 2021-04-19 15:58 UTC (permalink / raw)
  To: Andrew Cooper; +Cc: Roger Pau Monné, Wei Liu, Xen-devel

On 19.04.2021 16:45, Andrew Cooper wrote:
> This removes a visually-werid layout of conditionals.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

I don't mind the rearrangement, so
Acked-by: Jan Beulich <jbeulich@suse.com>
but I think it was done for a reason - to keep separate steps
separate.

Jan


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

end of thread, other threads:[~2021-04-19 15:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-19 14:45 [PATCH] x86/pv: Fold adjacent paths in dom0_construct_pv() Andrew Cooper
2021-04-19 15:58 ` Jan Beulich

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.