From: Andres Lagar-Cavilla <andres@lagarcavilla.org>
To: xen-devel@lists.xensource.com
Cc: olaf@aepfle.de, George.Dunlap@eu.citrix.com,
andres@gridcentric.ca, tim@xen.org, keir.xen@gmail.com,
adin@gridcentric.ca
Subject: [PATCH 2 of 6] Fix handling of m2p map in set_shared_p2m_entry
Date: Mon, 14 Nov 2011 16:48:43 -0500 [thread overview]
Message-ID: <1ef55d87b4590ff9a8cc.1321307323@xdev.gridcentric.ca> (raw)
In-Reply-To: <patchbomb.1321307321@xdev.gridcentric.ca>
xen/arch/x86/mm/p2m.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
When updating a p2m mapping to shared, previous code
unconditionally set the m2p entry for the old mfn to invalid.
We now check that the old mfn does not remain shared.
Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
diff -r d9a344a5c1e3 -r 1ef55d87b459 xen/arch/x86/mm/p2m.c
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -714,8 +714,9 @@ set_shared_p2m_entry(struct domain *d, u
* sharable first */
ASSERT(p2m_is_shared(ot));
ASSERT(mfn_valid(omfn));
- /* XXX: M2P translations have to be handled properly for shared pages */
- set_gpfn_from_mfn(mfn_x(omfn), INVALID_M2P_ENTRY);
+ if ( ((mfn_to_page(omfn)->u.inuse.type_info & PGT_type_mask)
+ != PGT_shared_page) )
+ set_gpfn_from_mfn(mfn_x(omfn), INVALID_M2P_ENTRY);
P2M_DEBUG("set shared %lx %lx\n", gfn, mfn_x(mfn));
rc = set_p2m_entry(p2m, gfn, mfn, PAGE_ORDER_4K, p2m_ram_shared, p2m->default_access);
next prev parent reply other threads:[~2011-11-14 21:48 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-14 21:48 [PATCH 0 of 6] P2M various fixes Andres Lagar-Cavilla
2011-11-14 21:48 ` [PATCH 1 of 6] The PoD code may split a 1GB superpage in a potentially unlocked way Andres Lagar-Cavilla
2011-11-15 15:39 ` George Dunlap
2011-11-14 21:48 ` Andres Lagar-Cavilla [this message]
2011-11-14 21:48 ` [PATCH 3 of 6] Make HAP log dirty disable return the correct rc Andres Lagar-Cavilla
2011-11-15 10:33 ` George Dunlap
2011-11-14 21:48 ` [PATCH 4 of 6] When passing no bitmap for the shadow log dirty bitmap clean up, we should not get EFAULT Andres Lagar-Cavilla
2011-11-14 21:48 ` [PATCH 5 of 6] Rework stale p2m auditing Andres Lagar-Cavilla
2011-11-15 12:14 ` George Dunlap
2011-11-15 15:38 ` Andres Lagar-Cavilla
2011-11-24 15:30 ` Tim Deegan
2011-11-24 16:21 ` Andres Lagar-Cavilla
2011-11-24 16:26 ` Tim Deegan
2011-11-14 21:48 ` [PATCH 6 of 6] Add libxc wrapper for p2m audit domctl Andres Lagar-Cavilla
2011-11-24 15:32 ` [PATCH 0 of 6] P2M various fixes Tim Deegan
2011-11-24 15:55 ` Andres Lagar-Cavilla
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=1ef55d87b4590ff9a8cc.1321307323@xdev.gridcentric.ca \
--to=andres@lagarcavilla.org \
--cc=George.Dunlap@eu.citrix.com \
--cc=adin@gridcentric.ca \
--cc=andres@gridcentric.ca \
--cc=keir.xen@gmail.com \
--cc=olaf@aepfle.de \
--cc=tim@xen.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).