AI Trajectory


Trajectory: (Expand/Collapse All)
Seq Timestamp Type Name Duration
0/0 2026/09/29 15:12 flow patch-triage
16m Args:
null

Results:
{
  "EnableConfigs": null,
  "FocusSymbols": [],
  "KMSANReasoning": "",
  "NeedsKMSAN": false,
  "Reasoning": "The patch modifies KVM interrupt and PV SCLP handling code exclusively within arch/s390/, which is specific to the s390 architecture. Since the target architecture is amd64, these code paths are structurally unreachable and cannot be executed or fuzzed on amd64.",
  "WorthFuzzing": false
}

1/1 2026/09/29 15:12 action read-patch-diff
0m Args:
null

Results:
{
  "PatchDiff": "commit 46a9811963ec11abc4f13ca3dfe7b3dadb96ba0c\nAuthor: syz-cluster \u003ctriage@syzkaller.com\u003e\nDate:   Tue Sep 29 15:12:58 2026 +0000\n\n    syz-cluster: applied patch under review\n\ndiff --git a/arch/s390/include/asm/kvm_host_s390.h b/arch/s390/include/asm/kvm_host_s390.h\nindex cd692f8fb7643..a86863e621b70 100644\n--- a/arch/s390/include/asm/kvm_host_s390.h\n+++ b/arch/s390/include/asm/kvm_host_s390.h\n@@ -412,6 +412,7 @@ struct kvm_vm_stat {\n \tu64 gmap_shadow_r3_entry;\n \tu64 gmap_shadow_sg_entry;\n \tu64 gmap_shadow_pg_entry;\n+\tu64 inject_redist;\n };\n \n struct kvm_arch_memory_slot {\ndiff --git a/arch/s390/kvm/s390/intercept.c b/arch/s390/kvm/s390/intercept.c\nindex ca1205dfac8b0..031d8fb0df06c 100644\n--- a/arch/s390/kvm/s390/intercept.c\n+++ b/arch/s390/kvm/s390/intercept.c\n@@ -536,6 +536,15 @@ static int handle_pv_sclp(struct kvm_vcpu *vcpu)\n \tset_bit(IRQ_PEND_EXT_SERVICE, \u0026fi-\u003epending_irqs);\n \tclear_bit(IRQ_PEND_EXT_SERVICE, \u0026fi-\u003emasked_irqs);\n \tspin_unlock_irqrestore(\u0026fi-\u003elock, flags);\n+\n+\t/*\n+\t * We missed the floating IRQ kick since we can only inject\n+\t * when we end up here and not when the irq was injected via\n+\t * the FLIC.\n+\t *\n+\t * Now that we have cleared the masking we can kick cpus.\n+\t */\n+\tkvm_s390_pv_sclp_kick(vcpu);\n \treturn 0;\n }\n \ndiff --git a/arch/s390/kvm/s390/interrupt.c b/arch/s390/kvm/s390/interrupt.c\nindex f892f43078831..1b06775e581bf 100644\n--- a/arch/s390/kvm/s390/interrupt.c\n+++ b/arch/s390/kvm/s390/interrupt.c\n@@ -372,6 +372,38 @@ static unsigned long deliverable_irqs(struct kvm_vcpu *vcpu)\n \treturn active_mask;\n }\n \n+static void distribute_float_irqs(struct kvm *kvm)\n+{\n+\tstruct kvm_vcpu *dst_vcpu;\n+\tint sigcpu, online_vcpus;\n+\n+\tif (!READ_ONCE(kvm-\u003earch.float_int.pending_irqs))\n+\t\treturn;\n+\n+\tonline_vcpus = atomic_read(\u0026kvm-\u003eonline_vcpus);\n+\n+\t/*\n+\t * Not too worried about synchronization for idle_mask. We\n+\t * might burn too many cycles but apart from that waking a\n+\t * vcpu is not harmful.\n+\t */\n+\tsigcpu = find_first_bit(kvm-\u003earch.idle_mask, online_vcpus);\n+\n+\t/* Well nobody's sleeping so someone will likely take the IRQ soon */\n+\tif (sigcpu == online_vcpus)\n+\t\treturn;\n+\n+\tdo {\n+\t\tdst_vcpu = kvm_get_vcpu(kvm, sigcpu);\n+\t\tif (deliverable_irqs(dst_vcpu)) {\n+\t\t\tkvm-\u003estat.inject_redist++;\n+\t\t\tkvm_s390_vcpu_wakeup(dst_vcpu);\n+\t\t\tbreak;\n+\t\t}\n+\t\tsigcpu = find_next_bit(kvm-\u003earch.idle_mask, online_vcpus, ++sigcpu);\n+\t} while (sigcpu \u003c online_vcpus);\n+}\n+\n static void __set_cpu_idle(struct kvm_vcpu *vcpu)\n {\n \tkvm_s390_set_cpuflags(vcpu, CPUSTAT_WAIT);\n@@ -1294,6 +1326,8 @@ int kvm_s390_handle_wait(struct kvm_vcpu *vcpu)\n \tif (!sltime)\n \t\treturn 0;\n \n+\tdistribute_float_irqs(vcpu-\u003ekvm);\n+\n \t__set_cpu_idle(vcpu);\n \thrtimer_start(\u0026vcpu-\u003earch.ckc_timer, sltime, HRTIMER_MODE_REL);\n \tVCPU_EVENT(vcpu, 4, \"enabled wait: %llu ns\", sltime);\n@@ -1918,49 +1952,126 @@ static int __inject_io(struct kvm *kvm, struct kvm_s390_interrupt_info *inti)\n \treturn 0;\n }\n \n+static u64 inti_to_irq_pend_mask(u64 type, int isc)\n+{\n+\tswitch (type) {\n+\tcase KVM_S390_MCHK:\n+\t\t/* Only repressible machine checks are floating */\n+\t\treturn BIT(IRQ_PEND_MCHK_REP);\n+\tcase KVM_S390_INT_VIRTIO:\n+\t\treturn BIT(IRQ_PEND_VIRTIO);\n+\tcase KVM_S390_INT_SERVICE:\n+\t\treturn BIT(IRQ_PEND_EXT_SERVICE) |\n+\t\t       BIT(IRQ_PEND_EXT_SERVICE_EV);\n+\tcase KVM_S390_INT_PFAULT_DONE:\n+\t\treturn BIT(IRQ_PEND_PFAULT_DONE);\n+\tcase KVM_S390_INT_IO_MIN...KVM_S390_INT_IO_MAX:\n+\t\treturn BIT(isc_to_irq_type(isc));\n+\tdefault:\n+\t\treturn 0;\n+\t}\n+}\n+\n /*\n- * Find a destination VCPU for a floating irq and kick it.\n+ * Setup intervention masks to catch running vcpus that hopefully open\n+ * their masks soonish and kick sleeping vcpus to motivate them to\n+ * take IRQs.\n  */\n-static void __floating_irq_kick(struct kvm *kvm, u64 type)\n+static void vcpu_intervention_kick(struct kvm_vcpu *vcpu, u64 type)\n+{\n+\t/* make the VCPU drop out of the SIE, or wake it up if sleeping */\n+\tswitch (type) {\n+\tcase KVM_S390_MCHK:\n+\t\tkvm_s390_set_cpuflags(vcpu, CPUSTAT_STOP_INT);\n+\t\tbreak;\n+\tcase KVM_S390_INT_IO_MIN...KVM_S390_INT_IO_MAX:\n+\t\tif (!(type \u0026 KVM_S390_INT_IO_AI_MASK \u0026\u0026\n+\t\t      vcpu-\u003ekvm-\u003earch.gisa_int.origin) ||\n+\t\t      kvm_s390_pv_cpu_get_handle(vcpu))\n+\t\t\tkvm_s390_set_cpuflags(vcpu, CPUSTAT_IO_INT);\n+\t\tbreak;\n+\tdefault:\n+\t\tkvm_s390_set_cpuflags(vcpu, CPUSTAT_EXT_INT);\n+\t\tbreak;\n+\t}\n+\tkvm_s390_vcpu_wakeup(vcpu);\n+}\n+\n+static void kick_cpu_irq(struct kvm *kvm, u64 type, u64 parm)\n {\n \tstruct kvm_vcpu *dst_vcpu;\n \tint sigcpu, online_vcpus, nr_tries = 0;\n+\tu64 irq_pend_mask;\n+\tunsigned long i;\n \n \tonline_vcpus = atomic_read(\u0026kvm-\u003eonline_vcpus);\n \tif (!online_vcpus)\n \t\treturn;\n \n+\tirq_pend_mask = inti_to_irq_pend_mask(type, parm);\n \tfor (sigcpu = kvm-\u003earch.float_int.last_sleep_cpu; ; sigcpu++) {\n \t\tsigcpu %= online_vcpus;\n \t\tdst_vcpu = kvm_get_vcpu(kvm, sigcpu);\n-\t\tif (!is_vcpu_stopped(dst_vcpu))\n+\t\tif (!is_vcpu_stopped(dst_vcpu) \u0026\u0026\n+\t\t    deliverable_irqs(dst_vcpu) \u0026 irq_pend_mask)\n \t\t\tbreak;\n \t\t/* avoid endless loops if all vcpus are stopped */\n-\t\tif (nr_tries++ \u003e= online_vcpus)\n-\t\t\treturn;\n+\t\tif (nr_tries++ \u003e= online_vcpus) {\n+\t\t\tdst_vcpu = NULL;\n+\t\t\tbreak;\n+\t\t}\n \t}\n \n-\t/* make the VCPU drop out of the SIE, or wake it up if sleeping */\n-\tswitch (type) {\n-\tcase KVM_S390_MCHK:\n-\t\tkvm_s390_set_cpuflags(dst_vcpu, CPUSTAT_STOP_INT);\n-\t\tbreak;\n-\tcase KVM_S390_INT_IO_MIN...KVM_S390_INT_IO_MAX:\n-\t\tif (!(type \u0026 KVM_S390_INT_IO_AI_MASK \u0026\u0026\n-\t\t      kvm-\u003earch.gisa_int.origin) ||\n-\t\t      kvm_s390_pv_cpu_get_handle(dst_vcpu))\n-\t\t\tkvm_s390_set_cpuflags(dst_vcpu, CPUSTAT_IO_INT);\n-\t\tbreak;\n-\tdefault:\n-\t\tkvm_s390_set_cpuflags(dst_vcpu, CPUSTAT_EXT_INT);\n-\t\tbreak;\n+\t/* Nobody was enabled, time to wake all of them */\n+\tif (!dst_vcpu) {\n+\t\tkvm_for_each_vcpu(i, dst_vcpu, kvm)\n+\t\t\tvcpu_intervention_kick(dst_vcpu, type);\n+\t\treturn;\n \t}\n-\tkvm_s390_vcpu_wakeup(dst_vcpu);\n+\n+\tvcpu_intervention_kick(dst_vcpu, type);\n+}\n+\n+void kvm_s390_pv_sclp_kick(struct kvm_vcpu *vcpu)\n+{\n+\t/*\n+\t * The cpu that called sclp likely will also take the IRQ, no\n+\t * need to kick anyone.\n+\t */\n+\tif (deliverable_irqs(vcpu) \u0026 BIT(IRQ_PEND_EXT_SERVICE))\n+\t\treturn;\n+\n+\t/*\n+\t * For the other cases we might have sleeping cpus with open\n+\t * masks. Time to find and kick them.\n+\t */\n+\tkick_cpu_irq(vcpu-\u003ekvm, KVM_S390_INT_SERVICE, -1);\n+}\n+\n+/*\n+ * Find a destination VCPU for a floating irq and kick it.\n+ */\n+static void __floating_irq_kick(struct kvm *kvm, u64 type, u64 parm)\n+{\n+\tstruct kvm_s390_float_interrupt *fi = \u0026kvm-\u003earch.float_int;\n+\n+\t/*\n+\t * No need to kick on non-ev service IRQs for PV VMs, we're\n+\t * not allowed to inject anyway. We need to wait for the sclp\n+\t * instruction notification AFTER re-entry of the vcpu that\n+\t * handled the instruction intercept.\n+\t */\n+\tif (type == KVM_S390_INT_SERVICE \u0026\u0026 !(parm \u0026 SCCB_EVENT_PENDING) \u0026\u0026\n+\t    test_bit(IRQ_PEND_EXT_SERVICE, \u0026fi-\u003emasked_irqs))\n+\t\treturn;\n+\n+\tkick_cpu_irq(kvm, type, parm);\n }\n \n static int __inject_vm(struct kvm *kvm, struct kvm_s390_interrupt_info *inti)\n {\n \tu64 type = READ_ONCE(inti-\u003etype);\n+\tu64 parm = -1;\n \tint rc;\n \n \tswitch (type) {\n@@ -1971,12 +2082,15 @@ static int __inject_vm(struct kvm *kvm, struct kvm_s390_interrupt_info *inti)\n \t\trc = __inject_virtio(kvm, inti);\n \t\tbreak;\n \tcase KVM_S390_INT_SERVICE:\n+\t\tparm = inti-\u003eext.ext_params \u0026 SCCB_EVENT_PENDING;\n \t\trc = __inject_service(kvm, inti);\n \t\tbreak;\n \tcase KVM_S390_INT_PFAULT_DONE:\n \t\trc = __inject_pfault_done(kvm, inti);\n \t\tbreak;\n \tcase KVM_S390_INT_IO_MIN...KVM_S390_INT_IO_MAX:\n+\t\t/* Grab isc here since __inject_io() might free inti */\n+\t\tparm = int_word_to_isc(inti-\u003eio.io_int_word);\n \t\trc = __inject_io(kvm, inti);\n \t\tbreak;\n \tdefault:\n@@ -1985,7 +2099,7 @@ static int __inject_vm(struct kvm *kvm, struct kvm_s390_interrupt_info *inti)\n \tif (rc)\n \t\treturn rc;\n \n-\t__floating_irq_kick(kvm, type);\n+\t__floating_irq_kick(kvm, type, parm);\n \treturn 0;\n }\n \ndiff --git a/arch/s390/kvm/s390/s390.c b/arch/s390/kvm/s390/s390.c\nindex efd77b9cd36c5..252fde3abc9c0 100644\n--- a/arch/s390/kvm/s390/s390.c\n+++ b/arch/s390/kvm/s390/s390.c\n@@ -87,6 +87,7 @@ const struct kvm_stats_desc kvm_vm_stats_desc[] = {\n \tSTATS_DESC_COUNTER(VM, gmap_shadow_r3_entry),\n \tSTATS_DESC_COUNTER(VM, gmap_shadow_sg_entry),\n \tSTATS_DESC_COUNTER(VM, gmap_shadow_pg_entry),\n+\tSTATS_DESC_COUNTER(VM, inject_redist),\n };\n \n const struct kvm_stats_header kvm_vm_stats_header = {\ndiff --git a/arch/s390/kvm/s390/s390.h b/arch/s390/kvm/s390/s390.h\nindex aa0d1d062f8dc..9ed1af5583e3f 100644\n--- a/arch/s390/kvm/s390/s390.h\n+++ b/arch/s390/kvm/s390/s390.h\n@@ -375,6 +375,7 @@ enum hrtimer_restart kvm_s390_idle_wakeup(struct hrtimer *timer);\n int __must_check kvm_s390_deliver_pending_interrupts(struct kvm_vcpu *vcpu);\n void kvm_s390_clear_local_irqs(struct kvm_vcpu *vcpu);\n void kvm_s390_clear_float_irqs(struct kvm *kvm);\n+void kvm_s390_pv_sclp_kick(struct kvm_vcpu *vcpu);\n int __must_check kvm_s390_inject_vm(struct kvm *kvm,\n \t\t\t\t    struct kvm_s390_interrupt *s390int,\n \t\t\t\t    struct kvm_s390_interrupt_info *inti);\n"
}

