Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932594AbcJLJKC (ORCPT ); Wed, 12 Oct 2016 05:10:02 -0400 Received: from mail-qt0-f172.google.com ([209.85.216.172]:34279 "EHLO mail-qt0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932105AbcJLJJz (ORCPT ); Wed, 12 Oct 2016 05:09:55 -0400 Subject: Re: [PATCH] kexec: Export memory sections virtual addresses to vmcoreinfo To: Baoquan He , Dave Young , ats-kumagai@wm.jp.nec.com References: <1475743561-23912-1-git-send-email-bhe@redhat.com> <877f9lckbq.fsf@x220.int.ebiederm.org> <20161011074111.GD11185@x1> <20161011081921.GA21765@dhcp-128-65.nay.redhat.com> <20161012002613.GB21477@x1> Cc: "Eric W. Biederman" , kexec@lists.infradead.org, linux-kernel@vger.kernel.org, tglx@linutronix.de, akpm@linux-foundation.org, mingo@redhat.com, hpa@zytor.com, tonli@redhat.com, keescook@chromium.org, takahiro.akashi@linaro.org, thgarnie@google.com From: Pratyush Anand Message-ID: <256e8ba2-4f92-36cf-ec5c-2502113922c6@redhat.com> Date: Wed, 12 Oct 2016 14:39:45 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <20161012002613.GB21477@x1> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 999 Lines: 29 On Wednesday 12 October 2016 05:56 AM, Baoquan He wrote: >> PAGE_OFFSET can be get via vaddr - paddr from elf pt_loads so only >> > VMALLOC_BASE and VMEMMAP_BASE is necessary.. > Well, yes, I was wrong. I wrongly thought of kernel text virtual address > when I wrote the reply So, if you can get PAGE_OFFSET then, probably you do not need to know anything else. I think, we can simplify makedumpfile code, where we do not need to depend on VMALLOC_START or VMEMMAP_START etc. "If we know PAGE_OFFSET, we can read from swapper space. If we can read from swapper space, then we can know PA of any kernel VA, whether it is VMALLOC, or vmemmap or module or kernel text area." In fact, I have cleanup patches for ARM64 [1], which take above approach and get rid of need of VMALLOC_START or VMEMMAP_START etc. I will be sending them upstream soon. Probably, x86 can take the similar approach. ~Pratyush [1] https://github.com/pratyushanand/makedumpfile/blob/arm64_devel/arch/arm64.c#L228