All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] xen/pv: Improvements to construct_dom0()
@ 2021-08-16 11:19 Jane Malalane
  2021-08-16 11:19 ` [PATCH 1/2] x86/pv: remove unnecessary use of goto out in construct_dom0() Jane Malalane
  2021-08-16 11:19 ` [PATCH 2/2] x86/pv: Provide more helpful error when CONFIG_PV32 is absent Jane Malalane
  0 siblings, 2 replies; 4+ messages in thread
From: Jane Malalane @ 2021-08-16 11:19 UTC (permalink / raw)
  To: Xen-devel
  Cc: Jane Malalane, Jan Beulich, Andrew Cooper, Roger Pau Monné, Wei Liu

Jane Malalane (2):
  x86/pv: remove unnecessary use of goto out in construct_dom0()
  x86/pv: Provide more helpful error when CONFIG_PV32 is absent

 xen/arch/x86/pv/dom0_build.c | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)

-- 
2.11.0



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

* [PATCH 1/2] x86/pv: remove unnecessary use of goto out in construct_dom0()
  2021-08-16 11:19 [PATCH 0/2] xen/pv: Improvements to construct_dom0() Jane Malalane
@ 2021-08-16 11:19 ` Jane Malalane
  2021-08-16 11:19 ` [PATCH 2/2] x86/pv: Provide more helpful error when CONFIG_PV32 is absent Jane Malalane
  1 sibling, 0 replies; 4+ messages in thread
From: Jane Malalane @ 2021-08-16 11:19 UTC (permalink / raw)
  To: Xen-devel
  Cc: Jane Malalane, Jan Beulich, Andrew Cooper, Roger Pau Monné, Wei Liu

elf_check_broken() only needs to be invoked after elf_xen_parse() and
after elf_load_binary().

Suggested-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Jane Malalane <jane.malalane@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
CC: Jan Beulich <jbeulich@suse.com>
CC: Andrew Cooper <andrew.cooper3@citrix.com>
CC: "Roger Pau Monné" <roger.pau@citrix.com>
CC: Wei Liu <wl@xen.org>

v2:
 * add into series
 * fixup ordering error with CONFIG_PV32 change
---
 xen/arch/x86/pv/dom0_build.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/xen/arch/x86/pv/dom0_build.c b/xen/arch/x86/pv/dom0_build.c
index af47615b22..8712baccc1 100644
--- a/xen/arch/x86/pv/dom0_build.c
+++ b/xen/arch/x86/pv/dom0_build.c
@@ -400,8 +400,7 @@ int __init dom0_construct_pv(struct domain *d,
     if ( !compatible )
     {
         printk("Mismatch between Xen and DOM0 kernel\n");
-        rc = -EINVAL;
-        goto out;
+        return -EINVAL;
     }
 
     if ( parms.elf_notes[XEN_ELFNOTE_SUPPORTED_FEATURES].type != XEN_ENT_NONE )
@@ -409,8 +408,7 @@ int __init dom0_construct_pv(struct domain *d,
         if ( !pv_shim && !test_bit(XENFEAT_dom0, parms.f_supported) )
         {
             printk("Kernel does not support Dom0 operation\n");
-            rc = -EINVAL;
-            goto out;
+            return -EINVAL;
         }
     }
 
@@ -607,8 +605,7 @@ int __init dom0_construct_pv(struct domain *d,
          : (v_start < HYPERVISOR_VIRT_END) && (v_end > HYPERVISOR_VIRT_START) )
     {
         printk("DOM0 image overlaps with Xen private area.\n");
-        rc = -EINVAL;
-        goto out;
+        return -EINVAL;
     }
 
     if ( compat )
@@ -753,8 +750,7 @@ int __init dom0_construct_pv(struct domain *d,
             mapcache_override_current(NULL);
             switch_cr3_cr4(current->arch.cr3, read_cr4());
             printk("Invalid HYPERCALL_PAGE field in ELF notes.\n");
-            rc = -EINVAL;
-            goto out;
+            return -EINVAL;
         }
         init_hypercall_page(d, _p(parms.virt_hypercall));
     }
-- 
2.11.0



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

