From: Juergen Gross <jgross@suse.com>
To: minios-devel@lists.xenproject.org, xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>,
samuel.thibault@ens-lyon.org, wei.liu2@citrix.com
Subject: [PATCH 1/9] mini-os: correct first free pfn
Date: Tue, 19 Jul 2016 10:44:17 +0200 [thread overview]
Message-ID: <1468917865-12828-2-git-send-email-jgross@suse.com> (raw)
In-Reply-To: <1468917865-12828-1-git-send-email-jgross@suse.com>
The first free pfn available for allocation is calculated by adding the
number of page table frames to the pfn of the first page table and
then the magic number 3 to account for start info page et al.
As the start info page, xenstore page and console page are allocated
_before_ the page tables leaving room for these pages behind the page
tables makes no sense.
Signed-off-by: Juergen Gross <jgross@suse.com>
---
arch/x86/mm.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/arch/x86/mm.c b/arch/x86/mm.c
index 51aa966..ae1036e 100644
--- a/arch/x86/mm.c
+++ b/arch/x86/mm.c
@@ -867,9 +867,8 @@ void arch_init_mm(unsigned long* start_pfn_p, unsigned long* max_pfn_p)
printk("stack start: %p(VA)\n", stack);
printk(" _end: %p(VA)\n", &_end);
- /* First page follows page table pages and 3 more pages (store page etc) */
- start_pfn = PFN_UP(to_phys(start_info.pt_base)) +
- start_info.nr_pt_frames + 3;
+ /* First page follows page table pages. */
+ start_pfn = PFN_UP(to_phys(start_info.pt_base)) + start_info.nr_pt_frames;
max_pfn = start_info.nr_pages;
/* We need room for demand mapping and heap, clip available memory */
--
2.6.6
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
next prev parent reply other threads:[~2016-07-19 8:44 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-19 8:44 [PATCH 0/9] mini-os: prepare for support of ballooning Juergen Gross
2016-07-19 8:44 ` Juergen Gross [this message]
2016-07-19 8:44 ` [PATCH 2/9] mini-os: remove unused alloc_contig_pages() function Juergen Gross
2016-07-19 8:44 ` [PATCH 3/9] mini-os: remove MM_DEBUG code Juergen Gross
2016-07-19 8:44 ` [PATCH 4/9] mini-os: add description of x86 memory usage Juergen Gross
2016-07-19 8:44 ` [PATCH 5/9] mini-os: add nr_free_pages counter Juergen Gross
2016-07-19 8:44 ` [PATCH 6/9] mini-os: let memory allocation fail if no free page available Juergen Gross
2016-07-19 8:44 ` [PATCH 7/9] mini-os: add ballooning config item Juergen Gross
2016-07-19 8:44 ` [PATCH 8/9] mini-os: get maximum memory size from hypervisor Juergen Gross
2016-07-19 8:44 ` [PATCH 9/9] mini-os: modify virtual memory layout for support of ballooning Juergen Gross
2016-07-25 13:52 ` [PATCH 0/9] mini-os: prepare " Wei Liu
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=1468917865-12828-2-git-send-email-jgross@suse.com \
--to=jgross@suse.com \
--cc=minios-devel@lists.xenproject.org \
--cc=samuel.thibault@ens-lyon.org \
--cc=wei.liu2@citrix.com \
--cc=xen-devel@lists.xenproject.org \
/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).