All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH V2] x86/boot/e820: add new chareater - to free BIOS memory in memmap bootargs
@ 2018-04-10  2:59 zoucao
  2018-04-10  2:59 ` [PATCH] x86/boot/e820: add new chareater "-" " zoucao
  0 siblings, 1 reply; 8+ messages in thread
From: zoucao @ 2018-04-10  2:59 UTC (permalink / raw)
  To: tglx, mingo, hpa; +Cc: x86, linux-kernel

this is useing memmap=0x4101000-0x6aeff000 to free BIOS reserved memory
"6aeff000-6effffff : reserved":

	......
	00100000-6aefefff : System RAM
	01000000-0165537a : Kernel code
	0165537b-01a8873f : Kernel data
	01c31000-01f4efff : Kernel bss
	28000000-320fffff : Crash kernel
	6aeff000-6effffff : reserved       --> it is e820 reserved memory
	6f000000-78240fff : System RAM
	......


add bootargs memmap=0x4101000-0x6aeff000, to free memory region: 6aeff000-6effffff
then 6aeff000-6effffff will be merged into 00100000-78240fff.

new iomem:
	cat /proc/iomem:
	......
	00100000-78240fff : System RAM
	01000000-0165537a : Kernel code
	0165537b-01a8873f : Kernel data
	01c31000-01f4efff : Kernel bss
	......


V1>V2: fixed the wrong chareaters

zoucao (1):
      x86/boot/e820: add new chareater "-" to free BIOS memory in memmap bootargs

 7u/Documentation/kernel-parameters.txt | 6 ++++++
 7u/arch/x86/kernel/e820.c              | 3 +++
 2 files changed, 9 insertions(+)

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

* [PATCH] x86/boot/e820: add new chareater "-" to free BIOS memory in memmap bootargs
  2018-04-10  2:59 [PATCH V2] x86/boot/e820: add new chareater - to free BIOS memory in memmap bootargs zoucao
@ 2018-04-10  2:59 ` zoucao
  2018-04-16 11:06   ` zoucao-ipc
                     ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: zoucao @ 2018-04-10  2:59 UTC (permalink / raw)
  To: tglx, mingo, hpa; +Cc: x86, linux-kernel

From: zoucao <zoucao@localhost.localdomain>

Normally every BIOS reserved memory is used for some features, we can't
use them, but in some conditions,  users can ensure some BIOS memories
are not used and reserved memory is well to free, they have not a good
way to free these memories, here add a new chareater "-" in memmap to
free reserved memory.

Signed-off-by: zou cao <zoucao@linux.alibaba.com>
---
 7u/Documentation/kernel-parameters.txt | 6 ++++++
 7u/arch/x86/kernel/e820.c              | 3 +++
 2 files changed, 9 insertions(+)

diff --git a/7u/Documentation/kernel-parameters.txt b/7u/Documentation/kernel-parameters.txt
index 9a1abb99a..dbea75e12 100644
--- a/7u/Documentation/kernel-parameters.txt
+++ b/7u/Documentation/kernel-parameters.txt
@@ -1677,6 +1677,12 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
 			         or
 			         memmap=0x10000$0x18690000
 
+	memmap=nn[KMG]-ss[KMG]
+			Free E820 reserved memory, as specified by the user.
+			Region of reserved memory to be free, from ss to ss+nn.
+			Example: free reserved memory from 0x18690000-0x186a0000
+					memmap=0x4101000-0x6aeff000
+
 	memory_corruption_check=0/1 [X86]
 			Some BIOSes seem to corrupt the first 64k of
 			memory when doing things like suspend/resume.
diff --git a/7u/arch/x86/kernel/e820.c b/7u/arch/x86/kernel/e820.c
index 174da5fc5..b8a042981 100644
--- a/7u/arch/x86/kernel/e820.c
+++ b/7u/arch/x86/kernel/e820.c
@@ -875,6 +875,9 @@ static int __init parse_memmap_one(char *p)
 	} else if (*p == '$') {
 		start_at = memparse(p+1, &p);
 		e820_add_region(start_at, mem_size, E820_RESERVED);
+	} else if (*p == '-') {
+		start_at = memparse(p+1, &p);
+		e820_remove_range(start_at, mem_size, E820_RESERVED, E820_RAM);
 	} else
 		e820_remove_range(mem_size, ULLONG_MAX - mem_size, E820_RAM, 1);
 
-- 
2.14.1.40.g8e62ba1

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

* Re: [PATCH] x86/boot/e820: add new chareater "-" to free BIOS memory in memmap bootargs
  2018-04-10  2:59 ` [PATCH] x86/boot/e820: add new chareater "-" " zoucao
