aboutsummaryrefslogtreecommitdiffstats
path: root/tools/tests
diff options
context:
space:
mode:
authorAndres Lagar-Cavilla <andres@lagarcavilla.org>2012-02-10 16:07:07 +0000
committerAndres Lagar-Cavilla <andres@lagarcavilla.org>2012-02-10 16:07:07 +0000
commitc13b827e66a93b121b48bd1fa6db1a11e77031c9 (patch)
treecee5e3f3edfb171d07544b8ea5a7a16f6604d7d4 /tools/tests
parent59a36d66a5d50a66f8a629b334a0cbd7af360f80 (diff)
downloadxen-c13b827e66a93b121b48bd1fa6db1a11e77031c9.tar.gz
xen-c13b827e66a93b121b48bd1fa6db1a11e77031c9.tar.bz2
xen-c13b827e66a93b121b48bd1fa6db1a11e77031c9.zip
x86/mm: New sharing audit memop
Remove costly mem_sharing audits from the inline path, and instead make them callable as a memop. Have the audit function return the number of errors detected. Update memshrtool to be able to trigger audits. Set sharing audits as enabled by default. Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org> Signed-off-by: Adin Scannell <adin@scannell.ca> Acked-by: Tim Deegan <tim@xen.org> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Tim Deegan <tim@xen.org>
Diffstat (limited to 'tools/tests')
-rw-r--r--tools/tests/mem-sharing/memshrtool.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/tools/tests/mem-sharing/memshrtool.c b/tools/tests/mem-sharing/memshrtool.c
index a5dfc24f94..db44294230 100644
--- a/tools/tests/mem-sharing/memshrtool.c
+++ b/tools/tests/mem-sharing/memshrtool.c
@@ -27,6 +27,7 @@ static int usage(const char* prog)
printf(" add-to-physmap <domid> <gfn> <source> <source-gfn> <source-handle>\n");
printf(" - Populate a page in a domain with a shared page.\n");
printf(" debug-gfn <domid> <gfn> - Debug a particular domain and gfn.\n");
+ printf(" audit - Audit the sharing subsytem in Xen.\n");
return 1;
}
@@ -160,6 +161,16 @@ int main(int argc, const char** argv)
gfn = strtol(argv[3], NULL, 0);
R(xc_memshr_debug_gfn(xch, domid, gfn));
}
+ else if( !strcasecmp(cmd, "audit") )
+ {
+ int rc = xc_memshr_audit(xch);
+ if ( rc < 0 )
+ {
+ printf("error executing xc_memshr_audit: %s\n", strerror(errno));
+ return rc;
+ }
+ printf("Audit returned %d errors.\n", rc);
+ }
return 0;
}