Blame SOURCES/kexec-tools-2.0.14-kexec-powerpc-fix-command-line-overflow-error.patch

fda493
From 21eb397a5fc9227cd95d23e8c74a49cf6a293e57 Mon Sep 17 00:00:00 2001
fda493
fda493
From: Hari Bathini <hbathini@linux.vnet.ibm.com>
fda493
fda493
Subject: [PATCH] kexec-tools: powerpc: fix command line overflow error
fda493
fda493
Since kernel commit a5980d064fe2 ("powerpc: Bump COMMAND_LINE_SIZE
fda493
to 2048"), powerpc bumped command line size to 2048 but the size
fda493
used here is still the default value of 512. Bump it to 2048 to
fda493
fix command line overflow errors observed when command line length
fda493
is above 512 bytes. Also, get rid of the multiple definitions of
fda493
COMMAND_LINE_SIZE macro in ppc architecture.
fda493
fda493
Signed-off-by: Hari Bathini <hbathini@linux.vnet.ibm.com>
fda493
Signed-off-by: Simon Horman <horms@verge.net.au>
fda493
---
fda493
 kexec/arch/ppc/crashdump-powerpc.h |    2 --
fda493
 kexec/arch/ppc/fs2dt.c             |    1 -
fda493
 kexec/arch/ppc/kexec-ppc.h         |    3 ++-
fda493
 kexec/arch/ppc/ops.h               |    1 -
fda493
 kexec/arch/ppc64/crashdump-ppc64.h |    2 +-
fda493
 5 files changed, 3 insertions(+), 6 deletions(-)
fda493
fda493
diff --git a/kexec/arch/ppc/crashdump-powerpc.h b/kexec/arch/ppc/crashdump-powerpc.h
fda493
index 9b9b01e..97b5095 100644
fda493
--- a/kexec/arch/ppc/crashdump-powerpc.h
fda493
+++ b/kexec/arch/ppc/crashdump-powerpc.h
fda493
@@ -20,8 +20,6 @@ extern struct arch_options_t arch_options;
fda493
 #define KERNELBASE	PAGE_OFFSET
fda493
 #define __pa(x)		((unsigned long)(x)-PAGE_OFFSET)
fda493
 
fda493
-#define COMMAND_LINE_SIZE	512 /* from kernel */
fda493
-
fda493
 #ifdef CONFIG_BOOKE
fda493
 /* We don't need backup region in Book E */
fda493
 #define BACKUP_SRC_START	0x0000
fda493
diff --git a/kexec/arch/ppc/fs2dt.c b/kexec/arch/ppc/fs2dt.c
fda493
index 6e77379..fed499b 100644
fda493
--- a/kexec/arch/ppc/fs2dt.c
fda493
+++ b/kexec/arch/ppc/fs2dt.c
fda493
@@ -37,7 +37,6 @@
fda493
 #define TREEWORDS		65536	/* max 32 bit words for properties */
fda493
 #define MEMRESERVE		256	/* max number of reserved memory blks */
fda493
 #define MAX_MEMORY_RANGES	1024
fda493
-#define COMMAND_LINE_SIZE	512	/* from kernel */
fda493
 
fda493
 static char pathname[MAXPATH];
fda493
 static char propnames[NAMESPACE] = { 0 };
fda493
diff --git a/kexec/arch/ppc/kexec-ppc.h b/kexec/arch/ppc/kexec-ppc.h
fda493
index 904cf48..6dc36c6 100644
fda493
--- a/kexec/arch/ppc/kexec-ppc.h
fda493
+++ b/kexec/arch/ppc/kexec-ppc.h
fda493
@@ -6,6 +6,8 @@
fda493
 #define CORE_TYPE_ELF32	1
fda493
 #define CORE_TYPE_ELF64	2
fda493
 
fda493
+#define COMMAND_LINE_SIZE	2048 /* from kernel */
fda493
+
fda493
 extern unsigned char setup_simple_start[];
fda493
 extern uint32_t setup_simple_size;
fda493
 
fda493
@@ -75,7 +77,6 @@ extern unsigned long dt_address_cells, dt_size_cells;
fda493
 extern int init_memory_region_info(void);
fda493
 extern int read_memory_region_limits(int fd, unsigned long long *start,
fda493
 					unsigned long long *end);
fda493
-#define COMMAND_LINE_SIZE	512 /* from kernel */
fda493
 /*fs2dt*/
fda493
 void reserve(unsigned long long where, unsigned long long length);
fda493
 
fda493
diff --git a/kexec/arch/ppc/ops.h b/kexec/arch/ppc/ops.h
fda493
index 7334a05..5e7a070 100644
fda493
--- a/kexec/arch/ppc/ops.h
fda493
+++ b/kexec/arch/ppc/ops.h
fda493
@@ -12,7 +12,6 @@
fda493
 #define _PPC_BOOT_OPS_H_
fda493
 #include "types.h"
fda493
 
fda493
-#define	COMMAND_LINE_SIZE	512
fda493
 #define	MAX_PATH_LEN		256
fda493
 #define	MAX_PROP_LEN		256 /* What should this be? */
fda493
 
fda493
diff --git a/kexec/arch/ppc64/crashdump-ppc64.h b/kexec/arch/ppc64/crashdump-ppc64.h
fda493
index d654c6b..42ccc31 100644
fda493
--- a/kexec/arch/ppc64/crashdump-ppc64.h
fda493
+++ b/kexec/arch/ppc64/crashdump-ppc64.h
fda493
@@ -16,7 +16,7 @@ void add_usable_mem_rgns(unsigned long long base, unsigned long long size);
fda493
 #define __pa(x)         ((unsigned long)(x)-PAGE_OFFSET)
fda493
 #define MAXMEM          (-KERNELBASE-VMALLOCBASE)
fda493
 
fda493
-#define COMMAND_LINE_SIZE       512 /* from kernel */
fda493
+#define COMMAND_LINE_SIZE       2048 /* from kernel */
fda493
 /* Backup Region, First 64K of System RAM. */
fda493
 #define BACKUP_SRC_START    0x0000
fda493
 #define BACKUP_SRC_END      0xffff