diff mbox series

xen/efi: Drop image_name from efi_arch_handle_cmdline()

Message ID 20231123113712.1933421-1-andrew.cooper3@citrix.com (mailing list archive)
State New, archived
Headers show
Series xen/efi: Drop image_name from efi_arch_handle_cmdline() | expand

Commit Message

Andrew Cooper Nov. 23, 2023, 11:37 a.m. UTC
With all architectures no longer wanting an image name in the command line
handling, drop the parameter and forgo making one up.

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>
CC: Stefano Stabellini <sstabellini@kernel.org>
CC: Julien Grall <julien@xen.org>
CC: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
CC: Bertrand Marquis <bertrand.marquis@arm.com>
CC: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/efi/efi-boot.h |  3 +--
 xen/arch/x86/efi/efi-boot.h |  3 +--
 xen/common/efi/boot.c       | 15 +--------------
 3 files changed, 3 insertions(+), 18 deletions(-)


base-commit: f96e2f64576cdbb147391c7cb399d393385719a9

Comments

Jan Beulich Nov. 23, 2023, 11:42 a.m. UTC | #1
On 23.11.2023 12:37, Andrew Cooper wrote:
> With all architectures no longer wanting an image name in the command line
> handling, drop the parameter and forgo making one up.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

Reviewed-by: Jan Beulich <jbeulich@suse.com>
Andrew Cooper Nov. 23, 2023, 11:43 a.m. UTC | #2
On 23/11/2023 11:42 am, Jan Beulich wrote:
> On 23.11.2023 12:37, Andrew Cooper wrote:
>> With all architectures no longer wanting an image name in the command line
>> handling, drop the parameter and forgo making one up.
>>
>> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> Reviewed-by: Jan Beulich <jbeulich@suse.com>

Thanks.

I'm quite surprised at how much cleanup this particular investigation
has yielded.

Definitely preferable to the first plan of using the const alias.

~Andrew
Julien Grall Nov. 23, 2023, 12:10 p.m. UTC | #3
Hi Andrew,

On 23/11/2023 11:37, Andrew Cooper wrote:
> With all architectures no longer wanting an image name in the command line
> handling, drop the parameter and forgo making one up.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

I am not sure if you need one Ack for the change in arm/efi/efi-boot.h. 
If you do:

Acked-by: Julien Grall <jgrall@amazon.com>

Cheers,
Luca Fancellu Nov. 23, 2023, 1:18 p.m. UTC | #4
> On 23 Nov 2023, at 11:37, Andrew Cooper <andrew.cooper3@citrix.com> wrote:
> 
> With all architectures no longer wanting an image name in the command line
> handling, drop the parameter and forgo making one up.
> 
> 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>
> CC: Stefano Stabellini <sstabellini@kernel.org>
> CC: Julien Grall <julien@xen.org>
> CC: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
> CC: Bertrand Marquis <bertrand.marquis@arm.com>
> CC: Michal Orzel <michal.orzel@amd.com>
> ---
> xen/arch/arm/efi/efi-boot.h |  3 +--

Tested on ARM board

Tested-by: Luca Fancellu <luca.fancellu@arm.com>
diff mbox series

Patch

diff --git a/xen/arch/arm/efi/efi-boot.h b/xen/arch/arm/efi/efi-boot.h
index 59d217667ff3..6e6db2445566 100644
--- a/xen/arch/arm/efi/efi-boot.h
+++ b/xen/arch/arm/efi/efi-boot.h
@@ -454,8 +454,7 @@  static void __init efi_arch_memory_setup(void)
 {
 }
 
-static void __init efi_arch_handle_cmdline(CHAR16 *image_name,
-                                           CHAR16 *cmdline_options,
+static void __init efi_arch_handle_cmdline(CHAR16 *cmdline_options,
                                            const char *cfgfile_options)
 {
     union string name;
diff --git a/xen/arch/x86/efi/efi-boot.h b/xen/arch/x86/efi/efi-boot.h
index 1a2a2dd83c9b..86467da301e5 100644
--- a/xen/arch/x86/efi/efi-boot.h
+++ b/xen/arch/x86/efi/efi-boot.h
@@ -303,8 +303,7 @@  static void __init efi_arch_cfg_file_late(const EFI_LOADED_IMAGE *image,
     }
 }
 
-static void __init efi_arch_handle_cmdline(CHAR16 *image_name,
-                                           CHAR16 *cmdline_options,
+static void __init efi_arch_handle_cmdline(CHAR16 *cmdline_options,
                                            const char *cfgfile_options)
 {
     union string name;
diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
index e5e86f22b2b2..61108199188f 100644
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -1462,21 +1462,8 @@  void EFIAPI __init noreturn efi_start(EFI_HANDLE ImageHandle,
             }
         }
 
-        /*
-         * EFI_LOAD_OPTION does not supply an image name as first component:
-         * Make one up.
-         */
-        if ( argc && !*argv )
-        {
-            EFI_FILE_HANDLE handle = get_parent_handle(loaded_image,
-                                                       &file_name);
-
-            handle->Close(handle);
-            *argv = file_name;
-        }
-
         name.s = get_value(&cfg, section.s, "options");
-        efi_arch_handle_cmdline(argc ? *argv : NULL, options, name.s);
+        efi_arch_handle_cmdline(options, name.s);
 
         if ( !base_video )
         {