* [PATCH] x86/p2m: add PoD accounting to set_typed_p2m_entry()
@ 2015-09-22 13:01 Jan Beulich
2015-09-22 13:06 ` Andrew Cooper
2015-09-22 16:30 ` George Dunlap
0 siblings, 2 replies; 3+ messages in thread
From: Jan Beulich @ 2015-09-22 13:01 UTC (permalink / raw)
To: xen-devel; +Cc: George Dunlap, Andrew Cooper, Keir Fraser
[-- Attachment #1: Type: text/plain, Size: 1053 bytes --]
While neither PoD together with pass-through nor PVH are currently
supported we still shouldn't leave in place such latent issues.
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Tim Deegan <tim@xen.org>
---
To apply cleanly this needs to have
http://lists.xenproject.org/archives/html/xen-devel/2015-09/msg02719.html
applied first.
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -941,10 +941,18 @@ static int set_typed_p2m_entry(struct do
P2M_DEBUG("set %d %lx %lx\n", gfn_p2mt, gfn, mfn_x(mfn));
rc = p2m_set_entry(p2m, gfn, mfn, order, gfn_p2mt, access);
- gfn_unlock(p2m, gfn, order);
if ( rc )
gdprintk(XENLOG_ERR, "p2m_set_entry: %#lx:%u -> %d (0x%"PRI_mfn")\n",
gfn, order, rc, mfn_x(mfn));
+ else if ( p2m_is_pod(ot) )
+ {
+ pod_lock(p2m);
+ p2m->pod.entry_count -= 1UL << order;
+ BUG_ON(p2m->pod.entry_count < 0);
+ pod_unlock(p2m);
+ }
+ gfn_unlock(p2m, gfn, order);
+
return rc;
}
[-- Attachment #2: x86-p2m-typed-entry-PoD.patch --]
[-- Type: text/plain, Size: 1102 bytes --]
x86/p2m: add PoD accounting to set_typed_p2m_entry()
While neither PoD together with pass-through nor PVH are currently
supported we still shouldn't leave in place such latent issues.
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Tim Deegan <tim@xen.org>
---
To apply cleanly this needs to have
http://lists.xenproject.org/archives/html/xen-devel/2015-09/msg02719.html
applied first.
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -941,10 +941,18 @@ static int set_typed_p2m_entry(struct do
P2M_DEBUG("set %d %lx %lx\n", gfn_p2mt, gfn, mfn_x(mfn));
rc = p2m_set_entry(p2m, gfn, mfn, order, gfn_p2mt, access);
- gfn_unlock(p2m, gfn, order);
if ( rc )
gdprintk(XENLOG_ERR, "p2m_set_entry: %#lx:%u -> %d (0x%"PRI_mfn")\n",
gfn, order, rc, mfn_x(mfn));
+ else if ( p2m_is_pod(ot) )
+ {
+ pod_lock(p2m);
+ p2m->pod.entry_count -= 1UL << order;
+ BUG_ON(p2m->pod.entry_count < 0);
+ pod_unlock(p2m);
+ }
+ gfn_unlock(p2m, gfn, order);
+
return rc;
}
[-- Attachment #3: Type: text/plain, Size: 126 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-09-22 16:31 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-22 13:01 [PATCH] x86/p2m: add PoD accounting to set_typed_p2m_entry() Jan Beulich
2015-09-22 13:06 ` Andrew Cooper
2015-09-22 16:30 ` George Dunlap
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).