2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-21 19:53:59 +08:00
linux-next/arch/x86/boot/compressed
Matthew Garrett f8b8404337 Modify UEFI anti-bricking code
This patch reworks the UEFI anti-bricking code, including an effective
reversion of cc5a080c and 31ff2f20. It turns out that calling
QueryVariableInfo() from boot services results in some firmware
implementations jumping to physical addresses even after entering virtual
mode, so until we have 1:1 mappings for UEFI runtime space this isn't
going to work so well.

Reverting these gets us back to the situation where we'd refuse to create
variables on some systems because they classify deleted variables as "used"
until the firmware triggers a garbage collection run, which they won't do
until they reach a lower threshold. This results in it being impossible to
install a bootloader, which is unhelpful.

Feedback from Samsung indicates that the firmware doesn't need more than
5KB of storage space for its own purposes, so that seems like a reasonable
threshold. However, there's still no guarantee that a platform will attempt
garbage collection merely because it drops below this threshold. It seems
that this is often only triggered if an attempt to write generates a
genuine EFI_OUT_OF_RESOURCES error. We can force that by attempting to
create a variable larger than the remaining space. This should fail, but if
it somehow succeeds we can then immediately delete it.

I've tested this on the UEFI machines I have available, but I don't have
a Samsung and so can't verify that it avoids the bricking problem.

Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
Signed-off-by: Lee, Chun-Y <jlee@suse.com> [ dummy variable cleanup ]
Cc: <stable@vger.kernel.org>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-06-10 21:59:37 +01:00
..
.gitignore x86, boot: add new generated files to the appropriate .gitignore files 2009-06-02 21:13:30 -07:00
cmdline.c x86, boot: Support loading bzImage, boot_params and ramdisk above 4G 2013-01-29 19:32:33 -08:00
early_serial_console.c x86, boot: Exclude early_serial_console.c if can't use it. 2012-07-21 11:07:34 -07:00
eboot.c Modify UEFI anti-bricking code 2013-06-10 21:59:37 +01:00
eboot.h X86: Improve GOP detection in the EFI boot stub 2012-09-17 13:29:20 +01:00
efi_stub_32.S x86, efi: EFI boot stub support 2011-12-12 14:26:10 -08:00
efi_stub_64.S x86, efi: EFI boot stub support 2011-12-12 14:26:10 -08:00
head_32.S x86, build: Dynamically find entry points in compressed startup code 2013-01-27 20:19:37 -08:00
head_64.S x86_64: Use __BOOT_DS instead_of __KERNEL_DS for safety 2013-03-01 10:18:33 -08:00
Makefile x86: Fix rebuild with EFI_STUB enabled 2013-04-05 13:59:23 -07:00
misc.c x86, boot: Sanitize boot_params if not zeroed on creation 2013-01-29 01:22:17 -08:00
misc.h x86, boot: Sanitize boot_params if not zeroed on creation 2013-01-29 01:22:17 -08:00
mkpiggy.c x86, mkpiggy: Don't open code put_unaligned_le32() 2012-02-28 10:22:57 -08:00
string.c x86, efi: EFI boot stub support 2011-12-12 14:26:10 -08:00
vmlinux.lds.S x86, setup: Allow global variables and functions in the decompressor 2010-08-02 15:34:44 -07:00