@ 2018-04-16 11:06   ` zoucao-ipc
  2018-04-17  6:18   ` zoucao-ipc
  2018-04-17 13:47   ` Thomas Gleixner
  2 siblings, 0 replies; 8+ messages in thread
From: zoucao-ipc @ 2018-04-16 11:06 UTC (permalink / raw)
  To: zoucao, tglx, mingo, hpa; +Cc: x86, linux-kernel

any suggestions?

On 2018/4/10 上午10:59, zoucao@linux.alibaba.com wrote:
> From: zoucao <zoucao@localhost.localdomain>
>
> Normally every BIOS reserved memory is used for some features, we can't
> use them, but in some conditions,  users can ensure some BIOS memories
> are not used and reserved memory is well to free, they have not a good
> way to free these memories, here add a new chareater "-" in memmap to
> free reserved memory.
>
> Signed-off-by: zou cao <zoucao@linux.alibaba.com>
> ---
>   7u/Documentation/kernel-parameters.txt | 6 ++++++
>   7u/arch/x86/kernel/e820.c              | 3 +++
>   2 files changed, 9 insertions(+)
>
> diff --git a/7u/Documentation/kernel-parameters.txt b/7u/Documentation/kernel-parameters.txt
> index 9a1abb99a..dbea75e12 100644
> --- a/7u/Documentation/kernel-parameters.txt
> +++ b/7u/Documentation/kernel-parameters.txt
> @@ -1677,6 +1677,12 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
>   			         or
>   			         memmap=0x10000$0x18690000
>   
> +	memmap=nn[KMG]-ss[KMG]
> +			Free E820 reserved memory, as specified by the user.
> +			Region of reserved memory to be free, from ss to ss+nn.
> +			Example: free reserved memory from 0x18690000-0x186a0000
> +					memmap=0x4101000-0x6aeff000
> +
>   	memory_corruption_check=0/1 [X86]
>   			Some BIOSes seem to corrupt the first 64k of
>   			memory when doing things like suspend/resume.
> diff --git a/7u/arch/x86/kernel/e820.c b/7u/arch/x86/kernel/e820.c
> index 174da5fc5..b8a042981 100644
> --- a/7u/arch/x86/kernel/e820.c
> +++ b/7u/arch/x86/kernel/e820.c
> @@ -875,6 +875,9 @@ static int __init parse_memmap_one(char *p)
>   	} else if (*p == '$') {
>   		start_at = memparse(p+1, &p);
>   		e820_add_region(start_at, mem_size, E820_RESERVED);
> +	} else if (*p == '-') {
> +		start_at = memparse(p+1, &p);
> +		e820_remove_range(start_at, mem_size, E820_RESERVED, E820_RAM);
>   	} else
>   		e820_remove_range(mem_size, ULLONG_MAX - mem_size, E820_RAM, 1);
>   

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

* Re: [PATCH] x86/boot/e820: add new chareater "-" to free BIOS memory in memmap bootargs
  2018-04-10  2:59 ` [PATCH] x86/boot/e820: add new chareater "-" " zoucao
  2018-04-16 11:06   ` zoucao-ipc
@ 2018-04-17  6:18   ` zoucao-ipc
  2018-04-17 10:22     ` Thomas Gleixner
  2018-04-17 13:47   ` Thomas Gleixner
  2 siblings, 1 reply; 8+ messages in thread
