All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86/PVH: Dom0 "broken ELF" reporting adjustments
@ 2024-01-17  8:53 Jan Beulich
  2024-01-17 10:25 ` Roger Pau Monné
  0 siblings, 1 reply; 5+ messages in thread
From: Jan Beulich @ 2024-01-17  8:53 UTC (permalink / raw)
  To: xen-devel@lists.xenproject.org
  Cc: Andrew Cooper, Wei Liu, Roger Pau Monné

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).

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- 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("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;
     }
 


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] x86/PVH: Dom0 "broken ELF" reporting adjustments
  2024-01-17  8:53 [PATCH] x86/PVH: Dom0 "broken ELF" reporting adjustments Jan Beulich
@ 2024-01-17 10:25 ` Roger Pau Monné
  2024-01-17 10:42   ` Jan Beulich
  0 siblings, 1 reply; 5+ messages in thread
From: Roger Pau Monné @ 2024-01-17 10:25 UTC (permalink / raw)
  To: Jan Beulich; +Cc: xen-devel@lists.xenproject.org, Andrew Cooper, Wei Liu

On Wed, Jan 17, 2024 at 09:53:26AM +0100, Jan Beulich wrote:
> 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).
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> 
> --- 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("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.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] x86/PVH: Dom0 "broken ELF" reporting adjustments
  2024-01-17 10:25 ` Roger Pau Monné
@ 2024-01-17 10:42   ` Jan Beulich
  2024-01-17 10:44     ` Andrew Cooper
  2024-01-17 11:13     ` Roger Pau Monné
  0 siblings, 2 replies; 5+ messages in thread
From: Jan Beulich @ 2024-01-17 10:42 UTC (permalink / raw)
  To: Roger Pau Monné
  Cc: xen-devel@lists.xenproject.org, Andrew Cooper, Wei Liu

On 17.01.2024 11:25, Roger Pau Monné wrote:
> On Wed, Jan 17, 2024 at 09:53:26AM +0100, Jan Beulich wrote:
>> 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).
>>
>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>>
>> --- 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("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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] x86/PVH: Dom0 "broken ELF" reporting adjustments
  2024-01-17 10:42   ` Jan Beulich
@ 2024-01-17 10:44     ` Andrew Cooper
  2024-01-17 11:13     ` Roger Pau Monné
  1 sibling, 0 replies; 5+ messages in thread
From: Andrew Cooper @ 2024-01-17 10:44 UTC (permalink / raw)
  To: Jan Beulich, Roger Pau Monné; +Cc: xen-devel@lists.xenproject.org, Wei Liu

On 17/01/2024 10:42 am, Jan Beulich wrote:
> On 17.01.2024 11:25, Roger Pau Monné wrote:
>> On Wed, Jan 17, 2024 at 09:53:26AM +0100, Jan Beulich wrote:
>>> 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).
>>>
>>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>>>
>>> --- 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("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.

Sounds good to me.

~Andrew


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] x86/PVH: Dom0 "broken ELF" reporting adjustments
  2024-01-17 10:42   ` Jan Beulich
  2024-01-17 10:44     ` Andrew Cooper
@ 2024-01-17 11:13     ` Roger Pau Monné
  1 sibling, 0 replies; 5+ messages in thread
From: Roger Pau Monné @ 2024-01-17 11:13 UTC (permalink / raw)
  To: Jan Beulich; +Cc: xen-devel@lists.xenproject.org, Andrew Cooper, Wei Liu

On Wed, Jan 17, 2024 at 11:42:53AM +0100, Jan Beulich wrote:
> On 17.01.2024 11:25, Roger Pau Monné wrote:
> > On Wed, Jan 17, 2024 at 09:53:26AM +0100, Jan Beulich wrote:
> >> 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).
> >>
> >> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> >>
> >> --- 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("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.

Sure, please go ahead.

Thanks, Roger.


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-01-17 11:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-17  8:53 [PATCH] x86/PVH: Dom0 "broken ELF" reporting adjustments Jan Beulich
2024-01-17 10:25 ` Roger Pau Monné
2024-01-17 10:42   ` Jan Beulich
2024-01-17 10:44     ` Andrew Cooper
2024-01-17 11:13     ` Roger Pau Monné

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.