Skip to contentSkip to conversation

2.4 and 2.5: fix /proc/kcore

PATCH New Russell King 1 participant 1 message Mar 15, 2002

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 2.4 and 2.5: fix /proc/kcore

As mentioned on May 11 on LKML, here is a patch to fix /proc/kcore for architectures which do not have RAM located at physical address 0.

I did say I'd send this on Monday, however I only got feedback from the ia64 people, and /proc/kcore is already broken on their machines anyway. (They need to fix it up; they place modules below PAGE_OFFSET, which breaks our generated ELF core header).

So I've decided to send it a few days early.

Please apply.

fs/proc/kcore.c +7 -2
@@ -381,8 +381,13 @@
 			return tsz;
 	}
 #endif
-	/* fill the remainder of the buffer from kernel VM space */
-	start = (unsigned long)__va(*fpos - elf_buflen);
+	
+	/*
+	 * Fill the remainder of the buffer from kernel VM space.
+	 * We said in the ELF header that the data which starts
+	 * at 'elf_buflen' is virtual address PAGE_OFFSET. --rmk
+	 */
+	start = PAGE_OFFSET + (*fpos - elf_buflen);
 	if ((tsz = (PAGE_SIZE - (start & ~PAGE_MASK))) > buflen)
 		tsz = buflen;
 		
Signature · 2 lines
Russell King ([email protected])                The developer of ARM Linux
             http://www.arm.linux.org.uk/personal/aboutme.html