Skip to contentSkip to conversation

x86: Remove excess calculations for heap_end_ptr

PATCH In review Alexander Kuleshov 3 participants 4 messages Dec 26, 2014 x86

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86: Remove excess calculations for heap_end_ptr

heap_end_ptr default value defined as _end+STACK_SZE-512, but STACK_SIZE is already 512.

---
 arch/x86/boot/header.S | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/boot/header.S +1 -1
index 16ef025..c69b870 100644
@@ -342,7 +342,7 @@ ramdisk_size:	.long	0		# its size in bytes
 bootsect_kludge:
 		.long	0		# obsolete
 
-heap_end_ptr:	.word	_end+STACK_SIZE-512
+heap_end_ptr:	.word	_end
 					# (Header version 0x0201 or later)
 					# space from here (exclusive) down to
 					# end of setup code can be used by setup
Signature · 1 line
2.2.1.201.gbbcefff
#1 lore raw

Alexander,

Quoted 1 line · Alexander Kuleshov

heap_end_ptr default value defined as _end+STACK_SZE-512, but

STACK_SIZE

Quoted 12 lines

STACK_SIZE is already 512.

---
 arch/x86/boot/header.S | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/boot/header.S +0 -0
index 16ef025..c69b870 100644

arch/x86/boot/header.S ramdisk_size: .long 0 # its size in bytes · line 348

Quoted 8 lines
arch/x86/boot/header.S +1 -1
@@ -342,7 +342,7 @@ ramdisk_size:	.long	0		# its size in bytes
 bootsect_kludge:
 		.long	0		# obsolete
 
-heap_end_ptr:	.word	_end+STACK_SIZE-512
+heap_end_ptr:	.word	_end
 					# (Header version 0x0201 or later)
 					# space from here (exclusive) down to
 					# end of setup code can be used by setup

So right now STACK_SIZE happens to be 512 so STACK_SIZE-512 is zero. What happens if someone changes the size of STACK_SIZE?

This change doesn't fix any problem right now and creates potential problems in the future.

Quoted 8 lines
Signature · 7 lines
2.2.1.201.gbbcefff

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
Signature · 1 line
- Jeremiah Mahler
#2 lore raw

Yes, you're right,

At first i thought that it is just typo, and right after that i thought about this case when somebody will change STACK_SIZE

2014-12-26 20:35 GMT+06:00 Jeremiah Mahler <[email protected]>:

Quoted 44 lines

Alexander,

Quoted 1 line · Alexander Kuleshov

heap_end_ptr default value defined as _end+STACK_SZE-512, but

STACK_SIZE

Quoted 12 lines

STACK_SIZE is already 512.

---
 arch/x86/boot/header.S | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/boot/header.S +0 -0
index 16ef025..c69b870 100644

arch/x86/boot/header.S ramdisk_size: .long 0 # its size in bytes · line 348

Quoted 8 lines
arch/x86/boot/header.S +1 -1
@@ -342,7 +342,7 @@ ramdisk_size:     .long   0               # its size in bytes
 bootsect_kludge:
              .long   0               # obsolete
 
-heap_end_ptr:        .word   _end+STACK_SIZE-512
+heap_end_ptr:        .word   _end
                                      # (Header version 0x0201 or later)
                                      # space from here (exclusive) down to
                                      # end of setup code can be used by setup

So right now STACK_SIZE happens to be 512 so STACK_SIZE-512 is zero. What happens if someone changes the size of STACK_SIZE?

This change doesn't fix any problem right now and creates potential problems in the future.

Quoted 8 lines

--
2.2.1.201.gbbcefff

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

--
- Jeremiah Mahler

Signature · 2 lines
_________________________
0xAX
#3 lore raw

Yes, the -512 is not related to STACK_SIZE, so this patch is wrong. NAK.

Quoted 55 lines · Alexander Kuleshov

Yes, you're right,

At first i thought that it is just typo, and right after that i thought about this case when somebody will change STACK_SIZE

2014-12-26 20:35 GMT+06:00 Jeremiah Mahler <[email protected]>:

Quoted 13 lines

Alexander,

Quoted 1 line · Alexander Kuleshov

heap_end_ptr default value defined as _end+STACK_SZE-512, but

STACK_SIZE

Quoted 7 lines

STACK_SIZE is already 512.

---
 arch/x86/boot/header.S | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 5 lines

arch/x86/boot/header.S ramdisk_size: .long 0 # its

Quoted 5 lines
arch/x86/boot/header.S +0 -0
index 16ef025..c69b870 100644
@@ -342,7 +342,7 @@ ramdisk_size:     .long   0               # its

size in bytes

Quoted 6 lines

arch/x86/boot/header.S ramdisk_size: .long 0 # its size in bytes

Quoted 6 lines
arch/x86/boot/header.S +1 -1
 bootsect_kludge:
              .long   0               # obsolete
 
-heap_end_ptr:        .word   _end+STACK_SIZE-512
+heap_end_ptr:        .word   _end
                                      # (Header version 0x0201 or

later)

Quoted 1 line

arch/x86/boot/header.S ramdisk_size: .long 0 # its · line 347

Quoted 1 line
arch/x86/boot/header.S +0 -0
                                      # space from here (exclusive)

down to

Quoted 1 line

arch/x86/boot/header.S ramdisk_size: .long 0 # its · line 348

Quoted 1 line
arch/x86/boot/header.S +0 -0
                                      # end of setup code can be

used by setup

Quoted 12 lines

So right now STACK_SIZE happens to be 512 so STACK_SIZE-512 is zero. What happens if someone changes the size of STACK_SIZE?

This change doesn't fix any problem right now and creates potential problems in the future.

Quoted 5 lines

--
2.2.1.201.gbbcefff

--
To unsubscribe from this list: send the line "unsubscribe

linux-kernel" in

Quoted 6 lines
Quoted 3 lines

the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

--
- Jeremiah Mahler

Signature · 1 line
Sent from my mobile phone.  Please pardon brevity and lack of formatting.