[lkml]   [2016]   [Apr]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH 2/6] x86/boot: Move compressed kernel to end of decompression buffer

* Kees Cook <> wrote:

> I don't agree. We do still have embedded systems running x86 kernels, and we
> have cases where we're running multiple kernels in memory (like kdump). I think
> the memory savings is worth the complexity, especially since the complexity is
> being reduced up by this patch. [...]

Hm, so can we quantify it, how much are the temporary memory savings in practice?
I'd like to see actual vmlinuz numbers with say a defconfig and with a distro

Small systems tend to have smaller kernel images, so the temporary savings tend to
be smaller as well. There's no long term loss, we'd still recover all memory not
used by the resulting kernel image and make it usable as free RAM. So the only
question is the temporary memory allocation size of the decompression step.

> [...] But that's not all:
> If we moved the compressed kernel after the buffer, the only thing
> we'd do would be taking up more memory. We'd still have the head_*.S
> complexity of handling the relocation and handling the copy, we'd
> still have the extraction, etc, etc. The only thing would be literally
> changing extract_offset to INIT_SIZE. Everything else would be the
> same.

Yes - but arguing about all this code would cause a lot fewer headaches,
for me at least!

Also, I think once we've simplified the whole model of decompression, we can
improve on the structure even more.

> If we moved the decompressed kernel after the compressed kernel, (ignoring KASLR
> for a moment) then we'd end up in a confusing situation where the kernel would
> be running somewhere other than where the boot loader asked it to load. I don't
> even want to think about the weird bug reports we might get from a change like
> that from old or weird loaders.

Well, 'where the boot loader asked it to load' in this case is essentially the
z_extract_offset .globl, isn't it? But how to use that value is a mostly x86
kernel internal matter - in fact there's even an inversion step between the 32-bit
and 64-bit value. Is there any other boot loader environment component I missed?



 \ /
  Last update: 2016-04-29 10:21    [W:0.065 / U:0.328 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site