From: zoucao-ipc @ 2018-04-17  6:18 UTC (permalink / raw)
  To: tglx, mingo, hpa; +Cc: zoucao, x86, linux-kernel

ping?

On 2018/4/10 上午10:59, zoucao@linux.alibaba.com wrote:
> From: zoucao <zoucao@localhost.localdomain>
>
> Normally every BIOS reserved memory is used for some features, we can't
> use them, but in some conditions,  users can ensure some BIOS memories
> are not used and reserved memory is well to free, they have not a good
> way to free these memories, here add a new chareater "-" in memmap to
> free reserved memory.
>
> Signed-off-by: zou cao <zoucao@linux.alibaba.com>
> ---
>   7u/Documentation/kernel-parameters.txt | 6 ++++++
>   7u/arch/x86/kernel/e820.c              | 3 +++
>   2 files changed, 9 insertions(+)
>
> diff --git a/7u/Documentation/kernel-parameters.txt b/7u/Documentation/kernel-parameters.txt
> index 9a1abb99a..dbea75e12 100644
> --- a/7u/Documentation/kernel-parameters.txt
> +++ b/7u/Documentation/kernel-parameters.txt
> @@ -1677,6 +1677,12 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
>   			         or
>   			         memmap=0x10000$0x18690000
>   
> +	memmap=nn[KMG]-ss[KMG]
> +			Free E820 reserved memory, as specified by the user.
> +			Region of reserved memory to be free, from ss to ss+nn.
> +			Example: free reserved memory from 0x18690000-0x186a0000
> +					memmap=0x4101000-0x6aeff000
> +
>   	memory_corruption_check=0/1 [X86]
>   			Some BIOSes seem to corrupt the first 64k of
>   			memory when doing things like suspend/resume.
> diff --git a/7u/arch/x86/kernel/e820.c b/7u/arch/x86/kernel/e820.c
> index 174da5fc5..b8a042981 100644
> --- a/7u/arch/x86/kernel/e820.c
> +++ b/7u/arch/x86/kernel/e820.c
> @@ -875,6 +875,9 @@ static int __init parse_memmap_one(char *p)
>   	} else if (*p == '$') {
>   		start_at = memparse(p+1, &p);
>   		e820_add_region(start_at, mem_size, E820_RESERVED);
> +	} else if (*p == '-') {
> +		start_at = memparse(p+1, &p);
> +		e820_remove_range(start_at, mem_size, E820_RESERVED, E820_RAM);
>   	} else
>   		e820_remove_range(mem_size, ULLONG_MAX - mem_size, E820_RAM, 1);
>   

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

* Re: [PATCH] x86/boot/e820: add new chareater "-" to free BIOS memory in memmap bootargs
  2018-04-17  6:18   ` zoucao-ipc
@ 2018-04-17 10:22     ` Thomas Gleixner
  2018-04-17 13:11       ` zoucao-ipc
  0 siblings, 1 reply; 8+ messages in thread
From: Thomas Gleixner @ 2018-04-17 10:22 UTC (permalink / raw)
  To: zoucao-ipc; +Cc: mingo, hpa, zoucao, x86, linux-kernel

On Tue, 17 Apr 2018, zoucao-ipc wrote:

> ping?

You already pinged yesterday. Are you going to switch to hourly pings
tomorrow?

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

* Re: [PATCH] x86/boot/e820: add new chareater "-" to free BIOS memory in memmap bootargs
  2018-04-17 10:22     ` Thomas Gleixner
