efi/x86: Remove extra headroom for setup block
authorArvind Sankar <nivedita@alum.mit.edu>
Sun, 8 Mar 2020 08:08:49 +0000 (09:08 +0100)
committerIngo Molnar <mingo@kernel.org>
Sun, 8 Mar 2020 08:58:21 +0000 (09:58 +0100)
commit964124a97b973555c475423fca0fceafdde01a17
tree04aea1d33b8877855174cba80acd04d1e81d359b
parent26725192c46e1e543ed86a06823fa591cd6faf58
efi/x86: Remove extra headroom for setup block

The following commit:

  223e3ee56f77 ("efi/x86: add headroom to decompressor BSS to account for setup block")

added headroom to the PE image to account for the setup block, which
wasn't used for the decompression buffer.

Now that the decompression buffer is located at the start of the image,
and includes the setup block, this is no longer required.

Add a check to make sure that the head section of the compressed kernel
won't overwrite itself while relocating. This is only for
future-proofing as with current limits on the setup and the actual size
of the head section, this can never happen.

Signed-off-by: Arvind Sankar <nivedita@alum.mit.edu>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/r/20200303221205.4048668-5-nivedita@alum.mit.edu
Link: https://lore.kernel.org/r/20200308080859.21568-19-ardb@kernel.org
arch/x86/boot/tools/build.c