From c13b827e66a93b121b48bd1fa6db1a11e77031c9 Mon Sep 17 00:00:00 2001 From: Andres Lagar-Cavilla Date: Fri, 10 Feb 2012 16:07:07 +0000 Subject: 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 Signed-off-by: Adin Scannell Acked-by: Tim Deegan Acked-by: Ian Jackson Committed-by: Tim Deegan --- tools/tests/mem-sharing/memshrtool.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'tools/tests') 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 \n"); printf(" - Populate a page in a domain with a shared page.\n"); printf(" debug-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; } -- cgit v1.2.3