linux_dsm_epyc7002/arch/x86/include/uapi/asm
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
..
a.out.h UAPI: (Scripted) Disintegrate arch/x86/include/asm 2012-12-14 22:37:13 +00:00
auxvec.h UAPI: (Scripted) Disintegrate arch/x86/include/asm 2012-12-14 22:37:13 +00:00
bitsperlong.h UAPI: (Scripted) Disintegrate arch/x86/include/asm 2012-12-14 22:37:13 +00:00
boot.h UAPI: (Scripted) Disintegrate arch/x86/include/asm 2012-12-14 22:37:13 +00:00
bootparam.h Modify UEFI anti-bricking code 2013-06-10 21:59:37 +01:00
byteorder.h UAPI: (Scripted) Disintegrate arch/x86/include/asm 2012-12-14 22:37:13 +00:00
debugreg.h UAPI: (Scripted) Disintegrate arch/x86/include/asm 2012-12-14 22:37:13 +00:00
e820.h UAPI: (Scripted) Disintegrate arch/x86/include/asm 2012-12-14 22:37:13 +00:00
errno.h UAPI: (Scripted) Disintegrate arch/x86/include/asm 2012-12-14 22:37:13 +00:00
fcntl.h UAPI: (Scripted) Disintegrate arch/x86/include/asm 2012-12-14 22:37:13 +00:00
hw_breakpoint.h create non-empty arch/x86/include/uapi/asm/ files 2012-12-17 17:15:11 -08:00
hyperv.h UAPI: (Scripted) Disintegrate arch/x86/include/asm 2012-12-14 22:37:13 +00:00
ioctl.h UAPI: (Scripted) Disintegrate arch/x86/include/asm 2012-12-14 22:37:13 +00:00
ioctls.h UAPI: (Scripted) Disintegrate arch/x86/include/asm 2012-12-14 22:37:13 +00:00
ipcbuf.h UAPI: (Scripted) Disintegrate arch/x86/include/asm 2012-12-14 22:37:13 +00:00
ist.h UAPI: (Scripted) Disintegrate arch/x86/include/asm 2012-12-14 22:37:13 +00:00
Kbuild UAPI: (Scripted) Disintegrate arch/x86/include/asm 2012-12-14 22:37:13 +00:00
kvm_para.h UAPI: (Scripted) Disintegrate arch/x86/include/asm 2012-12-14 22:37:13 +00:00
kvm.h kvm: Allow build-time configuration of KVM device assignment 2013-04-28 12:58:56 +03:00
ldt.h UAPI: (Scripted) Disintegrate arch/x86/include/asm 2012-12-14 22:37:13 +00:00
mce.h x86, MCE: Retract most UAPI exports 2013-01-09 14:49:02 +01:00
mman.h UAPI: (Scripted) Disintegrate arch/x86/include/asm 2012-12-14 22:37:13 +00:00
msgbuf.h UAPI: (Scripted) Disintegrate arch/x86/include/asm 2012-12-14 22:37:13 +00:00
msr-index.h Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux 2013-05-11 15:23:17 -07:00
msr.h UAPI: (Scripted) Disintegrate arch/x86/include/asm 2012-12-14 22:37:13 +00:00
mtrr.h UAPI: (Scripted) Disintegrate arch/x86/include/asm 2012-12-14 22:37:13 +00:00
param.h UAPI: (Scripted) Disintegrate arch/x86/include/asm 2012-12-14 22:37:13 +00:00
perf_regs.h UAPI: (Scripted) Disintegrate arch/x86/include/asm 2012-12-14 22:37:13 +00:00
poll.h UAPI: (Scripted) Disintegrate arch/x86/include/asm 2012-12-14 22:37:13 +00:00
posix_types_32.h UAPI: (Scripted) Disintegrate arch/x86/include/asm 2012-12-14 22:37:13 +00:00
posix_types_64.h UAPI: (Scripted) Disintegrate arch/x86/include/asm 2012-12-14 22:37:13 +00:00
posix_types_x32.h UAPI: (Scripted) Disintegrate arch/x86/include/asm 2012-12-14 22:37:13 +00:00
posix_types.h UAPI: (Scripted) Disintegrate arch/x86/include/asm 2012-12-14 22:37:13 +00:00
prctl.h UAPI: (Scripted) Disintegrate arch/x86/include/asm 2012-12-14 22:37:13 +00:00
processor-flags.h UAPI: (Scripted) Disintegrate arch/x86/include/asm 2012-12-14 22:37:13 +00:00
ptrace-abi.h UAPI: (Scripted) Disintegrate arch/x86/include/asm 2012-12-14 22:37:13 +00:00
ptrace.h UAPI: (Scripted) Disintegrate arch/x86/include/asm 2012-12-14 22:37:13 +00:00
resource.h UAPI: (Scripted) Disintegrate arch/x86/include/asm 2012-12-14 22:37:13 +00:00
sembuf.h UAPI: (Scripted) Disintegrate arch/x86/include/asm 2012-12-14 22:37:13 +00:00
setup.h create non-empty arch/x86/include/uapi/asm/ files 2012-12-17 17:15:11 -08:00
shmbuf.h UAPI: (Scripted) Disintegrate arch/x86/include/asm 2012-12-14 22:37:13 +00:00
sigcontext32.h UAPI: (Scripted) Disintegrate arch/x86/include/asm 2012-12-14 22:37:13 +00:00
sigcontext.h UAPI: (Scripted) Disintegrate arch/x86/include/asm 2012-12-14 22:37:13 +00:00
siginfo.h UAPI: (Scripted) Disintegrate arch/x86/include/asm 2012-12-14 22:37:13 +00:00
signal.h consolidate kernel-side struct sigaction declarations 2013-02-03 15:09:22 -05:00
socket.h UAPI: (Scripted) Disintegrate arch/x86/include/asm 2012-12-14 22:37:13 +00:00
sockios.h UAPI: (Scripted) Disintegrate arch/x86/include/asm 2012-12-14 22:37:13 +00:00
stat.h UAPI: (Scripted) Disintegrate arch/x86/include/asm 2012-12-14 22:37:13 +00:00
statfs.h UAPI: (Scripted) Disintegrate arch/x86/include/asm 2012-12-14 22:37:13 +00:00
svm.h UAPI: (Scripted) Disintegrate arch/x86/include/asm 2012-12-14 22:37:13 +00:00
swab.h UAPI: (Scripted) Disintegrate arch/x86/include/asm 2012-12-14 22:37:13 +00:00
termbits.h UAPI: (Scripted) Disintegrate arch/x86/include/asm 2012-12-14 22:37:13 +00:00
termios.h UAPI: (Scripted) Disintegrate arch/x86/include/asm 2012-12-14 22:37:13 +00:00
types.h UAPI: (Scripted) Disintegrate arch/x86/include/asm 2012-12-14 22:37:13 +00:00
ucontext.h UAPI: (Scripted) Disintegrate arch/x86/include/asm 2012-12-14 22:37:13 +00:00
unistd.h UAPI: (Scripted) Disintegrate arch/x86/include/asm 2012-12-14 22:37:13 +00:00
vm86.h UAPI: (Scripted) Disintegrate arch/x86/include/asm 2012-12-14 22:37:13 +00:00
vmx.h KVM: nVMX: Add preemption timer support 2013-03-14 10:01:21 +02:00
vsyscall.h UAPI: (Scripted) Disintegrate arch/x86/include/asm 2012-12-14 22:37:13 +00:00