提交 04b6b4a5 编写于 作者: B Boris Ostrovsky 提交者: David Vrabel

xen/x86: Zero out .bss for PV guests

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: NBoris Ostrovsky <boris.ostrovsky@oracle.com>
Signed-off-by: NDavid Vrabel <david.vrabel@citrix.com>
上级 a4d7b75b
...@@ -38,6 +38,15 @@ ...@@ -38,6 +38,15 @@
__INIT __INIT
ENTRY(startup_xen) ENTRY(startup_xen)
cld 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 #ifdef CONFIG_X86_32
mov %esi,xen_start_info mov %esi,xen_start_info
mov $init_thread_union+THREAD_SIZE,%esp mov $init_thread_union+THREAD_SIZE,%esp
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册