xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: linux-kernel@vger.kernel.org, xen-devel@lists.xensource.com
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: [PATCH 3/7] xen/mmu: Release the Xen provided L4 (PGD) back.
Date: Thu, 26 Jul 2012 16:47:28 -0400	[thread overview]
Message-ID: <1343335652-5659-4-git-send-email-konrad.wilk@oracle.com> (raw)
In-Reply-To: <1343335652-5659-1-git-send-email-konrad.wilk@oracle.com>

Since we are not using it and somebody else could use it.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
 arch/x86/xen/mmu.c |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c
index a59070b..48bdc9f 100644
--- a/arch/x86/xen/mmu.c
+++ b/arch/x86/xen/mmu.c
@@ -1782,20 +1782,21 @@ void __init xen_setup_kernel_pagetable(pgd_t *pgd, unsigned long max_pfn)
 	/* Unpin Xen-provided one */
 	pin_pagetable_pfn(MMUEXT_UNPIN_TABLE, PFN_DOWN(__pa(pgd)));
 
-	/* Switch over */
-	pgd = init_level4_pgt;
-
 	/*
 	 * At this stage there can be no user pgd, and no page
 	 * structure to attach it to, so make sure we just set kernel
 	 * pgd.
 	 */
 	xen_mc_batch();
-	__xen_write_cr3(true, __pa(pgd));
+	__xen_write_cr3(true, __pa(init_level4_pgt));
 	xen_mc_issue(PARAVIRT_LAZY_CPU);
 
-	memblock_reserve(__pa(xen_start_info->pt_base),
-			 xen_start_info->nr_pt_frames * PAGE_SIZE);
+	/* Offset by one page since the original pgd is going bye bye */
+	memblock_reserve(__pa(xen_start_info->pt_base + PAGE_SIZE),
+			 (xen_start_info->nr_pt_frames * PAGE_SIZE) - PAGE_SIZE);
+	/* and also RW it so it can actually be used. */
+	set_page_prot(pgd, PAGE_KERNEL);
+	clear_page(pgd);
 }
 #else	/* !CONFIG_X86_64 */
 static RESERVE_BRK_ARRAY(pmd_t, initial_kernel_pmd, PTRS_PER_PMD);
-- 
1.7.7.6

  parent reply	other threads:[~2012-07-26 20:47 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-26 20:47 [RFC PATCH] Boot PV guests with more than 128GB (v1) for 3.7 Konrad Rzeszutek Wilk
2012-07-26 20:47 ` [PATCH 1/7] xen/mmu: use copy_page instead of memcpy Konrad Rzeszutek Wilk
2012-07-27  7:35   ` Jan Beulich
2012-07-26 20:47 ` [PATCH 2/7] xen/mmu: For 64-bit do not call xen_map_identity_early Konrad Rzeszutek Wilk
2012-07-26 20:47 ` Konrad Rzeszutek Wilk [this message]
2012-07-27 11:37   ` [Xen-devel] [PATCH 3/7] xen/mmu: Release the Xen provided L4 (PGD) back Stefano Stabellini
2012-07-27 17:35     ` Konrad Rzeszutek Wilk
2012-07-26 20:47 ` [PATCH 4/7] xen/mmu: Recycle the Xen provided L4, L3, and L2 pages Konrad Rzeszutek Wilk
2012-07-27 11:45   ` [Xen-devel] " Stefano Stabellini
2012-07-27 17:38     ` Konrad Rzeszutek Wilk
2012-07-31 14:39       ` [Xen-devel] " Konrad Rzeszutek Wilk
2012-07-26 20:47 ` [PATCH 5/7] xen/p2m: Add logic to revector a P2M tree to use __va leafs Konrad Rzeszutek Wilk
2012-07-27 11:18   ` [Xen-devel] " Stefano Stabellini
2012-07-27 11:47     ` Jan Beulich
     [not found]     ` <50129C030200007800090F9B@nat28.tlf.novell.com>
2012-07-27 17:34       ` Konrad Rzeszutek Wilk
2012-07-30  7:10         ` Jan Beulich
2012-07-26 20:47 ` [PATCH 6/7] xen/mmu: Copy and revector the P2M tree Konrad Rzeszutek Wilk
2012-07-26 20:47 ` [PATCH 7/7] xen/mmu: Remove from __ka space PMD entries for pagetables Konrad Rzeszutek Wilk
2012-07-27 11:31   ` [Xen-devel] " Stefano Stabellini
2012-07-27 17:42     ` Konrad Rzeszutek Wilk
2012-07-31 14:37       ` Konrad Rzeszutek Wilk
2012-07-27  7:34 ` [RFC PATCH] Boot PV guests with more than 128GB (v1) for 3.7 Jan Beulich
     [not found] ` <501260980200007800090E08@nat28.tlf.novell.com>
2012-07-27 10:00   ` Ian Campbell
     [not found]   ` <1343383205.6812.137.camel@zakaz.uk.xensource.com>
2012-07-27 10:17     ` Jan Beulich
     [not found]     ` <501286E50200007800090ECB@nat28.tlf.novell.com>
2012-07-27 10:21       ` Ian Campbell
     [not found]       ` <1343384489.6812.143.camel@zakaz.uk.xensource.com>
2012-07-27 10:33         ` 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=1343335652-5659-4-git-send-email-konrad.wilk@oracle.com \
    --to=konrad.wilk@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --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).