All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86/pv: remove unnecessary use of goto out in construct_dom0()
@ 2021-08-13 11:02 Jane Malalane
  2021-08-13 14:06 ` Jan Beulich
  0 siblings, 1 reply; 2+ messages in thread
From: Jane Malalane @ 2021-08-13 11:02 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>
---
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>
---
 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



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

* Re: [PATCH] x86/pv: remove unnecessary use of goto out in construct_dom0()
  2021-08-13 11:02 [PATCH] x86/pv: remove unnecessary use of goto out in construct_dom0() Jane Malalane
@ 2021-08-13 14:06 ` Jan Beulich
  0 siblings, 0 replies; 2+ messages in thread
From: Jan Beulich @ 2021-08-13 14:06 UTC (permalink / raw)
  To: Jane Malalane; +Cc: Andrew Cooper, Roger Pau Monné, Wei Liu, Xen-devel

On 13.08.2021 13:02, Jane Malalane wrote:
> --- 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
>      }

Afaict here you're fixing up your own earlier patch, which hasn't gone
in yet. I did expect you to alter that patch and resubmit, to then
omit this hunk here (again in a resubmission). With that the patch here
Reviewed-by: Jan Beulich <jbeulich@suse.com>

Note that generally when a patch depends on another one which hasn't
been committed yet, you'd point out this fact in a post-commit-message
remark, so that reviewers (and possibly committer) are aware.

Jan



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

end of thread, other threads:[~2021-08-13 14:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-13 11:02 [PATCH] x86/pv: remove unnecessary use of goto out in construct_dom0() Jane Malalane
2021-08-13 14:06 ` 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.