Skip to content

Commit

Permalink
xen/x86: Zero out .bss for PV guests
Browse files Browse the repository at this point in the history
ELF spec is unclear about whether .bss must me cleared by the loader.
Currently the domain builder does it when loading the guest but because
it is not (or rather may not be) guaranteed we should zero it out
explicitly.

Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
  • Loading branch information
Boris Ostrovsky authored and David Vrabel committed Mar 3, 2016
1 parent a4d7b75 commit 04b6b4a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions arch/x86/xen/xen-head.S
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,15 @@
__INIT
ENTRY(startup_xen)
cld

/* Clear .bss */
xor %eax,%eax
mov $__bss_start, %_ASM_DI
mov $__bss_stop, %_ASM_CX
sub %_ASM_DI, %_ASM_CX
shr $__ASM_SEL(2, 3), %_ASM_CX
rep __ASM_SIZE(stos)

#ifdef CONFIG_X86_32
mov %esi,xen_start_info
mov $init_thread_union+THREAD_SIZE,%esp
Expand Down

0 comments on commit 04b6b4a

Please sign in to comment.