From 1f418a1c4480cef90b8596ae17bdca9cc7ca1b88 Mon Sep 17 00:00:00 2001 From: Louis Burda Date: Fri, 27 Jan 2023 00:01:09 +0100 Subject: Added initial qemu-eviction and qemu-pagestep Qemu-eviction seems to get stuck somewhere, potentially in the VC-handler(?) since we use the active gfn after resuming execution. Added qemu-pagestep to show viability of page-stepping for later use. --- test/qemu-eviction.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'test/qemu-eviction.c') diff --git a/test/qemu-eviction.c b/test/qemu-eviction.c index a602bef..016ee9e 100644 --- a/test/qemu-eviction.c +++ b/test/qemu-eviction.c @@ -15,9 +15,6 @@ #include #include -#define TARGET_CORE 2 -#define SECONDARY_CORE 3 - static struct cpc_event event; int @@ -32,6 +29,7 @@ monitor(bool baseline) switch (event.type) { case CPC_EVENT_GUEST: + printf("Guest event: %i\n", event.guest.type); if (event.guest.type == CPC_GUEST_STOP_TRACK) return 2; break; @@ -40,7 +38,7 @@ monitor(bool baseline) if (ret) err(1, "KVM_CPC_READ_COUNTS"); printf("Event: rip:%016llx cnt:%llu " - "inst:%08llu data:%08llx ret:%llu\n", + "inst:%08llx data:%08llx ret:%llu\n", vm_get_rip(), event.step.fault_count, event.step.fault_gfns[0], event.step.fault_gfns[1], event.step.retinst); @@ -74,12 +72,8 @@ main(int argc, const char **argv) uint8_t baseline[L1_SETS]; uint32_t eventcnt; uint32_t arg; - pid_t qemu; int ret; - qemu = pgrep("qemu-system-x86_64"); - if (!qemu) errx(1, "pgrep failed"); - pin_process(0, SECONDARY_CORE, true); setvbuf(stdout, NULL, _IONBF, 0); @@ -93,7 +87,7 @@ main(int argc, const char **argv) ret = ioctl(kvm_dev, KVM_CPC_CALC_BASELINE, &arg); if (ret) err(1, "KVM_CPC_CALC_BASELINE"); - arg = CPC_TRACK_STEPS; + arg = CPC_TRACK_STEPS_AND_FAULTS; ret = ioctl(kvm_dev, KVM_CPC_TRACK_MODE, &arg); if (ret) err(1, "KVM_CPC_RESET"); -- cgit v1.2.3-71-gd317