| Seq | Timestamp | Type | Name | Duration |
|---|---|---|---|---|
| 0/0 | 2026/08/26 12:27 | flow | patch-triage |
0mArgs:null Results: {
"EnableConfigs": null,
"FocusSymbols": [],
"KMSANReasoning": "",
"NeedsKMSAN": false,
"Reasoning": "The patch only adds a new test case to the KVM selftests in tools/testing/selftests/kvm/ and does not modify any kernel code.",
"WorthFuzzing": false
} |
| 1/1 | 2026/08/26 12:27 | action | read-patch-diff |
0mArgs:null Results: {
"PatchDiff": "commit 6d9d3da5915b58cc89ce8a9004f6e57fff413b5a\nAuthor: syz-cluster \u003ctriage@syzkaller.com\u003e\nDate: Wed Aug 26 12:27:29 2026 +0000\n\n syz-cluster: applied patch under review\n\ndiff --git a/tools/testing/selftests/kvm/include/x86/apic.h b/tools/testing/selftests/kvm/include/x86/apic.h\nindex 31887bdc3d6c4..293044c81228d 100644\n--- a/tools/testing/selftests/kvm/include/x86/apic.h\n+++ b/tools/testing/selftests/kvm/include/x86/apic.h\n@@ -79,6 +79,15 @@ void apic_disable(void);\n void xapic_enable(void);\n void x2apic_enable(void);\n \n+/* Reads the APIC ID of a vCPU from the host, e.g. to target an IPI at it. */\n+static inline u32 vcpu_get_apic_id(struct kvm_vcpu *vcpu)\n+{\n+\tstruct kvm_lapic_state lapic;\n+\n+\tvcpu_ioctl(vcpu, KVM_GET_LAPIC, \u0026lapic);\n+\treturn GET_APIC_ID_FIELD(*(u32 *)\u0026lapic.regs[APIC_ID]);\n+}\n+\n static inline u32 get_bsp_flag(void)\n {\n \treturn rdmsr(MSR_IA32_APICBASE) \u0026 MSR_IA32_APICBASE_BSP;\ndiff --git a/tools/testing/selftests/kvm/x86/kvm_pv_test.c b/tools/testing/selftests/kvm/x86/kvm_pv_test.c\nindex 8ed5fa6350211..120d08ac25ced 100644\n--- a/tools/testing/selftests/kvm/x86/kvm_pv_test.c\n+++ b/tools/testing/selftests/kvm/x86/kvm_pv_test.c\n@@ -6,8 +6,10 @@\n */\n #include \u003casm/kvm_para.h\u003e\n #include \u003clinux/kvm_para.h\u003e\n+#include \u003cpthread.h\u003e\n #include \u003cstdint.h\u003e\n \n+#include \"apic.h\"\n #include \"test_util.h\"\n #include \"kvm_util.h\"\n #include \"processor.h\"\n@@ -193,7 +195,99 @@ static void test_pv_unhalt(void)\n \tTEST_ASSERT(!vcpu_cpuid_has(vcpu, X86_FEATURE_KVM_PV_UNHALT),\n \t\t \"PV_UNHALT set in guest CPUID when HLT-exiting is disabled\");\n \n-\t/* FIXME: actually test KVM_FEATURE_PV_UNHALT feature */\n+\tkvm_vm_free(vm);\n+}\n+\n+static void pv_unhalt_halter_guest_code(void)\n+{\n+\t/*\n+\t * Enable the local APIC, as a guest that uses PV spinlocks would. KVM\n+\t * only routes the kick to this vCPU once its APIC is in the map.\n+\t */\n+\txapic_enable();\n+\n+\t/*\n+\t * Interrupts are disabled, so nothing except the KVM_HC_KICK_CPU from\n+\t * the other vCPU can end the halt, i.e. reaching GUEST_DONE() proves\n+\t * the kick was delivered.\n+\t */\n+\tasm volatile(\"cli; hlt\");\n+\n+\tGUEST_DONE();\n+}\n+\n+static void pv_unhalt_kicker_guest_code(u32 halter_apic_id)\n+{\n+\t/* KVM takes flags in a0 and the APIC ID to kick in a1. */\n+\tGUEST_ASSERT_EQ(kvm_hypercall(KVM_HC_KICK_CPU, 0, halter_apic_id, 0, 0), 0);\n+\tGUEST_DONE();\n+}\n+\n+static void run_guest_to_done(struct kvm_vcpu *vcpu)\n+{\n+\tstruct ucall uc;\n+\tu64 cmd;\n+\n+\tvcpu_run(vcpu);\n+\tTEST_ASSERT_KVM_EXIT_REASON(vcpu, KVM_EXIT_IO);\n+\n+\tcmd = get_ucall(vcpu, \u0026uc);\n+\tif (cmd == UCALL_ABORT)\n+\t\tREPORT_GUEST_ASSERT(uc);\n+\tTEST_ASSERT_EQ(cmd, UCALL_DONE);\n+}\n+\n+static void *pv_unhalt_halter_thread(void *vcpu)\n+{\n+\trun_guest_to_done(vcpu);\n+\treturn NULL;\n+}\n+\n+static void test_pv_unhalt_kick(void)\n+{\n+\tstruct kvm_vcpu *halter, *kicker;\n+\tstruct timespec start;\n+\tstruct kvm_vm *vm;\n+\tpthread_t thread;\n+\tint r;\n+\n+\tpr_info(\"testing KVM_HC_KICK_CPU\\n\");\n+\n+\t/*\n+\t * Give the halter a non-zero APIC ID, so that a kick sent to the wrong\n+\t * vCPU fails the test instead of hitting the halter by chance.\n+\t */\n+\tvm = vm_create_with_one_vcpu(\u0026kicker, pv_unhalt_kicker_guest_code);\n+\thalter = vm_vcpu_add(vm, 1, pv_unhalt_halter_guest_code);\n+\tvirt_pg_map(vm, APIC_DEFAULT_GPA, APIC_DEFAULT_GPA);\n+\n+\t/*\n+\t * Enforce the PV CPUID so that KVM services the hypercall because\n+\t * PV_UNHALT is advertised to the kicker, and not because enforcement\n+\t * is off. KVM advertises PV_UNHALT by default while HLT-exiting is\n+\t * enabled; set it explicitly so that the test keeps testing the\n+\t * feature if that ever changes.\n+\t */\n+\tvcpu_enable_cap(kicker, KVM_CAP_ENFORCE_PV_FEATURE_CPUID, 1);\n+\tvcpu_set_cpuid_feature(kicker, X86_FEATURE_KVM_PV_UNHALT);\n+\tvcpu_args_set(kicker, 1, vcpu_get_apic_id(halter));\n+\n+\tr = pthread_create(\u0026thread, NULL, pv_unhalt_halter_thread, halter);\n+\tTEST_ASSERT(!r, \"pthread_create halter failed, error=%d\", r);\n+\n+\t/* Kick only once the halter has taken its HLT exit. */\n+\tclock_gettime(CLOCK_MONOTONIC, \u0026start);\n+\twhile (!vcpu_get_stat(halter, halt_exits)) {\n+\t\tTEST_ASSERT(timespec_elapsed(start).tv_sec \u003c 10,\n+\t\t\t \"vCPU never halted\");\n+\t\tusleep(100);\n+\t}\n+\n+\trun_guest_to_done(kicker);\n+\n+\t/* Nothing except the kick can get the halter to GUEST_DONE(). */\n+\tr = pthread_join(thread, NULL);\n+\tTEST_ASSERT(!r, \"pthread_join halter failed, error=%d\", r);\n \n \tkvm_vm_free(vm);\n }\n@@ -215,4 +309,5 @@ int main(void)\n \tkvm_vm_free(vm);\n \n \ttest_pv_unhalt();\n+\ttest_pv_unhalt_kick();\n }\n"
} |
| 2/1 | 2026/08/26 12:27 | agent | patch-evaluator |
0mModel:best-expensive Args: null Results: {
"EnableConfigs": null,
"FocusSymbols": [],
"Reasoning": "The patch only adds a new test case to the KVM selftests in tools/testing/selftests/kvm/ and does not modify any kernel code.",
"WorthFuzzing": false
}Instruction: You are an expert Linux kernel maintainer. Your job is to review a provided patch series and determine if it makes functional changes to the kernel that should be fuzzed. IMPORTANT: The changes have ALREADY been applied and committed as the HEAD commit in your workspace. Do NOT rely on your internal knowledge of the kernel. You must actively use your code access tools to examine the actual source code and confirm any assumptions. Return WorthFuzzing=false if the patch only contains: - Modifications to Documentation/, Kconfig files, or code comments. - Purely decorative changes, such as logging (e.g., pr_err, printk) or tracepoints. - Changes to numeric constants or macros that do not functionally alter execution flow. - Code paths that are impossible to reach in virtualized environments like GCE or QEMU, even when utilizing software-emulated hardware (e.g., usb gadget, mac80211_hwsim). - Code in vendor-specific PCIe switch, SmartNIC, or GPU drivers (e.g., mlxsw, pds_core, qed, ionic, amdgpu) that require physical PCIe hardware cards not emulated in standard QEMU. - Driver .remove, .shutdown, or pci_unregister_driver teardown callbacks (e.g., igb_remove) that are executed only during PCI hot-unplug or sysfs driver unbind operations. If it modifies reachable core kernel logic, drivers, or architectures, use your code search tools to verify the code can be executed, then return WorthFuzzing=true. When returning WorthFuzzing=true, you MUST ALSO: 1. Extract any specific kernel functions that should be heavily fuzzed into FocusSymbols. Avoid listing generic hot-path functions to prevent skewed test distributions. Prefer non-static, non-inlined API entrypoint functions over internal static helper functions (which are inlined by the compiler and do not have distinct symbol addresses). 2. Identify any specific CONFIG_ options required to properly test this new/modified feature. Go and look into the Kconfig files and check for ifdefs around the code, do not make assumptions. Also check "depends on" lines in Kconfig to include any non-standard parent subsystem configs needed for Kbuild to compile the code statically into vmlinux. List them in the EnableConfigs output array, and DO NOT add a '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: For your convenience, here is the diff of the changes:
commit 6d9d3da5915b58cc89ce8a9004f6e57fff413b5a
Author: syz-cluster <triage@syzkaller.com>
Date: Wed Aug 26 12:27:29 2026 +0000
syz-cluster: applied patch under review
diff --git a/tools/testing/selftests/kvm/include/x86/apic.h b/tools/testing/selftests/kvm/include/x86/apic.h
index 31887bdc3d6c4..293044c81228d 100644
--- a/tools/testing/selftests/kvm/include/x86/apic.h
+++ b/tools/testing/selftests/kvm/include/x86/apic.h
@@ -79,6 +79,15 @@ void apic_disable(void);
void xapic_enable(void);
void x2apic_enable(void);
+/* Reads the APIC ID of a vCPU from the host, e.g. to target an IPI at it. */
+static inline u32 vcpu_get_apic_id(struct kvm_vcpu *vcpu)
+{
+ struct kvm_lapic_state lapic;
+
+ vcpu_ioctl(vcpu, KVM_GET_LAPIC, &lapic);
+ return GET_APIC_ID_FIELD(*(u32 *)&lapic.regs[APIC_ID]);
+}
+
static inline u32 get_bsp_flag(void)
{
return rdmsr(MSR_IA32_APICBASE) & MSR_IA32_APICBASE_BSP;
diff --git a/tools/testing/selftests/kvm/x86/kvm_pv_test.c b/tools/testing/selftests/kvm/x86/kvm_pv_test.c
index 8ed5fa6350211..120d08ac25ced 100644
--- a/tools/testing/selftests/kvm/x86/kvm_pv_test.c
+++ b/tools/testing/selftests/kvm/x86/kvm_pv_test.c
@@ -6,8 +6,10 @@
*/
#include <asm/kvm_para.h>
#include <linux/kvm_para.h>
+#include <pthread.h>
#include <stdint.h>
+#include "apic.h"
#include "test_util.h"
#include "kvm_util.h"
#include "processor.h"
@@ -193,7 +195,99 @@ static void test_pv_unhalt(void)
TEST_ASSERT(!vcpu_cpuid_has(vcpu, X86_FEATURE_KVM_PV_UNHALT),
"PV_UNHALT set in guest CPUID when HLT-exiting is disabled");
- /* FIXME: actually test KVM_FEATURE_PV_UNHALT feature */
+ kvm_vm_free(vm);
+}
+
+static void pv_unhalt_halter_guest_code(void)
+{
+ /*
+ * Enable the local APIC, as a guest that uses PV spinlocks would. KVM
+ * only routes the kick to this vCPU once its APIC is in the map.
+ */
+ xapic_enable();
+
+ /*
+ * Interrupts are disabled, so nothing except the KVM_HC_KICK_CPU from
+ * the other vCPU can end the halt, i.e. reaching GUEST_DONE() proves
+ * the kick was delivered.
+ */
+ asm volatile("cli; hlt");
+
+ GUEST_DONE();
+}
+
+static void pv_unhalt_kicker_guest_code(u32 halter_apic_id)
+{
+ /* KVM takes flags in a0 and the APIC ID to kick in a1. */
+ GUEST_ASSERT_EQ(kvm_hypercall(KVM_HC_KICK_CPU, 0, halter_apic_id, 0, 0), 0);
+ GUEST_DONE();
+}
+
+static void run_guest_to_done(struct kvm_vcpu *vcpu)
+{
+ struct ucall uc;
+ u64 cmd;
+
+ vcpu_run(vcpu);
+ TEST_ASSERT_KVM_EXIT_REASON(vcpu, KVM_EXIT_IO);
+
+ cmd = get_ucall(vcpu, &uc);
+ if (cmd == UCALL_ABORT)
+ REPORT_GUEST_ASSERT(uc);
+ TEST_ASSERT_EQ(cmd, UCALL_DONE);
+}
+
+static void *pv_unhalt_halter_thread(void *vcpu)
+{
+ run_guest_to_done(vcpu);
+ return NULL;
+}
+
+static void test_pv_unhalt_kick(void)
+{
+ struct kvm_vcpu *halter, *kicker;
+ struct timespec start;
+ struct kvm_vm *vm;
+ pthread_t thread;
+ int r;
+
+ pr_info("testing KVM_HC_KICK_CPU\n");
+
+ /*
+ * Give the halter a non-zero APIC ID, so that a kick sent to the wrong
+ * vCPU fails the test instead of hitting the halter by chance.
+ */
+ vm = vm_create_with_one_vcpu(&kicker, pv_unhalt_kicker_guest_code);
+ halter = vm_vcpu_add(vm, 1, pv_unhalt_halter_guest_code);
+ virt_pg_map(vm, APIC_DEFAULT_GPA, APIC_DEFAULT_GPA);
+
+ /*
+ * Enforce the PV CPUID so that KVM services the hypercall because
+ * PV_UNHALT is advertised to the kicker, and not because enforcement
+ * is off. KVM advertises PV_UNHALT by default while HLT-exiting is
+ * enabled; set it explicitly so that the test keeps testing the
+ * feature if that ever changes.
+ */
+ vcpu_enable_cap(kicker, KVM_CAP_ENFORCE_PV_FEATURE_CPUID, 1);
+ vcpu_set_cpuid_feature(kicker, X86_FEATURE_KVM_PV_UNHALT);
+ vcpu_args_set(kicker, 1, vcpu_get_apic_id(halter));
+
+ r = pthread_create(&thread, NULL, pv_unhalt_halter_thread, halter);
+ TEST_ASSERT(!r, "pthread_create halter failed, error=%d", r);
+
+ /* Kick only once the halter has taken its HLT exit. */
+ clock_gettime(CLOCK_MONOTONIC, &start);
+ while (!vcpu_get_stat(halter, halt_exits)) {
+ TEST_ASSERT(timespec_elapsed(start).tv_sec < 10,
+ "vCPU never halted");
+ usleep(100);
+ }
+
+ run_guest_to_done(kicker);
+
+ /* Nothing except the kick can get the halter to GUEST_DONE(). */
+ r = pthread_join(thread, NULL);
+ TEST_ASSERT(!r, "pthread_join halter failed, error=%d", r);
kvm_vm_free(vm);
}
@@ -215,4 +309,5 @@ int main(void)
kvm_vm_free(vm);
test_pv_unhalt();
+ test_pv_unhalt_kick();
}
|
| 3/2 | 2026/08/26 12:27 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 3671 output: 66 thoughts: 287 Thoughts: **WorthFuzzing=False: KVM Selftests Patch** Okay, so I'm looking at this patch. It's touching `tools/testing/selftests/kvm/include/x86/apic.h` and `tools/testing/selftests/kvm/x86/kvm_pv_test.c`. Ah, right, it looks like they're adding a test for KVM_HC_KICK_CPU, or PV_UNHALT. My initial gut reaction is, "selftests, not core kernel logic, nothing to see here..." but wait, let me think this through. These are selftests, so userspace, which means no direct kernel execution involved. Okay, yes, `tools/testing/selftests` is definitely userspace code. Now, the critical question: Does this patch make any *functional* changes to the kernel that might warrant fuzzing? No, not at all, because it's only modifying selftests. Let me just quickly double-check the diff to make sure I haven't missed anything subtle. Nope, it's just those two files. Nothing else. So, definitely **WorthFuzzing=false**. My reasoning is straightforward: This patch introduces a *new* test case within the KVM selftests, specifically within the `tools/testing/selftests/kvm/` directory. Crucially, it doesn't touch any actual kernel code. Case closed. Time to set-results. |
| 4/2 | 2026/08/26 12:27 | tool | set-results |
0mArgs:{
"EnableConfigs": [],
"FocusSymbols": [],
"Reasoning": "The patch only adds a new test case to the KVM selftests in tools/testing/selftests/kvm/ and does not modify any kernel code.",
"WorthFuzzing": false
}Results: {
"EnableConfigs": null,
"FocusSymbols": [],
"Reasoning": "The patch only adds a new test case to the KVM selftests in tools/testing/selftests/kvm/ and does not modify any kernel code.",
"WorthFuzzing": false
} |
| 5/1 | 2026/08/26 12:27 | 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) |
|---|