From: Boris Ostrovsky <boris.ostrovsky@oracle.com>
To: konrad.wilk@oracle.com, david.vrabel@citrix.com
Cc: xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org,
mcgrof@kernel.org, brgerst@gmail.com, andrew.cooper3@citrix.com,
roger.pau@citrix.com,
Boris Ostrovsky <boris.ostrovsky@oracle.com>
Subject: [PATCH v4 1/2] xen/x86: Zero out .bss for PV guests
Date: Fri, 26 Feb 2016 14:02:36 -0500 [thread overview]
Message-ID: <1456513357-19981-2-git-send-email-boris.ostrovsky@oracle.com> (raw)
In-Reply-To: <1456513357-19981-1-git-send-email-boris.ostrovsky@oracle.com>
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>
---
arch/x86/xen/xen-head.S | 9 +++++++++
1 file changed, 9 insertions(+)
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
--
2.1.0
next prev parent reply other threads:[~2016-02-26 19:03 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-26 19:02 [PATCH v4 0/2] Clear " Boris Ostrovsky
2016-02-26 19:02 ` Boris Ostrovsky [this message]
2016-02-26 19:02 ` [PATCH v4 2/2] xen/x86: Drop mode-selecting ifdefs in startup_xen() Boris Ostrovsky
2016-03-03 16:21 ` [Xen-devel] [PATCH v4 0/2] Clear .bss for PV guests David Vrabel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1456513357-19981-2-git-send-email-boris.ostrovsky@oracle.com \
--to=boris.ostrovsky@oracle.com \
--cc=andrew.cooper3@citrix.com \
--cc=brgerst@gmail.com \
--cc=david.vrabel@citrix.com \
--cc=konrad.wilk@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mcgrof@kernel.org \
--cc=roger.pau@citrix.com \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®