[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140827105901.GC28116@console-pimps.org>
Date: Wed, 27 Aug 2014 11:59:01 +0100
From: Matt Fleming <matt@...sole-pimps.org>
To: Yinghai Lu <yinghai@...nel.org>
Cc: Matt Fleming <matt.fleming@...el.com>,
"H. Peter Anvin" <hpa@...or.com>,
Mantas Mikulėnas <grawity@...il.com>,
Anders Darander <anders@...rgestorm.se>,
linux-efi@...r.kernel.org, linux-kernel@...r.kernel.org,
Ingo Molnar <mingo@...nel.org>,
Harald Hoyer <harald@...hat.com>
Subject: Re: [PATCH] x86: only load initrd above 4g on second try
On Tue, 26 Aug, at 02:45:44PM, Yinghai Lu wrote:
> Mantas found that after commit 4bf7111f5016 ("x86/efi: Support initrd
> loaded above 4G"), the kernel freezes at the earliest possible moment
> when trying to boot via UEFI on Asus laptop.
>
> There are buggy EFI implementations: with EFI run time, kernel need
> to load file with 512bytes alignment when buffer is above 4G.
>
> So revert to old way to load initrd on first try,
> second try will use above 4G buffer when initrd is more than
> 2G and does not fit under 4G.
>
> Reported-by: Mantas Mikulėnas <grawity@...il.com>
> Tested-by: Anders Darander <anders@...rgestorm.se>
> Signed-off-by: Yinghai Lu <yinghai@...nel.org>
>
> ---
> arch/x86/boot/compressed/eboot.c | 16 +++++++++-------
> 1 file changed, 9 insertions(+), 7 deletions(-)
The reason I suggested introducing some kind of kernel parameter to
allow loading above 4G is because if Mantas loads a 5GB initrd with your
patch, his machine is still going to hang, with no indication of why it
hung.
At least with a kernel paramter, by default we can try to load under 4G,
and if that fails because the file is too big we can print something
along the lines of,
"initramfs file too large: try booting with efi=file-max"
No, it's not ideal, but I think it's a worthwhile compromise because
you're only going to run into this issue when loading a huge initramfs
with the EFI boot stub.
If instead you're using Grub or Syslinux (and the EFI handover protocol)
it's a non-issue because both of those boot loaders carry FAT drivers
and use EFI_BLOCK_IO_PROTOCOL which doesn't trigger the firmware bug.
It's only because we don't have a FAT driver in the EFI boot stub and
have to resort to using EFI_FILE_PROTOCOL that we've encountered this
problem at all.
--
Matt Fleming, Intel Open Source Technology Center
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists