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

[PATCH] x86/pv: remove unnecessary use of goto out in construct_dom0()


  • To: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jane Malalane <jane.malalane@xxxxxxxxxx>
  • Date: Fri, 13 Aug 2021 12:02:24 +0100
  • Authentication-results: esa4.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: Jane Malalane <jane.malalane@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Fri, 13 Aug 2021 11:03:16 +0000
  • Ironport-hdrordr: A9a23:DTRa7q5/SDnBBYGujQPXwMTXdLJyesId70hD6qhwISY6TiX+rb HIoB17726RtN9/YhEdcLy7VJVoIkmskKKdg7NhXotKNTOO0ADDQb2KhbGSpQEIcBeeygcy78 hdmtBFeb/NMWQ=
  • Ironport-sdr: 4YCVcmoxdc15E5oYmarOCg8zC79FXxL3WKhjiS2pG7YwlBr9cehpVYzGO1S61bTve5aj3riibr wJJbxea1fpHNDiCiOXrkSYRrW2EIVBOeHxLj/0u5O5XXL6h/R4tp/aznQAxCFZjl3qRg8UP5E4 Zi48AyxWLJSD2i7cfWCDUfOix/g8inMqbJfVHES9e5RnOv/qywtnFh3UnPEePRHBBLRF8riTcL TPQPETzp3qx0E6ydkVCFcZlN3poTY42YBayHeFr8Z+7P/krU3wmDnzYv+x8+swjGqO0uhJi/+O EjpCJvVX2Sx9fFdw8Gy0J4Qw
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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

Suggested-by: Jan Beulich <jbeulich@xxxxxxxx>
Signed-off-by: Jane Malalane <jane.malalane@xxxxxxxxxx>
---
CC: Jan Beulich <jbeulich@xxxxxxxx>
CC: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
CC: "Roger Pau Monné" <roger.pau@xxxxxxxxxx>
CC: Wei Liu <wl@xxxxxxx>
---
 xen/arch/x86/pv/dom0_build.c | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/xen/arch/x86/pv/dom0_build.c b/xen/arch/x86/pv/dom0_build.c
index 80e6c6e35b..db1e1e5edd 100644
--- a/xen/arch/x86/pv/dom0_build.c
+++ b/xen/arch/x86/pv/dom0_build.c
@@ -379,8 +379,7 @@ int __init dom0_construct_pv(struct domain *d,
         }
 #else
         printk("Found 32-bit PV kernel, but CONFIG_PV32 missing\n");
-        rc = -ENODEV;
-        goto out;
+        return -ENODEV;
 #endif
     }
 
@@ -404,8 +403,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 )
@@ -413,8 +411,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;
         }
     }
 
@@ -611,8 +608,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 )
@@ -757,8 +753,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




 


Rackspace

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