2/1 2026/09/29 15:12 agent patch-evaluator
16m Model:
core

Args:
null

Results:
{
  "EnableConfigs": null,
  "FocusSymbols": [],
  "Reasoning": "The patch modifies KVM interrupt and PV SCLP handling code exclusively within arch/s390/, which is specific to the s390 architecture. Since the target architecture is amd64, these code paths are structurally unreachable and cannot be executed or fuzzed on amd64.",
  "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 46a9811963ec11abc4f13ca3dfe7b3dadb96ba0c
Author: syz-cluster <triage@syzkaller.com>
Date:   Tue Sep 29 15:12:58 2026 +0000

    syz-cluster: applied patch under review

diff --git a/arch/s390/include/asm/kvm_host_s390.h b/arch/s390/include/asm/kvm_host_s390.h
index cd692f8fb7643..a86863e621b70 100644
--- a/arch/s390/include/asm/kvm_host_s390.h
+++ b/arch/s390/include/asm/kvm_host_s390.h
@@ -412,6 +412,7 @@ struct kvm_vm_stat {
 	u64 gmap_shadow_r3_entry;
 	u64 gmap_shadow_sg_entry;
 	u64 gmap_shadow_pg_entry;
+	u64 inject_redist;
 };
 
 struct kvm_arch_memory_slot {
diff --git a/arch/s390/kvm/s390/intercept.c b/arch/s390/kvm/s390/intercept.c
index ca1205dfac8b0..031d8fb0df06c 100644
--- a/arch/s390/kvm/s390/intercept.c
+++ b/arch/s390/kvm/s390/intercept.c
@@ -536,6 +536,15 @@ static int handle_pv_sclp(struct kvm_vcpu *vcpu)
 	set_bit(IRQ_PEND_EXT_SERVICE, &fi->pending_irqs);
 	clear_bit(IRQ_PEND_EXT_SERVICE, &fi->masked_irqs);
 	spin_unlock_irqrestore(&fi->lock, flags);
+
+	/*
+	 * We missed the floating IRQ kick since we can only inject
+	 * when we end up here and not when the irq was injected via
+	 * the FLIC.
+	 *
+	 * Now that we have cleared the masking we can kick cpus.
+	 */
+	kvm_s390_pv_sclp_kick(vcpu);
 	return 0;
 }
 
diff --git a/arch/s390/kvm/s390/interrupt.c b/arch/s390/kvm/s390/interrupt.c
index f892f43078831..1b06775e581bf 100644
--- a/arch/s390/kvm/s390/interrupt.c
+++ b/arch/s390/kvm/s390/interrupt.c
@@ -372,6 +372,38 @@ static unsigned long deliverable_irqs(struct kvm_vcpu *vcpu)
 	return active_mask;
 }
 
