[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <m17hzg7oil.fsf@fess.ebiederm.org>
Date: Fri, 12 Jun 2009 21:20:50 -0700
From: ebiederm@...ssion.com (Eric W. Biederman)
To: Amerigo Wang <xiyou.wangcong@...il.com>
Cc: Tao Ma <tao.ma@...cle.com>,
Andrew Morton <akpm@...ux-foundation.org>,
linux-kernel@...r.kernel.org, Alexey Dobriyan <adobriyan@...il.com>
Subject: Re: [Patch BUGFIX] kcore: fix its wrong size on x86_64
Amerigo Wang <xiyou.wangcong@...il.com> writes:
> Fix wrong /proc/kcore size on x86_64.
How does that change anything?
> x86_64 uses __va() macro to caculate the virtual address passed to kclist_add()
> but decodes it with its own macro kc_vadd_to_offset(). This is wrong.
>
> Also, according to Documentation/x86/x86_64/mm.txt, kc_vaddr_to_offset()
> is wrong too.
>
> So just remove them, use the generic macro.
>
> BTW, the man page for /proc/kcore is wrong, its size can be more than
> the physical memory size, because it also contains memory area of
> vmalloc(), vsyscall etc...
The set of offsets that are usable sure.
However the size from stat is:
proc_root_kcore->size = (size_t)high_memory - PAGE_OFFSET + PAGE_SIZE;
Which can not be different than the physical memory size.
> Reported-by: Tao Ma <tao.ma@...cle.com>
> Signed-off-by: WANG Cong <amwang@...hat.com>
> Cc: Eric W. Biederman <ebiederm@...ssion.com>
>
> ---
> diff --git a/arch/x86/include/asm/pgtable_64.h b/arch/x86/include/asm/pgtable_64.h
> index abde308..cdbfd1d 100644
> --- a/arch/x86/include/asm/pgtable_64.h
> +++ b/arch/x86/include/asm/pgtable_64.h
> @@ -163,12 +163,6 @@ extern void cleanup_highmap(void);
> #define PAGE_AGP PAGE_KERNEL_NOCACHE
> #define HAVE_PAGE_AGP 1
>
> -/* fs/proc/kcore.c */
> -#define kc_vaddr_to_offset(v) ((v) & __VIRTUAL_MASK)
> -#define kc_offset_to_vaddr(o) \
> - (((o) & (1UL << (__VIRTUAL_MASK_SHIFT - 1))) \
> - ? ((o) | ~__VIRTUAL_MASK) \
> - : (o))
>
> #define __HAVE_ARCH_PTE_SAME
> #endif /* !__ASSEMBLY__ */
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists