Skip to contentSkip to conversation

pc-bios/s390-ccw: Do not pre-initialize empty array

PATCH In review Thomas Huth 3 participants 6 messages Aug 28, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pc-bios/s390-ccw: Do not pre-initialize empty array

We're clearing the BSS in start.S now, so there is no need to pre-initialize the loadparm_str array with zeroes anymore.

---
 pc-bios/s390-ccw/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
pc-bios/s390-ccw/main.c +1 -1
index a69c73349e..a21b386280 100644
@@ -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;
Signature · 1 line
2.18.1
#1 lore raw
Quoted 2 lines · Thomas Huth

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 <[email protected]>
AuthorDate: Wed Nov 22 15:26:27 2017 +0100
Commit:     Cornelia Huck <[email protected]>
CommitDate: Thu Dec 14 17:56:54 2017 +0100

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

Quoted 20 lines
---
 pc-bios/s390-ccw/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
pc-bios/s390-ccw/main.c +1 -1
index a69c73349e..a21b386280 100644
@@ -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 lore raw
Quoted 5 lines · Christian Borntraeger
Quoted 2 lines · Thomas Huth

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

Reviewed-by
#3 lore raw
Quoted 9 lines · On Wed, 28 Aug 2019 15:42:37 +0200 Thomas Huth <[email protected]> wrote:
Quoted 5 lines · Christian Borntraeger
Quoted 2 lines · Thomas Huth

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:

Quoted 7 lines

"
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:

#4 lore raw
Quoted 19 lines · Cornelia Huck
Quoted 16 lines · On Wed, 28 Aug 2019 15:42:37 +0200 Thomas Huth <[email protected]> wrote:
Quoted 5 lines · Christian Borntraeger
Quoted 2 lines · Thomas Huth

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. "

Quoted 5 lines
Quoted 1 line

Thomas

With that:

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

#5 lore raw
Quoted 24 lines · Christian Borntraeger
Quoted 21 lines · Cornelia Huck
Quoted 17 lines · On Wed, 28 Aug 2019 15:42:37 +0200 Thomas Huth <[email protected]> wrote:
Quoted 5 lines · Christian Borntraeger
Quoted 2 lines · Thomas Huth

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

Quoted 7 lines
Quoted 3 lines

With that:

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