From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752932Ab3KKVPR (ORCPT ); Mon, 11 Nov 2013 16:15:17 -0500 Received: from mx1.redhat.com ([209.132.183.28]:52252 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751036Ab3KKVPO (ORCPT ); Mon, 11 Nov 2013 16:15:14 -0500 Date: Mon, 11 Nov 2013 16:14:51 -0500 From: Vivek Goyal To: "H. Peter Anvin" Cc: linux kernel mailing list , Kexec Mailing List , "Eric W. Biederman" , Yinghai Lu Subject: Re: Kexec query about what makes sure control pages/page tables are not overwritten Message-ID: <20131111211451.GF11547@redhat.com> References: <20131111205341.GE11547@redhat.com> <15b29390-b535-4157-b7f2-8b1e03c919c1@email.android.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <15b29390-b535-4157-b7f2-8b1e03c919c1@email.android.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 11, 2013 at 12:57:12PM -0800, H. Peter Anvin wrote: > It is pretty simple: the kernel exports how much text+data+bss+brk it needs, and the kernel cannot use memory outside that region until it is ready to control the address space itself. Ok. So looks like that field is. 0260/4 2.10+ init_size Linear memory required during initialization This helps. Thanks. Vivek > > Vivek Goyal wrote: > >Hi, > > > >I am staring at control page allocation logic in case of kdump and > >wondering what makes sure that these pages are not overwritten by > >next kernel. > > > >I see that for 64bit entry, control pages have the page tables needed > >for second kernel. In case of crash these pages from from crash kernel > >reserved region. Page allocator is very simple and that is start from > >lowest crash reserved range and move higher and allocate first > >available > >page which is not allocated to segments. What makes sure that these > >pages > >are not overwritten by second kernel. > > > >I guess it becomes a general bootloader question. How do we make sure > >bootloader prepared page tables/gdt will not be overwritten by kernel > >(till kernel sets up its own page tables and gdt) and how should we do > >the > >allocation and placement. > > > >Thanks > >Vivek > > -- > Sent from my mobile phone. Please pardon brevity and lack of formatting.