Skip to contentSkip to conversation

send slave cpus to SAL slave loop on crash (IA64)

PATCH Horms 1 participant 2 messages Dec 1, 2006 – Dec 12, 2006

lore
Share & tools
lore

Horms

author
#0 lore raw
Quoted 10 lines · Zou Nan hai

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.

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.

kexec/arch/ia64/kexec-elf-ia64.c +7 -3
index bd2350c..e9f60ea 100644
@@ -86,7 +86,8 @@ void elf_ia64_usage(void)
 
 /* Move the crash kerenl physical offset to reserved region
  */
-static void move_loaded_segments(struct kexec_info *info, struct mem_ehdr *ehdr)
+void move_loaded_segments(struct kexec_info *info, struct mem_ehdr *ehdr,
+			  unsigned long addr)
 {
 	int i;
 	long offset;
@@ -94,7 +95,7 @@ static void move_loaded_segments(struct kexec_info *info, struct mem_ehdr *ehdr)
 	for(i = 0; i < ehdr->e_phnum; i++) {
 		phdr = &ehdr->e_phdr[i];
 		if (phdr->p_type = PT_LOAD) {
-			offset = mem_min - phdr->p_paddr;
+			offset = addr - phdr->p_paddr;
 			break;
 		}
 	}
@@ -189,7 +190,10 @@ int elf_ia64_load(int argc, char **argv, const char *buf, off_t len,
 			free_elf_info(&ehdr);
 			return -1;
 		}
-		move_loaded_segments(info, &ehdr);
+		move_loaded_segments(info, &ehdr, mem_min);
+	} else if (update_loaded_segments(info, &ehdr) < 0) {
+		fprintf(stderr, "Failed to place kernel\n");
+		return -1;
 	}
 
 	entry = ehdr.e_entry;
kexec/arch/ia64/kexec-ia64.c +42 -1

67 lines not on this page · raw message

kexec/arch/ia64/kexec-ia64.h +4 -0
index 62d05c1..7995307 100644
@@ -7,6 +7,10 @@ int elf_ia64_probe(const char *buf, off_t len);
 int elf_ia64_load(int argc, char **argv, const char *buf, off_t len,
 	struct kexec_info *info);
 void elf_ia64_usage(void);
+int update_loaded_segments(struct kexec_info *info, struct mem_ehdr *ehdr);
+void move_loaded_segments(struct kexec_info *info, struct mem_ehdr *ehdr,
+			  unsigned long addr);
+
 #define MAX_MEMORY_RANGES 1024
 #define EFI_PAGE_SIZE	  (1UL<<12)
 #define ELF_PAGE_SIZE	  (1UL<<16)
author
#1 lore raw
Quoted 29 lines · Horms
Quoted 10 lines · Zou Nan hai

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.

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

Quoted 4 lines

Is it ok to apply this incarntation of the patch? I can make my changes a second patch if you prefer.

Hi,

I have applied your patch, and then my changes as a second patch to kexec-tools-testing.

Signature · 3 lines
Horms
  H: http://www.vergenet.net/~horms/
  W: http://www.valinux.co.jp/en/