[PATCH v2] x86: Dom0 "broken ELF" reporting adjustments

Jan Beulich posted 1 patch 3 months, 1 week ago
Failed in applying to current master (apply log)
[PATCH v2] x86: Dom0 "broken ELF" reporting adjustments
Posted by Jan Beulich 3 months, 1 week ago
elf_load_binary() isn't the primary source of brokenness being
indicated. Therefore make the respective PVH log message there
conditional (much like PV has it), and add another instance when
elf_xen_parse() failed (again matching behavior in the PV case).

Make the PV side match the (new) use of %pd here.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
v2: Use %pd and bring PV in line with that as well.

--- a/xen/arch/x86/hvm/dom0_build.c
+++ b/xen/arch/x86/hvm/dom0_build.c
@@ -570,6 +570,8 @@ static int __init pvh_load_kernel(struct
     if ( (rc = elf_xen_parse(&elf, &parms, true)) != 0 )
     {
         printk("Unable to parse kernel for ELFNOTES\n");
+        if ( elf_check_broken(&elf) )
+            printk("%pd kernel: broken ELF: %s\n", d, elf_check_broken(&elf));
         return rc;
     }
 
@@ -588,7 +590,8 @@ static int __init pvh_load_kernel(struct
     if ( rc < 0 )
     {
         printk("Failed to load kernel: %d\n", rc);
-        printk("Xen dom0 kernel broken ELF: %s\n", elf_check_broken(&elf));
+        if ( elf_check_broken(&elf) )
+            printk("%pd kernel: broken ELF: %s\n", d, elf_check_broken(&elf));
         return rc;
     }
 
--- a/xen/arch/x86/pv/dom0_build.c
+++ b/xen/arch/x86/pv/dom0_build.c
@@ -1041,8 +1041,7 @@ int __init dom0_construct_pv(struct doma
 
 out:
     if ( elf_check_broken(&elf) )
-        printk(XENLOG_WARNING "Dom0 kernel broken ELF: %s\n",
-               elf_check_broken(&elf));
+        printk("%pd kernel: broken ELF: %s\n", d, elf_check_broken(&elf));
 
     return rc;
 }
Re: [PATCH v2] x86: Dom0 "broken ELF" reporting adjustments
Posted by Andrew Cooper 2 months ago
On 22/01/2024 1:41 pm, Jan Beulich wrote:
> elf_load_binary() isn't the primary source of brokenness being
> indicated. Therefore make the respective PVH log message there
> conditional (much like PV has it), and add another instance when
> elf_xen_parse() failed (again matching behavior in the PV case).
>
> Make the PV side match the (new) use of %pd here.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>