summaryrefslogtreecommitdiff
path: root/kexec/crashdump.h
diff options
context:
space:
mode:
authorVivek Goyal <vivek@in.ibm.com>2005-12-15 11:36:37 +0530
committerEric W. Biederman <ebiederm@xmission.com>2006-07-27 10:40:38 -0600
commit920fca9abfba3f5b86b2f73b54ba6f45148847cf (patch)
tree75f936be5224af9ff3a2ccb9427341eabab6481b /kexec/crashdump.h
parente2a925519d24e1aef1fd8d6e2f0d6f659d128ea7 (diff)
kexec-tools: i386 sys interface changes compatibility
On Wed, Dec 14, 2005 at 02:50:52PM -0600, Milton Miller wrote: [..] > >>(2) why do you stat the files instead of just trying to open them and > >>check for ENOENT? > >> > >>milton > >> > > > >I wanted to differentiate between two cases. One being sysfs not > >mounted > >and other being file not being present (Due to kernel bug or cpu not > >present), hence used stat(). In case of sysfs not being mounted, we > >simply exit after giving an error message. In other case we continue > >to loop through other cpus and ignore cpu, which is not present. > > > > Ok, but try to open the file first. IF you want to do this diagnostic > after the open fails, that is ok. But don't do this check n times (n = > number of cpus) when the file exists. > I have moved the sysfs mounted check in failure condition. > > > > >On Tue, Dec 13, 2005 at 09:36:26AM -0800, Haren Myneni wrote: > >>Vivek, I believe, we should push this func into arch independent code. > >>Otherwise, we have to copy it for every platform. > >> > > > >We have reworked the patch and moved this code to architecture > >independent > >portion. > > > > > Only the x86 code has the fallback the old name, not the genric code. > Only i386 port of kdump was available when crash_notes was exported through /sys/kernel/crash_notes. Rest of the architectures see new arch- independent percpu crash_notes sysfs interface only. Hence thought no point copying backward compatibility code in generic code. > > Also, there are error paths that do not set the address, others that > zero it. > The error paths which do not set address to zero are non return path. They call die() which inturn calls exit(1) after printing appropriate error messasge. > What happens if the base kernel is too old for kexec-panic, where > neiter file will exist? > In that case kexec will fail much earlier. There will be no reserved memory area for loading second kernel (crashkernel=X&Y) hence attempt to load the second kernel will fail and control will not reach this place at all. Modifed patch appended. Thanks Vivek o This patch moves per cpu interface to retrieve crash_notes address to architecture independent section. (As suggested by Haren) o For i386, kernels older than 2.6.15-rc1-mm2 used to export crash_notes through /sys/kernel/crash_notes. This patch also provides backward compatibility with older kernel versions. o Definition of MAX_NOTE_BYTES moved to architecture independent header file as everybody is using same definition. o Definition of MAX_LINE moved to architecture independent header file. Seems to be a better option than defining it in many C files. Signed-off-by: Maneesh Soni <maneesh@in.ibm.com> Signed-off-by: Vivek Goyal <vgoyal@in.ibm.com> Signed-off-by: Maneesh Soni <maneesh@in.ibm.com>
Diffstat (limited to 'kexec/crashdump.h')
-rw-r--r--kexec/crashdump.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/kexec/crashdump.h b/kexec/crashdump.h
new file mode 100644
index 0000000..682dd53
--- /dev/null
+++ b/kexec/crashdump.h
@@ -0,0 +1,9 @@
+#ifndef CRASHDUMP_H
+#define CRASHDUMP_H
+
+extern int get_crash_notes_per_cpu(int cpu, uint64_t *addr);
+
+/* Need to find a better way to determine per cpu notes section size. */
+#define MAX_NOTE_BYTES 1024
+
+#endif /* CRASHDUMP_H */