| Seq | Timestamp | Type | Name | Duration |
|---|---|---|---|---|
| 0/0 | 2026/09/30 13:28 | flow | patch-triage |
1mArgs:null Results: {
"EnableConfigs": null,
"FocusSymbols": [],
"KMSANReasoning": "",
"NeedsKMSAN": false,
"Reasoning": "The patch series only modifies user-space KVM selftests under tools/testing/selftests/kvm/ (adding dirty ring support to dirty_log_perf_test and updating test helper functions). It does not modify any code within the kernel image (vmlinux) or kernel modules.",
"WorthFuzzing": false
} |
| 1/1 | 2026/09/30 13:28 | action | read-patch-diff |
0mArgs:null Results: {
"PatchDiff": "commit e5eb62b4edbf70b40b08ae4b5da79d0accd7f590\nAuthor: syz-cluster \u003ctriage@syzkaller.com\u003e\nDate: Wed Sep 30 13:28:49 2026 +0000\n\n syz-cluster: applied patch under review\n\ndiff --git a/tools/testing/selftests/kvm/access_tracking_perf_test.c b/tools/testing/selftests/kvm/access_tracking_perf_test.c\nindex 4415c94b28660..f78d56265d893 100644\n--- a/tools/testing/selftests/kvm/access_tracking_perf_test.c\n+++ b/tools/testing/selftests/kvm/access_tracking_perf_test.c\n@@ -409,7 +409,7 @@ static void run_test(enum vm_guest_mode mode, void *arg)\n \tint nr_vcpus = params-\u003enr_vcpus;\n \n \tvm = memstress_create_vm(mode, nr_vcpus, params-\u003evcpu_memory_bytes, 1,\n-\t\t\t\t params-\u003ebacking_src, !overlap_memory_access);\n+\t\t\t\t params-\u003ebacking_src, !overlap_memory_access, 0);\n \n \t/*\n \t * If guest_page_size is larger than the host's page size, the\ndiff --git a/tools/testing/selftests/kvm/demand_paging_test.c b/tools/testing/selftests/kvm/demand_paging_test.c\nindex f8b3d0b68830d..3ec00de735532 100644\n--- a/tools/testing/selftests/kvm/demand_paging_test.c\n+++ b/tools/testing/selftests/kvm/demand_paging_test.c\n@@ -162,7 +162,7 @@ static void run_test(enum vm_guest_mode mode, void *arg)\n \tint i, num_uffds = 0;\n \n \tvm = memstress_create_vm(mode, nr_vcpus, guest_percpu_mem_size, 1,\n-\t\t\t\t p-\u003esrc_type, p-\u003epartition_vcpu_memory_access);\n+\t\t\t\t p-\u003esrc_type, p-\u003epartition_vcpu_memory_access, 0);\n \n \tdemand_paging_size = get_backing_src_pagesz(p-\u003esrc_type);\n \ndiff --git a/tools/testing/selftests/kvm/dirty_log_perf_test.c b/tools/testing/selftests/kvm/dirty_log_perf_test.c\nindex 7c5abe1ae9e01..af0ab654d46e2 100644\n--- a/tools/testing/selftests/kvm/dirty_log_perf_test.c\n+++ b/tools/testing/selftests/kvm/dirty_log_perf_test.c\n@@ -13,6 +13,7 @@\n #include \u003ctime.h\u003e\n #include \u003cpthread.h\u003e\n #include \u003clinux/bitmap.h\u003e\n+#include \u003casm/barrier.h\u003e\n \n #include \"kvm_util.h\"\n #include \"test_util.h\"\n@@ -29,9 +30,53 @@ static bool run_vcpus_while_disabling_dirty_logging;\n \n /* Host variables */\n static u64 dirty_log_manual_caps;\n+static u32 dirty_ring_size;\n static bool host_quit;\n static int iteration;\n static int vcpu_last_completed_iteration[KVM_MAX_VCPUS];\n+static struct timespec vcpu_dirty_ring_collect[KVM_MAX_VCPUS];\n+\n+static void dirty_ring_collect(struct kvm_vcpu *vcpu, u32 *ring_idx,\n+\t\t\t\tstruct timespec *ts)\n+{\n+\tstatic pthread_mutex_t collect = PTHREAD_MUTEX_INITIALIZER;\n+\tstruct timespec start;\n+\tstruct kvm_dirty_gfn *dirty_gfns = vcpu_map_dirty_ring(vcpu);\n+\tu32 idx = *ring_idx;\n+\tu32 ring_size = vcpu-\u003evm-\u003edirty_ring_size / sizeof(struct kvm_dirty_gfn);\n+\tint cleared, count;\n+\n+\tpthread_mutex_lock(\u0026collect);\n+\n+\tclock_gettime(CLOCK_MONOTONIC, \u0026start);\n+\n+\twhile (true) {\n+\t\tstruct kvm_dirty_gfn *cur;\n+\n+\t\tcur = \u0026dirty_gfns[idx % ring_size];\n+\t\tif (smp_load_acquire(\u0026cur-\u003eflags) != KVM_DIRTY_GFN_F_DIRTY)\n+\t\t\tbreak;\n+\n+\t\tsmp_store_release(\u0026cur-\u003eflags, KVM_DIRTY_GFN_F_RESET);\n+\t\tidx++;\n+\t}\n+\n+\tcount = idx - *ring_idx;\n+\t*ring_idx = idx;\n+\n+\tcleared = kvm_vm_reset_dirty_ring(vcpu-\u003evm);\n+\n+\t/* Cleared pages should be the same as collected, as KVM is supposed to\n+\t * clear only the entries that have been harvested, and a single vcpu will\n+\t * harvest at time.\n+\t */\n+\tTEST_ASSERT(cleared == count, \"Reset dirty pages (%u) mismatch \"\n+\t\t \"with collected (%u)\", cleared, count);\n+\n+\t*ts = timespec_add(*ts, timespec_elapsed(start));\n+\n+\tpthread_mutex_unlock(\u0026collect);\n+}\n \n static void vcpu_worker(struct memstress_vcpu_args *vcpu_args)\n {\n@@ -43,24 +88,45 @@ static void vcpu_worker(struct memstress_vcpu_args *vcpu_args)\n \tstruct timespec ts_diff;\n \tstruct timespec total = (struct timespec){0};\n \tstruct timespec avg;\n+\tbool use_dirty_ring = !!vcpu-\u003evm-\u003edirty_ring_size;\n+\tu32 ring_idx = 0;\n \tint ret;\n \n \trun = vcpu-\u003erun;\n \n \twhile (!READ_ONCE(host_quit)) {\n \t\tint current_iteration = READ_ONCE(iteration);\n+\t\tstruct timespec collect = (struct timespec){0};\n \n \t\tclock_gettime(CLOCK_MONOTONIC, \u0026start);\n-\t\tret = _vcpu_run(vcpu);\n+\n+\t\tdo {\n+\t\t\tret = _vcpu_run(vcpu);\n+\t\t\tif (!use_dirty_ring)\n+\t\t\t\tbreak;\n+\n+\t\t\tdirty_ring_collect(vcpu, \u0026ring_idx, \u0026collect);\n+\t\t} while (!ret \u0026\u0026 run-\u003eexit_reason == KVM_EXIT_DIRTY_RING_FULL);\n+\n \t\tts_diff = timespec_elapsed(start);\n \n+\t\tif (use_dirty_ring) {\n+\t\t\tts_diff = timespec_sub(ts_diff, collect);\n+\t\t\tvcpu_dirty_ring_collect[vcpu_idx] = collect;\n+\t\t}\n+\n \t\tTEST_ASSERT(ret == 0, \"vcpu_run failed: %d\", ret);\n \t\tTEST_ASSERT(get_ucall(vcpu, NULL) == UCALL_SYNC,\n \t\t\t \"Invalid guest sync status: exit_reason=%s\",\n \t\t\t exit_reason_str(run-\u003eexit_reason));\n \n \t\tpr_debug(\"Got sync event from vCPU %d\\n\", vcpu_idx);\n-\t\tvcpu_last_completed_iteration[vcpu_idx] = current_iteration;\n+\t\t/*\n+\t\t * Make sure vcpu_last_completed_iteration write happens before\n+\t\t * updating current iteration. Pairs with run_test, after populating..\n+\t\t */\n+\t\tsmp_store_release(\u0026vcpu_last_completed_iteration[vcpu_idx],\n+\t\t\t\t current_iteration);\n \t\tpr_debug(\"vCPU %d updated last completed iteration to %d\\n\",\n \t\t\t vcpu_idx, vcpu_last_completed_iteration[vcpu_idx]);\n \n@@ -119,7 +185,8 @@ static void run_test(enum vm_guest_mode mode, void *arg)\n \n \tvm = memstress_create_vm(mode, nr_vcpus, guest_percpu_mem_size,\n \t\t\t\t p-\u003eslots, p-\u003ebacking_src,\n-\t\t\t\t p-\u003epartition_vcpu_memory_access);\n+\t\t\t\t p-\u003epartition_vcpu_memory_access,\n+\t\t\t\t dirty_ring_size);\n \n \tmemstress_set_write_percent(vm, p-\u003ewrite_percent);\n \n@@ -128,7 +195,8 @@ static void run_test(enum vm_guest_mode mode, void *arg)\n \thost_num_pages = vm_num_host_pages(mode, guest_num_pages);\n \tpages_per_slot = host_num_pages / p-\u003eslots;\n \n-\tbitmaps = memstress_alloc_bitmaps(p-\u003eslots, pages_per_slot);\n+\tif (!dirty_ring_size)\n+\t\tbitmaps = memstress_alloc_bitmaps(p-\u003eslots, pages_per_slot);\n \n \tif (dirty_log_manual_caps)\n \t\tvm_enable_cap(vm, KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2,\n@@ -139,8 +207,10 @@ static void run_test(enum vm_guest_mode mode, void *arg)\n \thost_quit = false;\n \n \tclock_gettime(CLOCK_MONOTONIC, \u0026start);\n-\tfor (i = 0; i \u003c nr_vcpus; i++)\n+\tfor (i = 0; i \u003c nr_vcpus; i++) {\n \t\tvcpu_last_completed_iteration[i] = -1;\n+\t\tvcpu_dirty_ring_collect[i] = (struct timespec){0};\n+\t}\n \n \t/*\n \t * Use 100% writes during the population phase to ensure all\n@@ -185,7 +255,7 @@ static void run_test(enum vm_guest_mode mode, void *arg)\n \n \t\tpr_debug(\"Starting iteration %d\\n\", iteration);\n \t\tfor (i = 0; i \u003c nr_vcpus; i++) {\n-\t\t\twhile (READ_ONCE(vcpu_last_completed_iteration[i])\n+\t\t\twhile (smp_load_acquire(\u0026vcpu_last_completed_iteration[i])\n \t\t\t != iteration)\n \t\t\t\t;\n \t\t}\n@@ -195,6 +265,21 @@ static void run_test(enum vm_guest_mode mode, void *arg)\n \t\tpr_info(\"Iteration %d dirty memory time: %ld.%.9lds\\n\",\n \t\t\titeration, ts_diff.tv_sec, ts_diff.tv_nsec);\n \n+\t\tif (dirty_ring_size) {\n+\t\t\tstruct timespec iteration_sum = (struct timespec){0};\n+\n+\t\t\tfor (i = 0; i \u003c nr_vcpus; i++)\n+\t\t\t\titeration_sum = timespec_add(iteration_sum,\n+\t\t\t\t\t\t\t vcpu_dirty_ring_collect[i]);\n+\n+\t\t\tpr_info(\"Iteration %d clear dirty ring time: %ld.%.9lds\\n\",\n+\t\t\t\titeration, iteration_sum.tv_sec, iteration_sum.tv_nsec);\n+\n+\t\t\tclear_dirty_log_total = timespec_add(clear_dirty_log_total,\n+\t\t\t\t\t\t\t iteration_sum);\n+\t\t\tcontinue;\n+\t\t}\n+\n \t\tclock_gettime(CLOCK_MONOTONIC, \u0026start);\n \t\tmemstress_get_dirty_log(vm, bitmaps, p-\u003eslots);\n \t\tts_diff = timespec_elapsed(start);\n@@ -238,19 +323,22 @@ static void run_test(enum vm_guest_mode mode, void *arg)\n \thost_quit = true;\n \tmemstress_join_vcpu_threads(nr_vcpus);\n \n-\tavg = timespec_div(get_dirty_log_total, p-\u003eiterations);\n-\tpr_info(\"Get dirty log over %lu iterations took %ld.%.9lds. (Avg %ld.%.9lds/iteration)\\n\",\n-\t\tp-\u003eiterations, get_dirty_log_total.tv_sec,\n-\t\tget_dirty_log_total.tv_nsec, avg.tv_sec, avg.tv_nsec);\n+\tif (!dirty_ring_size) {\n+\t\tavg = timespec_div(get_dirty_log_total, p-\u003eiterations);\n+\t\tpr_info(\"Get dirty log over %lu iterations took %ld.%.9lds. (Avg %ld.%.9lds/iteration)\\n\",\n+\t\t\tp-\u003eiterations, get_dirty_log_total.tv_sec,\n+\t\t\tget_dirty_log_total.tv_nsec, avg.tv_sec, avg.tv_nsec);\n+\t}\n \n-\tif (dirty_log_manual_caps) {\n+\tif (dirty_log_manual_caps || dirty_ring_size) {\n \t\tavg = timespec_div(clear_dirty_log_total, p-\u003eiterations);\n \t\tpr_info(\"Clear dirty log over %lu iterations took %ld.%.9lds. (Avg %ld.%.9lds/iteration)\\n\",\n \t\t\tp-\u003eiterations, clear_dirty_log_total.tv_sec,\n \t\t\tclear_dirty_log_total.tv_nsec, avg.tv_sec, avg.tv_nsec);\n \t}\n \n-\tmemstress_free_bitmaps(bitmaps, p-\u003eslots);\n+\tif (!dirty_ring_size)\n+\t\tmemstress_free_bitmaps(bitmaps, p-\u003eslots);\n \tmemstress_destroy_vm(vm);\n }\n \n@@ -259,11 +347,15 @@ static void help(char *name)\n \tputs(\"\");\n \tprintf(\"usage: %s [-h] [-a] [-i iterations] [-p offset] [-g] \"\n \t \"[-m mode] [-n] [-b vcpu bytes] [-v vcpus] [-o] [-r random seed ] [-s mem type]\"\n-\t \"[-x memslots] [-w percentage] [-c physical cpus to run test on]\\n\", name);\n+\t \"[-x memslots] [-w percentage] [-c physical cpus to run test on] \\n\"\n+\t \"[-d dirty-ring entries]\\n\", name);\n \tputs(\"\");\n \tprintf(\" -a: access memory randomly rather than in order.\\n\");\n \tprintf(\" -i: specify iteration counts (default: %\"PRIu64\")\\n\",\n \t TEST_HOST_LOOP_N);\n+\tprintf(\" -d: enable dirty-ring for tracking dirty pages, with given entries count.\\n\"\n+\t \" If non-zero, will cause dirty-ring to be used instead of\\n\"\n+\t \" dirty-bitmap. Must be a power of two.\\n\");\n \tprintf(\" -g: Do not enable KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2. This\\n\"\n \t \" makes KVM_GET_DIRTY_LOG clear the dirty log (i.e.\\n\"\n \t \" KVM_DIRTY_LOG_MANUAL_PROTECT_ENABLE is not enabled)\\n\"\n@@ -309,6 +401,7 @@ int main(int argc, char *argv[])\n \t\t.write_percent = 100,\n \t};\n \tint opt;\n+\tu64 tmp;\n \n \t/* Override the seed to be deterministic by default. */\n \tkvm_random_seed = 1;\n@@ -320,7 +413,7 @@ int main(int argc, char *argv[])\n \n \tguest_modes_append_default();\n \n-\twhile ((opt = getopt(argc, argv, \"ab:c:eghi:m:nop:r:s:v:x:w:\")) != -1) {\n+\twhile ((opt = getopt(argc, argv, \"ab:c:d:eghi:m:nop:r:s:v:x:w:\")) != -1) {\n \t\tswitch (opt) {\n \t\tcase 'a':\n \t\t\tp.random_access = true;\n@@ -331,6 +424,13 @@ int main(int argc, char *argv[])\n \t\tcase 'c':\n \t\t\tpcpu_list = optarg;\n \t\t\tbreak;\n+\t\tcase 'd':\n+\t\t\ttmp = parse_size(optarg);\n+\t\t\tTEST_ASSERT(tmp, \"Dirty-ring size should be \u003e 0\");\n+\t\t\tTEST_ASSERT(tmp \u003c= UINT32_MAX / sizeof(struct kvm_dirty_gfn),\n+\t\t\t\t \"Dirty-ring size (%lu) is too large.\", tmp);\n+\t\t\tdirty_ring_size = tmp * sizeof(struct kvm_dirty_gfn);\n+\t\t\tbreak;\n \t\tcase 'e':\n \t\t\t/* 'e' is for evil. */\n \t\t\trun_vcpus_while_disabling_dirty_logging = true;\ndiff --git a/tools/testing/selftests/kvm/include/memstress.h b/tools/testing/selftests/kvm/include/memstress.h\nindex 0d1d6230cc051..e17f344978af6 100644\n--- a/tools/testing/selftests/kvm/include/memstress.h\n+++ b/tools/testing/selftests/kvm/include/memstress.h\n@@ -58,7 +58,8 @@ extern struct memstress_args memstress_args;\n struct kvm_vm *memstress_create_vm(enum vm_guest_mode mode, int nr_vcpus,\n \t\t\t\t u64 vcpu_memory_bytes, int slots,\n \t\t\t\t enum vm_mem_backing_src_type backing_src,\n-\t\t\t\t bool partition_vcpu_memory_access);\n+\t\t\t\t bool partition_vcpu_memory_access,\n+\t\t\t\t u32 dirty_ring_size);\n void memstress_destroy_vm(struct kvm_vm *vm);\n \n void memstress_set_write_percent(struct kvm_vm *vm, u32 write_percent);\ndiff --git a/tools/testing/selftests/kvm/lib/kvm_util.c b/tools/testing/selftests/kvm/lib/kvm_util.c\nindex 9ddc047d5c275..15a671b71553a 100644\n--- a/tools/testing/selftests/kvm/lib/kvm_util.c\n+++ b/tools/testing/selftests/kvm/lib/kvm_util.c\n@@ -175,10 +175,23 @@ unsigned int kvm_check_cap(long cap)\n \n void vm_enable_dirty_ring(struct kvm_vm *vm, u32 ring_size)\n {\n-\tif (vm_check_cap(vm, KVM_CAP_DIRTY_LOG_RING_ACQ_REL))\n-\t\tvm_enable_cap(vm, KVM_CAP_DIRTY_LOG_RING_ACQ_REL, ring_size);\n-\telse\n-\t\tvm_enable_cap(vm, KVM_CAP_DIRTY_LOG_RING, ring_size);\n+\tlong cap = KVM_CAP_DIRTY_LOG_RING_ACQ_REL;\n+\tint max_size = vm_check_cap(vm, cap);\n+\n+\tif (!max_size) {\n+\t\tcap = KVM_CAP_DIRTY_LOG_RING;\n+\t\tmax_size = vm_check_cap(vm, cap);\n+\t}\n+\n+\tTEST_ASSERT(max_size \u003e 0, \"Dirty-ring not supported in this kernel\\n\");\n+\tTEST_ASSERT(ring_size \u003c= max_size \u0026\u0026 is_power_of_2(ring_size) \u0026\u0026\n+\t\t ring_size \u003e= getpagesize(),\n+\t\t \"Invalid dirty-ring size: Should be a power of two \"\n+\t\t \"between %lu and %lu entries\\n\",\n+\t\t getpagesize() / sizeof(struct kvm_dirty_gfn),\n+\t\t max_size / sizeof(struct kvm_dirty_gfn));\n+\n+\tvm_enable_cap(vm, cap, ring_size);\n \tvm-\u003edirty_ring_size = ring_size;\n }\n \ndiff --git a/tools/testing/selftests/kvm/lib/memstress.c b/tools/testing/selftests/kvm/lib/memstress.c\nindex 2864562f57b40..4632449a58757 100644\n--- a/tools/testing/selftests/kvm/lib/memstress.c\n+++ b/tools/testing/selftests/kvm/lib/memstress.c\n@@ -121,10 +121,35 @@ void memstress_setup_vcpus(struct kvm_vm *vm, int nr_vcpus,\n \t}\n }\n \n+static struct kvm_vm *memstress_vm_create_with_vcpus(struct vm_shape shape,\n+\t\t\t\t\t\t u32 nr_vcpus,\n+\t\t\t\t\t\t u64 extra_mem_pages,\n+\t\t\t\t\t\t void *guest_code,\n+\t\t\t\t\t\t struct kvm_vcpu *vcpus[],\n+\t\t\t\t\t\t u32 dirty_ring_size)\n+{\n+\tstruct kvm_vm *vm;\n+\tint i;\n+\n+\tTEST_ASSERT(!nr_vcpus || vcpus, \"Must provide vCPU array\");\n+\n+\tvm = __vm_create(shape, nr_vcpus, extra_mem_pages);\n+\n+\tif (dirty_ring_size)\n+\t\tvm_enable_dirty_ring(vm, dirty_ring_size);\n+\n+\tfor (i = 0; i \u003c nr_vcpus; ++i)\n+\t\tvcpus[i] = vm_vcpu_add(vm, i, guest_code);\n+\n+\tkvm_arch_vm_finalize_vcpus(vm);\n+\treturn vm;\n+}\n+\n struct kvm_vm *memstress_create_vm(enum vm_guest_mode mode, int nr_vcpus,\n \t\t\t\t u64 vcpu_memory_bytes, int slots,\n \t\t\t\t enum vm_mem_backing_src_type backing_src,\n-\t\t\t\t bool partition_vcpu_memory_access)\n+\t\t\t\t bool partition_vcpu_memory_access,\n+\t\t\t\t u32 dirty_ring_size)\n {\n \tstruct memstress_args *args = \u0026memstress_args;\n \tstruct kvm_vm *vm;\n@@ -167,9 +192,10 @@ struct kvm_vm *memstress_create_vm(enum vm_guest_mode mode, int nr_vcpus,\n \t * The memory is also added to memslot 0, but that's a benign side\n \t * effect as KVM allows aliasing HVAs in meslots.\n \t */\n-\tvm = __vm_create_with_vcpus(VM_SHAPE(mode), nr_vcpus,\n-\t\t\t\t slot0_pages + guest_num_pages,\n-\t\t\t\t memstress_guest_code, vcpus);\n+\tvm = memstress_vm_create_with_vcpus(VM_SHAPE(mode), nr_vcpus,\n+\t\t\t\t\t slot0_pages + guest_num_pages,\n+\t\t\t\t\t memstress_guest_code, vcpus,\n+\t\t\t\t\t dirty_ring_size);\n \n \targs-\u003evm = vm;\n \ndiff --git a/tools/testing/selftests/kvm/memslot_modification_stress_test.c b/tools/testing/selftests/kvm/memslot_modification_stress_test.c\nindex 9c7578a098c3e..3a1be9b75e01d 100644\n--- a/tools/testing/selftests/kvm/memslot_modification_stress_test.c\n+++ b/tools/testing/selftests/kvm/memslot_modification_stress_test.c\n@@ -90,7 +90,7 @@ static void run_test(enum vm_guest_mode mode, void *arg)\n \n \tvm = memstress_create_vm(mode, nr_vcpus, guest_percpu_mem_size, 1,\n \t\t\t\t VM_MEM_SRC_ANONYMOUS,\n-\t\t\t\t p-\u003epartition_vcpu_memory_access);\n+\t\t\t\t p-\u003epartition_vcpu_memory_access, 0);\n #ifdef __x86_64__\n \tif (p-\u003edisable_slot_zap_quirk)\n \t\tvm_enable_cap(vm, KVM_CAP_DISABLE_QUIRKS2, KVM_X86_QUIRK_SLOT_ZAP_ALL);\ndiff --git a/tools/testing/selftests/kvm/x86/dirty_log_page_splitting_test.c b/tools/testing/selftests/kvm/x86/dirty_log_page_splitting_test.c\nindex 388ba4101f973..661e9abfb4395 100644\n--- a/tools/testing/selftests/kvm/x86/dirty_log_page_splitting_test.c\n+++ b/tools/testing/selftests/kvm/x86/dirty_log_page_splitting_test.c\n@@ -101,7 +101,7 @@ static void run_test(enum vm_guest_mode mode, void *unused)\n \tstruct kvm_page_stats stats_repopulated;\n \n \tvm = memstress_create_vm(mode, VCPUS, guest_percpu_mem_size,\n-\t\t\t\t SLOTS, backing_src, false);\n+\t\t\t\t SLOTS, backing_src, false, 0);\n \n \tguest_num_pages = (VCPUS * guest_percpu_mem_size) \u003e\u003e vm-\u003epage_shift;\n \tguest_num_pages = vm_adjust_num_guest_pages(mode, guest_num_pages);\n"
} |
| 2/1 | 2026/09/30 13:28 | agent | patch-evaluator |
1mModel:core Args: null Results: {
"EnableConfigs": null,
"FocusSymbols": [],
"Reasoning": "The patch series only modifies user-space KVM selftests under tools/testing/selftests/kvm/ (adding dirty ring support to dirty_log_perf_test and updating test helper functions). It does not modify any code within the kernel image (vmlinux) or kernel modules.",
"WorthFuzzing": false
}Instruction: You are an expert Linux kernel maintainer and security engineer.
Your job is to review a provided patch series and evaluate whether it warrants fuzzing with syzkaller.
IMPORTANT: The changes have ALREADY been applied and committed as the HEAD commit in
your workspace. Do NOT rely on internal assumptions. You must actively use your code access
tools to inspect the actual source code, callers, and surrounding context.
================================================================================
1. CORE TRIAGE PHILOSOPHY
================================================================================
The goal of patch fuzzing is to discover crashes, regressions, exposed latent bugs,
and newly triggered assertions introduced by the patch series.
- REACHABILITY IS THE PRIMARY GATE:
Fuzzing can only discover bugs in code that can actually execute in standard virtualized
environments (GCE or QEMU, utilizing software-emulated devices like USB gadgets, netdev, tun/tap).
If the modified code is structurally unreachable (see Section 2), it MUST NOT be fuzzed,
regardless of whether it adds assertions or complex logic.
- DO NOT BLINDLY TRUST "NO FUNCTIONAL CHANGE" (NFCI) OR "REFACTORING" CLAIMS:
Patch authors routinely label changes as "cleanups", "refactorings", or state
"No functional change intended". Do NOT take these claims at face value.
Code refactorings that rearrange logic, introduce helper functions, or alter state management
in core subsystems frequently introduce subtle semantic shifts or uncover latent kernel bugs.
If reachable executable code is modified or refactored, it MUST be fuzzed.
- NEW OR MODIFIED ASSERTIONS IN REACHABLE CODE MUST BE FUZZED:
When a patch introduces or modifies runtime checks or assertions (e.g., WARN_ON*, VM_WARN_ON*,
BUG_ON*, lockdep_assert*) in reachable code paths, it enforces new or stricter invariants.
Even if the author believes the invariant always holds, fuzzing is essential to verify whether
an unusual sequence of operations can violate it.
================================================================================
2. WHEN TO RETURN WorthFuzzing=false (NEGATIVE CRITERIA)
================================================================================
Return WorthFuzzing=false ONLY IF all modified code falls strictly into one or more of these categories:
- Non-kernel and non-executable changes:
* Modifications to Documentation/, comments, or spelling fixes.
* User-space directories, self-tests, samples, or scripts (e.g., tools/, samples/, scripts/, usr/)
that do not affect the compiled kernel image (vmlinux) or kernel modules.
* Purely decorative logging (e.g., message strings in pr_err, printk, dev_info) or tracepoints
that do not alter control flow or data structures.
* Build system or Kconfig changes that do not alter compiled C logic.
- Structurally unreachable hardware:
* Vendor-specific PCIe switches, SmartNICs, or GPU drivers (e.g., mlxsw, pds_core, qed,
ionic, amdgpu) requiring physical ASIC/PCIe cards not emulated in standard QEMU.
- Unreachable execution paths:
* Driver teardown callbacks (.remove, .shutdown, pci_unregister_driver) executed only during
physical PCI hot-unplug or manual sysfs driver unbinding.
* Code paths exclusive to architectures other than the target architecture.
================================================================================
3. WHEN TO RETURN WorthFuzzing=true (POSITIVE CRITERIA)
================================================================================
Return WorthFuzzing=true whenever the patch touches reachable executable code, including:
- Core Subsystems:
* Any logic modifications in memory management (mm/), synchronization/locking (kernel/locking/),
BPF, scheduler, core networking, VFS, or syscall handling.
- Refactorings and Code Cleanups:
* Any restructuring of reachable data structures, helper abstractions, or algorithm flows.
- Runtime Assertions and Defensive Checks:
* Any introduction or alteration of assertions (WARN_ON*, VM_WARN_ON*, BUG_ON*, etc.) in reachable paths.
- Reachable Drivers and Protocols:
* Drivers accessible via virtual buses (virtio, USB gadget, loopback, netlink, binder, sockets, etc.).
================================================================================
4. EXTRACTING FocusSymbols (PREVENTING DILUTION)
================================================================================
When WorthFuzzing=true, you must extract specific kernel functions into FocusSymbols to guide the fuzzer:
- AVOID UBIQUITOUS LIFECYCLE HOT-PATHS:
Do NOT list generic, ubiquitous functions called by almost every program in the corpus
(including, but not limited to: general memory allocators and deallocators, page fault
and trap handlers, or core synchronization primitives; this is not an exhaustive list).
Listing ubiquitous functions causes the fuzzer to classify thousands of unrelated tests as "focused",
which severely dilutes fuzzing effort away from the actual changes.
- TARGET SPECIFIC FEATURE LOGIC AND ENTRYPOINTS:
List functions that specifically implement the logic being added or altered, or direct API entrypoints
for the subsystem feature under review.
- HANDLING STATIC INLINE FUNCTIONS IN HEADERS (.h):
Compiler-inlined static functions (such as static inlines in mm/*.h or include/linux/*.h) lack
distinct symbol addresses in vmlinux and cannot be targeted directly by symbol coverage filters.
If the changes are primarily in static inline helpers, identify non-static, feature-specific caller
functions in .c files that exercise them (avoiding ubiquitous lifecycle wrappers).
================================================================================
5. IDENTIFYING EnableConfigs
================================================================================
Identify any specific CONFIG_ options required to properly compile and reach the modified code:
- Inspect Kconfig files and #ifdef guards; do not make assumptions.
- Check "depends on" lines in Kconfig to include any non-standard parent subsystem configs needed.
- Strip any 'CONFIG_' prefix (e.g., return "NET_IPV4" instead of "CONFIG_NET_IPV4").
Prefer calling several tools at the same time to save round-trips.
Use set-results tool to provide results of the analysis.
It must be called exactly once before the final reply.
Ignore results of this tool.
Prompt: Target architecture: amd64
For your convenience, here is the diff of the changes:
commit e5eb62b4edbf70b40b08ae4b5da79d0accd7f590
Author: syz-cluster <triage@syzkaller.com>
Date: Wed Sep 30 13:28:49 2026 +0000
syz-cluster: applied patch under review
diff --git a/tools/testing/selftests/kvm/access_tracking_perf_test.c b/tools/testing/selftests/kvm/access_tracking_perf_test.c
index 4415c94b28660..f78d56265d893 100644
--- a/tools/testing/selftests/kvm/access_tracking_perf_test.c
+++ b/tools/testing/selftests/kvm/access_tracking_perf_test.c
@@ -409,7 +409,7 @@ static void run_test(enum vm_guest_mode mode, void *arg)
int nr_vcpus = params->nr_vcpus;
vm = memstress_create_vm(mode, nr_vcpus, params->vcpu_memory_bytes, 1,
- params->backing_src, !overlap_memory_access);
+ params->backing_src, !overlap_memory_access, 0);
/*
* If guest_page_size is larger than the host's page size, the
diff --git a/tools/testing/selftests/kvm/demand_paging_test.c b/tools/testing/selftests/kvm/demand_paging_test.c
index f8b3d0b68830d..3ec00de735532 100644
--- a/tools/testing/selftests/kvm/demand_paging_test.c
+++ b/tools/testing/selftests/kvm/demand_paging_test.c
@@ -162,7 +162,7 @@ static void run_test(enum vm_guest_mode mode, void *arg)
int i, num_uffds = 0;
vm = memstress_create_vm(mode, nr_vcpus, guest_percpu_mem_size, 1,
- p->src_type, p->partition_vcpu_memory_access);
+ p->src_type, p->partition_vcpu_memory_access, 0);
demand_paging_size = get_backing_src_pagesz(p->src_type);
diff --git a/tools/testing/selftests/kvm/dirty_log_perf_test.c b/tools/testing/selftests/kvm/dirty_log_perf_test.c
index 7c5abe1ae9e01..af0ab654d46e2 100644
--- a/tools/testing/selftests/kvm/dirty_log_perf_test.c
+++ b/tools/testing/selftests/kvm/dirty_log_perf_test.c
@@ -13,6 +13,7 @@
#include <time.h>
#include <pthread.h>
#include <linux/bitmap.h>
+#include <asm/barrier.h>
#include "kvm_util.h"
#include "test_util.h"
@@ -29,9 +30,53 @@ static bool run_vcpus_while_disabling_dirty_logging;
/* Host variables */
static u64 dirty_log_manual_caps;
+static u32 dirty_ring_size;
static bool host_quit;
static int iteration;
static int vcpu_last_completed_iteration[KVM_MAX_VCPUS];
+static struct timespec vcpu_dirty_ring_collect[KVM_MAX_VCPUS];
+
+static void dirty_ring_collect(struct kvm_vcpu *vcpu, u32 *ring_idx,
+ struct timespec *ts)
+{
+ static pthread_mutex_t collect = PTHREAD_MUTEX_INITIALIZER;
+ struct timespec start;
+ struct kvm_dirty_gfn *dirty_gfns = vcpu_map_dirty_ring(vcpu);
+ u32 idx = *ring_idx;
+ u32 ring_size = vcpu->vm->dirty_ring_size / sizeof(struct kvm_dirty_gfn);
+ int cleared, count;
+
+ pthread_mutex_lock(&collect);
+
+ clock_gettime(CLOCK_MONOTONIC, &start);
+
+ while (true) {
+ struct kvm_dirty_gfn *cur;
+
+ cur = &dirty_gfns[idx % ring_size];
+ if (smp_load_acquire(&cur->flags) != KVM_DIRTY_GFN_F_DIRTY)
+ break;
+
+ smp_store_release(&cur->flags, KVM_DIRTY_GFN_F_RESET);
+ idx++;
+ }
+
+ count = idx - *ring_idx;
+ *ring_idx = idx;
+
+ cleared = kvm_vm_reset_dirty_ring(vcpu->vm);
+
+ /* Cleared pages should be the same as collected, as KVM is supposed to
+ * clear only the entries that have been harvested, and a single vcpu will
+ * harvest at time.
+ */
+ TEST_ASSERT(cleared == count, "Reset dirty pages (%u) mismatch "
+ "with collected (%u)", cleared, count);
+
+ *ts = timespec_add(*ts, timespec_elapsed(start));
+
+ pthread_mutex_unlock(&collect);
+}
static void vcpu_worker(struct memstress_vcpu_args *vcpu_args)
{
@@ -43,24 +88,45 @@ static void vcpu_worker(struct memstress_vcpu_args *vcpu_args)
struct timespec ts_diff;
struct timespec total = (struct timespec){0};
struct timespec avg;
+ bool use_dirty_ring = !!vcpu->vm->dirty_ring_size;
+ u32 ring_idx = 0;
int ret;
run = vcpu->run;
while (!READ_ONCE(host_quit)) {
int current_iteration = READ_ONCE(iteration);
+ struct timespec collect = (struct timespec){0};
clock_gettime(CLOCK_MONOTONIC, &start);
- ret = _vcpu_run(vcpu);
+
+ do {
+ ret = _vcpu_run(vcpu);
+ if (!use_dirty_ring)
+ break;
+
+ dirty_ring_collect(vcpu, &ring_idx, &collect);
+ } while (!ret && run->exit_reason == KVM_EXIT_DIRTY_RING_FULL);
+
ts_diff = timespec_elapsed(start);
+ if (use_dirty_ring) {
+ ts_diff = timespec_sub(ts_diff, collect);
+ vcpu_dirty_ring_collect[vcpu_idx] = collect;
+ }
+
TEST_ASSERT(ret == 0, "vcpu_run failed: %d", ret);
TEST_ASSERT(get_ucall(vcpu, NULL) == UCALL_SYNC,
"Invalid guest sync status: exit_reason=%s",
exit_reason_str(run->exit_reason));
pr_debug("Got sync event from vCPU %d\n", vcpu_idx);
- vcpu_last_completed_iteration[vcpu_idx] = current_iteration;
+ /*
+ * Make sure vcpu_last_completed_iteration write happens before
+ * updating current iteration. Pairs with run_test, after populating..
+ */
+ smp_store_release(&vcpu_last_completed_iteration[vcpu_idx],
+ current_iteration);
pr_debug("vCPU %d updated last completed iteration to %d\n",
vcpu_idx, vcpu_last_completed_iteration[vcpu_idx]);
@@ -119,7 +185,8 @@ static void run_test(enum vm_guest_mode mode, void *arg)
vm = memstress_create_vm(mode, nr_vcpus, guest_percpu_mem_size,
p->slots, p->backing_src,
- p->partition_vcpu_memory_access);
+ p->partition_vcpu_memory_access,
+ dirty_ring_size);
memstress_set_write_percent(vm, p->write_percent);
@@ -128,7 +195,8 @@ static void run_test(enum vm_guest_mode mode, void *arg)
host_num_pages = vm_num_host_pages(mode, guest_num_pages);
pages_per_slot = host_num_pages / p->slots;
- bitmaps = memstress_alloc_bitmaps(p->slots, pages_per_slot);
+ if (!dirty_ring_size)
+ bitmaps = memstress_alloc_bitmaps(p->slots, pages_per_slot);
if (dirty_log_manual_caps)
vm_enable_cap(vm, KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2,
@@ -139,8 +207,10 @@ static void run_test(enum vm_guest_mode mode, void *arg)
host_quit = false;
clock_gettime(CLOCK_MONOTONIC, &start);
- for (i = 0; i < nr_vcpus; i++)
+ for (i = 0; i < nr_vcpus; i++) {
vcpu_last_completed_iteration[i] = -1;
+ vcpu_dirty_ring_collect[i] = (struct timespec){0};
+ }
/*
* Use 100% writes during the population phase to ensure all
@@ -185,7 +255,7 @@ static void run_test(enum vm_guest_mode mode, void *arg)
pr_debug("Starting iteration %d\n", iteration);
for (i = 0; i < nr_vcpus; i++) {
- while (READ_ONCE(vcpu_last_completed_iteration[i])
+ while (smp_load_acquire(&vcpu_last_completed_iteration[i])
!= iteration)
;
}
@@ -195,6 +265,21 @@ static void run_test(enum vm_guest_mode mode, void *arg)
pr_info("Iteration %d dirty memory time: %ld.%.9lds\n",
iteration, ts_diff.tv_sec, ts_diff.tv_nsec);
+ if (dirty_ring_size) {
+ struct timespec iteration_sum = (struct timespec){0};
+
+ for (i = 0; i < nr_vcpus; i++)
+ iteration_sum = timespec_add(iteration_sum,
+ vcpu_dirty_ring_collect[i]);
+
+ pr_info("Iteration %d clear dirty ring time: %ld.%.9lds\n",
+ iteration, iteration_sum.tv_sec, iteration_sum.tv_nsec);
+
+ clear_dirty_log_total = timespec_add(clear_dirty_log_total,
+ iteration_sum);
+ continue;
+ }
+
clock_gettime(CLOCK_MONOTONIC, &start);
memstress_get_dirty_log(vm, bitmaps, p->slots);
ts_diff = timespec_elapsed(start);
@@ -238,19 +323,22 @@ static void run_test(enum vm_guest_mode mode, void *arg)
host_quit = true;
memstress_join_vcpu_threads(nr_vcpus);
- avg = timespec_div(get_dirty_log_total, p->iterations);
- pr_info("Get dirty log over %lu iterations took %ld.%.9lds. (Avg %ld.%.9lds/iteration)\n",
- p->iterations, get_dirty_log_total.tv_sec,
- get_dirty_log_total.tv_nsec, avg.tv_sec, avg.tv_nsec);
+ if (!dirty_ring_size) {
+ avg = timespec_div(get_dirty_log_total, p->iterations);
+ pr_info("Get dirty log over %lu iterations took %ld.%.9lds. (Avg %ld.%.9lds/iteration)\n",
+ p->iterations, get_dirty_log_total.tv_sec,
+ get_dirty_log_total.tv_nsec, avg.tv_sec, avg.tv_nsec);
+ }
- if (dirty_log_manual_caps) {
+ if (dirty_log_manual_caps || dirty_ring_size) {
avg = timespec_div(clear_dirty_log_total, p->iterations);
pr_info("Clear dirty log over %lu iterations took %ld.%.9lds. (Avg %ld.%.9lds/iteration)\n",
p->iterations, clear_dirty_log_total.tv_sec,
clear_dirty_log_total.tv_nsec, avg.tv_sec, avg.tv_nsec);
}
- memstress_free_bitmaps(bitmaps, p->slots);
+ if (!dirty_ring_size)
+ memstress_free_bitmaps(bitmaps, p->slots);
memstress_destroy_vm(vm);
}
@@ -259,11 +347,15 @@ static void help(char *name)
puts("");
printf("usage: %s [-h] [-a] [-i iterations] [-p offset] [-g] "
"[-m mode] [-n] [-b vcpu bytes] [-v vcpus] [-o] [-r random seed ] [-s mem type]"
- "[-x memslots] [-w percentage] [-c physical cpus to run test on]\n", name);
+ "[-x memslots] [-w percentage] [-c physical cpus to run test on] \n"
+ "[-d dirty-ring entries]\n", name);
puts("");
printf(" -a: access memory randomly rather than in order.\n");
printf(" -i: specify iteration counts (default: %"PRIu64")\n",
TEST_HOST_LOOP_N);
+ printf(" -d: enable dirty-ring for tracking dirty pages, with given entries count.\n"
+ " If non-zero, will cause dirty-ring to be used instead of\n"
+ " dirty-bitmap. Must be a power of two.\n");
printf(" -g: Do not enable KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2. This\n"
" makes KVM_GET_DIRTY_LOG clear the dirty log (i.e.\n"
" KVM_DIRTY_LOG_MANUAL_PROTECT_ENABLE is not enabled)\n"
@@ -309,6 +401,7 @@ int main(int argc, char *argv[])
.write_percent = 100,
};
int opt;
+ u64 tmp;
/* Override the seed to be deterministic by default. */
kvm_random_seed = 1;
@@ -320,7 +413,7 @@ int main(int argc, char *argv[])
guest_modes_append_default();
- while ((opt = getopt(argc, argv, "ab:c:eghi:m:nop:r:s:v:x:w:")) != -1) {
+ while ((opt = getopt(argc, argv, "ab:c:d:eghi:m:nop:r:s:v:x:w:")) != -1) {
switch (opt) {
case 'a':
p.random_access = true;
@@ -331,6 +424,13 @@ int main(int argc, char *argv[])
case 'c':
pcpu_list = optarg;
break;
+ case 'd':
+ tmp = parse_size(optarg);
+ TEST_ASSERT(tmp, "Dirty-ring size should be > 0");
+ TEST_ASSERT(tmp <= UINT32_MAX / sizeof(struct kvm_dirty_gfn),
+ "Dirty-ring size (%lu) is too large.", tmp);
+ dirty_ring_size = tmp * sizeof(struct kvm_dirty_gfn);
+ break;
case 'e':
/* 'e' is for evil. */
run_vcpus_while_disabling_dirty_logging = true;
diff --git a/tools/testing/selftests/kvm/include/memstress.h b/tools/testing/selftests/kvm/include/memstress.h
index 0d1d6230cc051..e17f344978af6 100644
--- a/tools/testing/selftests/kvm/include/memstress.h
+++ b/tools/testing/selftests/kvm/include/memstress.h
@@ -58,7 +58,8 @@ extern struct memstress_args memstress_args;
struct kvm_vm *memstress_create_vm(enum vm_guest_mode mode, int nr_vcpus,
u64 vcpu_memory_bytes, int slots,
enum vm_mem_backing_src_type backing_src,
- bool partition_vcpu_memory_access);
+ bool partition_vcpu_memory_access,
+ u32 dirty_ring_size);
void memstress_destroy_vm(struct kvm_vm *vm);
void memstress_set_write_percent(struct kvm_vm *vm, u32 write_percent);
diff --git a/tools/testing/selftests/kvm/lib/kvm_util.c b/tools/testing/selftests/kvm/lib/kvm_util.c
index 9ddc047d5c275..15a671b71553a 100644
--- a/tools/testing/selftests/kvm/lib/kvm_util.c
+++ b/tools/testing/selftests/kvm/lib/kvm_util.c
@@ -175,10 +175,23 @@ unsigned int kvm_check_cap(long cap)
void vm_enable_dirty_ring(struct kvm_vm *vm, u32 ring_size)
{
- if (vm_check_cap(vm, KVM_CAP_DIRTY_LOG_RING_ACQ_REL))
- vm_enable_cap(vm, KVM_CAP_DIRTY_LOG_RING_ACQ_REL, ring_size);
- else
- vm_enable_cap(vm, KVM_CAP_DIRTY_LOG_RING, ring_size);
+ long cap = KVM_CAP_DIRTY_LOG_RING_ACQ_REL;
+ int max_size = vm_check_cap(vm, cap);
+
+ if (!max_size) {
+ cap = KVM_CAP_DIRTY_LOG_RING;
+ max_size = vm_check_cap(vm, cap);
+ }
+
+ TEST_ASSERT(max_size > 0, "Dirty-ring not supported in this kernel\n");
+ TEST_ASSERT(ring_size <= max_size && is_power_of_2(ring_size) &&
+ ring_size >= getpagesize(),
+ "Invalid dirty-ring size: Should be a power of two "
+ "between %lu and %lu entries\n",
+ getpagesize() / sizeof(struct kvm_dirty_gfn),
+ max_size / sizeof(struct kvm_dirty_gfn));
+
+ vm_enable_cap(vm, cap, ring_size);
vm->dirty_ring_size = ring_size;
}
diff --git a/tools/testing/selftests/kvm/lib/memstress.c b/tools/testing/selftests/kvm/lib/memstress.c
index 2864562f57b40..4632449a58757 100644
--- a/tools/testing/selftests/kvm/lib/memstress.c
+++ b/tools/testing/selftests/kvm/lib/memstress.c
@@ -121,10 +121,35 @@ void memstress_setup_vcpus(struct kvm_vm *vm, int nr_vcpus,
}
}
+static struct kvm_vm *memstress_vm_create_with_vcpus(struct vm_shape shape,
+ u32 nr_vcpus,
+ u64 extra_mem_pages,
+ void *guest_code,
+ struct kvm_vcpu *vcpus[],
+ u32 dirty_ring_size)
+{
+ struct kvm_vm *vm;
+ int i;
+
+ TEST_ASSERT(!nr_vcpus || vcpus, "Must provide vCPU array");
+
+ vm = __vm_create(shape, nr_vcpus, extra_mem_pages);
+
+ if (dirty_ring_size)
+ vm_enable_dirty_ring(vm, dirty_ring_size);
+
+ for (i = 0; i < nr_vcpus; ++i)
+ vcpus[i] = vm_vcpu_add(vm, i, guest_code);
+
+ kvm_arch_vm_finalize_vcpus(vm);
+ return vm;
+}
+
struct kvm_vm *memstress_create_vm(enum vm_guest_mode mode, int nr_vcpus,
u64 vcpu_memory_bytes, int slots,
enum vm_mem_backing_src_type backing_src,
- bool partition_vcpu_memory_access)
+ bool partition_vcpu_memory_access,
+ u32 dirty_ring_size)
{
struct memstress_args *args = &memstress_args;
struct kvm_vm *vm;
@@ -167,9 +192,10 @@ struct kvm_vm *memstress_create_vm(enum vm_guest_mode mode, int nr_vcpus,
* The memory is also added to memslot 0, but that's a benign side
* effect as KVM allows aliasing HVAs in meslots.
*/
- vm = __vm_create_with_vcpus(VM_SHAPE(mode), nr_vcpus,
- slot0_pages + guest_num_pages,
- memstress_guest_code, vcpus);
+ vm = memstress_vm_create_with_vcpus(VM_SHAPE(mode), nr_vcpus,
+ slot0_pages + guest_num_pages,
+ memstress_guest_code, vcpus,
+ dirty_ring_size);
args->vm = vm;
diff --git a/tools/testing/selftests/kvm/memslot_modification_stress_test.c b/tools/testing/selftests/kvm/memslot_modification_stress_test.c
index 9c7578a098c3e..3a1be9b75e01d 100644
--- a/tools/testing/selftests/kvm/memslot_modification_stress_test.c
+++ b/tools/testing/selftests/kvm/memslot_modification_stress_test.c
@@ -90,7 +90,7 @@ static void run_test(enum vm_guest_mode mode, void *arg)
vm = memstress_create_vm(mode, nr_vcpus, guest_percpu_mem_size, 1,
VM_MEM_SRC_ANONYMOUS,
- p->partition_vcpu_memory_access);
+ p->partition_vcpu_memory_access, 0);
#ifdef __x86_64__
if (p->disable_slot_zap_quirk)
vm_enable_cap(vm, KVM_CAP_DISABLE_QUIRKS2, KVM_X86_QUIRK_SLOT_ZAP_ALL);
diff --git a/tools/testing/selftests/kvm/x86/dirty_log_page_splitting_test.c b/tools/testing/selftests/kvm/x86/dirty_log_page_splitting_test.c
index 388ba4101f973..661e9abfb4395 100644
--- a/tools/testing/selftests/kvm/x86/dirty_log_page_splitting_test.c
+++ b/tools/testing/selftests/kvm/x86/dirty_log_page_splitting_test.c
@@ -101,7 +101,7 @@ static void run_test(enum vm_guest_mode mode, void *unused)
struct kvm_page_stats stats_repopulated;
vm = memstress_create_vm(mode, VCPUS, guest_percpu_mem_size,
- SLOTS, backing_src, false);
+ SLOTS, backing_src, false, 0);
guest_num_pages = (VCPUS * guest_percpu_mem_size) >> vm->page_shift;
guest_num_pages = vm_adjust_num_guest_pages(mode, guest_num_pages);
|
| 3/2 | 2026/09/30 13:28 | llm | patch-evaluator |
1mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 9158 output: 34 thoughts: 432 Thoughts: **Fuzzing Evaluation: Patch Series Analysis** Okay, so I need to decide if this patch series is a good candidate for syzkaller fuzzing. Let's dig in. First, I'm going to look at the diff. The affected files are: `tools/testing/selftests/kvm/access_tracking_perf_test.c`, `tools/testing/selftests/kvm/demand_paging_test.c`, and a bunch more under the `tools/testing/selftests/kvm/` directory. Wait a second... it's *all* in `tools/testing/selftests/kvm/`? That's a red flag, but in this case, a green one! Now, I remember the rules. I need to make sure this patch *doesn't* fall under the "WorthFuzzing=false" criteria. Specifically: "Non-kernel and non-executable changes, such as user-space directories, self-tests, samples, or scripts that do not affect the compiled kernel image (vmlinux) or kernel modules". Hmm... all of these files are in `tools/testing/selftests/kvm/`. That means they're self-tests and they're *not* part of the kernel image itself (`vmlinux`) or kernel modules. So, according to the rule, this *should* be a "WorthFuzzing=false" situation. However, just to be absolutely sure, I'm going to quickly check the commit log and confirm that no other files outside of `tools/testing/selftests/kvm/` were changed. Just to be absolutely, positively certain! |
| 4/2 | 2026/09/30 13:30 | tool | grepper |
0mArgs:{
"Expression": "memstress_create_vm",
"PathPrefix": "tools/testing/selftests/"
}Results: {
"Output": "tools/testing/selftests/kvm/access_tracking_perf_test.c=405=static void run_test(enum vm_guest_mode mode, void *arg)\n--\ntools/testing/selftests/kvm/access_tracking_perf_test.c-410-\ntools/testing/selftests/kvm/access_tracking_perf_test.c:411:\tvm = memstress_create_vm(mode, nr_vcpus, params-\u003evcpu_memory_bytes, 1,\ntools/testing/selftests/kvm/access_tracking_perf_test.c-412-\t\t\t\t params-\u003ebacking_src, !overlap_memory_access, 0);\n--\ntools/testing/selftests/kvm/demand_paging_test.c=152=static void run_test(enum vm_guest_mode mode, void *arg)\n--\ntools/testing/selftests/kvm/demand_paging_test.c-163-\ntools/testing/selftests/kvm/demand_paging_test.c:164:\tvm = memstress_create_vm(mode, nr_vcpus, guest_percpu_mem_size, 1,\ntools/testing/selftests/kvm/demand_paging_test.c-165-\t\t\t\t p-\u003esrc_type, p-\u003epartition_vcpu_memory_access, 0);\n--\ntools/testing/selftests/kvm/dirty_log_perf_test.c=170=static void run_test(enum vm_guest_mode mode, void *arg)\n--\ntools/testing/selftests/kvm/dirty_log_perf_test.c-185-\ntools/testing/selftests/kvm/dirty_log_perf_test.c:186:\tvm = memstress_create_vm(mode, nr_vcpus, guest_percpu_mem_size,\ntools/testing/selftests/kvm/dirty_log_perf_test.c-187-\t\t\t\t p-\u003eslots, p-\u003ebacking_src,\n--\ntools/testing/selftests/kvm/include/memstress.h=56=extern struct memstress_args memstress_args;\ntools/testing/selftests/kvm/include/memstress.h-57-\ntools/testing/selftests/kvm/include/memstress.h:58:struct kvm_vm *memstress_create_vm(enum vm_guest_mode mode, int nr_vcpus,\ntools/testing/selftests/kvm/include/memstress.h-59-\t\t\t\t u64 vcpu_memory_bytes, int slots,\n--\ntools/testing/selftests/kvm/lib/memstress.c=124=static struct kvm_vm *memstress_vm_create_with_vcpus(struct vm_shape shape,\n--\ntools/testing/selftests/kvm/lib/memstress.c-147-\ntools/testing/selftests/kvm/lib/memstress.c:148:struct kvm_vm *memstress_create_vm(enum vm_guest_mode mode, int nr_vcpus,\ntools/testing/selftests/kvm/lib/memstress.c-149-\t\t\t\t u64 vcpu_memory_bytes, int slots,\n--\ntools/testing/selftests/kvm/memslot_modification_stress_test.c=86=static void run_test(enum vm_guest_mode mode, void *arg)\n--\ntools/testing/selftests/kvm/memslot_modification_stress_test.c-90-\ntools/testing/selftests/kvm/memslot_modification_stress_test.c:91:\tvm = memstress_create_vm(mode, nr_vcpus, guest_percpu_mem_size, 1,\ntools/testing/selftests/kvm/memslot_modification_stress_test.c-92-\t\t\t\t VM_MEM_SRC_ANONYMOUS,\n--\ntools/testing/selftests/kvm/x86/dirty_log_page_splitting_test.c=88=static void run_test(enum vm_guest_mode mode, void *unused)\n--\ntools/testing/selftests/kvm/x86/dirty_log_page_splitting_test.c-102-\ntools/testing/selftests/kvm/x86/dirty_log_page_splitting_test.c:103:\tvm = memstress_create_vm(mode, VCPUS, guest_percpu_mem_size,\ntools/testing/selftests/kvm/x86/dirty_log_page_splitting_test.c-104-\t\t\t\t SLOTS, backing_src, false, 0);\n"
} |
| 5/2 | 2026/09/30 13:30 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 11172 output: 94 thoughts: 457 Thoughts: **Analyzing the Provided Patch for Fuzzing Relevance** Okay, let's break this down. My initial instinct was to quickly verify the scope of the change using `git diff HEAD~1` (or something similar). But then I remember, the prompt helpfully included the exact diff: commit e5eb62b4edbf70b40b08ae4b5da79d0accd7f590. This saves a step! Now, the crucial part. The diff clearly shows that all modifications are confined to `tools/testing/selftests/kvm/`. This immediately triggers the "negative criteria" outlined in Section 2 – the section on when to *not* consider something worth fuzzing. It explicitly states that modifications to user-space self-tests within directories like `tools/`, specifically those *not* affecting the compiled kernel image (`vmlinux`) or kernel modules, should result in `WorthFuzzing=false`. Given this, the reasoning is straightforward: the patch focuses solely on adding dirty ring support to `dirty_log_perf_test` and updating related helper functions within the KVM self-tests. This is purely user-space, a dedicated self-test environment that doesn't touch the kernel's core. Therefore, the conclusion is clear. * `WorthFuzzing`: false * `FocusSymbols`: \[ ] * `EnableConfigs`: \[ ] I'll proceed to call `set-results` with these values. |
| 6/2 | 2026/09/30 13:30 | tool | set-results |
0mArgs:{
"EnableConfigs": [],
"FocusSymbols": [],
"Reasoning": "The patch series only modifies user-space KVM selftests under tools/testing/selftests/kvm/ (adding dirty ring support to dirty_log_perf_test and updating test helper functions). It does not modify any code within the kernel image (vmlinux) or kernel modules.",
"WorthFuzzing": false
}Results: {
"EnableConfigs": null,
"FocusSymbols": [],
"Reasoning": "The patch series only modifies user-space KVM selftests under tools/testing/selftests/kvm/ (adding dirty ring support to dirty_log_perf_test and updating test helper functions). It does not modify any code within the kernel image (vmlinux) or kernel modules.",
"WorthFuzzing": false
} |
| 7/1 | 2026/09/30 13:30 | action | If |
0mArgs:{
"WorthFuzzing": false
}Results: null |
| Total Calls | Total Tokens | Avg Tokens | Total Duration (Seconds) | Avg Duration (Seconds) |
|---|
| Total Calls | Total Duration (Seconds) | Avg Duration (Seconds) |
|---|