public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH]Fix wrong use of memparse in efi.c
@ 2006-02-07  3:35 Zou Nan hai
  2006-02-07  6:43 ` Chen, Kenneth W
  2006-02-07  6:45 ` Zou, Nanhai
  0 siblings, 2 replies; 3+ messages in thread
From: Zou Nan hai @ 2006-02-07  3:35 UTC (permalink / raw)
  To: linux-ia64


The check of (end != cp) after memparse in efi.c looks wrong to me.
The result is that we can't use mem= and max_addr= kernel parameter at
the same time.

The following patch removed the check just like other arches do.

Signed-off-by: Zou Nan hai <nanhai.zou@intel.com>

diff -Nraup a/arch/ia64/kernel/efi.c d/arch/ia64/kernel/efi.c
--- a/arch/ia64/kernel/efi.c	2006-02-06 08:33:01.000000000 +0800
+++ d/arch/ia64/kernel/efi.c	2006-02-06 11:50:50.000000000 +0800
@@ -384,24 +384,16 @@ efi_init (void)
 	efi_config_table_t *config_tables;
 	efi_char16_t *c16;
 	u64 efi_desc_size;
-	char *cp, *end, vendor[100] = "unknown";
+	char *cp, vendor[100] = "unknown";
 	extern char saved_command_line[];
 	int i;
 
 	/* it's too early to be able to use the standard kernel command line support... */
 	for (cp = saved_command_line; *cp; ) {
 		if (memcmp(cp, "mem=", 4) = 0) {
-			cp += 4;
-			mem_limit = memparse(cp, &end);
-			if (end != cp)
-				break;
-			cp = end;
+			mem_limit = memparse(cp + 4, &cp);
 		} else if (memcmp(cp, "max_addr=", 9) = 0) {
-			cp += 9;
-			max_addr = GRANULEROUNDDOWN(memparse(cp, &end));
-			if (end != cp)
-				break;
-			cp = end;
+			max_addr = GRANULEROUNDDOWN(memparse(cp + 9, &cp));
 		} else {
 			while (*cp != ' ' && *cp)
 				++cp;




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

* RE: [PATCH]Fix wrong use of memparse in efi.c
  2006-02-07  3:35 [PATCH]Fix wrong use of memparse in efi.c Zou Nan hai
@ 2006-02-07  6:43 ` Chen, Kenneth W
  2006-02-07  6:45 ` Zou, Nanhai
  1 sibling, 0 replies; 3+ messages in thread
From: Chen, Kenneth W @ 2006-02-07  6:43 UTC (permalink / raw)
  To: linux-ia64

Zou Nan hai wrote on Monday, February 06, 2006 7:36 PM
> The check of (end != cp) after memparse in efi.c looks wrong to me.
> The result is that we can't use mem= and max_addr= kernel parameter at
> the same time.

Why do you want to use both parameters at the same time?  mem= limits
maximum logical memory size while max_addr= limits maximum physical
address used in the system. It sounds wired, but people are creative...

- Ken

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

* RE: [PATCH]Fix wrong use of memparse in efi.c
  2006-02-07  3:35 [PATCH]Fix wrong use of memparse in efi.c Zou Nan hai
  2006-02-07  6:43 ` Chen, Kenneth W
@ 2006-02-07  6:45 ` Zou, Nanhai
  1 sibling, 0 replies; 3+ messages in thread
From: Zou, Nanhai @ 2006-02-07  6:45 UTC (permalink / raw)
  To: linux-ia64

Actually I found this when add support to min_addr= support,
min_addr= + max_addr= is useful for a crashdumping kernel to limit its memory range.

Also I think use mem= and max_addr= at the same time could be useful when testing some configurations.

Zou Nan hai

> -----Original Message-----
> From: Chen, Kenneth W [mailto:kenneth.w.chen@intel.com]
> Sent: 2006Äê2ÔÂ7ÈÕ 14:33
> To: Zou, Nanhai; linux-ia64@vger.kernel.org
> Cc: Luck, Tony
> Subject: RE: [PATCH]Fix wrong use of memparse in efi.c
> 
> Zou Nan hai wrote on Monday, February 06, 2006 7:36 PM
> > The check of (end != cp) after memparse in efi.c looks wrong to me.
> > The result is that we can't use mem= and max_addr= kernel parameter at
> > the same time.
> 
> Why do you want to use both parameters at the same time?  mem= limits
> maximum logical memory size while max_addr= limits maximum physical
> address used in the system. It sounds wired, but people are creative...
> 
> - Ken


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

end of thread, other threads:[~2006-02-07  6:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-07  3:35 [PATCH]Fix wrong use of memparse in efi.c Zou Nan hai
2006-02-07  6:43 ` Chen, Kenneth W
2006-02-07  6:45 ` Zou, Nanhai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox