summaryrefslogtreecommitdiff
path: root/purgatory/arch/ia64
AgeCommit message (Collapse)Author
2016-12-02purgatory: Change default sha256 optimization to -O2Geoff Levand
Change the default purgatory sha256 code optimization from -O0 to -O2, and add a new arch specific makefile variable $(ARCH)_PURGATORY_SHA256_CFLAGS which can over ride this default. Set ia64_PURGATORY_SHA256_CFLAGS to -O0 to retain the previous optimization level for ia64. The purgatory sha256 code needs the be built with -O0 for the ia64 architecture. Currently this code is built with -O0 for all architectures, which slows down the calculations for architectures which could otherwise use -O2. On arm64, it takes around 20 second to verify SHA in purgatory when vmlinuz image is around 13MB and initramfs is around 30M with -O2 enabled. Otherwise, it takes more than 2 minutes. Cc: Pratyush Anand <panand@redhat.com> Signed-off-by: Geoff Levand <geoff@infradead.org> 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>
2008-10-07ia64: make PA() work for both physical identity-mapped virtual addressesBjorn Helgaas
The EFI Runtime Services Table contains pointers to ia64 function descriptors. On existing, pre-Tiano, firmware, SetVirtualAddressMap() converts *all* these pointers from physical to virtual. On Tiano-based firmware, the pointer to the SetVirtualAddressMap() function descriptor is not converted, so it remains a physical pointer. The ia64 kexec purgatory patches the SetVirtualAddressMap() function descriptor so that when the new kernel calls SetVirtualAddressMap(), it never reaches firmware. Instead, it calls a dummy function that just returns success. Purgatory runs in physical mode, so it must convert the pointer from the RuntimeServicesTable to a physical address. This patch makes that conversion work both for old firmware (where the pointer is an identity- mapped virtual address) and new Tiano firmware (where the pointer is a physical address). Without this patch, kexec on Tiano firmware causes an MCA because ia64_env_setup() subtracts PAGE_OFFSET from a physical address and ends up with an invalid physical address. Referencing that address causes the MCA. Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Signed-off-by: Simon Horman <horms@verge.net.au>
2008-03-04kexec-tools: [ia64] redivide efi memory in purgatorySimon Horman
From my observations the way that the EFI_LOAD_DATA is provided on the inital boot works like this: There is a large EFI_CONVENTIONAL_MEMORY region. The portion begining at the first load segment of the image to be loading and ending with the last segment, aligned to 64K, is turned into a separate region of type EFI_LOAD_DATA. A truncated example of this: ... mem04: type= 7, attr=0x0000000000000008, range=[0x0000000000100000-0x0000000004000000) ( 63MB) mem05: type= 2, attr=0x0000000000000008, range=[0x0000000004000000-0x000000000481f000) ( 8MB) mem06: type= 7, attr=0x0000000000000008, range=[0x000000000481f000-0x000000003e876000) ( 928MB) ... Where type 7 is EFI_CONVENTIONAL_MEMORY and type 3 is EFI_LOAD_DATA. There is a patch to the user-space portion of kexec-tools that merges the segments supplied to this code if they are adjacent. This seems to always result in a single segment being passed to this code, that should start at the same address as the existing EFI_LOAD_DATA segment. So all that should be left to do is to merge the existing EFI_LOAD_DATA region with the following EFI_CONVENTIONAL_MEMORY region, and then split it up to accommodate the segment passed from user-space. The new EFI_LOAD_DATA region created with this code will always start at the same address as the old EFI_LOAD_DATA region. If this proves to be overly simplistic it should be easy to update. This code also allows merging of multiple regions to accommodate the new EFI_LOAD_DATA region. I strongly doubt this will ever be used, but it is in line with the way the existing code works. If the same image is used after kexec, then the EFI regions in question will turn out the same as the original regions. This is important, otherwise kernel / hypervisor regions will not be able to be inserted into /proc/iomem / /proc/iomem_machine. Signed-off-by: Simon Horman <horms@verge.net.au>
2008-02-21Only include needed files in distribution tarballSimon Horman
With the recent build changes a number of unneded files crept into tarballs, including .o and .d files. This patch is farily verbose, but hopefully in the long run this system will be obvious enough to be maintainable. Signed-off-by: Simon Horman <horms@verge.net.au>
2007-12-19Use general _SRCS and _OBJS, rather and _C_{SRCS, OBJS} and _S_{SRCS, OBJS}Jeremy Kerr
Since we use the implicit ruls for .c and .S, just colelct all sources in the one variable. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Simon Horman <horms@verge.net.au>
2007-12-19removed partially duplicated system headersSimon Horman
Purgatory seems to partially duplicate system headers. It seems a log cleaner not to do so. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Simon Horman <horms@verge.net.au>
2007-12-19Build system simplification/standardisationJeremy Kerr
This change makes kexec-tools work more like a standard configure-make- make-install-type project: * Remove $(OBJDIR) stuff. To do an out-of-tree build, just configure from a different directory. * Use the implicit Makefile rules more, and just edit the compiler flags for specific targets. * Simplify compiler/linker flags - no need for EXTRA_* * Add TARGET_CC, and improve checks for BUILD_CC too. * Set arch-specific flags in arch-specific makefiles, not conditional on $(ARCH). * Generate dependency files in the main compile, rather than as a separate step. * Don't #include sha256.c, but re-build it into the purgatory. Still a work-in-progress. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Simon Horman <horms@verge.net.au>
2007-03-07kexec-tools: Use EFI_LOADER_DATA for ELF core header (ia64)Magnus Damm
The address where the ELF core header is stored is passed to the secondary kernel as a kernel command line option. The memory area for this header is also marked as a separate EFI memory descriptor on ia64. The separate EFI memory descriptor is at the moment of the type EFI_UNUSABLE_MEMORY. With such a type the secondary kernel skips over the entire memory granule (config option, 16M or 64M) when detecting memory. If we are lucky we will just lose some memory, but if we happen to have data in the same granule (such as an initramfs image), then this data will never get mapped and the kernel bombs out when trying to access it. So this is an attempt to fix this by changing the EFI memory descriptor type into EFI_LOADER_DATA. This type is the same type used for the kernel data and for initramfs. In the secondary kernel we then handle the ELF core header data the same way as we handle the initramfs image. This strategy requires changes in the secondary kernel as well, I'll post the kernel patches in a little while. Signed-off-by: Magnus Damm <magnus@valinux.co.jp> Signed-off-by: Simon Horman <horms@verge.net.au>
2006-10-12kexec-tools: ia64: icache flush should align to 32-bytesTerry Loftin
Hi, I've run into problems testing kexec/kdump on a Montecito revision C processor. In purgatory, __dummy_efi_function is copied onto the end of the command line boot parameter (command_line + command_line_len) and this address is used to replace the EFI call to set_virtual_address_map(). The copied range is then icache flushed. The destination address is aligned to 16-bytes (in kexec-elf-ia64.c), but the fc.i instruction flushes a 32-byte range "associated" with that address. When my command line length is 16-byte aligned but not 32-byte aligned, this results in the first 16-bytes of __dummy_efi_function getting flushed (and the 16 bytes prior to that), but the second half of the function (the part with the br.ret) does not get flushed. kdump then hangs in purgatory. By adding a few spaces to my command line, it becomes both 16 and 32-byte aligned, and kdump works. This patch makes icache_flush_range() align the start address to 32-bytes and account for the difference. The patch is against Horms kexec-tools-testing tree. As a side note, you could also fix this by just adding 32 to the length passed to flush_icache_range() but that hides the dependent behavior. Thanks, -T It seems I was always testing with command line more than 16 bytes length..... Thanks. Acked-by: Zou Nan hai <nanhai.zou@intel.com> Manually applied - not sure why that was neccessary. Signed-Off-By: Simon Horman <horms@verge.net.au>
2006-10-06ia64-vmmSimon Horman
This adds vmm support to kexec-tool for ia64. This is annalogous to the same feature that is present in the latest version of elilo. It is a method of booting a vmm (hypervisor) such as Xen. Essentially it works as follows. * If the --vmm argument is not provided, then the kernel is booted as normal, no changes * Else, the image specified by --vmm is placed loaded into the elf segments, where the Linux kernel image would otherwise have gone. And the Linux kernel image, allong with its length is loaded into a seprate segment, and passed as new entry at the end of the boot parameters. This is somewhat similar to how initramfs/initramd images are passed to a booting kernel, and can work in conjunction with that feature. On boot (or in this case on kexec) the vmm (hypervisor) will be loaded instead of a Linux kernel, and the hypervisor will then load up the Linux kernel as it sees fit. This is needed in order for kexec from Xen to Xen, using the port of kexec to Xen that I am working on, to work. I am not entirely fond of this design, and i think that developing an ia64 variant of multiboot would be much nicer. However it is an existing method that is currently in widespread use through its incarntation in elilo. And if multiboot is added in future, it can be done as a separate boot method, and thus orthogonal to this patch. In order to use this code a number of other changes are needed, in particular: 1. Xen and the corresponding Linux Kernel needs to be patched with the port of kexec to ia64-xen that I have been working on. I will post the latest version of these patches to xen-devel shortly. 2. The currently hardcoded PAGE_OFFSET value in purgatory needs to be changed from the Linux value to the Xen value. I will post a very hackish, definately not to be released, patch after this patch which includes a comment that explains this problem more clearly. Also, xen->linux and linux->xen is still very much work in progress due to the problem described at the following link http://permalink.gmane.org/gmane.linux.ports.ia64/14995 However, from an infastructure point of view I think it would be good to apply this code, so that kexec-tool is one step closer to being able to support vmms (hypervisors). The patch does not alter any existing behaviour, it just adds a new feature. Bugs asside, the only real danger seems to be confusion for end-users, perhaps we could comment out the help text to hide the feature from the lay user, or attach a big fat warning to it. Signed-Off-By: Simon Horman <horms@verge.net.au>
2006-10-06kexec-tools: Explain dummy set_virtual_address_map more clearlySimon Horman
Add a more verbose comment to explain why set_virtual_address_map is replaced why a dummy function Signed-Off-By: Simon Horman <horms@verge.net.au>
2006-10-06kexec-tools: Use consistent comment style patch_efi_memmap()Simon Horman
This unifies the comments in purgatory-ia64.c to always use C style comments. Previously some comments where C style, while others were C++ style. Signed-Off-By: Simon Horman <horms@verge.net.au>
2006-10-06kexec-tools: Slightly less nested logic in patch_efi_memmap()Simon Horman
This makes the tail of patch_efi_memmap() slightly less nested, and thus a little easier to read. Signed-Off-By: Simon Horman <horms@verge.net.au>
2006-10-06kexec-tools: Use memdesc_size directly in patch_efi_memmap()Simon Horman
Just use boot_param->efi_memdesc_size directly instead, it seems at least as clean, and possibly easier to follow. Signed-Off-By: Simon Horman <horms@verge.net.au>
2006-10-06kexec-ktools: Use efi_memmap_size directly in patch_efi_memmap()Simon Horman
len is assigned once and used once, just use boot_param->efi_memmap_size directly instead. Signed-Off-By: Simon Horman <horms@verge.net.au>
2006-10-06kexec-tools: less confusing variable names in patch_efi_memmap()Simon Horman
* Rename md1 and md2 to md_src and md_dest respectively to make things a little easier to follow. * Remove p1 and p2, use src and dest instead Signed-Off-By: Simon Horman <horms@verge.net.au>
2006-10-06kexec-ktools: simplify segment walk logic in patch_efi_memmap()Simon Horman
There is a farily complex if, for construct in patch_efi_memmap(), that seems to be simplifyable to a somewhat simpler while statement. Note that this does change the logic statement. In particular the original code has if (seg->end < mend) towards the end, and the new code effectively replaces this with if (seg->end <= mend). However, in the original code this is copled with a separate if (seg->end > mend) check at the begining, so I believe that this is actually a minor (possibly never seen) logic error in the original code. The node code just always checks (seg->end > mend). Signed-Off-By: Simon Horman <horms@verge.net.au>
2006-10-06kexec-ktools: remove duplicated code in patch_efi_memmap()Simon Horman
This patch removes a duplicated assignment of *md2. It also replaces a switch statement with an if statement which is much more compact in this instance. Signed-Off-By: Simon Horman <horms@verge.net.au>
2006-10-06kexec-ktools: somewhat less nested code in patch_efi_memmap()Simon Horman
This patch reduces the nesting in patch_efi_memmap() by jumping to the next interation of the inner for loop if the following condition is true. if (seg->start < mstart || seg->start >= mend) This is instead of a reasonably large ammount of code inside the if conditional if the converse is true. This makes things somewhat easier to read as the nesting is already quite deep, and many lines do not fit easily within 80 columns. Signed-Off-By: Simon Horman <horms@verge.net.au>
2006-10-06kexec-tools: Make purgatory code 80 columns wideSimon Horman
Make purgatory code 80 columns wide Signed-Off-By: Simon Horman <horms@verge.net.au>
2006-10-06kexec-tools: Remove .orig filesSimon Horman
Remove kexec/arch/ia64/kexec-ia64.h.orig and purgatory/arch/ia64/Makefile.orig which were (presumably accidently) introduced in changest 9241000f28eb6b86a06c0be2d6cf31498373bc1c, "kdump ia64". Signed-Off-By: Simon Horman <horms@verge.net.au>
2006-10-06kexec-tools: --noio option to disable I/O in purgatory code.Zou Nan hai
SN platform support PIO in a different way to generic IA64 platform. It does not support most of the legacy I/O ports. Give an --noio option to kexec-tools to disable I/O in purgatory code. This patch also removed an unused io.h in kexec-tools. Signed-off-by: Zou Nan hai <nanhai.zou@intel.com> Edited to consistently use tabs instead of spaces for intentation, remove one instance of trailing whitespace, and fix indentation of noio line in options[]. Signed-off-by: Simon Horman <horms@verge.net.au>
2006-10-06ia64: kdump: patch clone ia64_boot_param area for crashZou Nan hai
without this patch, crash tool will not able to analyze efi memmap of first kernel from vmcore file. This patch is against kexec-tools-1.101 with kdump10 patch. Signed-off-by: Zou Nan hai <nanhai.zou@intel.com> Removed bogus fragments caused by whitespace addition Signed-off-by: Simon Horman <horms@verge.net.au>
2006-07-27kdump ia64Zou Nan hai
On Fri, 2006-06-09 at 19:50, Welterlen Benoit wrote: > Zou Nan hai wrote: > > The ia64 kdump patch is in 2 parts. > > > > the kexec-kdump-ia64-2.6.16.patch should apply on top of the previous > > kexec patch by Khalid in Tony's test tree. > > > > the kexec-tools-kdump-ia64.patch should apply to kexec-tools-1.101 > > with kexec-tools-1.101-kdump.patch > > > > > > To test it. > > Build first SMP kernel with KEXEC and KDUMP enabled. > > > > Boot it with kernel parameter "crashkernel=XXX@YYY" > > means reserver XXX from YYY for crashdumping. > > Build an UP kernel with KEXEC KDUMP VMCORE enabled. > > load this kernel as a crashdumping kernel > > kexec -p vmlinux.gz --initrd=initrd --append="...." > > > > trigger a crash, > > maybe "echo c > /proc/sysrq-trigger" > > after the crash kernel boots, > > cp /proc/vmcore core > > > > gdb first_kernel_vmlinux core > > > > please test and review. > > > > Signed-off-by: Khalid Aziz <khalid_aziz@hp.com> > > Signed-off-by: Zou Nan hai <nanhai.zou@intel.com> > > > > > > https://lists.osdl.org/mailman/listinfo/fastboot > > > > Hello Nan hai, > > I tried your patches. It seems that the kexec-tools-kdump-ia64.patch > file can not be applied after the latest release of kexec-tools > http://lse.sourceforge.net/kdump/patches/1.101-kdump9/kexec-tools-1.101-kdump9.patch > > I modified it for that. (attached file). > > I have a question about kdump : > > When the second kernel is loaded, kexec checks if the segments of the > new kernel are in the reserved memory > > valid_memory_range in kexec/kexec.c : > if ((send > mem_max) || (sstart < mem_min)) return 0; > > but mem_min and mem_max are defined by the XXX@YYY argument of the > first kernel. > For me, with 512@512 : > more /proc/iomem > ... > 049cc000-77ffffff : System RAM > 20000000-3fffffff : Crash kernel > ... > So, I can not load the second kernel : Invalid memory segment > 0x4000000 - 0x469ffff > > When I set 64@64 argument for the first kernel, the checking is ok, > but I have another issue : > kexec_load failed: Cannot assign requested address > entry = 0x80020 flags = 320001 > nr_segments = 6 > segment[0].buf = 0x6000000000021b90 > segment[0].bufsz = 20 > segment[0].mem = (nil) > segment[0].memsz = 10000 > segment[1].buf = 0x60000000000222d0 > segment[1].bufsz = 10638 > segment[1].mem = 0x80000 > segment[1].memsz = 20000 > segment[2].buf = 0x2000000003b50010 > segment[2].bufsz = 23473c > segment[2].mem = 0x100000 > segment[2].memsz = 240000 > segment[3].buf = 0x20000000002f0010 > segment[3].bufsz = 692dd8 > segment[3].mem = 0x4000000 > segment[3].memsz = 6a0000 > segment[4].buf = 0x2000000000990010 > segment[4].bufsz = 42c8 > segment[4].mem = 0x46a0000 > segment[4].memsz = 10000 > segment[5].buf = 0x20000000009a0010 > segment[5].bufsz = 17c3ec > segment[5].mem = 0x46b0000 > segment[5].memsz = 2d0000 > > > Segments of the second kernel are the same than the first one > (0x0000000004000000, 0x00000000046a0000 ...) > We can not change the PHYSICAL_START as in other architectures (x86, > x86_64, powerpc). > > So, I don't understand how it should work. Can you please have some > explanation on this ? > > Thank you very much ! > > Best regards, > > Benoit Welterlen > > > ______________________________________________________________________ I modify the patch based on this one, fixed some bugs in it. please test. Thanks Zou Nan hai Signed-off-by: Zou Nan hai <nanhai.zou@intel.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-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