[Qemu-devel] [PATCH] pc-bios/s390-ccw: Do not pre-initialize empty array

Thomas Huth posted 1 patch 4 years, 7 months ago
Test docker-clang@ubuntu passed
Test FreeBSD passed
Test checkpatch passed
Test docker-mingw@fedora passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20190828123343.8343-1-thuth@redhat.com
Maintainers: Cornelia Huck <cohuck@redhat.com>, Thomas Huth <thuth@redhat.com>, Christian Borntraeger <borntraeger@de.ibm.com>
pc-bios/s390-ccw/main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[Qemu-devel] [PATCH] pc-bios/s390-ccw: Do not pre-initialize empty array
Posted by Thomas Huth 4 years, 7 months ago
We're clearing the BSS in start.S now, so there is no need to
pre-initialize the loadparm_str array with zeroes anymore.

Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 pc-bios/s390-ccw/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pc-bios/s390-ccw/main.c b/pc-bios/s390-ccw/main.c
index a69c73349e..a21b386280 100644
--- a/pc-bios/s390-ccw/main.c
+++ b/pc-bios/s390-ccw/main.c
@@ -17,7 +17,7 @@
 
 char stack[PAGE_SIZE * 8] __attribute__((__aligned__(PAGE_SIZE)));
 static SubChannelId blk_schid = { .one = 1 };
-static char loadparm_str[LOADPARM_LEN + 1] = { 0, 0, 0, 0, 0, 0, 0, 0, 0 };
+static char loadparm_str[LOADPARM_LEN + 1];
 QemuIplParameters qipl;
 IplParameterBlock iplb __attribute__((__aligned__(PAGE_SIZE)));
 static bool have_iplb;
-- 
2.18.1


Re: [Qemu-devel] [PATCH] pc-bios/s390-ccw: Do not pre-initialize empty array
Posted by Christian Borntraeger 4 years, 7 months ago
On 28.08.19 14:33, Thomas Huth wrote:
> We're clearing the BSS in start.S now, so there is no need to
> pre-initialize the loadparm_str array with zeroes anymore.

Can you add a link to the commit that does the bss clearing?
I think it was
commit 339686a358b11a231aa5b6d1424e7a1460d7f277
Author:     Christian Borntraeger <borntraeger@de.ibm.com>
AuthorDate: Wed Nov 22 15:26:27 2017 +0100
Commit:     Cornelia Huck <cohuck@redhat.com>
CommitDate: Thu Dec 14 17:56:54 2017 +0100

    pc-bios/s390-ccw: zero out bss section

> 
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
>  pc-bios/s390-ccw/main.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/pc-bios/s390-ccw/main.c b/pc-bios/s390-ccw/main.c
> index a69c73349e..a21b386280 100644
> --- a/pc-bios/s390-ccw/main.c
> +++ b/pc-bios/s390-ccw/main.c
> @@ -17,7 +17,7 @@
>  
>  char stack[PAGE_SIZE * 8] __attribute__((__aligned__(PAGE_SIZE)));
>  static SubChannelId blk_schid = { .one = 1 };
> -static char loadparm_str[LOADPARM_LEN + 1] = { 0, 0, 0, 0, 0, 0, 0, 0, 0 };
> +static char loadparm_str[LOADPARM_LEN + 1];
>  QemuIplParameters qipl;
>  IplParameterBlock iplb __attribute__((__aligned__(PAGE_SIZE)));
>  static bool have_iplb;
> 


Re: [Qemu-devel] [PATCH] pc-bios/s390-ccw: Do not pre-initialize empty array
Posted by Thomas Huth 4 years, 7 months ago
On 28/08/2019 15.27, Christian Borntraeger wrote:
> On 28.08.19 14:33, Thomas Huth wrote:
>> We're clearing the BSS in start.S now, so there is no need to
>> pre-initialize the loadparm_str array with zeroes anymore.
> 
> Can you add a link to the commit that does the bss clearing?

Sure, I'll change the description to:

