Re: [PATCH 5.0 30/46] x86/boot/compressed/64: Do not read legacy ROM on EFI system

From: Kirill A. Shutemov
Date: Tue Mar 12 2019 - 05:50:34 EST


On Sat, Mar 09, 2019 at 10:10:19PM -0800, hpa@xxxxxxxxx wrote:
> >@@ -47,8 +50,18 @@ static unsigned long find_trampoline_pla
> > * This code is based on reserve_bios_regions().
> > */
> >
> >- ebda_start = *(unsigned short *)0x40e << 4;
> >- bios_start = *(unsigned short *)0x413 << 10;
> >+ /*
> >+ * EFI systems may not provide legacy ROM. The memory may not be
> >mapped
> >+ * at all.
> >+ *
> >+ * Only look for values in the legacy ROM for non-EFI system.
> >+ */
> >+ signature = (char *)&boot_params->efi_info.efi_loader_signature;
> >+ if (strncmp(signature, EFI32_LOADER_SIGNATURE, 4) &&
> >+ strncmp(signature, EFI64_LOADER_SIGNATURE, 4)) {
> >+ ebda_start = *(unsigned short *)0x40e << 4;
> >+ bios_start = *(unsigned short *)0x413 << 10;
> >+ }
> >
> > if (bios_start < BIOS_START_MIN || bios_start > BIOS_START_MAX)
> > bios_start = BIOS_START_MAX;
>
> Only one objection: the explanation is nonsensical.

Well, that's the best explanation I've come up with :/

I would be glad for any insight here.

--
Kirill A. Shutemov