From: Russell King Date: Fri, 15 Mar 2002 06:44:26 +0000 (-0800) Subject: [PATCH] 2.4 and 2.5: fix /proc/kcore X-Git-Tag: v2.5.7-pre2~34 X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=80d504c82b889e18a4d7bfc889d848a5e17b2eb1;p=history.git [PATCH] 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. --- diff --git a/fs/proc/kcore.c b/fs/proc/kcore.c index 26366a908ddc..f17b3fcd5357 100644 --- a/fs/proc/kcore.c +++ b/fs/proc/kcore.c @@ -381,8 +381,13 @@ static ssize_t read_kcore(struct file *file, char *buffer, size_t buflen, loff_t 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;