+static void distribute_float_irqs(struct kvm *kvm)
+{
+	struct kvm_vcpu *dst_vcpu;
+	int sigcpu, online_vcpus;
+
+	if (!READ_ONCE(kvm->arch.float_int.pending_irqs))
+		return;
+
+	online_vcpus = atomic_read(&kvm->online_vcpus);
+
+	/*
+	 * Not too worried about synchronization for idle_mask. We
+	 * might burn too many cycles but apart from that waking a
+	 * vcpu is not harmful.
+	 */
+	sigcpu = find_first_bit(kvm->arch.idle_mask, online_vcpus);
+
+	/* Well nobody's sleeping so someone will likely take the IRQ soon */
+	if (sigcpu == online_vcpus)
+		return;
+
+	do {
+		dst_vcpu = kvm_get_vcpu(kvm, sigcpu);
+		if (deliverable_irqs(dst_vcpu)) {
+			kvm->stat.inject_redist++;
+			kvm_s390_vcpu_wakeup(dst_vcpu);
+			break;
+		}
+		sigcpu = find_next_bit(kvm->arch.idle_mask, online_vcpus, ++sigcpu);
+	} while (sigcpu < online_vcpus);
+}
+
 static void __set_cpu_idle(struct kvm_vcpu *vcpu)
 {
 	kvm_s390_set_cpuflags(vcpu, CPUSTAT_WAIT);
@@ -1294,6 +1326,8 @@ int kvm_s390_handle_wait(struct kvm_vcpu *vcpu)
 	if (!sltime)
 		return 0;
 
+	distribute_float_irqs(vcpu->kvm);
+
 	__set_cpu_idle(vcpu);
 	hrtimer_start(&vcpu->arch.ckc_timer, sltime, HRTIMER_MODE_REL);
 	VCPU_EVENT(vcpu, 4, "enabled wait: %llu ns", sltime);
@@ -1918,49 +1952,126 @@ static int __inject_io(struct kvm *kvm, struct kvm_s390_interrupt_info *inti)
 	return 0;
 }
 
