public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Boris Ostrovsky <boris.ostrovsky@oracle.com>
To: "Roger Pau Monné" <roger.pau@citrix.com>,
	konrad.wilk@oracle.com, david.vrabel@citrix.com
Cc: andrew.cooper3@citrix.com, linux-kernel@vger.kernel.org,
	mcgrof@kernel.org, brgerst@gmail.com,
	xen-devel@lists.xenproject.org
Subject: Re: [Xen-devel] [PATCH v3 0/2] Clear .bss for VP guests
Date: Fri, 26 Feb 2016 08:51:56 -0500	[thread overview]
Message-ID: <56D0587C.7080607@oracle.com> (raw)
In-Reply-To: <56D02EAA.4090200@citrix.com>

On 02/26/2016 05:53 AM, Roger Pau Monné wrote:
> 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 guaranteed
>> to be cleared by Xen's domain builder
> I guess I'm missing something, but elf_load_image (in libelf-loader.c)
> 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.

-boris

  reply	other threads:[~2016-02-26 13:51 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-25 15:16 [PATCH v3 0/2] Clear .bss for VP guests Boris Ostrovsky
2016-02-25 15:16 ` [PATCH v3 1/2] xen/x86: Zero out .bss for PV guests Boris Ostrovsky
2016-02-25 16:12   ` Brian Gerst
2016-02-25 15:16 ` [PATCH v3 2/2] xen/x86: Drop mode-selecting ifdefs in startup_xen() Boris Ostrovsky
2016-02-26 10:53 ` [Xen-devel] [PATCH v3 0/2] Clear .bss for VP guests Roger Pau Monné
2016-02-26 13:51   ` Boris Ostrovsky [this message]
2016-02-26 14:42     ` Brian Gerst
2016-02-26 15:10       ` Boris Ostrovsky
2016-02-26 15:12         ` David Vrabel
2016-02-26 15:22         ` Roger Pau Monné
2016-02-26 15:26           ` David Vrabel
2016-02-26 15:38             ` Boris Ostrovsky
2016-02-26 15:30           ` Boris Ostrovsky

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=56D0587C.7080607@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