summaryrefslogtreecommitdiffstats
path: root/arch/x86
diff options
context:
space:
mode:
authorBoris Ostrovsky <boris.ostrovsky@oracle.com>2016-02-26 14:02:36 -0500
committerDavid Vrabel <david.vrabel@citrix.com>2016-03-03 16:20:09 +0000
commit04b6b4a56884327c1648c517f1f46a2638f04c9d (patch)
treedc96b84e9f78a1b50a3e616a748246ef9f3f5cb8 /arch/x86
parenta4d7b75be034115d36b6a20db566eb8b11bacaf8 (diff)
downloadop-kernel-dev-04b6b4a56884327c1648c517f1f46a2638f04c9d.zip
op-kernel-dev-04b6b4a56884327c1648c517f1f46a2638f04c9d.tar.gz
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: Boris Ostrovsky <boris.ostrovsky@oracle.com> Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/xen/xen-head.S9
1 files changed, 9 insertions, 0 deletions
diff --git a/arch/x86/xen/xen-head.S b/arch/x86/xen/xen-head.S
index b65f59a..5c63d2d 100644
--- a/arch/x86/xen/xen-head.S
+++ b/arch/x86/xen/xen-head.S
@@ -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
OpenPOWER on IntegriCloud