| Seq | Timestamp | Type | Name | Duration |
|---|---|---|---|---|
| 0/0 | 2026/09/22 06:12 | flow | patch-triage |
0mArgs:null Results: {
"EnableConfigs": null,
"FocusSymbols": [],
"KMSANReasoning": "",
"NeedsKMSAN": false,
"Reasoning": "The patch modifies the virtual interrupt controller (VGIC) implementation under arch/arm64/kvm/vgic/ and ARM64 KVM headers. All modified files and code paths are exclusive to the arm64 architecture and cannot be compiled or executed on the target architecture (amd64).",
"WorthFuzzing": false
} |
| 1/1 | 2026/09/22 06:12 | action | read-patch-diff |
0mArgs:null Results: {
"PatchDiff": "commit 8dc15eb6a2154d69b58714316255f215cd69724b\nAuthor: syz-cluster \u003ctriage@syzkaller.com\u003e\nDate: Tue Sep 22 06:11:59 2026 +0000\n\n syz-cluster: applied patch under review\n\ndiff --git a/arch/arm64/include/asm/kvm_host.h b/arch/arm64/include/asm/kvm_host.h\nindex 27fe0cd5b2d7a..c4355ae23e982 100644\n--- a/arch/arm64/include/asm/kvm_host.h\n+++ b/arch/arm64/include/asm/kvm_host.h\n@@ -800,9 +800,6 @@ struct kvm_host_data {\n \tunsigned int debug_brps;\n \tunsigned int debug_wrps;\n \n-\t/* Last vgic_irq part of the AP list recorded in an LR */\n-\tstruct vgic_irq *last_lr_irq;\n-\n \t/* PPI state tracking for GICv5-based guests */\n \tstruct {\n \t\tDECLARE_BITMAP(pendr, VGIC_V5_NR_PRIVATE_IRQS);\ndiff --git a/arch/arm64/kvm/vgic/vgic-v2.c b/arch/arm64/kvm/vgic/vgic-v2.c\nindex 7182f63fc9382..4a0ad5bd1cf65 100644\n--- a/arch/arm64/kvm/vgic/vgic-v2.c\n+++ b/arch/arm64/kvm/vgic/vgic-v2.c\n@@ -115,37 +115,71 @@ void vgic_v2_fold_lr_state(struct kvm_vcpu *vcpu)\n \tstruct vgic_cpu *vgic_cpu = \u0026vcpu-\u003earch.vgic_cpu;\n \tstruct vgic_v2_cpu_if *cpuif = \u0026vgic_cpu-\u003evgic_v2;\n \tu32 eoicount = FIELD_GET(GICH_HCR_EOICOUNT, cpuif-\u003evgic_hcr);\n-\tstruct vgic_irq *irq = *host_data_ptr(last_lr_irq);\n+\tstruct vgic_irq *targets[32];\n+\tu32 lr_intids[VGIC_V2_MAX_LRS];\n+\tint nr_lrs = min_t(int, vgic_cpu-\u003evgic_v2.used_lrs, ARRAY_SIZE(lr_intids));\n+\tu32 max_targets;\n+\tint nr_targets = 0;\n \n \tDEBUG_SPINLOCK_BUG_ON(!irqs_disabled());\n \n-\tfor (int lr = 0; lr \u003c vgic_cpu-\u003evgic_v2.used_lrs; lr++)\n-\t\tvgic_v2_fold_lr(vcpu, cpuif-\u003evgic_lr[lr]);\n+\tif (!vgic_cpu-\u003evgic_v2.used_lrs \u0026\u0026 !eoicount)\n+\t\treturn;\n \n-\t/* See the GICv3 equivalent for the EOIcount handling rationale */\n-\tlist_for_each_entry_continue(irq, \u0026vgic_cpu-\u003eap_list_head, ap_list) {\n-\t\tu32 lr;\n+\tfor (int lr = 0; lr \u003c nr_lrs; lr++) {\n+\t\tu32 val = cpuif-\u003evgic_lr[lr];\n+\n+\t\tlr_intids[lr] = val \u0026 GICH_LR_VIRTUALID;\n+\t\tvgic_v2_fold_lr(vcpu, val);\n+\t}\n+\n+\tcpuif-\u003eused_lrs = 0;\n+\n+\tif (likely(!eoicount))\n+\t\treturn;\n+\n+\tmax_targets = min_t(u32, eoicount, ARRAY_SIZE(targets));\n+\n+\t/*\n+\t * EOIMode=0: replay deactivations for overflow active interrupts.\n+\t * Walk ap_list under ap_list_lock and pin candidate interrupts so we\n+\t * can process them outside the lock without risking lock inversion.\n+\t */\n+\tscoped_guard(raw_spinlock, \u0026vgic_cpu-\u003eap_list_lock) {\n+\t\tstruct vgic_irq *irq;\n \n-\t\tif (!eoicount) {\n-\t\t\tbreak;\n-\t\t} else {\n-\t\t\tguard(raw_spinlock)(\u0026irq-\u003eirq_lock);\n+\t\tlist_for_each_entry(irq, \u0026vgic_cpu-\u003eap_list_head, ap_list) {\n+\t\t\tif (nr_targets == max_targets)\n+\t\t\t\tbreak;\n \n-\t\t\tif (!(likely(vgic_target_oracle(irq) == vcpu) \u0026\u0026\n-\t\t\t irq-\u003eactive))\n+\t\t\tif (intid_in_lrs(irq-\u003eintid, lr_intids, nr_lrs))\n \t\t\t\tcontinue;\n \n+\t\t\tscoped_guard(raw_spinlock, \u0026irq-\u003eirq_lock) {\n+\t\t\t\tif (likely(vgic_target_oracle(irq) == vcpu) \u0026\u0026\n+\t\t\t\t irq-\u003eactive) {\n+\t\t\t\t\tvgic_get_irq_ref(irq);\n+\t\t\t\t\ttargets[nr_targets++] = irq;\n+\t\t\t\t}\n+\t\t\t}\n+\t\t}\n+\t}\n+\n+\tfor (int i = 0; i \u003c nr_targets; i++) {\n+\t\tstruct vgic_irq *irq = targets[i];\n+\t\tu32 lr;\n+\n+\t\tscoped_guard(raw_spinlock, \u0026irq-\u003eirq_lock) {\n \t\t\tlr = vgic_v2_compute_lr(vcpu, irq) \u0026 ~GICH_LR_ACTIVE_BIT;\n \t\t}\n \n \t\tif (lr \u0026 GICH_LR_HW)\n \t\t\twritel_relaxed(FIELD_GET(GICH_LR_PHYSID_CPUID, lr),\n \t\t\t\t kvm_vgic_global_state.gicc_base + GIC_CPU_DEACTIVATE);\n+\n \t\tvgic_v2_fold_lr(vcpu, lr);\n-\t\teoicount--;\n+\t\tvgic_put_irq(vcpu-\u003ekvm, irq);\n \t}\n-\n-\tcpuif-\u003eused_lrs = 0;\n }\n \n void vgic_v2_deactivate(struct kvm_vcpu *vcpu, u32 val)\ndiff --git a/arch/arm64/kvm/vgic/vgic-v3.c b/arch/arm64/kvm/vgic/vgic-v3.c\nindex 726e20a1da6e7..7e573860f3e12 100644\n--- a/arch/arm64/kvm/vgic/vgic-v3.c\n+++ b/arch/arm64/kvm/vgic/vgic-v3.c\n@@ -148,37 +148,65 @@ void vgic_v3_fold_lr_state(struct kvm_vcpu *vcpu)\n \tstruct vgic_cpu *vgic_cpu = \u0026vcpu-\u003earch.vgic_cpu;\n \tstruct vgic_v3_cpu_if *cpuif = \u0026vgic_cpu-\u003evgic_v3;\n \tu32 eoicount = FIELD_GET(ICH_HCR_EL2_EOIcount, cpuif-\u003evgic_hcr);\n-\tstruct vgic_irq *irq = *host_data_ptr(last_lr_irq);\n+\tstruct vgic_irq *targets[32];\n+\tu32 lr_intids[VGIC_V3_MAX_LRS];\n+\tint nr_lrs = min_t(int, cpuif-\u003eused_lrs, ARRAY_SIZE(lr_intids));\n+\tu32 max_targets;\n+\tint nr_targets = 0;\n \n \tDEBUG_SPINLOCK_BUG_ON(!irqs_disabled());\n \n-\tfor (int lr = 0; lr \u003c cpuif-\u003eused_lrs; lr++)\n-\t\tvgic_v3_fold_lr(vcpu, cpuif-\u003evgic_lr[lr]);\n+\tif (!cpuif-\u003eused_lrs \u0026\u0026 !eoicount)\n+\t\treturn;\n+\n+\tfor (int lr = 0; lr \u003c nr_lrs; lr++) {\n+\t\tu64 val = cpuif-\u003evgic_lr[lr];\n+\n+\t\tif (vcpu-\u003ekvm-\u003earch.vgic.vgic_model == KVM_DEV_TYPE_ARM_VGIC_V3)\n+\t\t\tlr_intids[lr] = val \u0026 ICH_LR_VIRTUAL_ID_MASK;\n+\t\telse\n+\t\t\tlr_intids[lr] = val \u0026 GICH_LR_VIRTUALID;\n+\n+\t\tvgic_v3_fold_lr(vcpu, val);\n+\t}\n+\n+\tcpuif-\u003eused_lrs = 0;\n+\n+\tif (likely(!eoicount))\n+\t\treturn;\n+\n+\tmax_targets = min_t(u32, eoicount, ARRAY_SIZE(targets));\n \n \t/*\n-\t * EOIMode=0: use EOIcount to emulate deactivation. We are\n-\t * guaranteed to deactivate in reverse order of the activation, so\n-\t * just pick one active interrupt after the other in the tail part\n-\t * of the ap_list, past the LRs, and replay the deactivation as if\n-\t * the CPU was doing it. We also rely on priority drop to have taken\n-\t * place, and the list to be sorted by priority.\n+\t * EOIMode=0: replay deactivations for overflow active interrupts.\n+\t * Walk ap_list under ap_list_lock and pin candidate interrupts so we\n+\t * can process them outside the lock without risking lock inversion.\n \t */\n-\tlist_for_each_entry_continue(irq, \u0026vgic_cpu-\u003eap_list_head, ap_list) {\n-\t\tu64 lr;\n+\tscoped_guard(raw_spinlock, \u0026vgic_cpu-\u003eap_list_lock) {\n+\t\tstruct vgic_irq *irq;\n \n-\t\t/*\n-\t\t * I would have loved to write this using a scoped_guard(),\n-\t\t * but using 'continue' here is a total train wreck.\n-\t\t */\n-\t\tif (!eoicount) {\n-\t\t\tbreak;\n-\t\t} else {\n-\t\t\tguard(raw_spinlock)(\u0026irq-\u003eirq_lock);\n+\t\tlist_for_each_entry(irq, \u0026vgic_cpu-\u003eap_list_head, ap_list) {\n+\t\t\tif (nr_targets == max_targets)\n+\t\t\t\tbreak;\n \n-\t\t\tif (!(likely(vgic_target_oracle(irq) == vcpu) \u0026\u0026\n-\t\t\t irq-\u003eactive))\n+\t\t\tif (intid_in_lrs(irq-\u003eintid, lr_intids, nr_lrs))\n \t\t\t\tcontinue;\n \n+\t\t\tscoped_guard(raw_spinlock, \u0026irq-\u003eirq_lock) {\n+\t\t\t\tif (likely(vgic_target_oracle(irq) == vcpu) \u0026\u0026\n+\t\t\t\t irq-\u003eactive) {\n+\t\t\t\t\tvgic_get_irq_ref(irq);\n+\t\t\t\t\ttargets[nr_targets++] = irq;\n+\t\t\t\t}\n+\t\t\t}\n+\t\t}\n+\t}\n+\n+\tfor (int i = 0; i \u003c nr_targets; i++) {\n+\t\tstruct vgic_irq *irq = targets[i];\n+\t\tu64 lr;\n+\n+\t\tscoped_guard(raw_spinlock, \u0026irq-\u003eirq_lock) {\n \t\t\tlr = vgic_v3_compute_lr(vcpu, irq) \u0026 ~ICH_LR_ACTIVE_BIT;\n \t\t}\n \n@@ -186,10 +214,8 @@ void vgic_v3_fold_lr_state(struct kvm_vcpu *vcpu)\n \t\t\tvgic_v3_deactivate_phys(FIELD_GET(ICH_LR_PHYS_ID_MASK, lr));\n \n \t\tvgic_v3_fold_lr(vcpu, lr);\n-\t\teoicount--;\n+\t\tvgic_put_irq(vcpu-\u003ekvm, irq);\n \t}\n-\n-\tcpuif-\u003eused_lrs = 0;\n }\n \n void vgic_v3_deactivate(struct kvm_vcpu *vcpu, u64 val)\ndiff --git a/arch/arm64/kvm/vgic/vgic.c b/arch/arm64/kvm/vgic/vgic.c\nindex b25303d9919fd..966948fd3dddf 100644\n--- a/arch/arm64/kvm/vgic/vgic.c\n+++ b/arch/arm64/kvm/vgic/vgic.c\n@@ -866,9 +866,6 @@ static void vgic_fold_state(struct kvm_vcpu *vcpu)\n \t\treturn;\n \t}\n \n-\tif (!*host_data_ptr(last_lr_irq))\n-\t\treturn;\n-\n \tif (kvm_vgic_global_state.type == VGIC_V2)\n \t\tvgic_v2_fold_lr_state(vcpu);\n \telse\n@@ -1015,14 +1012,10 @@ static void vgic_flush_lr_state(struct kvm_vcpu *vcpu)\n \tif (irqs_outside_lrs(\u0026als))\n \t\tvgic_sort_ap_list(vcpu);\n \n-\t*host_data_ptr(last_lr_irq) = NULL;\n-\n \tlist_for_each_entry(irq, \u0026vgic_cpu-\u003eap_list_head, ap_list) {\n \t\tscoped_guard(raw_spinlock, \u0026irq-\u003eirq_lock) {\n-\t\t\tif (likely(vgic_target_oracle(irq) == vcpu)) {\n+\t\t\tif (likely(vgic_target_oracle(irq) == vcpu))\n \t\t\t\tvgic_populate_lr(vcpu, irq, count++);\n-\t\t\t\t*host_data_ptr(last_lr_irq) = irq;\n-\t\t\t}\n \t\t}\n \n \t\tif (count == kvm_vgic_global_state.nr_lr)\ndiff --git a/arch/arm64/kvm/vgic/vgic.h b/arch/arm64/kvm/vgic/vgic.h\nindex b71d486ae5145..35a07b320be47 100644\n--- a/arch/arm64/kvm/vgic/vgic.h\n+++ b/arch/arm64/kvm/vgic/vgic.h\n@@ -334,6 +334,20 @@ static inline void vgic_get_irq_ref(struct vgic_irq *irq)\n \tWARN_ON_ONCE(!vgic_try_get_irq_ref(irq));\n }\n \n+/*\n+ * Linear scan over at most VGIC_V3_MAX_LRS / VGIC_V2_MAX_LRS entries.\n+ * Only called on the rare eoicount \u003e 0 path, so the O(n) cost is\n+ * acceptable and avoids the complexity of a bitmap.\n+ */\n+static inline bool intid_in_lrs(u32 intid, const u32 *lr_intids, int nr_lrs)\n+{\n+\tfor (int i = 0; i \u003c nr_lrs; i++) {\n+\t\tif (lr_intids[i] == intid)\n+\t\t\treturn true;\n+\t}\n+\treturn false;\n+}\n+\n void vgic_v3_fold_lr_state(struct kvm_vcpu *vcpu);\n void vgic_v3_populate_lr(struct kvm_vcpu *vcpu, struct vgic_irq *irq, int lr);\n void vgic_v3_clear_lr(struct kvm_vcpu *vcpu, int lr);\n"
} |
| 2/1 | 2026/09/22 06:12 | agent | patch-evaluator |
0mModel:core Args: null Results: {
"EnableConfigs": null,
"FocusSymbols": [],
"Reasoning": "The patch modifies the virtual interrupt controller (VGIC) implementation under arch/arm64/kvm/vgic/ and ARM64 KVM headers. All modified files and code paths are exclusive to the arm64 architecture and cannot be compiled or executed on the target architecture (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 8dc15eb6a2154d69b58714316255f215cd69724b
Author: syz-cluster <triage@syzkaller.com>
Date: Tue Sep 22 06:11:59 2026 +0000
syz-cluster: applied patch under review
diff --git a/arch/arm64/include/asm/kvm_host.h b/arch/arm64/include/asm/kvm_host.h
index 27fe0cd5b2d7a..c4355ae23e982 100644
--- a/arch/arm64/include/asm/kvm_host.h
+++ b/arch/arm64/include/asm/kvm_host.h
@@ -800,9 +800,6 @@ struct kvm_host_data {
unsigned int debug_brps;
unsigned int debug_wrps;
- /* Last vgic_irq part of the AP list recorded in an LR */
- struct vgic_irq *last_lr_irq;
-
/* PPI state tracking for GICv5-based guests */
struct {
DECLARE_BITMAP(pendr, VGIC_V5_NR_PRIVATE_IRQS);
diff --git a/arch/arm64/kvm/vgic/vgic-v2.c b/arch/arm64/kvm/vgic/vgic-v2.c
index 7182f63fc9382..4a0ad5bd1cf65 100644
--- a/arch/arm64/kvm/vgic/vgic-v2.c
+++ b/arch/arm64/kvm/vgic/vgic-v2.c
@@ -115,37 +115,71 @@ void vgic_v2_fold_lr_state(struct kvm_vcpu *vcpu)
struct vgic_cpu *vgic_cpu = &vcpu->arch.vgic_cpu;
struct vgic_v2_cpu_if *cpuif = &vgic_cpu->vgic_v2;
u32 eoicount = FIELD_GET(GICH_HCR_EOICOUNT, cpuif->vgic_hcr);
- struct vgic_irq *irq = *host_data_ptr(last_lr_irq);
+ struct vgic_irq *targets[32];
+ u32 lr_intids[VGIC_V2_MAX_LRS];
+ int nr_lrs = min_t(int, vgic_cpu->vgic_v2.used_lrs, ARRAY_SIZE(lr_intids));
+ u32 max_targets;
+ int nr_targets = 0;
DEBUG_SPINLOCK_BUG_ON(!irqs_disabled());
- for (int lr = 0; lr < vgic_cpu->vgic_v2.used_lrs; lr++)
- vgic_v2_fold_lr(vcpu, cpuif->vgic_lr[lr]);
+ if (!vgic_cpu->vgic_v2.used_lrs && !eoicount)
+ return;
- /* See the GICv3 equivalent for the EOIcount handling rationale */
- list_for_each_entry_continue(irq, &vgic_cpu->ap_list_head, ap_list) {
- u32 lr;
+ for (int lr = 0; lr < nr_lrs; lr++) {
+ u32 val = cpuif->vgic_lr[lr];
+
+ lr_intids[lr] = val & GICH_LR_VIRTUALID;
+ vgic_v2_fold_lr(vcpu, val);
+ }
+
+ cpuif->used_lrs = 0;
+
+ if (likely(!eoicount))
+ return;
+
+ max_targets = min_t(u32, eoicount, ARRAY_SIZE(targets));
+
+ /*
+ * EOIMode=0: replay deactivations for overflow active interrupts.
+ * Walk ap_list under ap_list_lock and pin candidate interrupts so we
+ * can process them outside the lock without risking lock inversion.
+ */
+ scoped_guard(raw_spinlock, &vgic_cpu->ap_list_lock) {
+ struct vgic_irq *irq;
- if (!eoicount) {
- break;
- } else {
- guard(raw_spinlock)(&irq->irq_lock);
+ list_for_each_entry(irq, &vgic_cpu->ap_list_head, ap_list) {
+ if (nr_targets == max_targets)
+ break;
- if (!(likely(vgic_target_oracle(irq) == vcpu) &&
- irq->active))
+ if (intid_in_lrs(irq->intid, lr_intids, nr_lrs))
continue;
+ scoped_guard(raw_spinlock, &irq->irq_lock) {
+ if (likely(vgic_target_oracle(irq) == vcpu) &&
+ irq->active) {
+ vgic_get_irq_ref(irq);
+ targets[nr_targets++] = irq;
+ }
+ }
+ }
+ }
+
+ for (int i = 0; i < nr_targets; i++) {
+ struct vgic_irq *irq = targets[i];
+ u32 lr;
+
+ scoped_guard(raw_spinlock, &irq->irq_lock) {
lr = vgic_v2_compute_lr(vcpu, irq) & ~GICH_LR_ACTIVE_BIT;
}
if (lr & GICH_LR_HW)
writel_relaxed(FIELD_GET(GICH_LR_PHYSID_CPUID, lr),
kvm_vgic_global_state.gicc_base + GIC_CPU_DEACTIVATE);
+
vgic_v2_fold_lr(vcpu, lr);
- eoicount--;
+ vgic_put_irq(vcpu->kvm, irq);
}
-
- cpuif->used_lrs = 0;
}
void vgic_v2_deactivate(struct kvm_vcpu *vcpu, u32 val)
diff --git a/arch/arm64/kvm/vgic/vgic-v3.c b/arch/arm64/kvm/vgic/vgic-v3.c
index 726e20a1da6e7..7e573860f3e12 100644
--- a/arch/arm64/kvm/vgic/vgic-v3.c
+++ b/arch/arm64/kvm/vgic/vgic-v3.c
@@ -148,37 +148,65 @@ void vgic_v3_fold_lr_state(struct kvm_vcpu *vcpu)
struct vgic_cpu *vgic_cpu = &vcpu->arch.vgic_cpu;
struct vgic_v3_cpu_if *cpuif = &vgic_cpu->vgic_v3;
u32 eoicount = FIELD_GET(ICH_HCR_EL2_EOIcount, cpuif->vgic_hcr);
- struct vgic_irq *irq = *host_data_ptr(last_lr_irq);
+ struct vgic_irq *targets[32];
+ u32 lr_intids[VGIC_V3_MAX_LRS];
+ int nr_lrs = min_t(int, cpuif->used_lrs, ARRAY_SIZE(lr_intids));
+ u32 max_targets;
+ int nr_targets = 0;
DEBUG_SPINLOCK_BUG_ON(!irqs_disabled());
- for (int lr = 0; lr < cpuif->used_lrs; lr++)
- vgic_v3_fold_lr(vcpu, cpuif->vgic_lr[lr]);
+ if (!cpuif->used_lrs && !eoicount)
+ return;
+
+ for (int lr = 0; lr < nr_lrs; lr++) {
+ u64 val = cpuif->vgic_lr[lr];
+
+ if (vcpu->kvm->arch.vgic.vgic_model == KVM_DEV_TYPE_ARM_VGIC_V3)
+ lr_intids[lr] = val & ICH_LR_VIRTUAL_ID_MASK;
+ else
+ lr_intids[lr] = val & GICH_LR_VIRTUALID;
+
+ vgic_v3_fold_lr(vcpu, val);
+ }
+
+ cpuif->used_lrs = 0;
+
+ if (likely(!eoicount))
+ return;
+
+ max_targets = min_t(u32, eoicount, ARRAY_SIZE(targets));
/*
- * EOIMode=0: use EOIcount to emulate deactivation. We are
- * guaranteed to deactivate in reverse order of the activation, so
- * just pick one active interrupt after the other in the tail part
- * of the ap_list, past the LRs, and replay the deactivation as if
- * the CPU was doing it. We also rely on priority drop to have taken
- * place, and the list to be sorted by priority.
+ * EOIMode=0: replay deactivations for overflow active interrupts.
+ * Walk ap_list under ap_list_lock and pin candidate interrupts so we
+ * can process them outside the lock without risking lock inversion.
*/
- list_for_each_entry_continue(irq, &vgic_cpu->ap_list_head, ap_list) {
- u64 lr;
+ scoped_guard(raw_spinlock, &vgic_cpu->ap_list_lock) {
+ struct vgic_irq *irq;
- /*
- * I would have loved to write this using a scoped_guard(),
- * but using 'continue' here is a total train wreck.
- */
- if (!eoicount) {
- break;
- } else {
- guard(raw_spinlock)(&irq->irq_lock);
+ list_for_each_entry(irq, &vgic_cpu->ap_list_head, ap_list) {
+ if (nr_targets == max_targets)
+ break;
- if (!(likely(vgic_target_oracle(irq) == vcpu) &&
- irq->active))
+ if (intid_in_lrs(irq->intid, lr_intids, nr_lrs))
continue;
+ scoped_guard(raw_spinlock, &irq->irq_lock) {
+ if (likely(vgic_target_oracle(irq) == vcpu) &&
+ irq->active) {
+ vgic_get_irq_ref(irq);
+ targets[nr_targets++] = irq;
+ }
+ }
+ }
+ }
+
+ for (int i = 0; i < nr_targets; i++) {
+ struct vgic_irq *irq = targets[i];
+ u64 lr;
+
+ scoped_guard(raw_spinlock, &irq->irq_lock) {
lr = vgic_v3_compute_lr(vcpu, irq) & ~ICH_LR_ACTIVE_BIT;
}
@@ -186,10 +214,8 @@ void vgic_v3_fold_lr_state(struct kvm_vcpu *vcpu)
vgic_v3_deactivate_phys(FIELD_GET(ICH_LR_PHYS_ID_MASK, lr));
vgic_v3_fold_lr(vcpu, lr);
- eoicount--;
+ vgic_put_irq(vcpu->kvm, irq);
}
-
- cpuif->used_lrs = 0;
}
void vgic_v3_deactivate(struct kvm_vcpu *vcpu, u64 val)
diff --git a/arch/arm64/kvm/vgic/vgic.c b/arch/arm64/kvm/vgic/vgic.c
index b25303d9919fd..966948fd3dddf 100644
--- a/arch/arm64/kvm/vgic/vgic.c
+++ b/arch/arm64/kvm/vgic/vgic.c
@@ -866,9 +866,6 @@ static void vgic_fold_state(struct kvm_vcpu *vcpu)
return;
}
- if (!*host_data_ptr(last_lr_irq))
- return;
-
if (kvm_vgic_global_state.type == VGIC_V2)
vgic_v2_fold_lr_state(vcpu);
else
@@ -1015,14 +1012,10 @@ static void vgic_flush_lr_state(struct kvm_vcpu *vcpu)
if (irqs_outside_lrs(&als))
vgic_sort_ap_list(vcpu);
- *host_data_ptr(last_lr_irq) = NULL;
-
list_for_each_entry(irq, &vgic_cpu->ap_list_head, ap_list) {
scoped_guard(raw_spinlock, &irq->irq_lock) {
- if (likely(vgic_target_oracle(irq) == vcpu)) {
+ if (likely(vgic_target_oracle(irq) == vcpu))
vgic_populate_lr(vcpu, irq, count++);
- *host_data_ptr(last_lr_irq) = irq;
- }
}
if (count == kvm_vgic_global_state.nr_lr)
diff --git a/arch/arm64/kvm/vgic/vgic.h b/arch/arm64/kvm/vgic/vgic.h
index b71d486ae5145..35a07b320be47 100644
--- a/arch/arm64/kvm/vgic/vgic.h
+++ b/arch/arm64/kvm/vgic/vgic.h
@@ -334,6 +334,20 @@ static inline void vgic_get_irq_ref(struct vgic_irq *irq)
WARN_ON_ONCE(!vgic_try_get_irq_ref(irq));
}
+/*
+ * Linear scan over at most VGIC_V3_MAX_LRS / VGIC_V2_MAX_LRS entries.
+ * Only called on the rare eoicount > 0 path, so the O(n) cost is
+ * acceptable and avoids the complexity of a bitmap.
+ */
+static inline bool intid_in_lrs(u32 intid, const u32 *lr_intids, int nr_lrs)
+{
+ for (int i = 0; i < nr_lrs; i++) {
+ if (lr_intids[i] == intid)
+ return true;
+ }
+ return false;
+}
+
void vgic_v3_fold_lr_state(struct kvm_vcpu *vcpu);
void vgic_v3_populate_lr(struct kvm_vcpu *vcpu, struct vgic_irq *irq, int lr);
void vgic_v3_clear_lr(struct kvm_vcpu *vcpu, int lr);
|
| 3/2 | 2026/09/22 06:12 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 6653 output: 29 thoughts: 571 Thoughts: **Fuzzing Decision for This Patch Series** Okay, so I need to decide if this patch series warrants syzkaller fuzzing. The target architecture is amd64, which is crucial. Let's see what the changes actually touch. The diff mentions `arch/arm64/include/asm/kvm_host.h`, `arch/arm64/kvm/vgic/vgic-v2.c`, `arch/arm64/kvm/vgic/vgic-v3.c`, `arch/arm64/kvm/vgic/vgic.c`, and `arch/arm64/kvm/vgic/vgic.h`. Everything is strictly within `arch/arm64/`. Now, I need to apply the negative criteria. The prompt says *not* to fuzz if all modified code falls strictly into one of several categories, including code paths exclusive to architectures other than the target architecture. And here's the rub - my target is amd64, and these changes are *all* in `arch/arm64/`. So, the question is, are any of these files compiled or reachable on amd64? No, definitely not! The kernel's build system keeps `arch/$ARCH` very isolated. `arch/arm64` code is only included when we're building for `ARCH=arm64`. On amd64 (or x86_64), this code will never be built or executed. We can be sure because the kernel build system enforces architecture separation. Just to be absolutely sure, I'll quickly double-check that this isn't some odd cross-architecture inclusion or that the diff doesn't touch something else via a quick `git diff` or grepper. But given the clear architecture restriction and the rule, I'm confident in my conclusion. |
| 4/2 | 2026/09/22 06:12 | tool | grepper |
0mArgs:{
"Expression": "intid_in_lrs",
"PathPrefix": "arch/"
}Results: {
"Output": "arch/arm64/kvm/vgic/vgic-v2.c=113=void vgic_v2_fold_lr_state(struct kvm_vcpu *vcpu)\n--\narch/arm64/kvm/vgic/vgic-v2.c-154-\narch/arm64/kvm/vgic/vgic-v2.c:155:\t\t\tif (intid_in_lrs(irq-\u003eintid, lr_intids, nr_lrs))\narch/arm64/kvm/vgic/vgic-v2.c-156-\t\t\t\tcontinue;\n--\narch/arm64/kvm/vgic/vgic-v3.c=146=void vgic_v3_fold_lr_state(struct kvm_vcpu *vcpu)\n--\narch/arm64/kvm/vgic/vgic-v3.c-191-\narch/arm64/kvm/vgic/vgic-v3.c:192:\t\t\tif (intid_in_lrs(irq-\u003eintid, lr_intids, nr_lrs))\narch/arm64/kvm/vgic/vgic-v3.c-193-\t\t\t\tcontinue;\n--\narch/arm64/kvm/vgic/vgic.h=332=static inline void vgic_get_irq_ref(struct vgic_irq *irq)\n--\narch/arm64/kvm/vgic/vgic.h-341- */\narch/arm64/kvm/vgic/vgic.h:342:static inline bool intid_in_lrs(u32 intid, const u32 *lr_intids, int nr_lrs)\narch/arm64/kvm/vgic/vgic.h-343-{\n"
} |
| 5/2 | 2026/09/22 06:12 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 8126 output: 93 thoughts: 566 Thoughts: **My Assessment of the Patch's Fuzzing Worthiness** Okay, let's break this down. First, I need to understand the scope of this patch. I've already got the diff data, so there's no need to run `git log` or `git status` right now. I can see the changes are all confined to files within the `arch/arm64` directory, specifically relating to KVM and VGIC emulation. The key here is the target architecture: it's `amd64`. Now, based on my understanding of the rules outlined in Section 2, the question is whether the changes are *reachable* on that target architecture. The rule explicitly states that code paths exclusive to architectures *other than* the target architecture should be considered "Not Worth Fuzzing". And that's the crux of it: this patch deals exclusively with ARM64 KVM and VGIC. This code is fundamental to emulating an ARM64 environment, which isn't present on `amd64`. Thus, the changes aren't compiled or reachable. Therefore, I've got a definitive answer. Based on this analysis, the patch has no relevance to fuzzing on amd64. Thus, it's not worth fuzzing. I'll flag `WorthFuzzing` as `false`. No `EnableConfigs` or `FocusSymbols` are relevant here, so they can be empty. The `Reasoning` will clarify the architectural exclusivity. I'll quickly double-check that this conclusion aligns with the expected output format for `set-results`. Looks like strings, booleans, and nullables are allowed, which matches. Great, I'm ready to call `set-results`. |
| 6/2 | 2026/09/22 06:12 | tool | set-results |
0mArgs:{
"EnableConfigs": [],
"FocusSymbols": [],
"Reasoning": "The patch modifies the virtual interrupt controller (VGIC) implementation under arch/arm64/kvm/vgic/ and ARM64 KVM headers. All modified files and code paths are exclusive to the arm64 architecture and cannot be compiled or executed on the target architecture (amd64).",
"WorthFuzzing": false
}Results: {
"EnableConfigs": null,
"FocusSymbols": [],
"Reasoning": "The patch modifies the virtual interrupt controller (VGIC) implementation under arch/arm64/kvm/vgic/ and ARM64 KVM headers. All modified files and code paths are exclusive to the arm64 architecture and cannot be compiled or executed on the target architecture (amd64).",
"WorthFuzzing": false
} |
| 7/1 | 2026/09/22 06:12 | 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) |
|---|