From 0bdf830ba840ce53cb1362acbf71965cd80e9397 Mon Sep 17 00:00:00 2001 From: Louis Burda Date: Fri, 25 Nov 2022 21:50:43 +0100 Subject: Implement VMSA change based single stepping and guest vmmcall intercept among other things --- test/debug.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 test/debug.c (limited to 'test/debug.c') diff --git a/test/debug.c b/test/debug.c new file mode 100644 index 0000000..7a1e259 --- /dev/null +++ b/test/debug.c @@ -0,0 +1,26 @@ +#include "cachepc/uapi.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +int +main(int argc, const char **argv) +{ + uint32_t arg; + int fd, ret; + + fd = open("/dev/kvm", O_RDONLY); + if (fd < 0) err(1, "open"); + + arg = argc > 1 ? atoi(argv[1]) : 1; + ret = ioctl(fd, KVM_CPC_DEBUG, &arg); + if (ret == -1) err(1, "ioctl DEBUG"); + + close(fd); +} -- cgit v1.2.3-71-gd317