From: Andrew Cooper <andrew.cooper3@citrix.com>
To: xen-devel@lists.xensource.com
Cc: Andrew Cooper <andrew.cooper3@citrix.com>
Subject: [PATCH 2 of 4] x86: Introduce "top_of_mem"
Date: Fri, 9 Mar 2012 14:42:02 +0000 [thread overview]
Message-ID: <1e79fb20072213f90bd7.1331304122@andrewcoop.uk.xensource.com> (raw)
In-Reply-To: <patchbomb.1331304120@andrewcoop.uk.xensource.com>
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.
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
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) / \
next prev parent reply other threads:[~2012-03-09 14:42 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-09 14:42 [PATCH 0 of 4] KEXEC subsystem fixes and changes Andrew Cooper
2012-03-09 14:42 ` [PATCH 1 of 4] KEXEC: Allocate crash notes on boot Andrew Cooper
2012-03-09 15:41 ` Jan Beulich
2012-03-09 16:08 ` Andrew Cooper
2012-03-09 16:58 ` Jan Beulich
2012-03-09 14:42 ` Andrew Cooper [this message]
2012-03-09 15:43 ` [PATCH 2 of 4] x86: Introduce "top_of_mem" Jan Beulich
2012-03-09 16:46 ` Andrew Cooper
2012-03-09 17:00 ` Jan Beulich
2012-03-09 14:42 ` [PATCH 3 of 4] KEXEC: Allocate crash structures in low memory Andrew Cooper
2012-03-09 15:52 ` Keir Fraser
2012-03-09 16:24 ` Andrew Cooper
2012-03-09 16:30 ` Keir Fraser
2012-03-09 15:55 ` Jan Beulich
2012-03-09 17:01 ` Andrew Cooper
2012-03-09 14:42 ` [PATCH 4 of 4] KEXEC: Introduce new crashtables interface Andrew Cooper
2012-03-09 16:11 ` Jan Beulich
2012-03-09 17:33 ` Andrew Cooper
2012-03-11 9:59 ` Jan Beulich
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1e79fb20072213f90bd7.1331304122@andrewcoop.uk.xensource.com \
--to=andrew.cooper3@citrix.com \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).