@ 2018-04-17 13:11       ` zoucao-ipc
  0 siblings, 0 replies; 8+ messages in thread
From: zoucao-ipc @ 2018-04-17 13:11 UTC (permalink / raw)
  To: Thomas Gleixner; +Cc: mingo, hpa, zoucao, x86, linux-kernel

Hi thomas:

Sorry, i don't receive yesterday email, i think the ping email is lost,
so bad me.
Anyway,have you some suggestions for this little patch? i really need 
your help.

Regards,
czou

On 2018/4/17 下午6:22, Thomas Gleixner wrote:
> On Tue, 17 Apr 2018, zoucao-ipc wrote:
>
>> ping?
> You already pinged yesterday. Are you going to switch to hourly pings
> tomorrow?
>

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

* Re: [PATCH] x86/boot/e820: add new chareater "-" to free BIOS memory in memmap bootargs
  2018-04-10  2:59 ` [PATCH] x86/boot/e820: add new chareater "-" " zoucao
  2018-04-16 11:06   ` zoucao-ipc
  2018-04-17  6:18   ` zoucao-ipc
@ 2018-04-17 13:47   ` Thomas Gleixner
  2018-04-17 14:40     ` zoucao-ipc
  2 siblings, 1 reply; 8+ messages in thread
From: Thomas Gleixner @ 2018-04-17 13:47 UTC (permalink / raw)
  To: zoucao; +Cc: mingo, hpa, x86, linux-kernel

On Tue, 10 Apr 2018, zoucao@linux.alibaba.com wrote:
> From: zoucao <zoucao@localhost.localdomain>

Interesting from ... Please use your real mail address for this.

> Normally every BIOS reserved memory is used for some features, we can't
> use them, but in some conditions,  users can ensure some BIOS memories
> are not used and reserved memory is well to free, they have not a good
> way to free these memories, here add a new chareater "-" in memmap to
> free reserved memory.

I'm not really convinced about this. How should anyone without detailed
BIOS knowledge know that this is really reusable?

The person who knows must have access to the BIOS developer, so why can't
the BIOS be fixed instead?

Thanks,

	tglx

> Signed-off-by: zou cao <zoucao@linux.alibaba.com>
> ---
>  7u/Documentation/kernel-parameters.txt | 6 ++++++
>  7u/arch/x86/kernel/e820.c              | 3 +++
>  2 files changed, 9 insertions(+)
> 
> diff --git a/7u/Documentation/kernel-parameters.txt b/7u/Documentation/kernel-parameters.txt
> index 9a1abb99a..dbea75e12 100644
> --- a/7u/Documentation/kernel-parameters.txt
> +++ b/7u/Documentation/kernel-parameters.txt
> @@ -1677,6 +1677,12 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
>  			         or
>  			         memmap=0x10000$0x18690000
>  
> +	memmap=nn[KMG]-ss[KMG]
> +			Free E820 reserved memory, as specified by the user.
> +			Region of reserved memory to be free, from ss to ss+nn.
> +			Example: free reserved memory from 0x18690000-0x186a0000
> +					memmap=0x4101000-0x6aeff000
> +
>  	memory_corruption_check=0/1 [X86]
>  			Some BIOSes seem to corrupt the first 64k of
>  			memory when doing things like suspend/resume.
> diff --git a/7u/arch/x86/kernel/e820.c b/7u/arch/x86/kernel/e820.c
> index 174da5fc5..b8a042981 100644
> --- a/7u/arch/x86/kernel/e820.c
> +++ b/7u/arch/x86/kernel/e820.c
> @@ -875,6 +875,9 @@ static int __init parse_memmap_one(char *p)
>  	} else if (*p == '$') {
>  		start_at = memparse(p+1, &p);
>  		e820_add_region(start_at, mem_size, E820_RESERVED);
> +	} else if (*p == '-') {
> +		start_at = memparse(p+1, &p);
> +		e820_remove_range(start_at, mem_size, E820_RESERVED, E820_RAM);
>  	} else
>  		e820_remove_range(mem_size, ULLONG_MAX - mem_size, E820_RAM, 1);
>  
> -- 
> 2.14.1.40.g8e62ba1
> 
> 

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

* Re: [PATCH] x86/boot/e820: add new chareater "-" to free BIOS memory in memmap bootargs
  2018-04-17 13:47   ` Thomas Gleixner
@ 2018-04-17 14:40     ` zoucao-ipc
  0 siblings, 0 replies; 8+ messages in thread
