All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86: Remove excess calculations for heap_end_ptr
@ 2014-12-26 12:22 Alexander Kuleshov
  2014-12-26 14:35 ` Jeremiah Mahler
  0 siblings, 1 reply; 4+ messages in thread
From: Alexander Kuleshov @ 2014-12-26 12:22 UTC (permalink / raw)
  To: H. Peter Anvin, x86; +Cc: linux-kernel, Alexander Kuleshov

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

Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>
---
 arch/x86/boot/header.S | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/boot/header.S b/arch/x86/boot/header.S
index 16ef025..c69b870 100644
--- a/arch/x86/boot/header.S
+++ b/arch/x86/boot/header.S
@@ -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
-- 
2.2.1.201.gbbcefff


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] x86: Remove excess calculations for heap_end_ptr
  2014-12-26 12:22 [PATCH] x86: Remove excess calculations for heap_end_ptr Alexander Kuleshov
@ 2014-12-26 14:35 ` Jeremiah Mahler
  2014-12-26 17:03   ` Alexander Kuleshov
  0 siblings, 1 reply; 4+ messages in thread
From: Jeremiah Mahler @ 2014-12-26 14:35 UTC (permalink / raw)
  To: Alexander Kuleshov; +Cc: H. Peter Anvin, x86, linux-kernel

Alexander,

On Fri, Dec 26, 2014 at 06:22:42PM +0600, Alexander Kuleshov wrote:
> heap_end_ptr default value defined as _end+STACK_SZE-512, but
                                            STACK_SIZE 

> STACK_SIZE is already 512.
> 
> Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>
> ---
>  arch/x86/boot/header.S | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/x86/boot/header.S b/arch/x86/boot/header.S
> index 16ef025..c69b870 100644
> --- a/arch/x86/boot/header.S
> +++ b/arch/x86/boot/header.S
> @@ -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.

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

-- 
- Jeremiah Mahler

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] x86: Remove excess calculations for heap_end_ptr
  2014-12-26 14:35 ` Jeremiah Mahler
@ 2014-12-26 17:03   ` Alexander Kuleshov
  2014-12-26 17:04     ` H. Peter Anvin
  0 siblings, 1 reply; 4+ messages in thread
From: Alexander Kuleshov @ 2014-12-26 17:03 UTC (permalink / raw)
  To: Jeremiah Mahler, Alexander Kuleshov, H. Peter Anvin, x86, linux-kernel

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 <jmmahler@gmail.com>:
> Alexander,
>
> On Fri, Dec 26, 2014 at 06:22:42PM +0600, Alexander Kuleshov wrote:
>> heap_end_ptr default value defined as _end+STACK_SZE-512, but
>                                             STACK_SIZE
>
>> STACK_SIZE is already 512.
>>
>> Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>
>> ---
>>  arch/x86/boot/header.S | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/arch/x86/boot/header.S b/arch/x86/boot/header.S
>> index 16ef025..c69b870 100644
>> --- a/arch/x86/boot/header.S
>> +++ b/arch/x86/boot/header.S
>> @@ -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.
>
>> --
>> 2.2.1.201.gbbcefff
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>> Please read the FAQ at  http://www.tux.org/lkml/
>
> --
> - Jeremiah Mahler



-- 
_________________________
0xAX

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] x86: Remove excess calculations for heap_end_ptr
  2014-12-26 17:03   ` Alexander Kuleshov
@ 2014-12-26 17:04     ` H. Peter Anvin
  0 siblings, 0 replies; 4+ messages in thread
From: H. Peter Anvin @ 2014-12-26 17:04 UTC (permalink / raw)
  To: Alexander Kuleshov, Jeremiah Mahler, x86, linux-kernel

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

On December 26, 2014 9:03:38 AM PST, Alexander Kuleshov <kuleshovmail@gmail.com> wrote:
>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 <jmmahler@gmail.com>:
>> Alexander,
>>
>> On Fri, Dec 26, 2014 at 06:22:42PM +0600, Alexander Kuleshov wrote:
>>> heap_end_ptr default value defined as _end+STACK_SZE-512, but
>>                                             STACK_SIZE
>>
>>> STACK_SIZE is already 512.
>>>
>>> Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>
>>> ---
>>>  arch/x86/boot/header.S | 2 +-
>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/arch/x86/boot/header.S b/arch/x86/boot/header.S
>>> index 16ef025..c69b870 100644
>>> --- a/arch/x86/boot/header.S
>>> +++ b/arch/x86/boot/header.S
>>> @@ -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.
>>
>>> --
>>> 2.2.1.201.gbbcefff
>>>
>>> --
>>> To unsubscribe from this list: send the line "unsubscribe
>linux-kernel" in
>>> the body of a message to majordomo@vger.kernel.org
>>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>> Please read the FAQ at  http://www.tux.org/lkml/
>>
>> --
>> - Jeremiah Mahler

-- 
Sent from my mobile phone.  Please pardon brevity and lack of formatting.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-12-26 17:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-26 12:22 [PATCH] x86: Remove excess calculations for heap_end_ptr Alexander Kuleshov
2014-12-26 14:35 ` Jeremiah Mahler
2014-12-26 17:03   ` Alexander Kuleshov
2014-12-26 17:04     ` H. Peter Anvin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.