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 6 of 6] Add libxc wrapper for p2m audit domctl
Date: Mon, 14 Nov 2011 16:48:47 -0500 [thread overview]
Message-ID: <1f9e4cde0093d785dee3.1321307327@xdev.gridcentric.ca> (raw)
In-Reply-To: <patchbomb.1321307321@xdev.gridcentric.ca>
tools/libxc/xc_domain.c | 22 ++++++++++++++++++++++
tools/libxc/xenctrl.h | 27 +++++++++++++++++++++++++++
2 files changed, 49 insertions(+), 0 deletions(-)
Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
diff -r 764e0872dd4f -r 1f9e4cde0093 tools/libxc/xc_domain.c
--- a/tools/libxc/xc_domain.c
+++ b/tools/libxc/xc_domain.c
@@ -1472,6 +1472,28 @@ int xc_domain_debug_control(xc_interface
return do_domctl(xc, &domctl);
}
+int xc_domain_p2m_audit(xc_interface *xch,
+ uint32_t domid,
+ uint64_t *orphans_debug,
+ uint64_t *orphans_invalid,
+ uint64_t *m2p_bad,
+ uint64_t *p2m_bad)
+{
+ DECLARE_DOMCTL;
+ int rc;
+
+ domctl.cmd = XEN_DOMCTL_audit_p2m;
+ domctl.domain = domid;
+ rc = do_domctl(xch, &domctl);
+
+ *orphans_debug = domctl.u.audit_p2m.orphans_debug;
+ *orphans_invalid = domctl.u.audit_p2m.orphans_invalid;
+ *m2p_bad = domctl.u.audit_p2m.m2p_bad;
+ *p2m_bad = domctl.u.audit_p2m.p2m_bad;
+
+ return rc;
+}
+
int xc_domain_set_access_required(xc_interface *xch,
uint32_t domid,
unsigned int required)
diff -r 764e0872dd4f -r 1f9e4cde0093 tools/libxc/xenctrl.h
--- a/tools/libxc/xenctrl.h
+++ b/tools/libxc/xenctrl.h
@@ -712,6 +712,33 @@ int xc_domain_setdebugging(xc_interface
unsigned int enable);
/**
+ * This function audits the (top level) p2m of a domain
+ * and returns the different error counts, if any.
+ *
+ * @parm xch a handle to an open hypervisor interface
+ * @parm domid the domain id whose top level p2m we
+ * want to audit
+ * @parm orphans_debug count of m2p entries for valid
+ * domain pages containing a debug value
+ * @parm orphans_invalid count of m2p entries for valid
+ * domain pages containing an invalid value
+ * @parm m2p_bad count of m2p entries mismatching the
+ * associated p2m entry for this domain
+ * @parm p2m_bad count of p2m entries for this domain
+ * mismatching the associated m2p entry
+ * return 0 on success, -1 on failure
+ * errno values on failure include:
+ * -ENOSYS: not implemented
+ * -EFAULT: could not copy results back to guest
+ */
+int xc_domain_p2m_audit(xc_interface *xch,
+ uint32_t domid,
+ uint64_t *orphans_debug,
+ uint64_t *orphans_invalid,
+ uint64_t *m2p_bad,
+ uint64_t *p2m_bad);
+
+/**
* This function sets or clears the requirement that an access memory
* event listener is required on the domain.
*
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 ` [PATCH 2 of 6] Fix handling of m2p map in set_shared_p2m_entry Andres Lagar-Cavilla
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 ` Andres Lagar-Cavilla [this message]
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=1f9e4cde0093d785dee3.1321307327@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).