* [PATCH 2/2] x86/pv: Provide more helpful error when CONFIG_PV32 is absent
  2021-08-16 11:19 [PATCH 0/2] xen/pv: Improvements to construct_dom0() Jane Malalane
  2021-08-16 11:19 ` [PATCH 1/2] x86/pv: remove unnecessary use of goto out in construct_dom0() Jane Malalane
@ 2021-08-16 11:19 ` Jane Malalane
  2021-08-16 11:40   ` Jan Beulich
  1 sibling, 1 reply; 4+ messages in thread
From: Jane Malalane @ 2021-08-16 11:19 UTC (permalink / raw)
  To: Xen-devel
  Cc: Jane Malalane, Jan Beulich, Andrew Cooper, Roger Pau Monné, Wei Liu

Currently, when booting a 32bit dom0 kernel, the message isn't very
helpful:

  (XEN)  Xen  kernel: 64-bit, lsb
  (XEN)  Dom0 kernel: 32-bit, PAE, lsb, paddr 0x100000 -> 0x112000
  (XEN) Mismatch between Xen and DOM0 kernel
  (XEN)
  (XEN) ****************************************
  (XEN) Panic on CPU 0:
  (XEN) Could not construct domain 0
  (XEN) ****************************************

With this adjustment, it now looks like this:

  (XEN)  Xen  kernel: 64-bit, lsb
  (XEN) Found 32-bit PV kernel, but CONFIG_PV32 missing
  (XEN)
  (XEN) ****************************************
  (XEN) Panic on CPU 0:
  (XEN) Could not construct domain 0
  (XEN) ****************************************

Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Jane Malalane <jane.malalane@citrix.com>
---
CC: Jan Beulich <jbeulich@suse.com>
CC: Andrew Cooper <andrew.cooper3@citrix.com>
CC: "Roger Pau Monné" <roger.pau@citrix.com>
CC: Wei Liu <wl@xen.org>

v2:
 * switch to EOPNOTSUPP
---
 xen/arch/x86/pv/dom0_build.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/pv/dom0_build.c b/xen/arch/x86/pv/dom0_build.c
index 8712baccc1..d5a1a6a4e2 100644
--- a/xen/arch/x86/pv/dom0_build.c
+++ b/xen/arch/x86/pv/dom0_build.c
@@ -362,9 +362,9 @@ int __init dom0_construct_pv(struct domain *d,
     compatible = false;
     machine = elf_uval(&elf, elf.ehdr, e_machine);
 
-#ifdef CONFIG_PV32
     if ( elf_32bit(&elf) )
     {
+#ifdef CONFIG_PV32
         if ( parms.pae == XEN_PAE_BIMODAL )
             parms.pae = XEN_PAE_EXTCR3;
         if ( parms.pae && machine == EM_386 )
@@ -377,8 +377,11 @@ int __init dom0_construct_pv(struct domain *d,
 
             compatible = true;
         }
-    }
+#else
+        printk("Found 32-bit PV kernel, but CONFIG_PV32 missing\n");
+        return -EOPNOTSUPP;
 #endif
+    }
 
     compat = is_pv_32bit_domain(d);
 
-- 
2.11.0



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

* Re: [PATCH 2/2] x86/pv: Provide more helpful error when CONFIG_PV32 is absent
  2021-08-16 11:19 ` [PATCH 2/2] x86/pv: Provide more helpful error when CONFIG_PV32 is absent Jane Malalane
@ 2021-08-16 11:40   ` Jan Beulich
  0 siblings, 0 replies; 4+ messages in thread
From: Jan Beulich @ 2021-08-16 11:40 UTC (permalink / raw)
  To: Jane Malalane; +Cc: Andrew Cooper, Roger Pau Monné, Wei Liu, Xen-devel

On 16.08.2021 13:19, Jane Malalane wrote:
> Currently, when booting a 32bit dom0 kernel, the message isn't very
> helpful:
> 
>   (XEN)  Xen  kernel: 64-bit, lsb
>   (XEN)  Dom0 kernel: 32-bit, PAE, lsb, paddr 0x100000 -> 0x112000
>   (XEN) Mismatch between Xen and DOM0 kernel
>   (XEN)
>   (XEN) ****************************************
>   (XEN) Panic on CPU 0:
>   (XEN) Could not construct domain 0
>   (XEN) ****************************************
> 
> With this adjustment, it now looks like this:
> 
>   (XEN)  Xen  kernel: 64-bit, lsb
>   (XEN) Found 32-bit PV kernel, but CONFIG_PV32 missing
>   (XEN)
>   (XEN) ****************************************
>   (XEN) Panic on CPU 0:
>   (XEN) Could not construct domain 0
>   (XEN) ****************************************
> 
> Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
> Signed-off-by: Jane Malalane <jane.malalane@citrix.com>

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



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

end of thread, other threads:[~2021-08-16 11:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-16 11:19 [PATCH 0/2] xen/pv: Improvements to construct_dom0() Jane Malalane
2021-08-16 11:19 ` [PATCH 1/2] x86/pv: remove unnecessary use of goto out in construct_dom0() Jane Malalane
2021-08-16 11:19 ` [PATCH 2/2] x86/pv: Provide more helpful error when CONFIG_PV32 is absent Jane Malalane
2021-08-16 11:40   ` 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.