From 80d504c82b889e18a4d7bfc889d848a5e17b2eb1 Mon Sep 17 00:00:00 2001 From: Russell King Date: Thu, 14 Mar 2002 22:44:26 -0800 Subject: [PATCH] [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. --- fs/proc/kcore.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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; -- 2.39.5