+static u64 inti_to_irq_pend_mask(u64 type, int isc)
+{
+	switch (type) {
+	case KVM_S390_MCHK:
+		/* Only repressible machine checks are floating */
+		return BIT(IRQ_PEND_MCHK_REP);
+	case KVM_S390_INT_VIRTIO:
+		return BIT(IRQ_PEND_VIRTIO);
+	case KVM_S390_INT_SERVICE:
+		return BIT(IRQ_PEND_EXT_SERVICE) |
+		       BIT(IRQ_PEND_EXT_SERVICE_EV);
+	case KVM_S390_INT_PFAULT_DONE:
+		return BIT(IRQ_PEND_PFAULT_DONE);
+	case KVM_S390_INT_IO_MIN...KVM_S390_INT_IO_MAX:
+		return BIT(isc_to_irq_type(isc));
+	default:
+		return 0;
+	}
+}
+
 /*
- * Find a destination VCPU for a floating irq and kick it.
+ * Setup intervention masks to catch running vcpus that hopefully open
+ * their masks soonish and kick sleeping vcpus to motivate them to
+ * take IRQs.
  */
-static void __floating_irq_kick(struct kvm *kvm, u64 type)
+static void vcpu_intervention_kick(struct kvm_vcpu *vcpu, u64 type)
+{
+	/* make the VCPU drop out of the SIE, or wake it up if sleeping */
+	switch (type) {
+	case KVM_S390_MCHK:
+		kvm_s390_set_cpuflags(vcpu, CPUSTAT_STOP_INT);
+		break;
+	case KVM_S390_INT_IO_MIN...KVM_S390_INT_IO_MAX:
+		if (!(type & KVM_S390_INT_IO_AI_MASK &&
+		      vcpu->kvm->arch.gisa_int.origin) ||
+		      kvm_s390_pv_cpu_get_handle(vcpu))
+			kvm_s390_set_cpuflags(vcpu, CPUSTAT_IO_INT);
+		break;
+	default:
+		kvm_s390_set_cpuflags(vcpu, CPUSTAT_EXT_INT);
+		break;
+	}
+	kvm_s390_vcpu_wakeup(vcpu);
+}
+
+static void kick_cpu_irq(struct kvm *kvm, u64 type, u64 parm)
 {
 	struct kvm_vcpu *dst_vcpu;
 	int sigcpu, online_vcpus, nr_tries = 0;
+	u64 irq_pend_mask;
+	unsigned long i;
 
 	online_vcpus = atomic_read(&kvm->online_vcpus);
 	if (!online_vcpus)
 		return;
 
+	irq_pend_mask = inti_to_irq_pend_mask(type, parm);
 	for (sigcpu = kvm->arch.float_int.last_sleep_cpu; ; sigcpu++) {
 		sigcpu %= online_vcpus;
 		dst_vcpu = kvm_get_vcpu(kvm, sigcpu);
-		if (!is_vcpu_stopped(dst_vcpu))
+		if (!is_vcpu_stopped(dst_vcpu) &&
+		    deliverable_irqs(dst_vcpu) & irq_pend_mask)
 			break;
 		/* avoid endless loops if all vcpus are stopped */
-		if (nr_tries++ >= online_vcpus)
-			return;
+		if (nr_tries++ >= online_vcpus) {
+			dst_vcpu = NULL;
+			break;
+		}
 	}
 
-	/* make the VCPU drop out of the SIE, or wake it up if sleeping */
-	switch (type) {
-	case KVM_S390_MCHK:
-		kvm_s390_set_cpuflags(dst_vcpu, CPUSTAT_STOP_INT);
-		break;
-	case KVM_S390_INT_IO_MIN...KVM_S390_INT_IO_MAX:
-		if (!(type & KVM_S390_INT_IO_AI_MASK &&
-		      kvm->arch.gisa_int.origin) ||
-		      kvm_s390_pv_cpu_get_handle(dst_vcpu))
-			kvm_s390_set_cpuflags(dst_vcpu, CPUSTAT_IO_INT);
-		break;
-	default:
-		kvm_s390_set_cpuflags(dst_vcpu, CPUSTAT_EXT_INT);
-		break;
+	/* Nobody was enabled, time to wake all of them */
+	if (!dst_vcpu) {
+		kvm_for_each_vcpu(i, dst_vcpu, kvm)
+			vcpu_intervention_kick(dst_vcpu, type);
+		return;
 	}
-	kvm_s390_vcpu_wakeup(dst_vcpu);
+
+	vcpu_intervention_kick(dst_vcpu, type);
+}
+
+void kvm_s390_pv_sclp_kick(struct kvm_vcpu *vcpu)
+{
+	/*
+	 * The cpu that called sclp likely will also take the IRQ, no
+	 * need to kick anyone.
+	 */
+	if (deliverable_irqs(vcpu) & BIT(IRQ_PEND_EXT_SERVICE))
+		return;
+
+	/*
+	 * For the other cases we might have sleeping cpus with open
+	 * masks. Time to find and kick them.
+	 */
+	kick_cpu_irq(vcpu->kvm, KVM_S390_INT_SERVICE, -1);
+}
+
+/*
+ * Find a destination VCPU for a floating irq and kick it.
+ */
+static void __floating_irq_kick(struct kvm *kvm, u64 type, u64 parm)
+{
+	struct kvm_s390_float_interrupt *fi = &kvm->arch.float_int;
+
+	/*
+	 * No need to kick on non-ev service IRQs for PV VMs, we're
+	 * not allowed to inject anyway. We need to wait for the sclp
+	 * instruction notification AFTER re-entry of the vcpu that
+	 * handled the instruction intercept.
+	 */
+	if (type == KVM_S390_INT_SERVICE && !(parm & SCCB_EVENT_PENDING) &&
+	    test_bit(IRQ_PEND_EXT_SERVICE, &fi->masked_irqs))
+		return;
+
+	kick_cpu_irq(kvm, type, parm);
 }
 
 static int __inject_vm(struct kvm *kvm, struct kvm_s390_interrupt_info *inti)
 {
 	u64 type = READ_ONCE(inti->type);
+	u64 parm = -1;
 	int rc;
 
 	switch (type) {
@@ -1971,12 +2082,15 @@ static int __inject_vm(struct kvm *kvm, struct kvm_s390_interrupt_info *inti)
 		rc = __inject_virtio(kvm, inti);
 		break;
 	case KVM_S390_INT_SERVICE:
+		parm = inti->ext.ext_params & SCCB_EVENT_PENDING;
 		rc = __inject_service(kvm, inti);
 		break;
 	case KVM_S390_INT_PFAULT_DONE:
 		rc = __inject_pfault_done(kvm, inti);
 		break;
 	case KVM_S390_INT_IO_MIN...KVM_S390_INT_IO_MAX:
+		/* Grab isc here since __inject_io() might free inti */
+		parm = int_word_to_isc(inti->io.io_int_word);
 		rc = __inject_io(kvm, inti);
 		break;
 	default:
@@ -1985,7 +2099,7 @@ static int __inject_vm(struct kvm *kvm, struct kvm_s390_interrupt_info *inti)
 	if (rc)
 		return rc;
 
-	__floating_irq_kick(kvm, type);
+	__floating_irq_kick(kvm, type, parm);
 	return 0;
 }
 
diff --git a/arch/s390/kvm/s390/s390.c b/arch/s390/kvm/s390/s390.c
index efd77b9cd36c5..252fde3abc9c0 100644
--- a/arch/s390/kvm/s390/s390.c
+++ b/arch/s390/kvm/s390/s390.c
@@ -87,6 +87,7 @@ const struct kvm_stats_desc kvm_vm_stats_desc[] = {
 	STATS_DESC_COUNTER(VM, gmap_shadow_r3_entry),
 	STATS_DESC_COUNTER(VM, gmap_shadow_sg_entry),
 	STATS_DESC_COUNTER(VM, gmap_shadow_pg_entry),
+	STATS_DESC_COUNTER(VM, inject_redist),
 };
 
 const struct kvm_stats_header kvm_vm_stats_header = {
diff --git a/arch/s390/kvm/s390/s390.h b/arch/s390/kvm/s390/s390.h
index aa0d1d062f8dc..9ed1af5583e3f 100644
--- a/arch/s390/kvm/s390/s390.h
+++ b/arch/s390/kvm/s390/s390.h
@@ -375,6 +375,7 @@ enum hrtimer_restart kvm_s390_idle_wakeup(struct hrtimer *timer);
 int __must_check kvm_s390_deliver_pending_interrupts(struct kvm_vcpu *vcpu);
 void kvm_s390_clear_local_irqs(struct kvm_vcpu *vcpu);
 void kvm_s390_clear_float_irqs(struct kvm *kvm);
+void kvm_s390_pv_sclp_kick(struct kvm_vcpu *vcpu);
 int __must_check kvm_s390_inject_vm(struct kvm *kvm,
 				    struct kvm_s390_interrupt *s390int,
 				    struct kvm_s390_interrupt_info *inti);

3/2 2026/09/29 15:12 llm patch-evaluator
16m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 6827
							output: 92
							thoughts: 647
						

Thoughts:
**Analyzing the Patch for Fuzzing Worthiness**

Okay, so the target architecture is amd64, that's our baseline. Let's dig into this patch diff. Right off the bat, I see the modified files are all nestled within the `arch/s390/` directory: `kvm_host_s390.h`, `intercept.c`, `interrupt.c`, `s390.c`, and `s390.h`. All `s390` specific stuff.

Now, let's remember the instructions. We're looking for when `WorthFuzzing=false` – the negative criteria. Specifically, they point out "Code paths exclusive to architectures other than the target architecture". Bingo! We have `arch/s390/` code, and our target is amd64. Can s390 code even *run* on amd64? Nope, it's architecturally impossible.

Just to be absolutely sure, I'm quickly confirming there's nothing else in the diff, nothing in common code or shared headers. Nope, it's just `arch/s390/`. It's all self-contained and architecturally exclusive to s390. The target architecture is definitively amd64. Therefore, this patch modifies code that falls exclusively into the other architecture's code paths (s390).

So, according to those criteria, this clearly triggers the "WorthFuzzing=false" scenario: the code is unreachable on the target.

Time to verify my thinking. When we get a "false" verdict, we should have a clear `Reasoning` for why it's not worth fuzzing. I need to make sure the reasoning is clear and concise.

So, let me summarize my reasoning, this patch exclusively touches KVM code for the s390 architecture (`arch/s390/`), whereas the target architecture is amd64. Therefore, the modified code is structurally unreachable on the target architecture and not worth fuzzing.

Alright, sounds good. I'll get the `set-results` tool ready with these parameters.



4/2 2026/09/29 15:29 tool set-results
0m Args:
{
  "EnableConfigs": [],
  "FocusSymbols": [],
  "Reasoning": "The patch modifies KVM interrupt and PV SCLP handling code exclusively within arch/s390/, which is specific to the s390 architecture. Since the target architecture is amd64, these code paths are structurally unreachable and cannot be executed or fuzzed on amd64.",
  "WorthFuzzing": false
}

Results:
{
  "EnableConfigs": null,
  "FocusSymbols": [],
  "Reasoning": "The patch modifies KVM interrupt and PV SCLP handling code exclusively within arch/s390/, which is specific to the s390 architecture. Since the target architecture is amd64, these code paths are structurally unreachable and cannot be executed or fuzzed on amd64.",
  "WorthFuzzing": false
}

5/1 2026/09/29 15:29 action If
0m Args:
{
  "WorthFuzzing": false
}

Results:
null

LLM Calls Summary:
Total Calls Total Tokens Avg Tokens Total Duration (Seconds) Avg Duration (Seconds)
Tool Calls Summary:
Total Calls Total Duration (Seconds) Avg Duration (Seconds)