Skip to contentSkip to conversation

x86: Dom0 "broken ELF" reporting adjustments

PATCH In review Jan Beulich 2 participants 2 messages Jan 22, 2024 – Feb 26, 2024

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 x86: Dom0 "broken ELF" reporting adjustments

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.

---
v2: Use %pd and bring PV in line with that as well.

xen/arch/x86/hvm/dom0_build.c +4 -1
@@ -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;
     }
 
xen/arch/x86/pv/dom0_build.c +1 -2
@@ -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;
 }
Acked-by on v2 1/1
#1 lore raw
Quoted 8 lines · Jan Beulich

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.