On Fri, Feb 26, 2016 at 8:51 AM, Boris Ostrovsky
On 02/26/2016 05:53 AM, Roger Pau MonnÃ wrote:It does it on bare metal because bzImage is a raw binary image, not ELF.
El 25/2/16 a les 16:16, Boris Ostrovsky ha escrit:
PV guests need to have their .bss zeroed out since it is not guaranteedI guess I'm missing something, but elf_load_image (in libelf-loader.c)
to be cleared by Xen's domain builder
seems to be able to clear segments (it will zero the memory between
p_paddr + p_filesz and p_paddr + p_memsz) while loading the ELF into
memory, so if the program headers are correctly setup the .bss should be
zeroed out AFAICT.
Right, but I don't think this is guaranteed. It's uninitialized data so in
principle it can be anything.
The ELF spec says "the system initializes the data with zero when the
program begins to run" which I read as it's up to runtime and not the loader
to do so.
And since kernel does it explicitly on baremetal path I think it's a good
idea for PV to do the same.