From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [PATCH 2 of 4] x86: Introduce "top_of_mem" Date: Fri, 9 Mar 2012 16:46:44 +0000 Message-ID: <4F5A33F4.3070308@citrix.com> References: <1e79fb20072213f90bd7.1331304122@andrewcoop.uk.xensource.com> <4F5A33140200007800077654@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <4F5A33140200007800077654@nat28.tlf.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich Cc: xen-devel List-Id: xen-devel@lists.xenproject.org On 09/03/12 15:43, Jan Beulich wrote: >>>> On 09.03.12 at 15:42, Andrew Cooper wrote: >> It is very useful for the crashdump kernel to have an idea of what Xen >> thought was the maximum memory address was, especially if the >> crashdump kernel is 32bit. > But then you also need to update the value upon memory hotplug. > (And I assume subsequent patches will actually make use of this.) > > Jan Where/how does memory hotplug get exposed then? A cursory look in mm.c has references to hotplug in the init paths. A subsequent patch does make use of this value. ~Andrew >> Signed-off-by: Andrew Cooper >> >> diff -r 977fa1c61b3e -r 1e79fb200722 xen/arch/x86/mm.c >> --- a/xen/arch/x86/mm.c >> +++ b/xen/arch/x86/mm.c >> @@ -149,6 +149,7 @@ struct domain *dom_xen, *dom_io, *dom_co >> /* Frame table size in pages. */ >> unsigned long max_page; >> unsigned long total_pages; >> +u64 top_of_mem; >> >> unsigned long __read_mostly pdx_group_valid[BITS_TO_LONGS( >> (FRAMETABLE_SIZE / sizeof(*frame_table) + PDX_GROUP_COUNT - 1) >> diff -r 977fa1c61b3e -r 1e79fb200722 xen/arch/x86/setup.c >> --- a/xen/arch/x86/setup.c >> +++ b/xen/arch/x86/setup.c >> @@ -1111,6 +1111,7 @@ void __init __start_xen(unsigned long mb >> nr_pages >> (20 - PAGE_SHIFT), >> nr_pages << (PAGE_SHIFT - 10)); >> total_pages = nr_pages; >> + top_of_mem = e820.map[e820.nr_map-1].addr + e820.map[e820.nr_map-1].size; >> >> /* Sanity check for unwanted bloat of certain hypercall structures. */ >> BUILD_BUG_ON(sizeof(((struct xen_platform_op *)0)->u) != >> diff -r 977fa1c61b3e -r 1e79fb200722 xen/include/asm-x86/mm.h >> --- a/xen/include/asm-x86/mm.h >> +++ b/xen/include/asm-x86/mm.h >> @@ -296,6 +296,7 @@ int get_superpage(unsigned long mfn, str >> #endif >> extern unsigned long max_page; >> extern unsigned long total_pages; >> +extern u64 top_of_mem; >> void init_frametable(void); >> >> #define PDX_GROUP_COUNT ((1 << L2_PAGETABLE_SHIFT) / \ >> >> _______________________________________________ >> Xen-devel mailing list >> Xen-devel@lists.xen.org >> http://lists.xen.org/xen-devel > > -- Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer T: +44 (0)1223 225 900, http://www.citrix.com