"
Since commit 339686a358b11a231aa5b6d1424e7a1460d7f277 ("pc-bios/s390-ccw:
zero out bss section"), we are clearing now the BSS in start.S, so there
is no need to pre-initialize the loadparm_str array with zeroes anymore.
"

 Thomas

Re: [Qemu-devel] [PATCH] pc-bios/s390-ccw: Do not pre-initialize empty array
Posted by Cornelia Huck 4 years, 7 months ago
On Wed, 28 Aug 2019 15:42:37 +0200
Thomas Huth <thuth@redhat.com> wrote:

> On 28/08/2019 15.27, Christian Borntraeger wrote:
> > On 28.08.19 14:33, Thomas Huth wrote:  
> >> We're clearing the BSS in start.S now, so there is no need to
> >> pre-initialize the loadparm_str array with zeroes anymore.  
> > 
> > Can you add a link to the commit that does the bss clearing?  
> 
> Sure, I'll change the description to:
> 
> "
> Since commit 339686a358b11a231aa5b6d1424e7a1460d7f277 ("pc-bios/s390-ccw:
> zero out bss section"), we are clearing now the BSS in start.S, so there
> is no need to pre-initialize the loadparm_str array with zeroes anymore.
> "
> 
>  Thomas

With that:

Reviewed-by: Cornelia Huck <cohuck@redhat.com>

Re: [Qemu-devel] [qemu-s390x] [PATCH] pc-bios/s390-ccw: Do not pre-initialize empty array
Posted by Christian Borntraeger 4 years, 7 months ago

On 28.08.19 15:47, Cornelia Huck wrote:
> On Wed, 28 Aug 2019 15:42:37 +0200
> Thomas Huth <thuth@redhat.com> wrote:
> 
>> On 28/08/2019 15.27, Christian Borntraeger wrote:
>>> On 28.08.19 14:33, Thomas Huth wrote:  
>>>> We're clearing the BSS in start.S now, so there is no need to
>>>> pre-initialize the loadparm_str array with zeroes anymore.  
>>>
>>> Can you add a link to the commit that does the bss clearing?  
>>
>> Sure, I'll change the description to:
>>
>> "
>> Since commit 339686a358b11a231aa5b6d1424e7a1460d7f277 ("pc-bios/s390-ccw:
>> zero out bss section"), we are clearing now the BSS in start.S, so there
>> is no need to pre-initialize the loadparm_str array with zeroes anymore.
>> "

>>
>>  Thomas
> 
> With that:
> 
> Reviewed-by: Cornelia Huck <cohuck@redhat.com>

Acked-by: Christian Borntraeger <borntraeger@de.ibm.com>

Thomas are you going to pick this up or shall I do it?


Re: [Qemu-devel] [qemu-s390x] [PATCH] pc-bios/s390-ccw: Do not pre-initialize empty array
Posted by Thomas Huth 4 years, 7 months ago
On 28/08/2019 15.48, Christian Borntraeger wrote:
> 
> 
> On 28.08.19 15:47, Cornelia Huck wrote:
>> On Wed, 28 Aug 2019 15:42:37 +0200
>> Thomas Huth <thuth@redhat.com> wrote:
>>
>>> On 28/08/2019 15.27, Christian Borntraeger wrote:
>>>> On 28.08.19 14:33, Thomas Huth wrote:  
>>>>> We're clearing the BSS in start.S now, so there is no need to
>>>>> pre-initialize the loadparm_str array with zeroes anymore.  
>>>>
>>>> Can you add a link to the commit that does the bss clearing?  
>>>
>>> Sure, I'll change the description to:
>>>
>>> "
>>> Since commit 339686a358b11a231aa5b6d1424e7a1460d7f277 ("pc-bios/s390-ccw:
>>> zero out bss section"), we are clearing now the BSS in start.S, so there
>>> is no need to pre-initialize the loadparm_str array with zeroes anymore.
>>> "
> 
>>>
>>>  Thomas
>>
>> With that:
>>
>> Reviewed-by: Cornelia Huck <cohuck@redhat.com>
> 
> Acked-by: Christian Borntraeger <borntraeger@de.ibm.com>
> 
> Thomas are you going to pick this up or shall I do it?

I don't mind either way. Not sure whether this patch justifies a bios
rebuild, so I'd rather wait for some more time for other bios patches to
show up. But if you want to pick it up (together with the "fix a
possible memory leak in get_uuid" patch that is still pending), please
go ahead.

 Thomas