-Wwrite-strings is unhappy with assigning "xen" to a mutable pointer, but this
logic looks incorrect.  It was inherited from the x86 side, where the logic
was redundant and has now been removed.

In the ARM case it inserts the image name into "xen,xen-bootargs" and there is
no logic at all to strip this before parsing it as the command line.

The absence of any logic to strip an image name suggests that it shouldn't
exist there, or having a Xen image named e.g. "hmp-unsafe" in the filesystem
is going to lead to some unexpected behaviour on boot.

No functional change.

Signed-off-by: Andrew Cooper <andrew.coop...@citrix.com>
---
CC: Jan Beulich <jbeul...@suse.com>
CC: Roger Pau Monné <roger....@citrix.com>
CC: Wei Liu <w...@xen.org>
CC: Stefano Stabellini <sstabell...@kernel.org>
CC: Julien Grall <jul...@xen.org>
CC: Volodymyr Babchuk <volodymyr_babc...@epam.com>
CC: Bertrand Marquis <bertrand.marq...@arm.com>
CC: Roberto Bagnara <roberto.bagn...@bugseng.com>
CC: Nicola Vetrini <nicola.vetr...@bugseng.com>

v2:
 * New.

I'm afraid that all of this reasoning is based on reading the source code.  I
don't have any way to try this out in a real ARM UEFI environment.
---
 xen/arch/arm/efi/efi-boot.h | 16 +---------------
 1 file changed, 1 insertion(+), 15 deletions(-)

diff --git a/xen/arch/arm/efi/efi-boot.h b/xen/arch/arm/efi/efi-boot.h
index 1c3640bb65fd..59d217667ff3 100644
--- a/xen/arch/arm/efi/efi-boot.h
+++ b/xen/arch/arm/efi/efi-boot.h
@@ -461,7 +461,7 @@ static void __init efi_arch_handle_cmdline(CHAR16 
*image_name,
     union string name;
     char *buf;
     EFI_STATUS status;
-    int prop_len;
+    int prop_len = 0;
     int chosen;
 
     /* locate chosen node, which is where we add Xen module info. */
@@ -473,20 +473,6 @@ static void __init efi_arch_handle_cmdline(CHAR16 
*image_name,
     if ( EFI_ERROR(status) )
         PrintErrMesg(L"Unable to allocate string buffer", status);
 
-    if ( image_name )
-    {
-        name.w = image_name;
-        w2s(&name);
-    }
-    else
-        name.s = "xen";
-
-    prop_len = 0;
-    prop_len += snprintf(buf + prop_len,
-                           EFI_PAGE_SIZE - prop_len, "%s", name.s);
-    if ( prop_len >= EFI_PAGE_SIZE )
-        blexit(L"FDT string overflow");
-
     if ( cfgfile_options )
     {
         PrintMessage(L"Using bootargs from Xen configuration file.");
-- 
2.30.2


Reply via email to