From 252b11a01e061fd17821e53a41c8451a1d2c27bd Mon Sep 17 00:00:00 2001 From: Louis Burda Date: Tue, 10 Jan 2023 01:37:23 +0100 Subject: Begin ioctl and test-case overhaul --- test/qemu-eviction_guest.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 test/qemu-eviction_guest.c (limited to 'test/qemu-eviction_guest.c') diff --git a/test/qemu-eviction_guest.c b/test/qemu-eviction_guest.c new file mode 100644 index 0000000..0cb5cab --- /dev/null +++ b/test/qemu-eviction_guest.c @@ -0,0 +1,30 @@ +#include "cachepc/uapi.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +int +main(int argc, const char **argv) +{ + void *buf; + + buf = NULL; + if (posix_memalign(&buf, L1_LINESIZE * L1_SETS, L1_LINESIZE * L1_SETS)) + err(1, "memalign"); + memset(buf, 0, L1_LINESIZE * L1_SETS); + + setpriority(PRIO_PROCESS, 0, -20); + + while (1) { + printf("LOOP\n"); + CPC_DO_VMMCALL(CPC_GUEST_START_TRACK, 0); + *(uint8_t *)(buf + L1_LINESIZE * 15) = 1; + CPC_DO_VMMCALL(CPC_GUEST_STOP_TRACK, 0); + } +} -- cgit v1.2.3-71-gd317