| Seq | Timestamp | Type | Name | Duration |
|---|---|---|---|---|
| 0/0 | 2026/09/15 06:23 | flow | patch-triage |
1mArgs:null Results: {
"EnableConfigs": null,
"FocusSymbols": [],
"KMSANReasoning": "",
"NeedsKMSAN": false,
"Reasoning": "The patch modifies only user-space files under tools/testing/selftests/kvm/ (adding a new KVM selftest for nested SVM vNMI and updating test headers/Makefile). It does not alter any kernel source code, compiled kernel image (vmlinux), or kernel modules.",
"WorthFuzzing": false
} |
| 1/1 | 2026/09/15 06:23 | action | read-patch-diff |
0mArgs:null Results: {
"PatchDiff": "commit 13cd2b8636193914e3ab52e1f12653b185ff92d2\nAuthor: syz-cluster \u003ctriage@syzkaller.com\u003e\nDate: Tue Sep 15 06:23:07 2026 +0000\n\n syz-cluster: applied patch under review\n\ndiff --git a/tools/testing/selftests/kvm/Makefile.kvm b/tools/testing/selftests/kvm/Makefile.kvm\nindex 96bab7002d39e..92e1018e9c8ae 100644\n--- a/tools/testing/selftests/kvm/Makefile.kvm\n+++ b/tools/testing/selftests/kvm/Makefile.kvm\n@@ -121,6 +121,7 @@ TEST_GEN_PROGS_x86 += x86/svm_nested_clear_efer_svme\n TEST_GEN_PROGS_x86 += x86/svm_nested_shutdown_test\n TEST_GEN_PROGS_x86 += x86/svm_nested_soft_inject_test\n TEST_GEN_PROGS_x86 += x86/svm_nested_vmcb12_gpa\n+TEST_GEN_PROGS_x86 += x86/svm_nested_vnmi_test\n TEST_GEN_PROGS_x86 += x86/svm_nested_pat_test\n TEST_GEN_PROGS_x86 += x86/svm_lbr_nested_state\n TEST_GEN_PROGS_x86 += x86/svm_pmu_host_guest_test\ndiff --git a/tools/testing/selftests/kvm/include/x86/processor.h b/tools/testing/selftests/kvm/include/x86/processor.h\nindex 6e6f70035508a..71697a1d5b865 100644\n--- a/tools/testing/selftests/kvm/include/x86/processor.h\n+++ b/tools/testing/selftests/kvm/include/x86/processor.h\n@@ -224,6 +224,7 @@ struct kvm_x86_cpu_feature {\n #define X86_FEATURE_PFTHRESHOLD KVM_X86_CPU_FEATURE(0x8000000A, 0, EDX, 12)\n #define\tX86_FEATURE_V_VMSAVE_VMLOAD\tKVM_X86_CPU_FEATURE(0x8000000A, 0, EDX, 15)\n #define\tX86_FEATURE_VGIF\t\tKVM_X86_CPU_FEATURE(0x8000000A, 0, EDX, 16)\n+#define X86_FEATURE_VNMI\t\tKVM_X86_CPU_FEATURE(0x8000000A, 0, EDX, 25)\n #define X86_FEATURE_IDLE_HLT\t\tKVM_X86_CPU_FEATURE(0x8000000A, 0, EDX, 30)\n #define X86_FEATURE_SEV\t\t\tKVM_X86_CPU_FEATURE(0x8000001F, 0, EAX, 1)\n #define X86_FEATURE_SEV_ES\t\tKVM_X86_CPU_FEATURE(0x8000001F, 0, EAX, 3)\ndiff --git a/tools/testing/selftests/kvm/include/x86/svm.h b/tools/testing/selftests/kvm/include/x86/svm.h\nindex c8539166270ea..5779fb285d79c 100644\n--- a/tools/testing/selftests/kvm/include/x86/svm.h\n+++ b/tools/testing/selftests/kvm/include/x86/svm.h\n@@ -140,6 +140,12 @@ struct __attribute__ ((__packed__)) vmcb_control_area {\n #define V_GIF_SHIFT 9\n #define V_GIF_MASK (1 \u003c\u003c V_GIF_SHIFT)\n \n+#define V_NMI_PENDING_SHIFT 11\n+#define V_NMI_PENDING_MASK (1 \u003c\u003c V_NMI_PENDING_SHIFT)\n+\n+#define V_NMI_BLOCKING_SHIFT 12\n+#define V_NMI_BLOCKING_MASK (1 \u003c\u003c V_NMI_BLOCKING_SHIFT)\n+\n #define V_INTR_PRIO_SHIFT 16\n #define V_INTR_PRIO_MASK (0x0f \u003c\u003c V_INTR_PRIO_SHIFT)\n \n@@ -152,6 +158,9 @@ struct __attribute__ ((__packed__)) vmcb_control_area {\n #define V_GIF_ENABLE_SHIFT 25\n #define V_GIF_ENABLE_MASK (1 \u003c\u003c V_GIF_ENABLE_SHIFT)\n \n+#define V_NMI_ENABLE_SHIFT 26\n+#define V_NMI_ENABLE_MASK (1 \u003c\u003c V_NMI_ENABLE_SHIFT)\n+\n #define AVIC_ENABLE_SHIFT 31\n #define AVIC_ENABLE_MASK (1 \u003c\u003c AVIC_ENABLE_SHIFT)\n \ndiff --git a/tools/testing/selftests/kvm/x86/svm_nested_vnmi_test.c b/tools/testing/selftests/kvm/x86/svm_nested_vnmi_test.c\nnew file mode 100644\nindex 0000000000000..b4bde81a4e54e\n--- /dev/null\n+++ b/tools/testing/selftests/kvm/x86/svm_nested_vnmi_test.c\n@@ -0,0 +1,132 @@\n+// SPDX-License-Identifier: GPL-2.0-only\n+/*\n+ * Test KVM's virtual NMI (vNMI) support for nested guests: the consistency\n+ * check on the vNMI controls in vmcb12, delivery of a virtual NMI to L2, and\n+ * the V_NMI_PENDING/V_NMI_BLOCKING state L1 observes across the NMI.\n+ *\n+ * Copyright (C) 2026 Hemanth Selam \u003chemanth.selam@gmail.com\u003e\n+ */\n+#include \"kvm_util.h\"\n+#include \"processor.h\"\n+#include \"svm_util.h\"\n+#include \"test_util.h\"\n+\n+/* Number of virtual NMIs to deliver; more than one to prove it's repeatable. */\n+#define NR_VNMIS\t3\n+\n+static unsigned int nmi_fired;\n+\n+static void guest_nmi_handler(struct ex_regs *regs)\n+{\n+\tnmi_fired++;\n+\n+\t/*\n+\t * Exit to L1 from NMI context, i.e. before this handler's IRET, so\n+\t * that L1 can observe V_NMI_BLOCKING while the NMI is in service.\n+\t * Keep the update to nmi_fired ahead of the exit, as vmmcall() doesn't\n+\t * clobber memory and L1 reads nmi_fired as soon as L2 exits.\n+\t */\n+\tbarrier();\n+\tvmmcall();\n+}\n+\n+static void l2_guest_code(void)\n+{\n+\tvmmcall();\n+}\n+\n+static void l1_vnmi_setup(struct svm_test_data *svm)\n+{\n+\tstruct vmcb *vmcb = svm-\u003evmcb;\n+\n+\tgeneric_svm_setup(svm, l2_guest_code);\n+\n+\t/* KVM requires L1 to intercept NMIs in order to enable vNMI. */\n+\tvmcb-\u003econtrol.intercept |= BIT(INTERCEPT_NMI);\n+\tvmcb-\u003econtrol.int_ctl |= V_NMI_ENABLE_MASK;\n+}\n+\n+static void l1_guest_code(struct svm_test_data *svm)\n+{\n+\tstruct vmcb *vmcb = svm-\u003evmcb;\n+\tunsigned int i;\n+\n+\t/* Without a pending virtual NMI, L2 runs to its VMMCALL untouched. */\n+\tl1_vnmi_setup(svm);\n+\n+\trun_guest(vmcb, svm-\u003evmcb_gpa);\n+\tGUEST_ASSERT_EQ(vmcb-\u003econtrol.exit_code, SVM_EXIT_VMMCALL);\n+\tGUEST_ASSERT_EQ(nmi_fired, 0);\n+\tGUEST_ASSERT(!(vmcb-\u003econtrol.int_ctl \u0026 V_NMI_PENDING_MASK));\n+\tGUEST_ASSERT(!(vmcb-\u003econtrol.int_ctl \u0026 V_NMI_BLOCKING_MASK));\n+\n+\tfor (i = 1; i \u003c= NR_VNMIS; i++) {\n+\t\t/* Request a virtual NMI; L2 must take it on VMRUN. */\n+\t\tl1_vnmi_setup(svm);\n+\t\tvmcb-\u003econtrol.int_ctl |= V_NMI_PENDING_MASK;\n+\n+\t\trun_guest(vmcb, svm-\u003evmcb_gpa);\n+\n+\t\t/*\n+\t\t * The NMI was delivered and L2 exited from the handler, so\n+\t\t * hardware has consumed the request and blocked further NMIs.\n+\t\t */\n+\t\tGUEST_ASSERT_EQ(vmcb-\u003econtrol.exit_code, SVM_EXIT_VMMCALL);\n+\t\tGUEST_ASSERT_EQ(nmi_fired, i);\n+\t\tGUEST_ASSERT(!(vmcb-\u003econtrol.int_ctl \u0026 V_NMI_PENDING_MASK));\n+\t\tGUEST_ASSERT(vmcb-\u003econtrol.int_ctl \u0026 V_NMI_BLOCKING_MASK);\n+\n+\t\t/* Resume L2 so the handler can IRET, which unblocks NMIs. */\n+\t\tvmcb-\u003esave.rip = vmcb-\u003econtrol.next_rip;\n+\n+\t\trun_guest(vmcb, svm-\u003evmcb_gpa);\n+\t\tGUEST_ASSERT_EQ(vmcb-\u003econtrol.exit_code, SVM_EXIT_VMMCALL);\n+\t\tGUEST_ASSERT_EQ(nmi_fired, i);\n+\t\tGUEST_ASSERT(!(vmcb-\u003econtrol.int_ctl \u0026 V_NMI_BLOCKING_MASK));\n+\t}\n+\n+\t/*\n+\t * Enabling vNMI without intercepting NMIs is illegal, as L1 would have\n+\t * no way of observing the NMIs it is nominally responsible for.\n+\t */\n+\tvmcb-\u003econtrol.intercept \u0026= ~BIT(INTERCEPT_NMI);\n+\n+\trun_guest(vmcb, svm-\u003evmcb_gpa);\n+\tGUEST_ASSERT_EQ(vmcb-\u003econtrol.exit_code, SVM_EXIT_ERR);\n+\n+\tGUEST_DONE();\n+}\n+\n+int main(int argc, char *argv[])\n+{\n+\tstruct kvm_vcpu *vcpu;\n+\tstruct kvm_vm *vm;\n+\tstruct ucall uc;\n+\tgva_t svm_gva;\n+\n+\tTEST_REQUIRE(kvm_cpu_has(X86_FEATURE_SVM));\n+\tTEST_REQUIRE(kvm_cpu_has(X86_FEATURE_VNMI));\n+\n+\tvm = vm_create_with_one_vcpu(\u0026vcpu, l1_guest_code);\n+\n+\tvm_install_exception_handler(vm, NMI_VECTOR, guest_nmi_handler);\n+\n+\tvcpu_alloc_svm(vm, \u0026svm_gva);\n+\tvcpu_args_set(vcpu, 1, svm_gva);\n+\n+\tvcpu_run(vcpu);\n+\tTEST_ASSERT_KVM_EXIT_REASON(vcpu, KVM_EXIT_IO);\n+\n+\tswitch (get_ucall(vcpu, \u0026uc)) {\n+\tcase UCALL_ABORT:\n+\t\tREPORT_GUEST_ASSERT(uc);\n+\t\t/* NOT REACHED */\n+\tcase UCALL_DONE:\n+\t\tbreak;\n+\tdefault:\n+\t\tTEST_FAIL(\"Unexpected ucall: %lu\", uc.cmd);\n+\t}\n+\n+\tkvm_vm_free(vm);\n+\treturn 0;\n+}\n"
} |
| 2/1 | 2026/09/15 06:23 | agent | patch-evaluator |
1mModel:core Args: null Results: {
"EnableConfigs": null,
"FocusSymbols": [],
"Reasoning": "The patch modifies only user-space files under tools/testing/selftests/kvm/ (adding a new KVM selftest for nested SVM vNMI and updating test headers/Makefile). It does not alter any kernel source code, compiled 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 13cd2b8636193914e3ab52e1f12653b185ff92d2
Author: syz-cluster <triage@syzkaller.com>
Date: Tue Sep 15 06:23:07 2026 +0000
syz-cluster: applied patch under review
diff --git a/tools/testing/selftests/kvm/Makefile.kvm b/tools/testing/selftests/kvm/Makefile.kvm
index 96bab7002d39e..92e1018e9c8ae 100644
--- a/tools/testing/selftests/kvm/Makefile.kvm
+++ b/tools/testing/selftests/kvm/Makefile.kvm
@@ -121,6 +121,7 @@ TEST_GEN_PROGS_x86 += x86/svm_nested_clear_efer_svme
TEST_GEN_PROGS_x86 += x86/svm_nested_shutdown_test
TEST_GEN_PROGS_x86 += x86/svm_nested_soft_inject_test
TEST_GEN_PROGS_x86 += x86/svm_nested_vmcb12_gpa
+TEST_GEN_PROGS_x86 += x86/svm_nested_vnmi_test
TEST_GEN_PROGS_x86 += x86/svm_nested_pat_test
TEST_GEN_PROGS_x86 += x86/svm_lbr_nested_state
TEST_GEN_PROGS_x86 += x86/svm_pmu_host_guest_test
diff --git a/tools/testing/selftests/kvm/include/x86/processor.h b/tools/testing/selftests/kvm/include/x86/processor.h
index 6e6f70035508a..71697a1d5b865 100644
--- a/tools/testing/selftests/kvm/include/x86/processor.h
+++ b/tools/testing/selftests/kvm/include/x86/processor.h
@@ -224,6 +224,7 @@ struct kvm_x86_cpu_feature {
#define X86_FEATURE_PFTHRESHOLD KVM_X86_CPU_FEATURE(0x8000000A, 0, EDX, 12)
#define X86_FEATURE_V_VMSAVE_VMLOAD KVM_X86_CPU_FEATURE(0x8000000A, 0, EDX, 15)
#define X86_FEATURE_VGIF KVM_X86_CPU_FEATURE(0x8000000A, 0, EDX, 16)
+#define X86_FEATURE_VNMI KVM_X86_CPU_FEATURE(0x8000000A, 0, EDX, 25)
#define X86_FEATURE_IDLE_HLT KVM_X86_CPU_FEATURE(0x8000000A, 0, EDX, 30)
#define X86_FEATURE_SEV KVM_X86_CPU_FEATURE(0x8000001F, 0, EAX, 1)
#define X86_FEATURE_SEV_ES KVM_X86_CPU_FEATURE(0x8000001F, 0, EAX, 3)
diff --git a/tools/testing/selftests/kvm/include/x86/svm.h b/tools/testing/selftests/kvm/include/x86/svm.h
index c8539166270ea..5779fb285d79c 100644
--- a/tools/testing/selftests/kvm/include/x86/svm.h
+++ b/tools/testing/selftests/kvm/include/x86/svm.h
@@ -140,6 +140,12 @@ struct __attribute__ ((__packed__)) vmcb_control_area {
#define V_GIF_SHIFT 9
#define V_GIF_MASK (1 << V_GIF_SHIFT)
+#define V_NMI_PENDING_SHIFT 11
+#define V_NMI_PENDING_MASK (1 << V_NMI_PENDING_SHIFT)
+
+#define V_NMI_BLOCKING_SHIFT 12
+#define V_NMI_BLOCKING_MASK (1 << V_NMI_BLOCKING_SHIFT)
+
#define V_INTR_PRIO_SHIFT 16
#define V_INTR_PRIO_MASK (0x0f << V_INTR_PRIO_SHIFT)
@@ -152,6 +158,9 @@ struct __attribute__ ((__packed__)) vmcb_control_area {
#define V_GIF_ENABLE_SHIFT 25
#define V_GIF_ENABLE_MASK (1 << V_GIF_ENABLE_SHIFT)
+#define V_NMI_ENABLE_SHIFT 26
+#define V_NMI_ENABLE_MASK (1 << V_NMI_ENABLE_SHIFT)
+
#define AVIC_ENABLE_SHIFT 31
#define AVIC_ENABLE_MASK (1 << AVIC_ENABLE_SHIFT)
diff --git a/tools/testing/selftests/kvm/x86/svm_nested_vnmi_test.c b/tools/testing/selftests/kvm/x86/svm_nested_vnmi_test.c
new file mode 100644
index 0000000000000..b4bde81a4e54e
--- /dev/null
+++ b/tools/testing/selftests/kvm/x86/svm_nested_vnmi_test.c
@@ -0,0 +1,132 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Test KVM's virtual NMI (vNMI) support for nested guests: the consistency
+ * check on the vNMI controls in vmcb12, delivery of a virtual NMI to L2, and
+ * the V_NMI_PENDING/V_NMI_BLOCKING state L1 observes across the NMI.
+ *
+ * Copyright (C) 2026 Hemanth Selam <hemanth.selam@gmail.com>
+ */
+#include "kvm_util.h"
+#include "processor.h"
+#include "svm_util.h"
+#include "test_util.h"
+
+/* Number of virtual NMIs to deliver; more than one to prove it's repeatable. */
+#define NR_VNMIS 3
+
+static unsigned int nmi_fired;
+
+static void guest_nmi_handler(struct ex_regs *regs)
+{
+ nmi_fired++;
+
+ /*
+ * Exit to L1 from NMI context, i.e. before this handler's IRET, so
+ * that L1 can observe V_NMI_BLOCKING while the NMI is in service.
+ * Keep the update to nmi_fired ahead of the exit, as vmmcall() doesn't
+ * clobber memory and L1 reads nmi_fired as soon as L2 exits.
+ */
+ barrier();
+ vmmcall();
+}
+
+static void l2_guest_code(void)
+{
+ vmmcall();
+}
+
+static void l1_vnmi_setup(struct svm_test_data *svm)
+{
+ struct vmcb *vmcb = svm->vmcb;
+
+ generic_svm_setup(svm, l2_guest_code);
+
+ /* KVM requires L1 to intercept NMIs in order to enable vNMI. */
+ vmcb->control.intercept |= BIT(INTERCEPT_NMI);
+ vmcb->control.int_ctl |= V_NMI_ENABLE_MASK;
+}
+
+static void l1_guest_code(struct svm_test_data *svm)
+{
+ struct vmcb *vmcb = svm->vmcb;
+ unsigned int i;
+
+ /* Without a pending virtual NMI, L2 runs to its VMMCALL untouched. */
+ l1_vnmi_setup(svm);
+
+ run_guest(vmcb, svm->vmcb_gpa);
+ GUEST_ASSERT_EQ(vmcb->control.exit_code, SVM_EXIT_VMMCALL);
+ GUEST_ASSERT_EQ(nmi_fired, 0);
+ GUEST_ASSERT(!(vmcb->control.int_ctl & V_NMI_PENDING_MASK));
+ GUEST_ASSERT(!(vmcb->control.int_ctl & V_NMI_BLOCKING_MASK));
+
+ for (i = 1; i <= NR_VNMIS; i++) {
+ /* Request a virtual NMI; L2 must take it on VMRUN. */
+ l1_vnmi_setup(svm);
+ vmcb->control.int_ctl |= V_NMI_PENDING_MASK;
+
+ run_guest(vmcb, svm->vmcb_gpa);
+
+ /*
+ * The NMI was delivered and L2 exited from the handler, so
+ * hardware has consumed the request and blocked further NMIs.
+ */
+ GUEST_ASSERT_EQ(vmcb->control.exit_code, SVM_EXIT_VMMCALL);
+ GUEST_ASSERT_EQ(nmi_fired, i);
+ GUEST_ASSERT(!(vmcb->control.int_ctl & V_NMI_PENDING_MASK));
+ GUEST_ASSERT(vmcb->control.int_ctl & V_NMI_BLOCKING_MASK);
+
+ /* Resume L2 so the handler can IRET, which unblocks NMIs. */
+ vmcb->save.rip = vmcb->control.next_rip;
+
+ run_guest(vmcb, svm->vmcb_gpa);
+ GUEST_ASSERT_EQ(vmcb->control.exit_code, SVM_EXIT_VMMCALL);
+ GUEST_ASSERT_EQ(nmi_fired, i);
+ GUEST_ASSERT(!(vmcb->control.int_ctl & V_NMI_BLOCKING_MASK));
+ }
+
+ /*
+ * Enabling vNMI without intercepting NMIs is illegal, as L1 would have
+ * no way of observing the NMIs it is nominally responsible for.
+ */
+ vmcb->control.intercept &= ~BIT(INTERCEPT_NMI);
+
+ run_guest(vmcb, svm->vmcb_gpa);
+ GUEST_ASSERT_EQ(vmcb->control.exit_code, SVM_EXIT_ERR);
+
+ GUEST_DONE();
+}
+
+int main(int argc, char *argv[])
+{
+ struct kvm_vcpu *vcpu;
+ struct kvm_vm *vm;
+ struct ucall uc;
+ gva_t svm_gva;
+
+ TEST_REQUIRE(kvm_cpu_has(X86_FEATURE_SVM));
+ TEST_REQUIRE(kvm_cpu_has(X86_FEATURE_VNMI));
+
+ vm = vm_create_with_one_vcpu(&vcpu, l1_guest_code);
+
+ vm_install_exception_handler(vm, NMI_VECTOR, guest_nmi_handler);
+
+ vcpu_alloc_svm(vm, &svm_gva);
+ vcpu_args_set(vcpu, 1, svm_gva);
+
+ vcpu_run(vcpu);
+ TEST_ASSERT_KVM_EXIT_REASON(vcpu, KVM_EXIT_IO);
+
+ switch (get_ucall(vcpu, &uc)) {
+ case UCALL_ABORT:
+ REPORT_GUEST_ASSERT(uc);
+ /* NOT REACHED */
+ case UCALL_DONE:
+ break;
+ default:
+ TEST_FAIL("Unexpected ucall: %lu", uc.cmd);
+ }
+
+ kvm_vm_free(vm);
+ return 0;
+}
|
| 3/2 | 2026/09/15 06:23 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 5647 output: 22 thoughts: 393 Thoughts: **My Initial Assessment of the Patch Series** Okay, so the user wants me to evaluate this patch series that's been applied as the HEAD commit. My immediate instinct is to dive into the `git diff` they've provided. Before I get too deep, though, let's just make sure there aren't any other commits or changes lurking around that might be relevant. It's always good to have a complete picture. Alright, let's see this `diff`: ```diff diff --git a/tools/testing/selftests/kvm/Makefile.kvm b/tools/testing/selftests/kvm/Makefile.kvm diff --git a/tools/testing/selftests/kvm/include/x86/processor.h b/tools/testing/selftests/kvm/include/x86/processor.h diff --git a/tools/testing/selftests/kvm/include/x86/svm.h b/tools/testing/selftests/kvm/include/x86/svm.h diff --git a/tools/testing/selftests/kvm/x86/svm_nested_vnmi_test.c b/tools/testing/selftests/kvm/x86/svm_nested_vnmi_test.c ``` Hold on... everything is within `tools/testing/selftests/kvm/`? That's interesting. Now, let me quickly refer to Section 2 of the instructions. The rules for "WorthFuzzing=false" are pretty clear. It's ONLY if the changes fall *strictly* into those specific categories: documentation, comments, spelling fixes, or user-space stuff like self-tests, samples, or scripts that don't affect the kernel image or modules. Given that the modified files are all inside that testing directory, it's pretty likely we're looking at something non-kernel related. Just to be absolutely sure, I'm going to double-check that the `git diff` really *is* showing me everything modified in HEAD. I want to be 100% sure before I make any definitive conclusions. This is a crucial step! |
| 4/2 | 2026/09/15 06:23 | tool | grepper |
0mArgs:{
"Expression": "svm_nested_vnmi_test"
}Results: {
"Output": "tools/testing/selftests/kvm/Makefile.kvm=123=TEST_GEN_PROGS_x86 += x86/svm_nested_vmcb12_gpa\ntools/testing/selftests/kvm/Makefile.kvm:124:TEST_GEN_PROGS_x86 += x86/svm_nested_vnmi_test\ntools/testing/selftests/kvm/Makefile.kvm-125-TEST_GEN_PROGS_x86 += x86/svm_nested_pat_test\n"
} |
| 5/2 | 2026/09/15 06:23 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 6693 output: 34 thoughts: 85 Thoughts: Here's my thought process, as an expert in this area: **Investigating Potential Causes** Okay, so something's shifted. I need to figure out the scope of the change and where it might have originated. My first instinct is to dive into the core KVM/SVM areas. Let's start by checking `arch/x86/kvm/svm/` and the broader `arch/x86/kvm/` directory. Maybe I'll find related modifications in those areas. The specific change is important so I will begin searching for a specific change. Just to be thorough, before I go too deep, it might be quickest to find the *single* commit related to this issue. It'd be great to quickly understand the immediate context. I'm thinking of doing a `git log -1` equivalent but I also want to see if the kernel code touched the `V_NMI_ENABLE` so I'll see if that variable was changed or touched in `arch/x86/kvm/svm/`. That should give me a good jumping-off point and hopefully save some time instead of a full code review. |
| 6/2 | 2026/09/15 06:23 | tool | grepper |
0mArgs:{
"Expression": "V_NMI_ENABLE",
"PathPrefix": "arch/x86/kvm"
}Results: {
"Output": "arch/x86/kvm/svm/nested.c=406=static bool nested_vmcb_check_controls(struct kvm_vcpu *vcpu,\n--\narch/x86/kvm/svm/nested.c-425-\narch/x86/kvm/svm/nested.c:426:\tif (CC((control-\u003eint_ctl \u0026 V_NMI_ENABLE_MASK) \u0026\u0026\narch/x86/kvm/svm/nested.c-427-\t !vmcb12_is_intercept(control, INTERCEPT_NMI))) {\n--\narch/x86/kvm/svm/nested.c=852=static void nested_vmcb02_prepare_control(struct vcpu_svm *svm)\n--\narch/x86/kvm/svm/nested.c-885-\t\t\tint_ctl_vmcb12_bits |= (V_NMI_PENDING_MASK |\narch/x86/kvm/svm/nested.c:886:\t\t\t\t\t\tV_NMI_ENABLE_MASK |\narch/x86/kvm/svm/nested.c-887-\t\t\t\t\t\tV_NMI_BLOCKING_MASK);\n--\narch/x86/kvm/svm/svm.c=1126=static void init_vmcb(struct kvm_vcpu *vcpu, bool init_event)\n--\narch/x86/kvm/svm/svm.c-1258-\tif (vnmi)\narch/x86/kvm/svm/svm.c:1259:\t\tsvm-\u003evmcb-\u003econtrol.int_ctl |= V_NMI_ENABLE_MASK;\narch/x86/kvm/svm/svm.c-1260-\n--\narch/x86/kvm/svm/svm.h=668=static inline bool nested_vnmi_enabled(struct vcpu_svm *svm)\n--\narch/x86/kvm/svm/svm.h-670-\treturn guest_cpu_cap_has(\u0026svm-\u003evcpu, X86_FEATURE_VNMI) \u0026\u0026\narch/x86/kvm/svm/svm.h:671:\t (svm-\u003enested.ctl.int_ctl \u0026 V_NMI_ENABLE_MASK);\narch/x86/kvm/svm/svm.h-672-}\n--\narch/x86/kvm/svm/svm.h=694=static inline bool is_vnmi_enabled(struct vcpu_svm *svm)\n--\narch/x86/kvm/svm/svm.h-698-\tif (vmcb)\narch/x86/kvm/svm/svm.h:699:\t\treturn !!(vmcb-\u003econtrol.int_ctl \u0026 V_NMI_ENABLE_MASK);\narch/x86/kvm/svm/svm.h-700-\telse\n"
} |
| 7/2 | 2026/09/15 06:23 | llm | patch-evaluator |
1mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 7782 output: 93 thoughts: 475 Thoughts: **Analyzing the KVM Self-Test Patch** Okay, let's break down this commit. The diff is showing changes specifically within the `tools/testing/selftests/kvm/` directory. That immediately flags this as a potential candidate for a quick negative assessment, given the guidelines we have. According to the rules, we need to return `WorthFuzzing=false` if *all* modified code falls under one of the negative criteria. Specifically, we're looking for things like documentation, comments, user-space tools and self-tests that don't impact the kernel image or modules. And that's exactly what we have here. All touched files are confined to `tools/testing/selftests/kvm/`. This means this patch is all about user-space tests and their related headers. So, the logic is pretty straightforward: Since this change is isolated to self-tests that don't touch the kernel image or modules, there's no need to fuzz this. It does not affect the core kernel, therefore no further investigation or fuzzing is necessary. Thus, `WorthFuzzing` is `false`, the focus symbols are empty (as is expected), and enable configs are also not required. I'll provide a concise reasoning: "The patch only modifies files in `tools/testing/selftests/kvm/`, which are user-space KVM self-tests and headers that do not affect the compiled kernel image (`vmlinux`) or kernel modules." Now, time to set the results and move on. |
| 8/2 | 2026/09/15 06:24 | tool | set-results |
0mArgs:{
"EnableConfigs": [],
"FocusSymbols": [],
"Reasoning": "The patch modifies only user-space files under tools/testing/selftests/kvm/ (adding a new KVM selftest for nested SVM vNMI and updating test headers/Makefile). It does not alter any kernel source code, compiled kernel image (vmlinux), or kernel modules.",
"WorthFuzzing": false
}Results: {
"EnableConfigs": null,
"FocusSymbols": [],
"Reasoning": "The patch modifies only user-space files under tools/testing/selftests/kvm/ (adding a new KVM selftest for nested SVM vNMI and updating test headers/Makefile). It does not alter any kernel source code, compiled kernel image (vmlinux), or kernel modules.",
"WorthFuzzing": false
} |
| 9/1 | 2026/09/15 06:24 | 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) |
|---|