From: zoucao-ipc @ 2018-04-17 14:40 UTC (permalink / raw)
  To: Thomas Gleixner, zoucao; +Cc: mingo, hpa, x86, linux-kernel


On 2018/4/17 下午9:47, Thomas Gleixner wrote:
> On Tue, 10 Apr 2018, zoucao@linux.alibaba.com wrote:
>> From: zoucao <zoucao@localhost.localdomain>
> Interesting from ... Please use your real mail address for this.
miss this, i will do it.
>> Normally every BIOS reserved memory is used for some features, we can't
>> use them, but in some conditions,  users can ensure some BIOS memories
>> are not used and reserved memory is well to free, they have not a good
>> way to free these memories, here add a new chareater "-" in memmap to
>> free reserved memory.
> I'm not really convinced about this. How should anyone without detailed
> BIOS knowledge know that this is really reusable?
>
> The person who knows must have access to the BIOS developer, so why can't
> the BIOS be fixed instead?
>
> Thanks,
>
> 	tglx
>
>> Signed-off-by: zou cao <zoucao@linux.alibaba.com>
>> ---
>>   7u/Documentation/kernel-parameters.txt | 6 ++++++
>>   7u/arch/x86/kernel/e820.c              | 3 +++
>>   2 files changed, 9 insertions(+)
>>
>> diff --git a/7u/Documentation/kernel-parameters.txt b/7u/Documentation/kernel-parameters.txt
>> index 9a1abb99a..dbea75e12 100644
>> --- a/7u/Documentation/kernel-parameters.txt
>> +++ b/7u/Documentation/kernel-parameters.txt
>> @@ -1677,6 +1677,12 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
>>   			         or
>>   			         memmap=0x10000$0x18690000
>>   
>> +	memmap=nn[KMG]-ss[KMG]
>> +			Free E820 reserved memory, as specified by the user.
>> +			Region of reserved memory to be free, from ss to ss+nn.
>> +			Example: free reserved memory from 0x18690000-0x186a0000
>> +					memmap=0x4101000-0x6aeff000
>> +
>>   	memory_corruption_check=0/1 [X86]
>>   			Some BIOSes seem to corrupt the first 64k of
>>   			memory when doing things like suspend/resume.
>> diff --git a/7u/arch/x86/kernel/e820.c b/7u/arch/x86/kernel/e820.c
>> index 174da5fc5..b8a042981 100644
>> --- a/7u/arch/x86/kernel/e820.c
>> +++ b/7u/arch/x86/kernel/e820.c
>> @@ -875,6 +875,9 @@ static int __init parse_memmap_one(char *p)
>>   	} else if (*p == '$') {
>>   		start_at = memparse(p+1, &p);
>>   		e820_add_region(start_at, mem_size, E820_RESERVED);
>> +	} else if (*p == '-') {
>> +		start_at = memparse(p+1, &p);
>> +		e820_remove_range(start_at, mem_size, E820_RESERVED, E820_RAM);
>>   	} else
>>   		e820_remove_range(mem_size, ULLONG_MAX - mem_size, E820_RAM, 1);
>>   
>> -- 
>> 2.14.1.40.g8e62ba1
>>
>>

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

end of thread, other threads:[~2018-04-17 14:41 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-10  2:59 [PATCH V2] x86/boot/e820: add new chareater - to free BIOS memory in memmap bootargs zoucao
2018-04-10  2:59 ` [PATCH] x86/boot/e820: add new chareater "-" " zoucao
2018-04-16 11:06   ` zoucao-ipc
2018-04-17  6:18   ` zoucao-ipc
2018-04-17 10:22     ` Thomas Gleixner
2018-04-17 13:11       ` zoucao-ipc
2018-04-17 13:47   ` Thomas Gleixner
2018-04-17 14:40     ` zoucao-ipc

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.