summaryrefslogtreecommitdiff
path: root/kexec/arch/ia64/kexec-ia64.c
AgeCommit message (Collapse)Author
2013-03-14kexec: ia64: use _ALIGN* to make the logic clearZhang Yanfei
By replacing all the explicit align opertion with marco _ALIGN*, the code logic could be simplified. Signed-off-by: Zhang Yanfei <zhangyanfei@cn.fujitsu.com> Signed-off-by: Simon Horman <horms@verge.net.au>
2010-05-13kexec-tools: remove unused code from arch_process_options (arm, cris, ia64, ↵Matt Evans
mips, ppc) These architectures don't have any architecture-specific options (note: distinct from loader options, which are more specific), yet their arch_process_options() functions contain getopts_long() calls followed by no argument processing. The code doesn't do anything, so this patch removes it. Signed-off-by: Matt Evans <matt@ozlabs.org> Signed-off-by: Simon Horman <horms@verge.net.au>
2010-02-02Use C99 initialisersSimon Horman
Signed-off-by: Simon Horman <horms@verge.net.au>
2010-02-02Avoid possible overflows from signed/unsigned comparisonsSimon Horman
Signed-off-by: Simon Horman <horms@verge.net.au>
2010-02-02ia64: Remove unused info parameter from {move,update}_loaded_segments()Simon Horman
Signed-off-by: Simon Horman <horms@verge.net.au>
2010-02-02Mark unused parametersSimon Horman
Signed-off-by: Simon Horman <horms@verge.net.au>
2008-09-24IA64: do not include uncached memory to vmcoreJay Lan
Currently a memory segment in memory map with attribute of EFI_MEMORY_UC is denoted as "System RAM" in /proc/iomem, while memory of attribute (EFI_MEMORY_WB|EFI_MEMORY_UC) is also labeled the same. The kexec utility then includes uncached memory as part of vmcore. The kdump kernel may MCA when it tries to save the vmcore to a disk. A normal "cached" access can cause MCAs. Since kexec assembled memory ranges with memory tagged as "System RAM", the uncached memory will be excluded if it is labeled differently. Simon, since only IA64 will create "Uncached RAM" label, i do not make changes to other arch. Our HP machine in the lab is dead. I am sorry that i can not test against other IA64 systems (than SGI's). Feedback is very much appreciated. The corresponding kernel patch is needed to test this kexec patch: http://marc.info/?l=linux-ia64&m=122122791230130&w=2 This patch without the kernel patch will have no effect and do no harm. The kernel patch has been commited as "[IA64] kexec fails on systems with blocks of uncached memory". Signed-off-by: Jay Lan <jlan@sgi.com> Signed-off-by: Simon Horman <horms@verge.net.au>
2008-05-21Factor uname-based native architecture detection into a common function.Jamey Sharp
This code was copy-pasted into every architecture and was basically identical. Besides producing a nice net reduction in code, this factors a portability challenge into a single function that can be easily replaced at build-time. Signed-off-by: Jamey Sharp <jamey@thetovacompany.com> Signed-off-by: Simon Horman <horms@verge.net.au>
2008-03-07ia64: Remove debug messages from get_memory_ranges()Simon Horman
Remove debug messages that were accidently added as part of commit 91ce7876a6ec7e51532f3a2a949bd8d284f5aaad, "kexec-tools: no machine machine to proc_iomem()" Signed-off-by: Simon Horman <horms@verge.net.au>
2008-03-04kexec-tools: no machine machine to proc_iomem()Simon Horman
Removes the machine parameter to proc_iomem() which is no longer of any use. Signed-off-by: Simon Horman <horms@verge.net.au>
2007-10-17Allow architectures to specify the location of /proc/iomemSimon Horman
On ia64 XEN it is sometimes neccessary to use an alternate location for the information that is usually provided by /proc/iomem. By having the path returned by a function, which can be overriden on a per-architecture basis, it is possible for ia64 XEN to make use of existing generic code. Hopefully other achitectures can use this infastructure as the need arises. If the machine parameter is zero, then iomem file relating to the currently running kernel should be returned. If the machine parameter is non-zero then iomem file, relating to the underlying hypervisor, should be returned. In the simple case, these will be the same file. Signed-off-by: Simon Horman <horms@verge.net.au> kexec/arch/i386/crashdump-x86.c | 4 ++-- kexec/arch/i386/kexec-x86.c | 2 +- kexec/arch/i386/x86-linux-setup.c | 2 +- kexec/arch/ia64/crashdump-ia64.c | 9 +++++---- kexec/arch/ia64/kexec-elf-ia64.c | 2 +- kexec/arch/ia64/kexec-ia64.c | 5 +++-- kexec/arch/ppc/kexec-ppc.c | 2 +- kexec/arch/s390/kexec-s390.c | 5 +++-- kexec/arch/x86_64/crashdump-x86_64.c | 10 +++++----- kexec/arch/x86_64/kexec-x86_64.c | 2 +- kexec/crashdump-xen.c | 6 ++++-- kexec/kexec-iomem.c | 31 +++++++++++++++++++++++-------- kexec/kexec.h | 6 +++--- 13 files changed, 53 insertions(+), 33 deletions(-) 9079040b40f643cfc9eb3d425dffa0ca8fd573e1
2007-02-16Make sure max_memory_ranges are cleared before incrementedMagnus Damm
Make sure max_memory_ranges are cleared before incremented I happened to call get_memory_ranges() twice on ia64 while debugging some kdump issue the other day. This did not work as expected because the variable max_memory_ranges was not cleared before being incremented. So the second caller gets more ranges than needed. This is normally not a problem - get_memory_ranges() is only called once - but I think it is good coding practice to start from a known state. Signed-off-by: Magnus Damm <magnus@valinux.co.jp> Signed-off-by: Simon Horman <horms@verge.net.au>
2007-02-03IA64 kexec-tools: memory_ranges arrays scalability issueJay Lan
There are two memory_ranges arrays declared in the IA64 kexec code. One in kexec-ia64.c and the other one in crashdump-ia64.c. They currently were allocated as a hard-coded size of array. Since SN systems may scale to hunders of nodes and each node may contain up to 12 DIMMs, the hard-coded size of 1024 is not enough for very large systems. The size of either array can not be greater than the number of entries in /proc/iomem, which is saved as "max_memory_ranges" and is used to dynamically allocate the two arrays. Signed-off-by: Jay Lan <jlan@sgi.com> Signed-off-by: Simon Horman <horms@verge.net.au>
2007-02-01IA64 kexec-tools: efi_memmap overflow on large systemsJay Lan
This patch fixes a efi_memmap overflow problem on large system. Currently the kexec allocates statically 16k buffer to contain efi_memmap. It can hold about 333 entries. It causes data corruption on large system. This patch would let kexec allocate the efi_memmap at run time using the actual size allocated in the production kernel. Signed-off-by: Jay Lan <jlan@sgi.com> Signed-off-by: Simon Horman <horms@verge.net.au>
2006-12-12send slave cpus to SAL slave loop on crash (IA64)Horms
On Tue, Nov 21, 2006 at 07:13:56AM +0800, Zou Nan hai wrote: > This patch make normal "kexec -l" first try physical address suggested > by vmlinux. > > If there is no enough memory, kexec tools will search /proc/iomem and > find a place to put the new kernel. > > This is necessary for "kexec -l" to work on SN platform. > > Signed-off-by: Zou Nan hai <nanhai.zou@intel.com> > Hi Nan hai, sorry for not responding sooner. I have take a look at your patch with an eye to including it into kexec-tools-testing. It does seem like a good feature. Below is an updated version of the patch that cleans up your implementation a little. In particular. * update_loaded_segments() returns -1 on error, 0 on success - amongst other things the previous incarnation could return nothing at all in once case. * else { if () { ; } } -> else if () { ; } * < 80 columns wide * removed trailing whitespace Is it ok to apply this incarntation of the patch? I can make my changes a second patch if you prefer. Signed-off-by: Simon Horman <horms@verge.net.au> * Incremental version of above patch * Include kexec-ia64.h in kexec-elf-ia64.c for update_loaded_segments() Signed-off-by: Simon Horman <horms@verge.net.au>
2006-12-12send slave cpus to SAL slave loop on crash (IA64)Zou Nan hai
On Tue, 2006-11-21 at 07:33, Jay Lan wrote: > Zou, Nanhai wrote: > >> We do not rely on machine crash on CPU 0 any more. If the > >> crashing CPU is not cpu 0 and the cpu 0 not being returned to > >> the slave loop, this case is handled by our PROM now. > >> > >> However, if somebody tries to boot up a production kernel using > '-le' > >> option _after_ the kexec'ed kernel is up running, the third kernel > >> would not boot unless we boot up the second kernel with cpu 0. I > >> posted a question on "if running 'kexec -le' on a kexec'ed kdump > >> kernel is legal" earlier and Vivek responded saying the scenario > >> is not guranteed to work. So, i think we are fine here. > >> > > > > Ok, so with this patch and the PROM fix, on a SN system, > > 1. Kdump -> 2nd kernel works. > > 2. Kdump -> 2nd kernel -> Kexec to third kernel will not work. > > 3. Kexec -> 2nd Kernel -> Kexec -> 3rd kernel works? > > 4. Kexec -> 2nd Kernel -> Kdump -> 3rd kernel works? > > > > I think if scenario 1, 3 and 4 works it will be ok. Scenario 2 is > not so useful I guess. > > > > With the patch Nanhai sent to me to fix '-l' option on SN system, > now scenario 1, 3 and 4 all works. Of course, you need to include > 'crashkernel' parameter in "append" option when you do 'kexec -l' > in order for scenario #4 to work. You do not need crashkernel > parameter for #3 though. > > Thanks, > - jay > > This is the patch, This patch make normal "kexec -l" first try physical address suggested by vmlinux. If there is no enough memory, kexec tools will search /proc/iomem and find a place to put the new kernel. This is necessary for "kexec -l" to work on SN platform. Signed-off-by: Zou Nan hai <nanhai.zou@intel.com>
2006-10-06ia64: kdump: reserve efi memmap and boot param regionZou Nan hai
This patch is against kexec-tools-1.101 with kdump10 patch. This patch reserve efi memmap and boot param area for the first kernel so that they will not be overlapped. Signed-off-by: Zou Nan hai <nanhai.zou@intel.com> Removed trailing whitespace Signed-off-by: Simon Horman <horms@verge.net.au>
2006-07-27ia64 use /proc/iomemKhalid Aziz
This patch makes kexec tool use /proc/iomem to determine memory layout on ia64. This is based upon code written by Zou Nan hai. Signed-off-by: Khalid Aziz <khalid.aziz@hp.com> Signed-off-by: Maneesh Soni <maneesh@in.ibm.com>
2006-07-27ia64 supportKhalid Aziz
This patch adds support for kexec-tools on ia64. This patch applies on top of -kdump7 patch from <http://lse.sourceforge.net/kdump/>. Signed-off-by: Khalid Aziz <khalid.aziz@hp.com> Signed-off-by: Maneesh Soni <maneesh@in.ibm.com>
2006-07-27kexec-tools: i386 sys interface changes compatibilityVivek Goyal
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>
2006-07-27crashdump backup region handlingVivek Goyal
o This patch adds support for reserving space for backup region. Also adds code in purgatory to copy the first 640K to backup region. o Moved kexec_flags inside kexec_info structure. Signed-off-by: Vivek Goyal <vgoyal@in.ibm.com> Signed-off-by: Maneesh Soni <maneesh@in.ibm.com>
2006-07-27kexec-tools-1.101Eric W. Biederman
- Initial import into git - initial nbi image formage support - ppc32 initial register setting fixes. - gzipped multiboot file support