Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1344331

Re: [Xen-devel] [PATCH v3 0/2] Clear .bss for VP guests

From David Vrabel <david.vrabel@citrix.com>
Newsgroups linux.kernel
Subject Re: [Xen-devel] [PATCH v3 0/2] Clear .bss for VP guests
Date 2016-02-26 16:20 +0100
Message-ID <r6sls-5aU-17@gated-at.bofh.it> (permalink)
References <r65RU-5J5-7@gated-at.bofh.it> <r6ohT-1Wt-77@gated-at.bofh.it> <r6r61-44C-1@gated-at.bofh.it> <r6rSq-4HT-3@gated-at.bofh.it> <r6sls-5aU-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 26/02/16 15:10, Boris Ostrovsky wrote:
> On 02/26/2016 09:42 AM, Brian Gerst wrote:
>> On Fri, Feb 26, 2016 at 8:51 AM, Boris Ostrovsky
>> <boris.ostrovsky@oracle.com> wrote:
>>> 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.
>> It does it on bare metal because bzImage is a raw binary image, not ELF.
> 
> OK, I didn't think about this.
> 
> But nevertheless, is it guaranteed that .bss is cleared by the loader?
> My reading of the spec is that it's not.

I'm going to apply it once you post a final version with the last
suggestion from Brian.

I'll drop the tag for stable though.

David

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v3 0/2] Clear .bss for VP guests Boris Ostrovsky <boris.ostrovsky@oracle.com> - 2016-02-25 16:20 +0100
  [PATCH v3 1/2] xen/x86: Zero out .bss for PV guests Boris Ostrovsky <boris.ostrovsky@oracle.com> - 2016-02-25 16:20 +0100
    Re: [PATCH v3 1/2] xen/x86: Zero out .bss for PV guests Brian Gerst <brgerst@gmail.com> - 2016-02-25 17:20 +0100
  [PATCH v3 2/2] xen/x86: Drop mode-selecting ifdefs in startup_xen() Boris Ostrovsky <boris.ostrovsky@oracle.com> - 2016-02-25 16:20 +0100
  Re: [Xen-devel] [PATCH v3 0/2] Clear .bss for VP guests Roger Pau Monné <roger.pau@citrix.com> - 2016-02-26 12:00 +0100
    Re: [Xen-devel] [PATCH v3 0/2] Clear .bss for VP guests Boris Ostrovsky <boris.ostrovsky@oracle.com> - 2016-02-26 15:00 +0100
      Re: [Xen-devel] [PATCH v3 0/2] Clear .bss for VP guests Brian Gerst <brgerst@gmail.com> - 2016-02-26 15:50 +0100
        Re: [Xen-devel] [PATCH v3 0/2] Clear .bss for VP guests Boris Ostrovsky <boris.ostrovsky@oracle.com> - 2016-02-26 16:20 +0100
          Re: [Xen-devel] [PATCH v3 0/2] Clear .bss for VP guests David Vrabel <david.vrabel@citrix.com> - 2016-02-26 16:20 +0100
          Re: [Xen-devel] [PATCH v3 0/2] Clear .bss for VP guests Roger Pau Monné <roger.pau@citrix.com> - 2016-02-26 16:30 +0100
            Re: [Xen-devel] [PATCH v3 0/2] Clear .bss for VP guests David Vrabel <david.vrabel@citrix.com> - 2016-02-26 16:30 +0100
              Re: [Xen-devel] [PATCH v3 0/2] Clear .bss for VP guests Boris Ostrovsky <boris.ostrovsky@oracle.com> - 2016-02-26 16:40 +0100
            Re: [Xen-devel] [PATCH v3 0/2] Clear .bss for VP guests Boris Ostrovsky <boris.ostrovsky@oracle.com> - 2016-02-26 16:40 +0100

csiph-web