public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC][PATCH 3/3] Kdump: Export crash notes section address through sysfs
@ 2005-02-24 16:17 Vivek Goyal
  2005-03-01  6:05 ` Andrew Morton
  0 siblings, 1 reply; 3+ messages in thread
From: Vivek Goyal @ 2005-02-24 16:17 UTC (permalink / raw)
  To: Eric W. Biederman; +Cc: fastboot, lkml, Andrew Morton

[-- Attachment #1: Type: text/plain, Size: 1 bytes --]



[-- Attachment #2: kexec-x86-exports-thru-sysfs.patch --]
[-- Type: text/plain, Size: 2434 bytes --]


o Following patch exports kexec global variable "crash_notes" to user space
  through sysfs as kernel attribute in /sys/kernel.

Signed-off-by: Maneesh Soni <maneesh@in.ibm.com>
---

 linux-2.6.11-rc4-mm1-maneesh/arch/i386/kernel/crash.c |    2 --
 linux-2.6.11-rc4-mm1-maneesh/include/asm-i386/kexec.h |    5 +++++
 linux-2.6.11-rc4-mm1-maneesh/kernel/ksysfs.c          |   13 +++++++++++++
 3 files changed, 18 insertions(+), 2 deletions(-)

diff -puN kernel/ksysfs.c~kexec-exports-thru-sysfs kernel/ksysfs.c
--- linux-2.6.11-rc4-mm1/kernel/ksysfs.c~kexec-exports-thru-sysfs	2005-02-24 13:49:27.953186392 +0530
+++ linux-2.6.11-rc4-mm1-maneesh/kernel/ksysfs.c	2005-02-24 13:49:27.969183960 +0530
@@ -15,6 +15,8 @@
 #include <linux/module.h>
 #include <linux/init.h>
 
+#include <asm/kexec.h>
+
 #define KERNEL_ATTR_RO(_name) \
 static struct subsys_attribute _name##_attr = __ATTR_RO(_name)
 
@@ -30,6 +32,14 @@ static ssize_t hotplug_seqnum_show(struc
 KERNEL_ATTR_RO(hotplug_seqnum);
 #endif
 
+#ifdef CONFIG_KEXEC
+static ssize_t crash_notes_show(struct subsystem *subsys, char *page)
+{
+	return sprintf(page, "%p\n", (void *)crash_notes);
+}
+KERNEL_ATTR_RO(crash_notes);
+#endif
+
 decl_subsys(kernel, NULL, NULL);
 EXPORT_SYMBOL_GPL(kernel_subsys);
 
@@ -37,6 +47,9 @@ static struct attribute * kernel_attrs[]
 #ifdef CONFIG_HOTPLUG
 	&hotplug_seqnum_attr.attr,
 #endif
+#ifdef CONFIG_KEXEC
+	&crash_notes_attr.attr,
+#endif
 	NULL
 };
 
diff -puN include/asm-i386/kexec.h~kexec-exports-thru-sysfs include/asm-i386/kexec.h
--- linux-2.6.11-rc4-mm1/include/asm-i386/kexec.h~kexec-exports-thru-sysfs	2005-02-24 13:49:27.957185784 +0530
+++ linux-2.6.11-rc4-mm1-maneesh/include/asm-i386/kexec.h	2005-02-24 13:49:27.970183808 +0530
@@ -25,4 +25,9 @@
 /* The native architecture */
 #define KEXEC_ARCH KEXEC_ARCH_386
 
+#define MAX_NOTE_BYTES 1024
+typedef u32 note_buf_t[MAX_NOTE_BYTES/4];
+
+extern note_buf_t crash_notes[];
+
 #endif /* _I386_KEXEC_H */
diff -puN arch/i386/kernel/crash.c~kexec-exports-thru-sysfs arch/i386/kernel/crash.c
--- linux-2.6.11-rc4-mm1/arch/i386/kernel/crash.c~kexec-exports-thru-sysfs	2005-02-24 13:49:27.960185328 +0530
+++ linux-2.6.11-rc4-mm1-maneesh/arch/i386/kernel/crash.c	2005-02-24 13:49:27.970183808 +0530
@@ -26,8 +26,6 @@
 #include <asm/apic.h>
 #include <mach_ipi.h>
 
-#define MAX_NOTE_BYTES 1024
-typedef u32 note_buf_t[MAX_NOTE_BYTES/4];
 
 note_buf_t crash_notes[NR_CPUS];
 
_
-- 

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

* Re: [RFC][PATCH 3/3] Kdump: Export crash notes section address through sysfs
  2005-02-24 16:17 [RFC][PATCH 3/3] Kdump: Export crash notes section address through sysfs Vivek Goyal
@ 2005-03-01  6:05 ` Andrew Morton
  2005-03-01 22:03   ` [Fastboot] " Randy.Dunlap
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Morton @ 2005-03-01  6:05 UTC (permalink / raw)
  To: Vivek Goyal; +Cc: ebiederm, fastboot, linux-kernel

Vivek Goyal <vgoyal@in.ibm.com> wrote:
>
> o Following patch exports kexec global variable "crash_notes" to user space
>    through sysfs as kernel attribute in /sys/kernel.

It breaks the x86_64 build.  A fix for that is below.

Please test kexec/kdump patches on all three architectures, both with your
config option enabled and with it disabled.  There are cross-compilers at
http://developer.osdl.org/dev/plm/cross_compile/


It also breaks the ppc build:

kernel/ksysfs.c: In function `crash_notes_show':
kernel/ksysfs.c:38: error: `crash_notes' undeclared (first use in this function)
kernel/ksysfs.c:38: error: (Each undeclared identifier is reported only once
kernel/ksysfs.c:38: error: for each function it appears in.)

but as ppc doesn't support crashdump, that is unfixable.

Why is the crashdump feature linked to CONFIG_KEXEC?  It should have its
own config option, which is dependent upon kexec.




kernel/ksysfs.c: In function `crash_notes_show':
kernel/ksysfs.c:38: error: `crash_notes' undeclared (first use in this function)
kernel/ksysfs.c:38: error: (Each undeclared identifier is reported only once
kernel/ksysfs.c:38: error: for each function it appears in.)


Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/arch/x86_64/kernel/crash.c |    3 ---
 25-akpm/include/asm-x86_64/kexec.h |    5 +++++
 2 files changed, 5 insertions(+), 3 deletions(-)

diff -puN include/asm-x86_64/kexec.h~kdump-export-crash-notes-section-address-through-x86_64-fix include/asm-x86_64/kexec.h
--- 25/include/asm-x86_64/kexec.h~kdump-export-crash-notes-section-address-through-x86_64-fix	2005-02-28 21:54:41.000000000 -0800
+++ 25-akpm/include/asm-x86_64/kexec.h	2005-02-28 21:55:12.000000000 -0800
@@ -25,4 +25,9 @@
 /* The native architecture */
 #define KEXEC_ARCH KEXEC_ARCH_X86_64
 
+#define MAX_NOTE_BYTES 1024
+typedef u32 note_buf_t[MAX_NOTE_BYTES/4];
+
+extern note_buf_t crash_notes[];
+
 #endif /* _X86_64_KEXEC_H */
diff -puN arch/x86_64/kernel/crash.c~kdump-export-crash-notes-section-address-through-x86_64-fix arch/x86_64/kernel/crash.c
--- 25/arch/x86_64/kernel/crash.c~kdump-export-crash-notes-section-address-through-x86_64-fix	2005-02-28 21:58:39.000000000 -0800
+++ 25-akpm/arch/x86_64/kernel/crash.c	2005-02-28 21:58:55.000000000 -0800
@@ -22,9 +22,6 @@
 #include <asm/nmi.h>
 #include <asm/hw_irq.h>
 
-#define MAX_NOTE_BYTES 1024
-typedef u32 note_buf_t[MAX_NOTE_BYTES/4];
-
 note_buf_t crash_notes[NR_CPUS];
 
 void machine_crash_shutdown(void)
_


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

* Re: [Fastboot] Re: [RFC][PATCH 3/3] Kdump: Export crash notes section address through sysfs
  2005-03-01  6:05 ` Andrew Morton
@ 2005-03-01 22:03   ` Randy.Dunlap
  0 siblings, 0 replies; 3+ messages in thread
From: Randy.Dunlap @ 2005-03-01 22:03 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Vivek Goyal, fastboot, ebiederm, linux-kernel

Andrew Morton wrote:
> Vivek Goyal <vgoyal@in.ibm.com> wrote:
> 
>>o Following patch exports kexec global variable "crash_notes" to user space
>>   through sysfs as kernel attribute in /sys/kernel.
> 
> 
> It breaks the x86_64 build.  A fix for that is below.
> 
> Please test kexec/kdump patches on all three architectures, both with your
> config option enabled and with it disabled.  There are cross-compilers at
> http://developer.osdl.org/dev/plm/cross_compile/

BTW:
You can download the cross_compile tools and run them yourself or you
can submit a patch to the PLM tool and it will run 8 arch. builds
for you....

-- 
~Randy

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

end of thread, other threads:[~2005-03-01 22:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-02-24 16:17 [RFC][PATCH 3/3] Kdump: Export crash notes section address through sysfs Vivek Goyal
2005-03-01  6:05 ` Andrew Morton
2005-03-01 22:03   ` [Fastboot] " Randy.Dunlap

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