Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752751AbZFMEHq (ORCPT ); Sat, 13 Jun 2009 00:07:46 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751044AbZFMEHh (ORCPT ); Sat, 13 Jun 2009 00:07:37 -0400 Received: from mail-px0-f187.google.com ([209.85.216.187]:54886 "EHLO mail-px0-f187.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750981AbZFMEHg (ORCPT ); Sat, 13 Jun 2009 00:07:36 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=sgwOWAe1TMMCDyk2sKaDRJFD93DiP1yOQGYGh/tkMKksakoRJxw8saw7R5nPAFURl9 j7cur1hKK/yzpsgARyvWcvaY5ecC+3wI7g4MV2GVYbPJraD0O81tFtOajZ9ilq8OlQ6z 74ETYKOCrzVK1MNNRQROS/P+J/0LWcTpMpE0M= Date: Sat, 13 Jun 2009 12:09:58 +0800 From: Amerigo Wang To: "Eric W. Biederman" Cc: Amerigo Wang , Tao Ma , Andrew Morton , linux-kernel@vger.kernel.org, Alexey Dobriyan Subject: [Patch BUGFIX] kcore: fix its wrong size on x86_64 Message-ID: <20090613040958.GA2959@cr0> References: <4A2A7F33.4030807@oracle.com> <4A2AEBE3.4000100@kernel.org> <20090608015242.GB2596@cr0.nay.redhat.com> <4A2CA96D.3090502@oracle.com> <2375c9f90906072341o2cded749m45bdddfdb499469@mail.gmail.com> <4A2CC52B.9010602@oracle.com> <2375c9f90906081743p77934f47n8ba1a018d333b95b@mail.gmail.com> <20090611050929.GA2706@cr0.nay.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1452 Lines: 43 Fix wrong /proc/kcore size on x86_64. 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... Reported-by: Tao Ma Signed-off-by: WANG Cong Cc: Eric W. Biederman --- 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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/