Re: [PATCH] x86: only load initrd above 4g on second try
From: Matt Fleming
Date: Wed Aug 27 2014 - 06:59:13 EST
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@xxxxxxxxx>
> Tested-by: Anders Darander <anders@xxxxxxxxxxxxxx>
> Signed-off-by: Yinghai Lu <yinghai@xxxxxxxxxx>
>
> ---
> 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@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/