summaryrefslogtreecommitdiffstats
path: root/test/kvm-step.c
diff options
context:
space:
mode:
authorLouis Burda <quent.burda@gmail.com>2023-02-05 16:02:54 -0600
committerLouis Burda <quent.burda@gmail.com>2023-02-06 07:01:01 -0600
commit4dd9fe04e1399e8629ab2a98b54db6a7dcdb0076 (patch)
tree887ef659e545698927c9997b53a80beaebcbd4ce /test/kvm-step.c
parent0d4f62bcc065026390dd1f19b0bb462d07dcf9ff (diff)
downloadcachepc-4dd9fe04e1399e8629ab2a98b54db6a7dcdb0076.tar.gz
cachepc-4dd9fe04e1399e8629ab2a98b54db6a7dcdb0076.zip
Fix stepping inconsistency by moving oneshot after primee
Diffstat (limited to 'test/kvm-step.c')
-rw-r--r--test/kvm-step.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/test/kvm-step.c b/test/kvm-step.c
index 4cae764..4c1b6b5 100644
--- a/test/kvm-step.c
+++ b/test/kvm-step.c
@@ -66,14 +66,17 @@ main(int argc, const char **argv)
struct cpc_track_cfg cfg;
uint64_t eventcnt;
uint32_t arg;
+ bool with_data;
int ret;
- vmtype = "kvm";
- if (argc > 1) vmtype = argv[1];
- if (strcmp(vmtype, "kvm") && strcmp(vmtype, "sev")
- && strcmp(vmtype, "sev-es")
- && strcmp(vmtype, "sev-snp"))
- errx(1, "invalid vm mode: %s", vmtype);
+ with_data = true;
+ if (argc > 1 && !strcmp(argv[1], "--exec-only")) {
+ with_data = false;
+ argc--;
+ argv++;
+ }
+
+ parse_vmtype(argc, argv);
setvbuf(stdout, NULL, _IONBF, 0);
@@ -122,7 +125,7 @@ main(int argc, const char **argv)
memset(&cfg, 0, sizeof(cfg));
cfg.mode = CPC_TRACK_STEPS;
- cfg.steps.with_data = true;
+ cfg.steps.with_data = with_data;
ret = ioctl(kvm_dev, KVM_CPC_TRACK_MODE, &cfg);
if (ret) err(1, "KVM_CPC_TRACK_MODE");
@@ -173,7 +176,7 @@ main(int argc, const char **argv)
if (ret) err(1, "KVM_CPC_ACK_EVENT");
eventcnt = 0;
- while (eventcnt < 50) {
+ while (eventcnt < 110) {
eventcnt += monitor(&kvm, false);
}