Skip to contentSkip to conversation

x86/PVH: Dom0 "broken ELF" reporting adjustments

PATCH Superseded Jan Beulich 3 participants 5 messages Jan 17, 2024

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

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

elf_load_binary() isn't the primary source of brokenness being indicated. Therefore make the respective 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).

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("Xen dom0 kernel broken ELF: %s\n", 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("Xen dom0 kernel broken ELF: %s\n", elf_check_broken(&elf));
         return rc;
     }
 
#1 lore raw
Quoted 10 lines · Jan Beulich

elf_load_binary() isn't the primary source of brokenness being indicated. Therefore make the respective 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).

xen/arch/x86/hvm/dom0_build.c static int __init pvh_load_kernel(struct · line 574

Quoted 5 lines
xen/arch/x86/hvm/dom0_build.c +2 -0
@@ -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("Xen dom0 kernel broken ELF: %s\n", elf_check_broken(&elf));

I would rather use "%pd: kernel broken ELF: %s\n", in case this gets used for loading more than dom0 in the dom0less case. The 'Xen' prefix is IMO useless here (I know it was here before).

Thanks, Roger.

#2 lore raw
Quoted 8 lines · Roger Pau Monné
Quoted 7 lines · Jan Beulich

elf_load_binary() isn't the primary source of brokenness being indicated. Therefore make the respective 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).

Quoted 12 lines

xen/arch/x86/hvm/dom0_build.c static int __init pvh_load_kernel(struct · line 574

Quoted 8 lines
xen/arch/x86/hvm/dom0_build.c +2 -0
@@ -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("Xen dom0 kernel broken ELF: %s\n", elf_check_broken(&elf));

I would rather use "%pd: kernel broken ELF: %s\n", in case this gets used for loading more than dom0 in the dom0less case. The 'Xen' prefix is IMO useless here (I know it was here before).

Can do. But if I do, I'd like to bring PV in sync with this as well, right in the same patch. I hope you don't mind that.

Jan

#3 lore raw
Quoted 20 lines · Jan Beulich
Quoted 8 lines · Roger Pau Monné
Quoted 7 lines · Jan Beulich

elf_load_binary() isn't the primary source of brokenness being indicated. Therefore make the respective 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).

Quoted 11 lines

xen/arch/x86/hvm/dom0_build.c static int __init pvh_load_kernel(struct · line 574

Quoted 8 lines
xen/arch/x86/hvm/dom0_build.c +2 -0
@@ -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("Xen dom0 kernel broken ELF: %s\n", elf_check_broken(&elf));

I would rather use "%pd: kernel broken ELF: %s\n", in case this gets used for loading more than dom0 in the dom0less case. The 'Xen' prefix is IMO useless here (I know it was here before).

Quoted 2 lines

Can do. But if I do, I'd like to bring PV in sync with this as well, right in the same patch. I hope you don't mind that.

Sounds good to me.

~Andrew

#4 lore raw
In reply to Jan Beulich
Quoted 22 lines · Jan Beulich
Quoted 8 lines · Roger Pau Monné
Quoted 7 lines · Jan Beulich

elf_load_binary() isn't the primary source of brokenness being indicated. Therefore make the respective 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).

Quoted 12 lines

xen/arch/x86/hvm/dom0_build.c static int __init pvh_load_kernel(struct · line 574

Quoted 8 lines
xen/arch/x86/hvm/dom0_build.c +2 -0
@@ -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("Xen dom0 kernel broken ELF: %s\n", elf_check_broken(&elf));

I would rather use "%pd: kernel broken ELF: %s\n", in case this gets used for loading more than dom0 in the dom0less case. The 'Xen' prefix is IMO useless here (I know it was here before).

Quoted 2 lines

Can do. But if I do, I'd like to bring PV in sync with this as well, right in the same patch. I hope you don't mind that.

Sure, please go ahead.

Thanks, Roger.