Skip to contentSkip to conversation

makedumpfile: ARM: fix bug on sparse_decode_mem_map

PATCH RESEND In review Liu Hua 2 participants 2 messages May 7, 2014 – May 8, 2014

Subsystems (2)
lore
Share & tools
lore

Liu Hua

author
#0 lore raw

PATCH RESEND 1/1 makedumpfile: ARM: fix bug on sparse_decode_mem_map

In sparse_decode_mem_map, makedumpfile checks whether coded_mem_map is a vald vaddr. But coded_mem_map is not real vaddr. So this patch checks decoded_mem_map instead.

---
 makedumpfile.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
makedumpfile.c +6 -4
index 16081a5..94515f6 100644
@@ -2794,13 +2794,15 @@ section_mem_map_addr(unsigned long addr)
 unsigned long
 sparse_decode_mem_map(unsigned long coded_mem_map, unsigned long section_nr)
 {
-	if (!is_kvaddr(coded_mem_map))
-		return NOT_KV_ADDR;
+	unsigned long mem_map;
 
-	return coded_mem_map +
+	mem_map =  coded_mem_map +
 	    (SECTION_NR_TO_PFN(section_nr) * SIZE(page));
-}
 
+	if (!is_kvaddr(mem_map))
+		return NOT_KV_ADDR;
+	return mem_map;
+}
 int
 get_mm_sparsemem(void)
 {
Signature · 7 lines
1.9.0


_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
#1 lore raw
Quoted 5 lines

In sparse_decode_mem_map, makedumpfile checks whether coded_mem_map is a vald vaddr. But coded_mem_map is not real vaddr. So this patch checks decoded_mem_map instead.

Thanks, I'll merge this patch into v1.5.7.

Atsushi Kumagai

Quoted 25 lines

---
makedumpfile.c | 10 ++++++----

1 file changed, 6 insertions(+), 4 deletions(-)
makedumpfile.c +0 -0
index 16081a5..94515f6 100644
@@ -2794,13 +2794,15 @@ section_mem_map_addr(unsigned long addr)

unsigned long
sparse_decode_mem_map(unsigned long coded_mem_map, unsigned long section_nr) {

makedumpfile.c +2 -3
-	if (!is_kvaddr(coded_mem_map))
-		return NOT_KV_ADDR;
+	unsigned long mem_map;
 
-	return coded_mem_map +
+	mem_map =  coded_mem_map +
	    (SECTION_NR_TO_PFN(section_nr) * SIZE(page));
makedumpfile.c +4 -1
-}
 
+	if (!is_kvaddr(mem_map))
+		return NOT_KV_ADDR;
+	return mem_map;
+}
Quoted 5 lines

int
get_mm_sparsemem(void)
{
--
1.9.0

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