linux-efi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] arch/x86: Add better error logging to efi main
@ 2014-07-10  0:12 ulf-rS3t9PEbhQ0OIzVOb1FTxg
       [not found] ` <1404951161-2677-1-git-send-email-ulf-rS3t9PEbhQ0OIzVOb1FTxg@public.gmane.org>
  0 siblings, 1 reply; 8+ messages in thread
From: ulf-rS3t9PEbhQ0OIzVOb1FTxg @ 2014-07-10  0:12 UTC (permalink / raw)
  To: linux-efi-u79uwXL29TY76Z2rM5mHXA
  Cc: matt.fleming-ral2JQCrhuEAvxtiuMwx3w, Ulf Winkelvos

From: Ulf Winkelvos <ulf-rS3t9PEbhQ0OIzVOb1FTxg@public.gmane.org>

Hopefully this will enable us to better debug:
https://bugzilla.kernel.org/show_bug.cgi?id=68761

Signed-off-by: Ulf Winkelvos <ulf-rS3t9PEbhQ0OIzVOb1FTxg@public.gmane.org>
---
 arch/x86/boot/compressed/eboot.c | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/arch/x86/boot/compressed/eboot.c b/arch/x86/boot/compressed/eboot.c
index 3b5c66c..f277184 100644
--- a/arch/x86/boot/compressed/eboot.c
+++ b/arch/x86/boot/compressed/eboot.c
@@ -1376,7 +1376,10 @@ struct boot_params *efi_main(struct efi_config *c,

	setup_graphics(boot_params);

-	setup_efi_pci(boot_params);
+	status = setup_efi_pci(boot_params);
+	if (status != EFI_SUCCESS) {
+		efi_printk(sys_table, "setup_efi_pci() failed!\n");
+	}

	status = efi_call_early(allocate_pool, EFI_LOADER_DATA,
				sizeof(*gdt), (void **)&gdt);
@@ -1403,16 +1406,20 @@ struct boot_params *efi_main(struct efi_config *c,
					     hdr->init_size, hdr->init_size,
					     hdr->pref_address,
					     hdr->kernel_alignment);
-		if (status != EFI_SUCCESS)
+		if (status != EFI_SUCCESS) {
+			efi_printk(sys_table, "efi_relocate_kernel() failed!\n");
			goto fail;
+		}

		hdr->pref_address = hdr->code32_start;
		hdr->code32_start = bzimage_addr;
	}

	status = exit_boot(boot_params, handle, is64);
-	if (status != EFI_SUCCESS)
+	if (status != EFI_SUCCESS) {
+		efi_printk(sys_table, "exit_boot() failed!\n");
		goto fail;
+	}

	memset((char *)gdt->address, 0x0, gdt->size);
	desc = (struct desc_struct *)gdt->address;
@@ -1472,5 +1479,6 @@ struct boot_params *efi_main(struct efi_config *c,

	return boot_params;
 fail:
+	efi_printk(sys_table, "efi_main() failed!\n");
	return NULL;
 }
--
2.0.1

^ permalink raw reply related	[flat|nested] 8+ messages in thread
* Re: [PATCH 1/1] arch/x86: Add better error logging to efi main
@ 2014-09-06 21:02 Andre
  2014-09-07  0:11 ` Andre
  0 siblings, 1 reply; 8+ messages in thread
From: Andre @ 2014-09-06 21:02 UTC (permalink / raw)
  To: linux-efi-u79uwXL29TY76Z2rM5mHXA,
	matt-HNK1S37rvNbeXh+fF434Mdi2O/JbrIOy, Ulf Winkelvos

Matt Fleming <matt@...> writes:
> 
> On Thu, 10 Jul, at 02:12:41AM, ulf@... wrote:
> >  <at>  <at>  -1376,7 +1376,10  <at>  <at>  struct boot_params *efi_main(struct efi_config *c,
> > 
> >     setup_graphics(boot_params);
> > 
> > -   setup_efi_pci(boot_params);
> > +   status = setup_efi_pci(boot_params);
> > +   if (status != EFI_SUCCESS) {
> > +           efi_printk(sys_table, "setup_efi_pci() failed!\n");
> > +   }
> 
> Actually, it turns out that a lot of people are seeing this error
> message in what would be an otherwise quiet boot,
> 
>   https://bugzilla.kernel.org/show_bug.cgi?id=81891
> 
> Maybe we should distinguish between EFI_PCI_IO_PROTOCOL_GUID not being
> found and all other errors, i.e. memory allocation failure. We obviously
> do want to know if we failed to allocate memory, but we're less bothered
> if we've no PCI devices.
> 
> Something like below? Folks on Cc, could you apply this snippet and see
> whether you're still seeing the error message?
> 

With a Thinkpad T420 (pre-2.0 EFI), I do run into the failure condition for another reason:

setup_efi_pci64 gets called,
the loop therein is executed nr_pci=11 (!?) times.
The second call run calls into __setup_efi_pci64 successfully, the memcpy takes place; the free_struct: path is not used. Back in setup_efi_pci64, the non-data path is walked.

For all the other 10 runs of the loop, __setup_efi_pci64 fails at
if (!pci->romimage || !pci->romsize)
        return EFI_INVALID_PARAMETER;
so that is the status here for any run but the second.

So here, I can work around the message by accepting the EFI_INVALID_PARAMETER condition. 
Also, I can work around that by adding break; to the end of the loop in setup_efi_pci64, as it only gets to the end in the successful case. But I guess other machines require to loop successfully through this more than once?

Regards,
Andre Müller

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

end of thread, other threads:[~2014-09-09 22:54 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-10  0:12 [PATCH 1/1] arch/x86: Add better error logging to efi main ulf-rS3t9PEbhQ0OIzVOb1FTxg
     [not found] ` <1404951161-2677-1-git-send-email-ulf-rS3t9PEbhQ0OIzVOb1FTxg@public.gmane.org>
2014-07-10 18:36   ` Matt Fleming
2014-08-13 17:56   ` Matt Fleming
     [not found]     ` <20140813175611.GU15082-HNK1S37rvNbeXh+fF434Mdi2O/JbrIOy@public.gmane.org>
2014-08-14 22:56       ` Ulf Winkelvos
  -- strict thread matches above, loose matches on Subject: below --
2014-09-06 21:02 Andre
2014-09-07  0:11 ` Andre
2014-09-08 21:18   ` Matt Fleming
     [not found]     ` <20140908211856.GC18582-HNK1S37rvNbeXh+fF434Mdi2O/JbrIOy@public.gmane.org>
2014-09-09 22:54       ` Andre

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).