Skip to contentSkip to conversation

kexec/kdump: RMO region does not exist in drconf memory

PATCH Applied Chandru 2 participants 2 messages Mar 2, 2010

Subsystems (2)
lore
Share & tools
lore

Chandru

author
#0 lore raw

PATCH 1/1 kexec/kdump: RMO region does not exist in drconf memory

The RMO region can only exist in '/memory@0' node in the device tree. While adding support for '/ibm,dynamic-reconfiguration-memory' in kexec-tools, I incorrectly extended the code of '/memory@' nodes to drconf memory with the assumption that what applies to '/memory@' nodes would also apply to drconf memory. This is incorrect and hence removing the code from kexec-tools now.

With this code in place, kexec on kexec fails. The first kexec works because '/memory@0' node is read after drconf memory and that correctly sets rmo_base and rmo_top from '/memory@0' node. While in the kexec'ed kernel, '/ibm,dynamic-reconfiguration-memory' is read after '/memory@xxx' nodes and this incorrectly sets both rmo_base and rmo_top from drconf memory.

Sorry for introducing this bug.

---

kexec/arch/ppc64/kexec-ppc64.c renamed from kexec/arch/ppc64/kexec-ppc64.c.orig +1 -26
@@ -342,9 +342,7 @@ static int get_devtree_details(unsigned
 			strncmp(dentry->d_name, "memory@", 7) &&
 			strcmp(dentry->d_name, "memory") &&
 			strncmp(dentry->d_name, "pci@", 4) &&
-			strncmp(dentry->d_name, "rtas", 4) &&
-			strncmp(dentry->d_name,
-				"ibm,dynamic-reconfiguration-memory", 35))
+			strncmp(dentry->d_name, "rtas", 4)) 
 			continue;
 		strcpy(fname, device_tree);
 		strcat(fname, dentry->d_name);
@@ -550,29 +548,6 @@ static int get_devtree_details(unsigned
 			closedir(cdir);
 		} /* memory */
 
-		if (!strncmp(dentry->d_name,
-				"ibm,dynamic-reconfiguration-memory", 35)) {
-			unsigned int k;
-			strcat(fname, "/ibm,dynamic-memory");
-			if ((file = fopen(fname, "r")) == NULL) {
-				perror(fname);
-				goto error_opencdir;
-			}
-			fseek(file, 4, SEEK_SET);
-			for (k = 0; k < num_of_lmbs; k++) {
-				if ((n = fread(buf, 1, 24, file)) < 0) {
-					perror(fname);
-					goto error_openfile;
-				}
-				rmo_base = ((uint64_t *)buf)[0];
-				rmo_top = rmo_base + lmb_size;
-				if (rmo_top > 0x30000000UL)
-					rmo_top = 0x30000000UL;
-			}
-			fclose(file);
-			closedir(cdir);
-		} /* ibm,dynamic-reconfiguration-memory */
-
 		if (strncmp(dentry->d_name, "pci@", 4) == 0) {
 			strcat(fname, "/linux,tce-base");
 			if ((file = fopen(fname, "r")) == NULL) {

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

Applied
#1 lore raw
Quoted 7 lines · Chandru

The RMO region can only exist in '/memory@0' node in the device tree. While adding support for '/ibm,dynamic-reconfiguration-memory' in kexec-tools, I incorrectly extended the code of '/memory@' nodes to drconf memory with the assumption that what applies to '/memory@' nodes would also apply to drconf memory. This is incorrect and hence removing the code from kexec-tools now.

Quoted 6 lines

With this code in place, kexec on kexec fails. The first kexec works because '/memory@0' node is read after drconf memory and that correctly sets rmo_base and rmo_top from '/memory@0' node. While in the kexec'ed kernel, '/ibm,dynamic-reconfiguration-memory' is read after '/memory@xxx' nodes and this incorrectly sets both rmo_base and rmo_top from drconf memory.

Thanks, applied.

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec