| Seq | Timestamp | Type | Name | Duration |
|---|---|---|---|---|
| 0/0 | 2026/09/29 13:51 | flow | patch-triage |
5mArgs:null Results: {
"EnableConfigs": [
"VIRTIO_BLK",
"VIRTIO",
"VIRTIO_PCI",
"PM_SLEEP"
],
"FocusSymbols": [
"virtblk_freeze_priv",
"virtblk_reset_prepare",
"virtblk_freeze"
],
"KMSANReasoning": "The patch modifies virtblk_freeze_priv() in drivers/block/virtio_blk.c by changing blk_mq_quiesce_queue_nowait(q) to blk_mq_quiesce_queue(q). This ensures that the block request queue is properly quiesced and synchronized before the virtqueues are deleted and freed.\n\nThis change is strictly related to queue synchronization and device power management lifecycle to prevent race conditions and potential use-after-free issues during device freeze/suspend. It does not introduce, allocate, or modify any uninitialized stack or heap data, nor does it affect data copies to user space or conditional branching on uninitialized memory. Such concurrency and lifecycle issues are covered by standard bug detectors, KASAN, and LOCKDEP, not KMSAN.",
"NeedsKMSAN": false,
"Reasoning": "The patch modifies virtblk_freeze_priv() in drivers/block/virtio_blk.c, changing the quiesce call from blk_mq_quiesce_queue_nowait() to blk_mq_quiesce_queue() to ensure ongoing request dispatches have fully completed before resetting virtqueues. This affects reachable virtio block device reset and suspend/freeze paths in standard QEMU environments.",
"WorthFuzzing": true
} |
| 1/1 | 2026/09/29 13:51 | action | read-patch-diff |
0mArgs:null Results: {
"PatchDiff": "commit 01cbd6d9b82823dc0fd0f2f7eb96d39234630983\nAuthor: syz-cluster \u003ctriage@syzkaller.com\u003e\nDate: Tue Sep 29 13:51:51 2026 +0000\n\n syz-cluster: applied patch under review\n\ndiff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c\nindex 32bf3ba07a9dc..7a570591e040a 100644\n--- a/drivers/block/virtio_blk.c\n+++ b/drivers/block/virtio_blk.c\n@@ -1595,7 +1595,7 @@ static int virtblk_freeze_priv(struct virtio_device *vdev)\n \n \t/* Ensure no requests in virtqueues before deleting vqs. */\n \tmemflags = blk_mq_freeze_queue(q);\n-\tblk_mq_quiesce_queue_nowait(q);\n+\tblk_mq_quiesce_queue(q);\n \tblk_mq_unfreeze_queue(q, memflags);\n \n \t/* Ensure we don't receive any more interrupts */\n"
} |
| 2/1 | 2026/09/29 13:51 | agent | patch-evaluator |
4mModel:core Args: null Results: {
"EnableConfigs": [
"VIRTIO_BLK",
"VIRTIO",
"VIRTIO_PCI",
"PM_SLEEP"
],
"FocusSymbols": [
"virtblk_freeze_priv",
"virtblk_reset_prepare",
"virtblk_freeze"
],
"Reasoning": "The patch modifies virtblk_freeze_priv() in drivers/block/virtio_blk.c, changing the quiesce call from blk_mq_quiesce_queue_nowait() to blk_mq_quiesce_queue() to ensure ongoing request dispatches have fully completed before resetting virtqueues. This affects reachable virtio block device reset and suspend/freeze paths in standard QEMU environments.",
"WorthFuzzing": true
}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 01cbd6d9b82823dc0fd0f2f7eb96d39234630983
Author: syz-cluster <triage@syzkaller.com>
Date: Tue Sep 29 13:51:51 2026 +0000
syz-cluster: applied patch under review
diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
index 32bf3ba07a9dc..7a570591e040a 100644
--- a/drivers/block/virtio_blk.c
+++ b/drivers/block/virtio_blk.c
@@ -1595,7 +1595,7 @@ static int virtblk_freeze_priv(struct virtio_device *vdev)
/* Ensure no requests in virtqueues before deleting vqs. */
memflags = blk_mq_freeze_queue(q);
- blk_mq_quiesce_queue_nowait(q);
+ blk_mq_quiesce_queue(q);
blk_mq_unfreeze_queue(q, memflags);
/* Ensure we don't receive any more interrupts */
|
| 3/2 | 2026/09/29 13:51 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 2888 output: 39 thoughts: 280 Thoughts: **Analyzing the Virtio Block Driver Patch** Okay, let's dive into this patch. My immediate thought is to start with the `diff` itself. I see a change within `drivers/block/virtio_blk.c`. Specifically, line 1595, which involves a change from `blk_mq_quiesce_queue_nowait(q);` to `blk_mq_quiesce_queue(q);` within the `virtblk_freeze_priv` function. Hmm, `blk_mq_quiesce_queue` versus `blk_mq_quiesce_queue_nowait`... that's a key difference in how the queue is handled during a freeze operation. It looks like we are changing from an immediate, non-blocking quiesce to a blocking one. Now, I'll need to understand the implications of this change. I'll need to understand the context of this function; the surrounding code is important. I'm going to quickly reference the source around that line with a `read-file` or `grepper` command to get a better handle on things. I want to see what's happening *before* this call and *after* it, and I want to see *why* the quiesce is needed. I'm assuming this is related to ensuring no inflight requests during a virtual block device freeze, but I need to confirm this from the source. Is it safe to block? Are there any potential deadlocks? What is the intended behavior of the driver here? |
| 4/2 | 2026/09/29 13:52 | tool | read-file |
0mArgs:{
"File": "drivers/block/virtio_blk.c",
"FirstLine": 1580,
"LineCount": 50
}Results: {
"Contents": "1580:\t\tvblk-\u003evdev = NULL;\n1581:\t\n1582:\t\tvdev-\u003econfig-\u003edel_vqs(vdev);\n1583:\t\tkfree(vblk-\u003evqs);\n1584:\t\n1585:\t\tmutex_unlock(\u0026vblk-\u003evdev_mutex);\n1586:\t\n1587:\t\tput_disk(vblk-\u003edisk);\n1588:\t}\n1589:\t\n1590:\tstatic int virtblk_freeze_priv(struct virtio_device *vdev)\n1591:\t{\n1592:\t\tstruct virtio_blk *vblk = vdev-\u003epriv;\n1593:\t\tstruct request_queue *q = vblk-\u003edisk-\u003equeue;\n1594:\t\tunsigned int memflags;\n1595:\t\n1596:\t\t/* Ensure no requests in virtqueues before deleting vqs. */\n1597:\t\tmemflags = blk_mq_freeze_queue(q);\n1598:\t\tblk_mq_quiesce_queue(q);\n1599:\t\tblk_mq_unfreeze_queue(q, memflags);\n1600:\t\n1601:\t\t/* Ensure we don't receive any more interrupts */\n1602:\t\tvirtio_reset_device(vdev);\n1603:\t\n1604:\t\t/* Make sure no work handler is accessing the device. */\n1605:\t\tflush_work(\u0026vblk-\u003econfig_work);\n1606:\t\n1607:\t\tvdev-\u003econfig-\u003edel_vqs(vdev);\n1608:\t\tkfree(vblk-\u003evqs);\n1609:\t\t/*\n1610:\t\t * Set to NULL to prevent freeing vqs again after a failed vqs\n1611:\t\t * allocation during resume. Note that kfree() already handles NULL\n1612:\t\t * pointers safely.\n1613:\t\t */\n1614:\t\tvblk-\u003evqs = NULL;\n1615:\t\n1616:\t\treturn 0;\n1617:\t}\n1618:\t\n1619:\tstatic int virtblk_restore_priv(struct virtio_device *vdev)\n1620:\t{\n1621:\t\tstruct virtio_blk *vblk = vdev-\u003epriv;\n1622:\t\tint ret;\n1623:\t\n1624:\t\tret = init_vq(vdev-\u003epriv);\n1625:\t\tif (ret)\n1626:\t\t\treturn ret;\n1627:\t\n1628:\t\tvirtio_device_ready(vdev);\n1629:\t\tblk_mq_unquiesce_queue(vblk-\u003edisk-\u003equeue);\n"
} |
| 5/2 | 2026/09/29 13:52 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 4250 output: 39 thoughts: 37 Thoughts: Okay, here's my interpretation of that thought process, assuming I'm deep in the weeds of kernel driver debugging: **Tracing the Usage of `virtblk_freeze_priv`** Alright, I need to understand how `virtblk_freeze_priv` is actually being used within the virtio-blk driver. First, my instinct is to track its usage. Where is it being called? I need to understand the context, the call paths, and what code depends on it. A quick search should give me the entry points. Then I'll look directly at `drivers/block/virtio_blk.c` because that's the obvious place to find it. I'll read through the code in that file, starting at the definition of that function, and carefully look at the surrounding code to determine how it fits into the overall driver flow. Understanding the purpose of that function is the first step. |
| 6/2 | 2026/09/29 13:52 | tool | read-file |
0mArgs:{
"File": "drivers/block/virtio_blk.c",
"FirstLine": 1630,
"LineCount": 50
}Results: {
"Contents": "1630:\t\n1631:\t\treturn 0;\n1632:\t}\n1633:\t\n1634:\t#ifdef CONFIG_PM_SLEEP\n1635:\tstatic int virtblk_freeze(struct virtio_device *vdev)\n1636:\t{\n1637:\t\treturn virtblk_freeze_priv(vdev);\n1638:\t}\n1639:\t\n1640:\tstatic int virtblk_restore(struct virtio_device *vdev)\n1641:\t{\n1642:\t\treturn virtblk_restore_priv(vdev);\n1643:\t}\n1644:\t#endif\n1645:\t\n1646:\tstatic int virtblk_reset_prepare(struct virtio_device *vdev)\n1647:\t{\n1648:\t\treturn virtblk_freeze_priv(vdev);\n1649:\t}\n1650:\t\n1651:\tstatic int virtblk_reset_done(struct virtio_device *vdev)\n1652:\t{\n1653:\t\treturn virtblk_restore_priv(vdev);\n1654:\t}\n1655:\t\n1656:\tstatic const struct virtio_device_id id_table[] = {\n1657:\t\t{ VIRTIO_ID_BLOCK, VIRTIO_DEV_ANY_ID },\n1658:\t\t{ 0 },\n1659:\t};\n1660:\t\n1661:\tstatic unsigned int features_legacy[] = {\n1662:\t\tVIRTIO_BLK_F_SEG_MAX, VIRTIO_BLK_F_SIZE_MAX, VIRTIO_BLK_F_GEOMETRY,\n1663:\t\tVIRTIO_BLK_F_RO, VIRTIO_BLK_F_BLK_SIZE,\n1664:\t\tVIRTIO_BLK_F_FLUSH, VIRTIO_BLK_F_TOPOLOGY, VIRTIO_BLK_F_CONFIG_WCE,\n1665:\t\tVIRTIO_BLK_F_MQ, VIRTIO_BLK_F_DISCARD, VIRTIO_BLK_F_WRITE_ZEROES,\n1666:\t\tVIRTIO_BLK_F_SECURE_ERASE,\n1667:\t}\n1668:\t;\n1669:\tstatic unsigned int features[] = {\n1670:\t\tVIRTIO_BLK_F_SEG_MAX, VIRTIO_BLK_F_SIZE_MAX, VIRTIO_BLK_F_GEOMETRY,\n1671:\t\tVIRTIO_BLK_F_RO, VIRTIO_BLK_F_BLK_SIZE,\n1672:\t\tVIRTIO_BLK_F_FLUSH, VIRTIO_BLK_F_TOPOLOGY, VIRTIO_BLK_F_CONFIG_WCE,\n1673:\t\tVIRTIO_BLK_F_MQ, VIRTIO_BLK_F_DISCARD, VIRTIO_BLK_F_WRITE_ZEROES,\n1674:\t\tVIRTIO_BLK_F_SECURE_ERASE, VIRTIO_BLK_F_ZONED,\n1675:\t};\n1676:\t\n1677:\tstatic struct virtio_driver virtio_blk = {\n1678:\t\t.feature_table\t\t\t= features,\n1679:\t\t.feature_table_size\t\t= ARRAY_SIZE(features),\n"
} |
| 7/2 | 2026/09/29 13:52 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 5401 output: 39 thoughts: 16 Thoughts: Okay, let's dive into this. I need to get a better understanding of the `virtio_blk` structure. I've seen it mentioned, and I need to solidify my understanding of the details. I want to see the complete definition, so I can start making some meaningful comparisons with similar virtio drivers. From here, I can plan how best to use it in some code I'm working on. The goal is to fully understand how it works. |
| 8/2 | 2026/09/29 13:52 | tool | read-file |
0mArgs:{
"File": "drivers/block/virtio_blk.c",
"FirstLine": 1680,
"LineCount": 40
}Results: {
"Contents": "1680:\t\t.feature_table_legacy\t\t= features_legacy,\n1681:\t\t.feature_table_size_legacy\t= ARRAY_SIZE(features_legacy),\n1682:\t\t.driver.name\t\t\t= KBUILD_MODNAME,\n1683:\t\t.id_table\t\t\t= id_table,\n1684:\t\t.probe\t\t\t\t= virtblk_probe,\n1685:\t\t.remove\t\t\t\t= virtblk_remove,\n1686:\t\t.config_changed\t\t\t= virtblk_config_changed,\n1687:\t#ifdef CONFIG_PM_SLEEP\n1688:\t\t.freeze\t\t\t\t= virtblk_freeze,\n1689:\t\t.restore\t\t\t= virtblk_restore,\n1690:\t#endif\n1691:\t\t.reset_prepare\t\t\t= virtblk_reset_prepare,\n1692:\t\t.reset_done\t\t\t= virtblk_reset_done,\n1693:\t};\n1694:\t\n1695:\tstatic int __init virtio_blk_init(void)\n1696:\t{\n1697:\t\tint error;\n1698:\t\n1699:\t\tvirtblk_wq = alloc_workqueue(\"virtio-blk\", WQ_PERCPU, 0);\n1700:\t\tif (!virtblk_wq)\n1701:\t\t\treturn -ENOMEM;\n1702:\t\n1703:\t\tmajor = register_blkdev(0, \"virtblk\");\n1704:\t\tif (major \u003c 0) {\n1705:\t\t\terror = major;\n1706:\t\t\tgoto out_destroy_workqueue;\n1707:\t\t}\n1708:\t\n1709:\t\terror = register_virtio_driver(\u0026virtio_blk);\n1710:\t\tif (error)\n1711:\t\t\tgoto out_unregister_blkdev;\n1712:\t\treturn 0;\n1713:\t\n1714:\tout_unregister_blkdev:\n1715:\t\tunregister_blkdev(major, \"virtblk\");\n1716:\tout_destroy_workqueue:\n1717:\t\tdestroy_workqueue(virtblk_wq);\n1718:\t\treturn error;\n1719:\t}\n"
} |
| 9/2 | 2026/09/29 13:52 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 6141 output: 17 thoughts: 90 Thoughts: Here's my thought process, as requested: **Deconstructing `virtblk_freeze_priv` Calls** Okay, so I'm looking at `virtblk_freeze_priv`, and it seems like it's a key function in the virtblk driver. I see that it's called from two distinct places: `virtblk_freeze`, which is directly related to power management and system sleep states, specifically handling the freezing or suspension process, and also from `virtblk_reset_prepare`. Hmm, `reset_prepare`... that's interesting. I know that usually indicates some sort of device reset preparation. But I need to contextualize this better. I'm trying to visualize the virtio driver lifecycle here. Now, my immediate thought is *when* are `freeze` and `reset_prepare` actually called within the virtio framework? That's the crucial missing piece. I need to understand the sequencing and triggering mechanisms of these functions to truly grasp the implications of `virtblk_freeze_priv`. Time to get digging into the kernel source, specifically looking for uses of `reset_prepare` more generally. Let's see if that provides more context in the virtio driver. |
| 10/2 | 2026/09/29 13:52 | tool | grepper |
0mArgs:{
"Expression": "reset_prepare"
}Results: {
"Output": "\nFull output is too long, showing 500 out of 953 lines.\nUse more precise expression if possible.\n\ndrivers/accel/habanalabs/common/habanalabs_drv.c=668=static pci_ers_result_t hl_pci_err_slot_reset(struct pci_dev *pdev)\n--\ndrivers/accel/habanalabs/common/habanalabs_drv.c-676-\ndrivers/accel/habanalabs/common/habanalabs_drv.c:677:static void hl_pci_reset_prepare(struct pci_dev *pdev)\ndrivers/accel/habanalabs/common/habanalabs_drv.c-678-{\n--\ndrivers/accel/habanalabs/common/habanalabs_drv.c=714=static const struct pci_error_handlers hl_pci_err_handler = {\n--\ndrivers/accel/habanalabs/common/habanalabs_drv.c-717-\t.resume = hl_pci_err_resume,\ndrivers/accel/habanalabs/common/habanalabs_drv.c:718:\t.reset_prepare = hl_pci_reset_prepare,\ndrivers/accel/habanalabs/common/habanalabs_drv.c-719-\t.reset_done = hl_pci_reset_done,\n--\ndrivers/accel/ivpu/ivpu_drv.c=892=static const struct pci_error_handlers ivpu_drv_pci_err = {\ndrivers/accel/ivpu/ivpu_drv.c:893:\t.reset_prepare = ivpu_pm_reset_prepare_cb,\ndrivers/accel/ivpu/ivpu_drv.c-894-\t.reset_done = ivpu_pm_reset_done_cb,\n--\ndrivers/accel/ivpu/ivpu_pm.c=372=void ivpu_rpm_put(struct ivpu_device *vdev)\n--\ndrivers/accel/ivpu/ivpu_pm.c-376-\ndrivers/accel/ivpu/ivpu_pm.c:377:void ivpu_pm_reset_prepare_cb(struct pci_dev *pdev)\ndrivers/accel/ivpu/ivpu_pm.c-378-{\n--\ndrivers/accel/ivpu/ivpu_pm.h=33=int ivpu_pm_runtime_resume_cb(struct device *dev);\ndrivers/accel/ivpu/ivpu_pm.h-34-\ndrivers/accel/ivpu/ivpu_pm.h:35:void ivpu_pm_reset_prepare_cb(struct pci_dev *pdev);\ndrivers/accel/ivpu/ivpu_pm.h-36-void ivpu_pm_reset_done_cb(struct pci_dev *pdev);\n--\ndrivers/accel/qaic/qaic_drv.c=627=static pci_ers_result_t qaic_pci_error_detected(struct pci_dev *pdev, pci_channel_state_t error)\n--\ndrivers/accel/qaic/qaic_drv.c-631-\ndrivers/accel/qaic/qaic_drv.c:632:static void qaic_pci_reset_prepare(struct pci_dev *pdev)\ndrivers/accel/qaic/qaic_drv.c-633-{\n--\ndrivers/accel/qaic/qaic_drv.c=672=static const struct pci_error_handlers qaic_pci_err_handler = {\ndrivers/accel/qaic/qaic_drv.c-673-\t.error_detected = qaic_pci_error_detected,\ndrivers/accel/qaic/qaic_drv.c:674:\t.reset_prepare = qaic_pci_reset_prepare,\ndrivers/accel/qaic/qaic_drv.c-675-\t.reset_done = qaic_pci_reset_done,\n--\ndrivers/accel/qaic/qaic_drv.c=721=static int qaic_pm_suspend(struct device *dev)\n--\ndrivers/accel/qaic/qaic_drv.c-734-\tqaic_mqts_ch_stop_timer(qdev-\u003emqts_ch);\ndrivers/accel/qaic/qaic_drv.c:735:\tqaic_pci_reset_prepare(qdev-\u003epdev);\ndrivers/accel/qaic/qaic_drv.c-736-\tpci_save_state(qdev-\u003epdev);\n--\ndrivers/block/virtio_blk.c=1640=static int virtblk_restore(struct virtio_device *vdev)\n--\ndrivers/block/virtio_blk.c-1645-\ndrivers/block/virtio_blk.c:1646:static int virtblk_reset_prepare(struct virtio_device *vdev)\ndrivers/block/virtio_blk.c-1647-{\n--\ndrivers/block/virtio_blk.c=1677=static struct virtio_driver virtio_blk = {\n--\ndrivers/block/virtio_blk.c-1690-#endif\ndrivers/block/virtio_blk.c:1691:\t.reset_prepare\t\t\t= virtblk_reset_prepare,\ndrivers/block/virtio_blk.c-1692-\t.reset_done\t\t\t= virtblk_reset_done,\n--\ndrivers/bus/mhi/host/pci_generic.c=1509=static void mhi_pci_shutdown(struct pci_dev *pdev)\n--\ndrivers/bus/mhi/host/pci_generic.c-1514-\ndrivers/bus/mhi/host/pci_generic.c:1515:static void mhi_pci_reset_prepare(struct pci_dev *pdev)\ndrivers/bus/mhi/host/pci_generic.c-1516-{\n--\ndrivers/bus/mhi/host/pci_generic.c=1616=static const struct pci_error_handlers mhi_pci_err_handler = {\n--\ndrivers/bus/mhi/host/pci_generic.c-1619-\t.resume = mhi_pci_io_resume,\ndrivers/bus/mhi/host/pci_generic.c:1620:\t.reset_prepare = mhi_pci_reset_prepare,\ndrivers/bus/mhi/host/pci_generic.c-1621-\t.reset_done = mhi_pci_reset_done,\n--\ndrivers/cdx/cdx.c=95=int cdx_dev_reset(struct device *dev)\n--\ndrivers/cdx/cdx.c-104-\t/* Notify driver that device is being reset */\ndrivers/cdx/cdx.c:105:\tif (cdx_drv \u0026\u0026 cdx_drv-\u003ereset_prepare)\ndrivers/cdx/cdx.c:106:\t\tcdx_drv-\u003ereset_prepare(cdx_dev);\ndrivers/cdx/cdx.c-107-\n--\ndrivers/crypto/hisilicon/hpre/hpre_main.c=1688=static const struct pci_error_handlers hpre_err_handler = {\n--\ndrivers/crypto/hisilicon/hpre/hpre_main.c-1690-\t.slot_reset\t\t= hisi_qm_dev_slot_reset,\ndrivers/crypto/hisilicon/hpre/hpre_main.c:1691:\t.reset_prepare\t\t= hisi_qm_reset_prepare,\ndrivers/crypto/hisilicon/hpre/hpre_main.c-1692-\t.reset_done\t\t= hisi_qm_reset_done,\n--\ndrivers/crypto/hisilicon/qm.c=597=static void qm_dev_db_ctrl(struct hisi_qm *qm, bool enable)\n--\ndrivers/crypto/hisilicon/qm.c-607-\ndrivers/crypto/hisilicon/qm.c:608:static int qm_reset_prepare_ready(struct hisi_qm *qm)\ndrivers/crypto/hisilicon/qm.c-609-{\n--\ndrivers/crypto/hisilicon/qm.c=1196=static void qm_reset_function(struct hisi_qm *qm)\n--\ndrivers/crypto/hisilicon/qm.c-1203-\ndrivers/crypto/hisilicon/qm.c:1204:\tret = qm_reset_prepare_ready(qm);\ndrivers/crypto/hisilicon/qm.c-1205-\tif (ret) {\n--\ndrivers/crypto/hisilicon/qm.c=4525=static void qm_dev_ecc_mbit_handle(struct hisi_qm *qm)\n--\ndrivers/crypto/hisilicon/qm.c-4546-\ndrivers/crypto/hisilicon/qm.c:4547:static int qm_vf_reset_prepare(struct hisi_qm *qm,\ndrivers/crypto/hisilicon/qm.c-4548-\t\t\t enum qm_stop_reason stop_reason)\n--\ndrivers/crypto/hisilicon/qm.c=4577=static int qm_try_stop_vfs(struct hisi_qm *qm, enum qm_ifc_cmd cmd,\n--\ndrivers/crypto/hisilicon/qm.c-4591-\t} else {\ndrivers/crypto/hisilicon/qm.c:4592:\t\tret = qm_vf_reset_prepare(qm, stop_reason);\ndrivers/crypto/hisilicon/qm.c-4593-\t\tif (ret)\n--\ndrivers/crypto/hisilicon/qm.c-4599-\ndrivers/crypto/hisilicon/qm.c:4600:static int qm_controller_reset_prepare(struct hisi_qm *qm)\ndrivers/crypto/hisilicon/qm.c-4601-{\n--\ndrivers/crypto/hisilicon/qm.c-4610-\ndrivers/crypto/hisilicon/qm.c:4611:\tret = qm_reset_prepare_ready(qm);\ndrivers/crypto/hisilicon/qm.c-4612-\tif (ret) {\n--\ndrivers/crypto/hisilicon/qm.c=4649=static int qm_master_ooo_check(struct hisi_qm *qm)\n--\ndrivers/crypto/hisilicon/qm.c-4664-\ndrivers/crypto/hisilicon/qm.c:4665:static int qm_soft_reset_prepare(struct hisi_qm *qm)\ndrivers/crypto/hisilicon/qm.c-4666-{\n--\ndrivers/crypto/hisilicon/qm.c=4732=static int qm_soft_reset(struct hisi_qm *qm)\n--\ndrivers/crypto/hisilicon/qm.c-4735-\ndrivers/crypto/hisilicon/qm.c:4736:\tret = qm_soft_reset_prepare(qm);\ndrivers/crypto/hisilicon/qm.c-4737-\tif (ret)\n--\ndrivers/crypto/hisilicon/qm.c=4952=static int qm_controller_reset(struct hisi_qm *qm)\n--\ndrivers/crypto/hisilicon/qm.c-4958-\ndrivers/crypto/hisilicon/qm.c:4959:\tret = qm_controller_reset_prepare(qm);\ndrivers/crypto/hisilicon/qm.c-4960-\tif (ret) {\n--\ndrivers/crypto/hisilicon/qm.c=5016=EXPORT_SYMBOL_GPL(hisi_qm_dev_slot_reset);\ndrivers/crypto/hisilicon/qm.c-5017-\ndrivers/crypto/hisilicon/qm.c:5018:void hisi_qm_reset_prepare(struct pci_dev *pdev)\ndrivers/crypto/hisilicon/qm.c-5019-{\n--\ndrivers/crypto/hisilicon/qm.c-5034-\ndrivers/crypto/hisilicon/qm.c:5035:\tret = qm_reset_prepare_ready(qm);\ndrivers/crypto/hisilicon/qm.c-5036-\tif (ret) {\n--\ndrivers/crypto/hisilicon/qm.c-5073-}\ndrivers/crypto/hisilicon/qm.c:5074:EXPORT_SYMBOL_GPL(hisi_qm_reset_prepare);\ndrivers/crypto/hisilicon/qm.c-5075-\n--\ndrivers/crypto/hisilicon/qm.c=5236=static void qm_pf_reset_vf_prepare(struct hisi_qm *qm,\n--\ndrivers/crypto/hisilicon/qm.c-5242-\ndrivers/crypto/hisilicon/qm.c:5243:\tret = qm_reset_prepare_ready(qm);\ndrivers/crypto/hisilicon/qm.c-5244-\tif (ret) {\n--\ndrivers/crypto/hisilicon/sec2/sec_main.c=1506=static const struct pci_error_handlers sec_err_handler = {\n--\ndrivers/crypto/hisilicon/sec2/sec_main.c-1508-\t.slot_reset\t= hisi_qm_dev_slot_reset,\ndrivers/crypto/hisilicon/sec2/sec_main.c:1509:\t.reset_prepare\t= hisi_qm_reset_prepare,\ndrivers/crypto/hisilicon/sec2/sec_main.c-1510-\t.reset_done\t= hisi_qm_reset_done,\n--\ndrivers/crypto/hisilicon/zip/zip_main.c=1615=static const struct pci_error_handlers hisi_zip_err_handler = {\n--\ndrivers/crypto/hisilicon/zip/zip_main.c-1617-\t.slot_reset\t= hisi_qm_dev_slot_reset,\ndrivers/crypto/hisilicon/zip/zip_main.c:1618:\t.reset_prepare\t= hisi_qm_reset_prepare,\ndrivers/crypto/hisilicon/zip/zip_main.c-1619-\t.reset_done\t= hisi_qm_reset_done,\n--\ndrivers/crypto/intel/qat/qat_common/adf_aer.c=18=static struct workqueue_struct *device_sriov_wq;\ndrivers/crypto/intel/qat/qat_common/adf_aer.c-19-\ndrivers/crypto/intel/qat/qat_common/adf_aer.c:20:static pci_ers_result_t reset_prepare(struct pci_dev *pdev)\ndrivers/crypto/intel/qat/qat_common/adf_aer.c-21-{\n--\ndrivers/crypto/intel/qat/qat_common/adf_aer.c=72=static pci_ers_result_t adf_error_detected(struct pci_dev *pdev,\n--\ndrivers/crypto/intel/qat/qat_common/adf_aer.c-90-\ndrivers/crypto/intel/qat/qat_common/adf_aer.c:91:\treturn reset_prepare(pdev);\ndrivers/crypto/intel/qat/qat_common/adf_aer.c-92-}\n--\ndrivers/crypto/intel/qat/qat_common/adf_aer.c=249=static void adf_resume(struct pci_dev *pdev)\n--\ndrivers/crypto/intel/qat/qat_common/adf_aer.c-254-\ndrivers/crypto/intel/qat/qat_common/adf_aer.c:255:static void adf_reset_prepare(struct pci_dev *pdev)\ndrivers/crypto/intel/qat/qat_common/adf_aer.c-256-{\ndrivers/crypto/intel/qat/qat_common/adf_aer.c:257:\treset_prepare(pdev);\ndrivers/crypto/intel/qat/qat_common/adf_aer.c-258-}\n--\ndrivers/crypto/intel/qat/qat_common/adf_aer.c=265=const struct pci_error_handlers adf_err_handler = {\n--\ndrivers/crypto/intel/qat/qat_common/adf_aer.c-268-\t.resume = adf_resume,\ndrivers/crypto/intel/qat/qat_common/adf_aer.c:269:\t.reset_prepare = adf_reset_prepare,\ndrivers/crypto/intel/qat/qat_common/adf_aer.c-270-\t.reset_done = adf_reset_done,\n--\ndrivers/dma/idxd/init.c=942=static void idxd_device_config_restore(struct idxd_device *idxd,\n--\ndrivers/dma/idxd/init.c-1020-\ndrivers/dma/idxd/init.c:1021:static void idxd_reset_prepare(struct pci_dev *pdev)\ndrivers/dma/idxd/init.c-1022-{\n--\ndrivers/dma/idxd/init.c=1126=static const struct pci_error_handlers idxd_error_handler = {\ndrivers/dma/idxd/init.c:1127:\t.reset_prepare\t= idxd_reset_prepare,\ndrivers/dma/idxd/init.c-1128-\t.reset_done\t= idxd_reset_done,\n--\ndrivers/gpu/drm/amd/amdgpu/amdgpu_device.c=5028=int amdgpu_device_pre_asic_reset(struct amdgpu_device *adev,\n--\ndrivers/gpu/drm/amd/amdgpu/amdgpu_device.c-5086-\ndrivers/gpu/drm/amd/amdgpu/amdgpu_device.c:5087:\tr = amdgpu_reset_prepare_hwcontext(adev, reset_context);\ndrivers/gpu/drm/amd/amdgpu/amdgpu_device.c-5088-\t/* If reset handler not implemented, continue; otherwise return */\n--\ndrivers/gpu/drm/amd/amdgpu/amdgpu_reset.c=148=int amdgpu_reset_do_xgmi_reset_on_init(\n--\ndrivers/gpu/drm/amd/amdgpu/amdgpu_reset.c-160-\t\t\t\treset_list);\ndrivers/gpu/drm/amd/amdgpu/amdgpu_reset.c:161:\tr = amdgpu_reset_prepare_hwcontext(adev, reset_context);\ndrivers/gpu/drm/amd/amdgpu/amdgpu_reset.c-162-\tif (r)\n--\ndrivers/gpu/drm/amd/amdgpu/amdgpu_reset.c=204=int amdgpu_reset_fini(struct amdgpu_device *adev)\n--\ndrivers/gpu/drm/amd/amdgpu/amdgpu_reset.c-227-\ndrivers/gpu/drm/amd/amdgpu/amdgpu_reset.c:228:int amdgpu_reset_prepare_hwcontext(struct amdgpu_device *adev,\ndrivers/gpu/drm/amd/amdgpu/amdgpu_reset.c-229-\t\t\t\t struct amdgpu_reset_context *reset_context)\n--\ndrivers/gpu/drm/amd/amdgpu/amdgpu_reset.h=146=int amdgpu_reset_fini(struct amdgpu_device *adev);\ndrivers/gpu/drm/amd/amdgpu/amdgpu_reset.h-147-\ndrivers/gpu/drm/amd/amdgpu/amdgpu_reset.h:148:int amdgpu_reset_prepare_hwcontext(struct amdgpu_device *adev,\ndrivers/gpu/drm/amd/amdgpu/amdgpu_reset.h-149-\t\t\t\t struct amdgpu_reset_context *reset_context);\n--\ndrivers/gpu/drm/amd/amdgpu/amdgpu_reset.h=151=int amdgpu_reset_perform_reset(struct amdgpu_device *adev,\n--\ndrivers/gpu/drm/amd/amdgpu/amdgpu_reset.h-153-\ndrivers/gpu/drm/amd/amdgpu/amdgpu_reset.h:154:int amdgpu_reset_prepare_env(struct amdgpu_device *adev,\ndrivers/gpu/drm/amd/amdgpu/amdgpu_reset.h-155-\t\t\t struct amdgpu_reset_context *reset_context);\n--\ndrivers/gpu/drm/i915/display/intel_display_reset.c=26=bool intel_display_reset_test(struct intel_display *display)\n--\ndrivers/gpu/drm/i915/display/intel_display_reset.c-31-\ndrivers/gpu/drm/i915/display/intel_display_reset.c:32:void intel_display_reset_prepare(struct intel_display *display)\ndrivers/gpu/drm/i915/display/intel_display_reset.c-33-{\n--\ndrivers/gpu/drm/i915/display/intel_display_reset.h=14=bool intel_display_reset_test(struct intel_display *display);\ndrivers/gpu/drm/i915/display/intel_display_reset.h:15:void intel_display_reset_prepare(struct intel_display *display);\ndrivers/gpu/drm/i915/display/intel_display_reset.h-16-void intel_display_reset_finish(struct intel_display *display, bool test_only);\n--\ndrivers/gpu/drm/i915/gt/intel_execlists_submission.c=2952=static int execlists_resume(struct intel_engine_cs *engine)\n--\ndrivers/gpu/drm/i915/gt/intel_execlists_submission.c-2964-\ndrivers/gpu/drm/i915/gt/intel_execlists_submission.c:2965:static void execlists_reset_prepare(struct intel_engine_cs *engine)\ndrivers/gpu/drm/i915/gt/intel_execlists_submission.c-2966-{\n--\ndrivers/gpu/drm/i915/gt/intel_execlists_submission.c=3427=logical_ring_default_vfuncs(struct intel_engine_cs *engine)\n--\ndrivers/gpu/drm/i915/gt/intel_execlists_submission.c-3437-\ndrivers/gpu/drm/i915/gt/intel_execlists_submission.c:3438:\tengine-\u003ereset.prepare = execlists_reset_prepare;\ndrivers/gpu/drm/i915/gt/intel_execlists_submission.c-3439-\tengine-\u003ereset.rewind = execlists_reset_rewind;\n--\ndrivers/gpu/drm/i915/gt/intel_gt_pm.c=169=static void gt_sanitize(struct intel_gt *gt, bool force)\n--\ndrivers/gpu/drm/i915/gt/intel_gt_pm.c-192-\t/* For GuC mode, ensure submission is disabled before stopping ring */\ndrivers/gpu/drm/i915/gt/intel_gt_pm.c:193:\tintel_uc_reset_prepare(\u0026gt-\u003euc);\ndrivers/gpu/drm/i915/gt/intel_gt_pm.c-194-\n--\ndrivers/gpu/drm/i915/gt/intel_reset.c=521=static int __gen11_reset_engines(struct intel_gt *gt,\n--\ndrivers/gpu/drm/i915/gt/intel_reset.c-561-\ndrivers/gpu/drm/i915/gt/intel_reset.c:562:static int gen8_engine_reset_prepare(struct intel_engine_cs *engine)\ndrivers/gpu/drm/i915/gt/intel_reset.c-563-{\n--\ndrivers/gpu/drm/i915/gt/intel_reset.c=610=static int gen8_reset_engines(struct intel_gt *gt,\n--\ndrivers/gpu/drm/i915/gt/intel_reset.c-622-\tfor_each_engine_masked(engine, gt, engine_mask, tmp) {\ndrivers/gpu/drm/i915/gt/intel_reset.c:623:\t\tret = gen8_engine_reset_prepare(engine);\ndrivers/gpu/drm/i915/gt/intel_reset.c-624-\t\tif (ret \u0026\u0026 !reset_non_ready)\n--\ndrivers/gpu/drm/i915/gt/intel_reset.c=813=int intel_reset_guc(struct intel_gt *gt)\n--\ndrivers/gpu/drm/i915/gt/intel_reset.c-829- */\ndrivers/gpu/drm/i915/gt/intel_reset.c:830:static void reset_prepare_engine(struct intel_engine_cs *engine)\ndrivers/gpu/drm/i915/gt/intel_reset.c-831-{\n--\ndrivers/gpu/drm/i915/gt/intel_reset.c=844=static void revoke_mmaps(struct intel_gt *gt)\n--\ndrivers/gpu/drm/i915/gt/intel_reset.c-874-\ndrivers/gpu/drm/i915/gt/intel_reset.c:875:static intel_engine_mask_t reset_prepare(struct intel_gt *gt)\ndrivers/gpu/drm/i915/gt/intel_reset.c-876-{\n--\ndrivers/gpu/drm/i915/gt/intel_reset.c-885-\t * For GuC mode with submission disabled, ensure that GuC is not\ndrivers/gpu/drm/i915/gt/intel_reset.c:886:\t * sanitized, do that after engine reset. reset_prepare()\ndrivers/gpu/drm/i915/gt/intel_reset.c-887-\t * is followed by engine reset which in this mode requires GuC to\n--\ndrivers/gpu/drm/i915/gt/intel_reset.c-890-\tif (intel_uc_uses_guc_submission(\u0026gt-\u003euc))\ndrivers/gpu/drm/i915/gt/intel_reset.c:891:\t\tintel_uc_reset_prepare(\u0026gt-\u003euc);\ndrivers/gpu/drm/i915/gt/intel_reset.c-892-\n--\ndrivers/gpu/drm/i915/gt/intel_reset.c-895-\t\t\tawake |= engine-\u003emask;\ndrivers/gpu/drm/i915/gt/intel_reset.c:896:\t\treset_prepare_engine(engine);\ndrivers/gpu/drm/i915/gt/intel_reset.c-897-\t}\n--\ndrivers/gpu/drm/i915/gt/intel_reset.c=969=static void __intel_gt_set_wedged(struct intel_gt *gt)\n--\ndrivers/gpu/drm/i915/gt/intel_reset.c-985-\t */\ndrivers/gpu/drm/i915/gt/intel_reset.c:986:\tawake = reset_prepare(gt);\ndrivers/gpu/drm/i915/gt/intel_reset.c-987-\n--\ndrivers/gpu/drm/i915/gt/intel_reset.c=1205=void intel_gt_reset(struct intel_gt *gt,\n--\ndrivers/gpu/drm/i915/gt/intel_reset.c-1233-\ndrivers/gpu/drm/i915/gt/intel_reset.c:1234:\tawake = reset_prepare(gt);\ndrivers/gpu/drm/i915/gt/intel_reset.c-1235-\n--\ndrivers/gpu/drm/i915/gt/intel_reset.c-1258-\tif (!intel_uc_uses_guc_submission(\u0026gt-\u003euc))\ndrivers/gpu/drm/i915/gt/intel_reset.c:1259:\t\tintel_uc_reset_prepare(\u0026gt-\u003euc);\ndrivers/gpu/drm/i915/gt/intel_reset.c-1260-\t/*\n--\ndrivers/gpu/drm/i915/gt/intel_reset.c=1331=int __intel_engine_reset_bh(struct intel_engine_cs *engine, const char *msg)\n--\ndrivers/gpu/drm/i915/gt/intel_reset.c-1344-\ndrivers/gpu/drm/i915/gt/intel_reset.c:1345:\treset_prepare_engine(engine);\ndrivers/gpu/drm/i915/gt/intel_reset.c-1346-\n--\ndrivers/gpu/drm/i915/gt/intel_reset.c=1404=static void intel_gt_reset_global(struct intel_gt *gt,\n--\ndrivers/gpu/drm/i915/gt/intel_reset.c-1442-\ndrivers/gpu/drm/i915/gt/intel_reset.c:1443:\t\t\tintel_display_reset_prepare(display);\ndrivers/gpu/drm/i915/gt/intel_reset.c-1444-\t\t}\n--\ndrivers/gpu/drm/i915/gt/intel_ring_submission.c=314=static void xcs_sanitize(struct intel_engine_cs *engine)\n--\ndrivers/gpu/drm/i915/gt/intel_ring_submission.c-340-\ndrivers/gpu/drm/i915/gt/intel_ring_submission.c:341:static void reset_prepare(struct intel_engine_cs *engine)\ndrivers/gpu/drm/i915/gt/intel_ring_submission.c-342-{\n--\ndrivers/gpu/drm/i915/gt/intel_ring_submission.c=1154=static void setup_common(struct intel_engine_cs *engine)\n--\ndrivers/gpu/drm/i915/gt/intel_ring_submission.c-1165-\ndrivers/gpu/drm/i915/gt/intel_ring_submission.c:1166:\tengine-\u003ereset.prepare = reset_prepare;\ndrivers/gpu/drm/i915/gt/intel_ring_submission.c-1167-\tengine-\u003ereset.rewind = reset_rewind;\n--\ndrivers/gpu/drm/i915/gt/mock_engine.c=262=static void mock_remove_from_engine(struct i915_request *rq)\n--\ndrivers/gpu/drm/i915/gt/mock_engine.c-283-\ndrivers/gpu/drm/i915/gt/mock_engine.c:284:static void mock_reset_prepare(struct intel_engine_cs *engine)\ndrivers/gpu/drm/i915/gt/mock_engine.c-285-{\n--\ndrivers/gpu/drm/i915/gt/mock_engine.c=341=struct intel_engine_cs *mock_engine(struct drm_i915_private *i915,\n--\ndrivers/gpu/drm/i915/gt/mock_engine.c-372-\ndrivers/gpu/drm/i915/gt/mock_engine.c:373:\tengine-\u003ebase.reset.prepare = mock_reset_prepare;\ndrivers/gpu/drm/i915/gt/mock_engine.c-374-\tengine-\u003ebase.reset.rewind = mock_reset_rewind;\n--\ndrivers/gpu/drm/i915/gt/selftest_reset.c=260=static int igt_atomic_reset(void *arg)\n--\ndrivers/gpu/drm/i915/gt/selftest_reset.c-280-\ndrivers/gpu/drm/i915/gt/selftest_reset.c:281:\t\tawake = reset_prepare(gt);\ndrivers/gpu/drm/i915/gt/selftest_reset.c-282-\t\tp-\u003ecritical_section_begin();\n--\ndrivers/gpu/drm/i915/gt/uc/intel_guc.h=533=void intel_guc_context_ban(struct intel_context *ce, struct i915_request *rq);\ndrivers/gpu/drm/i915/gt/uc/intel_guc.h-534-\ndrivers/gpu/drm/i915/gt/uc/intel_guc.h:535:void intel_guc_submission_reset_prepare(struct intel_guc *guc);\ndrivers/gpu/drm/i915/gt/uc/intel_guc.h-536-void intel_guc_submission_reset(struct intel_guc *guc, intel_engine_mask_t stalled);\n--\ndrivers/gpu/drm/i915/gt/uc/intel_guc_submission.c=1077=static void scrub_guc_desc_for_outstanding_g2h(struct intel_guc *guc)\n--\ndrivers/gpu/drm/i915/gt/uc/intel_guc_submission.c-1104-\t\t * to be visible to all callers who set the below flags (see above\ndrivers/gpu/drm/i915/gt/uc/intel_guc_submission.c:1105:\t\t * flush and flushes in reset_prepare). If submission_disabled()\ndrivers/gpu/drm/i915/gt/uc/intel_guc_submission.c-1106-\t\t * is set, the caller shouldn't set these flags.\n--\ndrivers/gpu/drm/i915/gt/uc/intel_guc_submission.c=1391=static void guc_cancel_busyness_worker(struct intel_guc *guc)\n--\ndrivers/gpu/drm/i915/gt/uc/intel_guc_submission.c-1425-\t * And note that in the case of a reset occurring during driver unload\ndrivers/gpu/drm/i915/gt/uc/intel_guc_submission.c:1426:\t * (wedged_on_fini), skipping the cancel in reset_prepare/reset_fini (when the\ndrivers/gpu/drm/i915/gt/uc/intel_guc_submission.c-1427-\t * reset flag/mutex are set) is fine because there is another explicit cancel in\n--\ndrivers/gpu/drm/i915/gt/uc/intel_guc_submission.c=1723=static void guc_flush_destroyed_contexts(struct intel_guc *guc);\ndrivers/gpu/drm/i915/gt/uc/intel_guc_submission.c-1724-\ndrivers/gpu/drm/i915/gt/uc/intel_guc_submission.c:1725:void intel_guc_submission_reset_prepare(struct intel_guc *guc)\ndrivers/gpu/drm/i915/gt/uc/intel_guc_submission.c-1726-{\n--\ndrivers/gpu/drm/i915/gt/uc/intel_guc_submission.c=1777=static void guc_reset_state(struct intel_context *ce, u32 head, bool scrub)\n--\ndrivers/gpu/drm/i915/gt/uc/intel_guc_submission.c-1800-\ndrivers/gpu/drm/i915/gt/uc/intel_guc_submission.c:1801:static void guc_engine_reset_prepare(struct intel_engine_cs *engine)\ndrivers/gpu/drm/i915/gt/uc/intel_guc_submission.c-1802-{\n--\ndrivers/gpu/drm/i915/gt/uc/intel_guc_submission.c=4536=static void guc_default_vfuncs(struct intel_engine_cs *engine)\n--\ndrivers/gpu/drm/i915/gt/uc/intel_guc_submission.c-4548-\ndrivers/gpu/drm/i915/gt/uc/intel_guc_submission.c:4549:\tengine-\u003ereset.prepare = guc_engine_reset_prepare;\ndrivers/gpu/drm/i915/gt/uc/intel_guc_submission.c-4550-\tengine-\u003ereset.rewind = guc_rewind_nop;\n--\ndrivers/gpu/drm/i915/gt/uc/intel_uc.c=569=static void __uc_fini_hw(struct intel_uc *uc)\n--\ndrivers/gpu/drm/i915/gt/uc/intel_uc.c-582-/**\ndrivers/gpu/drm/i915/gt/uc/intel_uc.c:583: * intel_uc_reset_prepare - Prepare for reset\ndrivers/gpu/drm/i915/gt/uc/intel_uc.c-584- * @uc: the intel_uc structure\n--\ndrivers/gpu/drm/i915/gt/uc/intel_uc.c-587- */\ndrivers/gpu/drm/i915/gt/uc/intel_uc.c:588:void intel_uc_reset_prepare(struct intel_uc *uc)\ndrivers/gpu/drm/i915/gt/uc/intel_uc.c-589-{\n--\ndrivers/gpu/drm/i915/gt/uc/intel_uc.c-602-\tif (intel_uc_uses_guc_submission(uc))\ndrivers/gpu/drm/i915/gt/uc/intel_uc.c:603:\t\tintel_guc_submission_reset_prepare(guc);\ndrivers/gpu/drm/i915/gt/uc/intel_uc.c-604-\n--\ndrivers/gpu/drm/i915/gt/uc/intel_uc.h=47=void intel_uc_init_mmio(struct intel_uc *uc);\ndrivers/gpu/drm/i915/gt/uc/intel_uc.h:48:void intel_uc_reset_prepare(struct intel_uc *uc);\ndrivers/gpu/drm/i915/gt/uc/intel_uc.h-49-void intel_uc_reset(struct intel_uc *uc, intel_engine_mask_t stalled);\n--\ndrivers/gpu/drm/xe/xe_gt.c=982=void xe_gt_reset_async(struct xe_gt *gt)\n--\ndrivers/gpu/drm/xe/xe_gt.c-989-\t/* Don't do a reset while one is already in flight */\ndrivers/gpu/drm/xe/xe_gt.c:990:\tif (!xe_fault_gt_reset() \u0026\u0026 xe_uc_reset_prepare(\u0026gt-\u003euc))\ndrivers/gpu/drm/xe/xe_gt.c-991-\t\treturn;\n--\ndrivers/gpu/drm/xe/xe_guc.c=1703=void xe_guc_sanitize(struct xe_guc *guc)\n--\ndrivers/gpu/drm/xe/xe_guc.c-1709-\ndrivers/gpu/drm/xe/xe_guc.c:1710:int xe_guc_reset_prepare(struct xe_guc *guc)\ndrivers/gpu/drm/xe/xe_guc.c-1711-{\ndrivers/gpu/drm/xe/xe_guc.c:1712:\treturn xe_guc_submit_reset_prepare(guc);\ndrivers/gpu/drm/xe/xe_guc.c-1713-}\n--\ndrivers/gpu/drm/xe/xe_guc.c=1820=void xe_guc_declare_wedged(struct xe_guc *guc)\n--\ndrivers/gpu/drm/xe/xe_guc.c-1823-\ndrivers/gpu/drm/xe/xe_guc.c:1824:\txe_guc_reset_prepare(guc);\ndrivers/gpu/drm/xe/xe_guc.c-1825-\txe_guc_ct_stop(\u0026guc-\u003ect);\n--\ndrivers/gpu/drm/xe/xe_guc.h=57=int xe_guc_print_info(struct xe_guc *guc, struct drm_printer *p);\ndrivers/gpu/drm/xe/xe_guc.h:58:int xe_guc_reset_prepare(struct xe_guc *guc);\ndrivers/gpu/drm/xe/xe_guc.h-59-void xe_guc_reset_wait(struct xe_guc *guc);\n--\ndrivers/gpu/drm/xe/xe_guc_submit.c-51-\ndrivers/gpu/drm/xe/xe_guc_submit.c:52:static int guc_submit_reset_prepare(struct xe_guc *guc);\ndrivers/gpu/drm/xe/xe_guc_submit.c-53-\n--\ndrivers/gpu/drm/xe/xe_guc_submit.c=244=static void guc_submit_fini(void *arg)\n--\ndrivers/gpu/drm/xe/xe_guc_submit.c-262-\txe_guc_ct_stop(\u0026guc-\u003ect);\ndrivers/gpu/drm/xe/xe_guc_submit.c:263:\tguc_submit_reset_prepare(guc);\ndrivers/gpu/drm/xe/xe_guc_submit.c-264-\txe_guc_softreset(guc);\n--\ndrivers/gpu/drm/xe/xe_guc_submit.c=1321=void xe_guc_submit_wedge(struct xe_guc *guc)\n--\ndrivers/gpu/drm/xe/xe_guc_submit.c-1343-\t\t/* Forcefully kill any remaining exec queues, signal fences */\ndrivers/gpu/drm/xe/xe_guc_submit.c:1344:\t\tguc_submit_reset_prepare(guc);\ndrivers/gpu/drm/xe/xe_guc_submit.c-1345-\t\txe_guc_submit_stop(guc);\n--\ndrivers/gpu/drm/xe/xe_guc_submit.c=2561=static void guc_exec_queue_stop(struct xe_guc *guc, struct xe_exec_queue *q)\n--\ndrivers/gpu/drm/xe/xe_guc_submit.c-2612-\ndrivers/gpu/drm/xe/xe_guc_submit.c:2613:static int guc_submit_reset_prepare(struct xe_guc *guc)\ndrivers/gpu/drm/xe/xe_guc_submit.c-2614-{\n--\ndrivers/gpu/drm/xe/xe_guc_submit.c-2630-\ndrivers/gpu/drm/xe/xe_guc_submit.c:2631:int xe_guc_submit_reset_prepare(struct xe_guc *guc)\ndrivers/gpu/drm/xe/xe_guc_submit.c-2632-{\n--\ndrivers/gpu/drm/xe/xe_guc_submit.c-2638-\ndrivers/gpu/drm/xe/xe_guc_submit.c:2639:\treturn guc_submit_reset_prepare(guc);\ndrivers/gpu/drm/xe/xe_guc_submit.c-2640-}\n--\ndrivers/gpu/drm/xe/xe_guc_submit.h=17=void xe_guc_submit_disable(struct xe_guc *guc);\ndrivers/gpu/drm/xe/xe_guc_submit.h-18-\ndrivers/gpu/drm/xe/xe_guc_submit.h:19:int xe_guc_submit_reset_prepare(struct xe_guc *guc);\ndrivers/gpu/drm/xe/xe_guc_submit.h-20-void xe_guc_submit_reset_wait(struct xe_guc *guc);\n--\ndrivers/gpu/drm/xe/xe_uc.c=182=int xe_uc_load_hw(struct xe_uc *uc)\n--\ndrivers/gpu/drm/xe/xe_uc.c-235-\ndrivers/gpu/drm/xe/xe_uc.c:236:int xe_uc_reset_prepare(struct xe_uc *uc)\ndrivers/gpu/drm/xe/xe_uc.c-237-{\n--\ndrivers/gpu/drm/xe/xe_uc.c-241-\ndrivers/gpu/drm/xe/xe_uc.c:242:\treturn xe_guc_reset_prepare(\u0026uc-\u003eguc);\ndrivers/gpu/drm/xe/xe_uc.c-243-}\n--\ndrivers/gpu/drm/xe/xe_uc.c=269=static void uc_reset_wait(struct xe_uc *uc)\n--\ndrivers/gpu/drm/xe/xe_uc.c-275-\ndrivers/gpu/drm/xe/xe_uc.c:276:\tret = xe_uc_reset_prepare(uc);\ndrivers/gpu/drm/xe/xe_uc.c-277-\tif (ret)\n--\ndrivers/gpu/drm/xe/xe_uc.h=14=int xe_uc_load_hw(struct xe_uc *uc);\ndrivers/gpu/drm/xe/xe_uc.h:15:int xe_uc_reset_prepare(struct xe_uc *uc);\ndrivers/gpu/drm/xe/xe_uc.h-16-void xe_uc_runtime_resume(struct xe_uc *uc);\n--\ndrivers/media/pci/intel/ipu6/ipu6.c=699=static void ipu6_pci_remove(struct pci_dev *pdev)\n--\ndrivers/media/pci/intel/ipu6/ipu6.c-721-\ndrivers/media/pci/intel/ipu6/ipu6.c:722:static void ipu6_pci_reset_prepare(struct pci_dev *pdev)\ndrivers/media/pci/intel/ipu6/ipu6.c-723-{\n--\ndrivers/media/pci/intel/ipu6/ipu6.c=816=static const struct pci_error_handlers pci_err_handlers = {\ndrivers/media/pci/intel/ipu6/ipu6.c:817:\t.reset_prepare = ipu6_pci_reset_prepare,\ndrivers/media/pci/intel/ipu6/ipu6.c-818-\t.reset_done = ipu6_pci_reset_done,\n--\ndrivers/net/ethernet/amd/pds_core/core.c=637=static void pdsc_check_pci_health(struct pdsc *pdsc)\n--\ndrivers/net/ethernet/amd/pds_core/core.c-650-\ndrivers/net/ethernet/amd/pds_core/core.c:651:\t/* prevent deadlock between pdsc_reset_prepare and pdsc_health_thread */\ndrivers/net/ethernet/amd/pds_core/core.c-652-\tqueue_work(pdsc-\u003ewq, \u0026pdsc-\u003epci_reset_work);\n--\ndrivers/net/ethernet/amd/pds_core/main.c=485=static void pdsc_restart_health_thread(struct pdsc *pdsc)\n--\ndrivers/net/ethernet/amd/pds_core/main.c-497-\ndrivers/net/ethernet/amd/pds_core/main.c:498:static void pdsc_reset_prepare(struct pci_dev *pdev)\ndrivers/net/ethernet/amd/pds_core/main.c-499-{\n\n"
} |
| 11/2 | 2026/09/29 13:52 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 18661 output: 27 thoughts: 39 Thoughts: Okay, let's dive into this. Here's how I'd approach this task, as if these were my internal thoughts: **Investigating virtio's Reset Preparation** Alright, I need to understand how the `reset_prepare` function is being utilized within the virtio framework. The goal here is to get a handle on the reset process. So, first things first, where is it *actually* called? I need to track down the points where `reset_prepare` is being invoked within the `drivers/virtio/` directory tree. This is best done with a targeted search. I'll focus my search on two possibilities: 1. I'll look for direct calls with the full function signature or pointer dereference: `->reset_prepare`. This is the clearest way to find a method call. 2. I'll also widen the net a bit and include a search for just `reset_prepare`. It may be the case that a wrapper function or macro is involved, and I need to account for those possibilities to get the full picture. Ultimately, I want to trace the execution flow and context of this important function. |
| 12/2 | 2026/09/29 13:52 | tool | grepper |
0mArgs:{
"Expression": "reset_prepare",
"PathPrefix": "drivers/virtio"
}Results: {
"Output": "drivers/virtio/virtio.c=695=EXPORT_SYMBOL_GPL(virtio_device_restore);\n--\ndrivers/virtio/virtio.c-697-\ndrivers/virtio/virtio.c:698:int virtio_device_reset_prepare(struct virtio_device *dev)\ndrivers/virtio/virtio.c-699-{\n--\ndrivers/virtio/virtio.c-702-\ndrivers/virtio/virtio.c:703:\tif (!drv || !drv-\u003ereset_prepare)\ndrivers/virtio/virtio.c-704-\t\treturn -EOPNOTSUPP;\n--\ndrivers/virtio/virtio.c-709-\ndrivers/virtio/virtio.c:710:\tret = drv-\u003ereset_prepare(dev);\ndrivers/virtio/virtio.c-711-\tif (ret) {\n--\ndrivers/virtio/virtio.c-717-}\ndrivers/virtio/virtio.c:718:EXPORT_SYMBOL_GPL(virtio_device_reset_prepare);\ndrivers/virtio/virtio.c-719-\n--\ndrivers/virtio/virtio_pci_common.c=771=static int virtio_pci_sriov_configure(struct pci_dev *pci_dev, int num_vfs)\n--\ndrivers/virtio/virtio_pci_common.c-797-\ndrivers/virtio/virtio_pci_common.c:798:static void virtio_pci_reset_prepare(struct pci_dev *pci_dev)\ndrivers/virtio/virtio_pci_common.c-799-{\n--\ndrivers/virtio/virtio_pci_common.c-802-\ndrivers/virtio/virtio_pci_common.c:803:\tret = virtio_device_reset_prepare(\u0026vp_dev-\u003evdev);\ndrivers/virtio/virtio_pci_common.c-804-\tif (ret) {\n--\ndrivers/virtio/virtio_pci_common.c=833=static const struct pci_error_handlers virtio_pci_err_handler = {\ndrivers/virtio/virtio_pci_common.c:834:\t.reset_prepare = virtio_pci_reset_prepare,\ndrivers/virtio/virtio_pci_common.c-835-\t.reset_done = virtio_pci_reset_done,\n"
} |
| 13/2 | 2026/09/29 13:52 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 19615 output: 25 thoughts: 152 Thoughts: **Analyzing Virtio Device Reset and Freeze Mechanisms** Okay, here's what I'm seeing. I'm taking a look at how VirtIO handles potential errors and system transitions. First, the `virtio_pci_err_handler` function catches my eye. Specifically, I'm noting that its `.reset_prepare` member is set to `virtio_pci_reset_prepare`. This in turn calls `virtio_device_reset_prepare` with the VirtIO device itself. That suggests the reset process starts at the PCI level and eventually reaches the generic VirtIO device. I'm keeping a mental note of this flow, as understanding the reset sequence is crucial for diagnosing any potential hardware issues. Next, I'm examining how VirtIO devices are frozen, which is important for power management. I'm seeing that the `virtblk_freeze` function is assigned to the `.freeze` member. I see that it is conditional, `#ifdef CONFIG_PM_SLEEP`, indicating it is only compiled when power management is enabled, but more interestingly, I am noting that the specific implementation calls another function `virtblk_freeze_priv`. So I'm now curious about where that `.freeze` operation is actually invoked within the `drivers/virtio/` directory. Time to dig into `drivers/virtio/virtio.c` to trace the calls. |
| 14/2 | 2026/09/29 13:53 | tool | grepper |
0mArgs:{
"Expression": "freeze",
"PathPrefix": "drivers/virtio"
}Results: {
"Output": "drivers/virtio/virtio.c=613=static int virtio_device_restore_priv(struct virtio_device *dev, bool restore)\n--\ndrivers/virtio/virtio.c-624-\ndrivers/virtio/virtio.c:625:\t/* Maybe driver failed before freeze.\ndrivers/virtio/virtio.c-626-\t * Restore the failed status, for debugging. */\n--\ndrivers/virtio/virtio.c-669-#ifdef CONFIG_PM_SLEEP\ndrivers/virtio/virtio.c:670:int virtio_device_freeze(struct virtio_device *dev)\ndrivers/virtio/virtio.c-671-{\n--\ndrivers/virtio/virtio.c-678-\ndrivers/virtio/virtio.c:679:\tif (drv \u0026\u0026 drv-\u003efreeze) {\ndrivers/virtio/virtio.c:680:\t\tret = drv-\u003efreeze(dev);\ndrivers/virtio/virtio.c-681-\t\tif (ret) {\n--\ndrivers/virtio/virtio.c-688-}\ndrivers/virtio/virtio.c:689:EXPORT_SYMBOL_GPL(virtio_device_freeze);\ndrivers/virtio/virtio.c-690-\n--\ndrivers/virtio/virtio_balloon.c=1143=static void virtballoon_shutdown(struct virtio_device *vdev)\n--\ndrivers/virtio/virtio_balloon.c-1149-#ifdef CONFIG_PM_SLEEP\ndrivers/virtio/virtio_balloon.c:1150:static int virtballoon_freeze(struct virtio_device *vdev)\ndrivers/virtio/virtio_balloon.c-1151-{\n--\ndrivers/virtio/virtio_balloon.c=1211=static struct virtio_driver virtio_balloon_driver = {\n--\ndrivers/virtio/virtio_balloon.c-1221-#ifdef CONFIG_PM_SLEEP\ndrivers/virtio/virtio_balloon.c:1222:\t.freeze\t=\tvirtballoon_freeze,\ndrivers/virtio/virtio_balloon.c-1223-\t.restore =\tvirtballoon_restore,\n--\ndrivers/virtio/virtio_input.c=347=static void virtinput_remove(struct virtio_device *vdev)\n--\ndrivers/virtio/virtio_input.c-366-#ifdef CONFIG_PM_SLEEP\ndrivers/virtio/virtio_input.c:367:static int virtinput_freeze(struct virtio_device *vdev)\ndrivers/virtio/virtio_input.c-368-{\n--\ndrivers/virtio/virtio_input.c=408=static struct virtio_driver virtio_input_driver = {\n--\ndrivers/virtio/virtio_input.c-415-#ifdef CONFIG_PM_SLEEP\ndrivers/virtio/virtio_input.c:416:\t.freeze\t = virtinput_freeze,\ndrivers/virtio/virtio_input.c-417-\t.restore = virtinput_restore,\n--\ndrivers/virtio/virtio_mem.c=3076=static void virtio_mem_config_changed(struct virtio_device *vdev)\n--\ndrivers/virtio/virtio_mem.c-3087-#ifdef CONFIG_PM_SLEEP\ndrivers/virtio/virtio_mem.c:3088:static int virtio_mem_freeze(struct virtio_device *vdev)\ndrivers/virtio/virtio_mem.c-3089-{\n--\ndrivers/virtio/virtio_mem.c=3140=static struct virtio_driver virtio_mem_driver = {\n--\ndrivers/virtio/virtio_mem.c-3148-#ifdef CONFIG_PM_SLEEP\ndrivers/virtio/virtio_mem.c:3149:\t.freeze\t=\tvirtio_mem_freeze,\ndrivers/virtio/virtio_mem.c-3150-\t.restore =\tvirtio_mem_restore,\n--\ndrivers/virtio/virtio_mmio.c=539=static const struct virtio_config_ops virtio_mmio_config_ops = {\n--\ndrivers/virtio/virtio_mmio.c-555-#ifdef CONFIG_PM_SLEEP\ndrivers/virtio/virtio_mmio.c:556:static int virtio_mmio_freeze(struct device *dev)\ndrivers/virtio/virtio_mmio.c-557-{\n--\ndrivers/virtio/virtio_mmio.c-559-\ndrivers/virtio/virtio_mmio.c:560:\treturn virtio_device_freeze(\u0026vm_dev-\u003evdev);\ndrivers/virtio/virtio_mmio.c-561-}\n--\ndrivers/virtio/virtio_mmio.c=573=static const struct dev_pm_ops virtio_mmio_pm_ops = {\ndrivers/virtio/virtio_mmio.c:574:\tSET_SYSTEM_SLEEP_PM_OPS(virtio_mmio_freeze, virtio_mmio_restore)\ndrivers/virtio/virtio_mmio.c-575-};\n--\ndrivers/virtio/virtio_pci_common.c=585=const struct cpumask *vp_get_vq_affinity(struct virtio_device *vdev, int index)\n--\ndrivers/virtio/virtio_pci_common.c-598-#ifdef CONFIG_PM_SLEEP\ndrivers/virtio/virtio_pci_common.c:599:static int virtio_pci_freeze(struct device *dev)\ndrivers/virtio/virtio_pci_common.c-600-{\n--\ndrivers/virtio/virtio_pci_common.c-604-\ndrivers/virtio/virtio_pci_common.c:605:\tret = virtio_device_freeze(\u0026vp_dev-\u003evdev);\ndrivers/virtio/virtio_pci_common.c-606-\n--\ndrivers/virtio/virtio_pci_common.c=643=static int virtio_pci_suspend(struct device *dev)\ndrivers/virtio/virtio_pci_common.c-644-{\ndrivers/virtio/virtio_pci_common.c:645:\treturn vp_supports_pm_no_reset(dev) ? 0 : virtio_pci_freeze(dev);\ndrivers/virtio/virtio_pci_common.c-646-}\n--\ndrivers/virtio/virtio_pci_common.c=653=static const struct dev_pm_ops virtio_pci_pm_ops = {\n--\ndrivers/virtio/virtio_pci_common.c-655-\t.resume = virtio_pci_resume,\ndrivers/virtio/virtio_pci_common.c:656:\t.freeze = virtio_pci_freeze,\ndrivers/virtio/virtio_pci_common.c-657-\t.thaw = virtio_pci_restore,\ndrivers/virtio/virtio_pci_common.c:658:\t.poweroff = virtio_pci_freeze,\ndrivers/virtio/virtio_pci_common.c-659-\t.restore = virtio_pci_restore,\n--\ndrivers/virtio/virtio_rtc_driver.c=1337=static void viortc_remove(struct virtio_device *vdev)\n--\ndrivers/virtio/virtio_rtc_driver.c-1343-\ndrivers/virtio/virtio_rtc_driver.c:1344:static int viortc_freeze(struct virtio_device *dev)\ndrivers/virtio/virtio_rtc_driver.c-1345-{\n--\ndrivers/virtio/virtio_rtc_driver.c=1404=static struct virtio_driver virtio_rtc_drv = {\n--\ndrivers/virtio/virtio_rtc_driver.c-1410-\t.remove = viortc_remove,\ndrivers/virtio/virtio_rtc_driver.c:1411:\t.freeze = pm_sleep_ptr(viortc_freeze),\ndrivers/virtio/virtio_rtc_driver.c-1412-\t.restore = pm_sleep_ptr(viortc_restore),\n"
} |
| 15/2 | 2026/09/29 13:53 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 22212 output: 27 thoughts: 318 Thoughts: **Analyzing Potential Crash Paths in Virtio Block Driver** Okay, let's break this down. My initial focus is `virtblk_freeze_priv`. I need to figure out how it can be reached, because that's where vulnerabilities can be lurking. So, where does it come from? I see two primary paths: system suspend/hibernation/freeze. These paths start either with `virtio_pci_freeze` or `virtio_mmio_freeze`, eventually leading to `virtblk_freeze` and finally, to `virtblk_freeze_priv`. The million-dollar question is: can Syzkaller trigger this freeze scenario? I know it can potentially trigger a suspend, either through `/sys/power/state` or suspend syscalls like those used by `syz_mount_image`, or via write operations to `/sys/power/state`. But hold on, the critical point is this: is the freeze path part of power management / suspend, or is it related to something more like device teardown? Now, a completely different route comes to mind. What about `virtio_pci_reset_prepare`? When does this function get called? Looking deeper into `virtio_pci_err_handler`, I find that the `.reset_prepare` field is set to `virtio_pci_reset_prepare`. Okay, so PCI errors somehow trigger the reset preparation. How are these PCI errors generated? My guess is PCI reset is involved, which could be initiated via `pci_reset_function`, or by writing to the sysfs entry `/sys/bus/pci/devices/.../reset`. This gives me an even clearer path. The key question now is this: can userspace actually write to that `/sys/bus/pci/devices/.../reset` file? If so, that's a direct route into the reset path. Time to confirm by taking a peek at the kernel's `pci_reset_function` implementation. |
| 16/2 | 2026/09/29 13:53 | tool | grepper |
0mArgs:{
"Expression": "reset_prepare",
"PathPrefix": "drivers/pci"
}Results: {
"Output": "drivers/pci/pci.c=5088=static void pci_dev_save_and_disable(struct pci_dev *dev)\n--\ndrivers/pci/pci.c-5093-\t/*\ndrivers/pci/pci.c:5094:\t * dev-\u003edriver-\u003eerr_handler-\u003ereset_prepare() is protected against\ndrivers/pci/pci.c-5095-\t * races with -\u003eremove() by the device lock, which must be held by\n--\ndrivers/pci/pci.c-5098-\tdevice_lock_assert(\u0026dev-\u003edev);\ndrivers/pci/pci.c:5099:\tif (err_handler \u0026\u0026 err_handler-\u003ereset_prepare)\ndrivers/pci/pci.c:5100:\t\terr_handler-\u003ereset_prepare(dev);\ndrivers/pci/pci.c-5101-\telse if (dev-\u003edriver)\n"
} |
| 17/2 | 2026/09/29 13:53 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 23225 output: 34 thoughts: 20 Thoughts: Okay, here's my summary, tailored for an expert audience, as if I'm thinking these thoughts: **Analyzing `pci_dev_save_and_disable` Callers** Alright, time to dive into this. I need to understand the control flow surrounding `pci_dev_save_and_disable`. Specifically, I need to identify *all* its callers. This is essential for a complete understanding of how it interacts with the broader PCIe device lifecycle and the implications of its actions, particularly the disabling aspect. I can't just operate in the dark here; knowing the contexts where this function is invoked will determine the scope of my investigation. Are we dealing with hotplug events, driver unloads, error handling, power management, or something else entirely? The caller context will immediately suggest those possibilities. |
| 18/2 | 2026/09/29 13:53 | tool | grepper |
0mArgs:{
"Expression": "pci_dev_save_and_disable",
"PathPrefix": "drivers/pci"
}Results: {
"Output": "drivers/pci/pci.c=5086=EXPORT_SYMBOL_GPL(pci_dev_unlock);\ndrivers/pci/pci.c-5087-\ndrivers/pci/pci.c:5088:static void pci_dev_save_and_disable(struct pci_dev *dev)\ndrivers/pci/pci.c-5089-{\n--\ndrivers/pci/pci.c=5261=int pci_reset_function(struct pci_dev *dev)\n--\ndrivers/pci/pci.c-5277-\tpci_dev_lock(dev);\ndrivers/pci/pci.c:5278:\tpci_dev_save_and_disable(dev);\ndrivers/pci/pci.c-5279-\n--\ndrivers/pci/pci.c=5311=int pci_reset_function_locked(struct pci_dev *dev)\n--\ndrivers/pci/pci.c-5319-\ndrivers/pci/pci.c:5320:\tpci_dev_save_and_disable(dev);\ndrivers/pci/pci.c-5321-\n--\ndrivers/pci/pci.c=5336=int pci_try_reset_function(struct pci_dev *dev)\n--\ndrivers/pci/pci.c-5345-\ndrivers/pci/pci.c:5346:\tpci_dev_save_and_disable(dev);\ndrivers/pci/pci.c-5347-\trc = __pci_reset_function_locked(dev);\n--\ndrivers/pci/pci.c=5506=static void pci_bus_save_and_disable_locked(struct pci_bus *bus)\n--\ndrivers/pci/pci.c-5510-\tlist_for_each_entry(dev, \u0026bus-\u003edevices, bus_list) {\ndrivers/pci/pci.c:5511:\t\tpci_dev_save_and_disable(dev);\ndrivers/pci/pci.c-5512-\t\tif (dev-\u003esubordinate)\n--\ndrivers/pci/pci.c=5539=static void pci_slot_save_and_disable_locked(struct pci_slot *slot)\n--\ndrivers/pci/pci.c-5545-\t\t\tcontinue;\ndrivers/pci/pci.c:5546:\t\tpci_dev_save_and_disable(dev);\ndrivers/pci/pci.c-5547-\t\tif (dev-\u003esubordinate)\n"
} |
| 19/2 | 2026/09/29 13:53 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 24134 output: 30 thoughts: 26 Thoughts: Here's my take on the thought process, as requested: **Debugging PCI Function Reset: The Caller Mystery** Okay, so I'm digging into this `pci_reset_function` call, and my first question is always: *who* is actually invoking this function? I need to understand the control flow, the triggering mechanism. The best place to start, of course, is the source code itself, so let's check `pci-sysfs.c`. That file seems like the most likely candidate for handling system calls and the user-space interface, so it's a logical starting point. I suspect that the sysfs interface might provide the entry point for this reset functionality. Let's see if I can trace the call from there. |
| 20/2 | 2026/09/29 13:53 | tool | grepper |
0mArgs:{
"Expression": "pci_reset_function",
"PathPrefix": "drivers/pci"
}Results: {
"Output": "drivers/pci/pci-sysfs.c=1556=static ssize_t reset_store(struct device *dev, struct device_attribute *attr,\n--\ndrivers/pci/pci-sysfs.c-1569-\tpm_runtime_get_sync(dev);\ndrivers/pci/pci-sysfs.c:1570:\tresult = pci_reset_function(pdev);\ndrivers/pci/pci-sysfs.c-1571-\tpm_runtime_put(dev);\n--\ndrivers/pci/pci.c=5144=const struct pci_reset_fn_method pci_reset_fn_methods[] = {\n--\ndrivers/pci/pci.c-5155-/**\ndrivers/pci/pci.c:5156: * __pci_reset_function_locked - reset a PCI device function while holding\ndrivers/pci/pci.c-5157- * the @dev mutex lock.\n--\ndrivers/pci/pci.c-5176- */\ndrivers/pci/pci.c:5177:int __pci_reset_function_locked(struct pci_dev *dev)\ndrivers/pci/pci.c-5178-{\n--\ndrivers/pci/pci.c-5210-}\ndrivers/pci/pci.c:5211:EXPORT_SYMBOL_GPL(__pci_reset_function_locked);\ndrivers/pci/pci.c-5212-\n--\ndrivers/pci/pci.c=5225=void pci_init_reset_methods(struct pci_dev *dev)\n--\ndrivers/pci/pci.c-5245-/**\ndrivers/pci/pci.c:5246: * pci_reset_function - quiesce and reset a PCI device function\ndrivers/pci/pci.c-5247- * @dev: PCI device to reset\n--\ndrivers/pci/pci.c-5254- * clears all the state associated with the device. This function differs\ndrivers/pci/pci.c:5255: * from __pci_reset_function_locked() in that it saves and restores device state\ndrivers/pci/pci.c-5256- * over the reset and takes the PCI device lock.\n--\ndrivers/pci/pci.c-5260- */\ndrivers/pci/pci.c:5261:int pci_reset_function(struct pci_dev *dev)\ndrivers/pci/pci.c-5262-{\n--\ndrivers/pci/pci.c-5279-\ndrivers/pci/pci.c:5280:\trc = __pci_reset_function_locked(dev);\ndrivers/pci/pci.c-5281-\n--\ndrivers/pci/pci.c-5289-}\ndrivers/pci/pci.c:5290:EXPORT_SYMBOL_GPL(pci_reset_function);\ndrivers/pci/pci.c-5291-\ndrivers/pci/pci.c-5292-/**\ndrivers/pci/pci.c:5293: * pci_reset_function_locked - quiesce and reset a PCI device function\ndrivers/pci/pci.c-5294- * @dev: PCI device to reset\n--\ndrivers/pci/pci.c-5301- * clears all the state associated with the device. This function differs\ndrivers/pci/pci.c:5302: * from __pci_reset_function_locked() in that it saves and restores device state\ndrivers/pci/pci.c:5303: * over the reset. It also differs from pci_reset_function() in that it\ndrivers/pci/pci.c-5304- * requires the PCI device lock to be held.\n--\ndrivers/pci/pci.c-5310- */\ndrivers/pci/pci.c:5311:int pci_reset_function_locked(struct pci_dev *dev)\ndrivers/pci/pci.c-5312-{\n--\ndrivers/pci/pci.c-5321-\ndrivers/pci/pci.c:5322:\trc = __pci_reset_function_locked(dev);\ndrivers/pci/pci.c-5323-\n--\ndrivers/pci/pci.c-5327-}\ndrivers/pci/pci.c:5328:EXPORT_SYMBOL_GPL(pci_reset_function_locked);\ndrivers/pci/pci.c-5329-\n--\ndrivers/pci/pci.c=5336=int pci_try_reset_function(struct pci_dev *dev)\n--\ndrivers/pci/pci.c-5346-\tpci_dev_save_and_disable(dev);\ndrivers/pci/pci.c:5347:\trc = __pci_reset_function_locked(dev);\ndrivers/pci/pci.c-5348-\tpci_dev_restore(dev);\n--\ndrivers/pci/quirks.c=3814=static void quirk_no_pm_reset(struct pci_dev *dev)\n--\ndrivers/pci/quirks.c-3828- * monitor sync. Advertising this support makes other layers, like VFIO,\ndrivers/pci/quirks.c:3829: * assume pci_reset_function() is viable for this device. Mark it as\ndrivers/pci/quirks.c-3830- * unavailable to skip it when testing reset methods.\n--\ndrivers/pci/quirks.c=4005=static int reset_chelsio_generic_dev(struct pci_dev *dev, bool probe)\n--\ndrivers/pci/quirks.c-4027-\t * Level Reset completes. (BUS_MASTER is disabled in\ndrivers/pci/quirks.c:4028:\t * pci_reset_function()).\ndrivers/pci/quirks.c-4029-\t */\n"
} |
| 21/2 | 2026/09/29 13:53 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 25923 output: 26 thoughts: 536 Thoughts: **Analyzing a Potential Fuzzing Target**
Okay, hold on a second! I need to carefully consider Section 2 of the rules. The negative criteria for returning `WorthFuzzing=false` are very specific. It says I should *only* return false if *all* modified code falls into certain categories. The listed exclusions include things like changes that aren't kernel or executable, structurally unreachable hardware, and unreachable execution paths.
Alright, let's get down to brass tacks. Is `virtio_blk` reachable hardware in a standard QEMU/GCE setup? YES! That's a resounding yes! Standard QEMU *uses* `virtio-blk`, or at least emulates it with `virtio-blk-pci` or `virtio-blk-device`. I mean, come on, `virtio_blk` is one of the *most* common virtual block devices in QEMU! It's practically ubiquitous in those environments.
Now, what is this patch actually changing? I need to understand the intent and scope of the change. Time to dig into the commit history! I don't have direct access to `git log`, but I'll use grepper or if available, I can check comments instead to understand the reasons for the patch. Let's start by looking at what line 1595 of `drivers/block/virtio_blk.c` was doing previously and how it's changed.
```c
static int virtblk_freeze_priv(struct virtio_device *vdev)
{
struct virtio_blk *vblk = vdev->priv;
struct request_queue *q = vblk->disk->queue;
unsigned int memflags;
/* Ensure no requests in virtqueues before deleting vqs. */
memflags = blk_mq_freeze_queue(q);
- blk_mq_quiesce_queue_nowait(q);
+ blk_mq_quiesce_queue(q);
blk_mq_unfreeze_queue(q, memflags);
...
```
Ah-ha! The change is swapping `blk_mq_quiesce_queue_nowait(q)` for `blk_mq_quiesce_queue(q)`. Now I'm curious. Why was it using `nowait` before? Let's do a full kernel search using grepper for `blk_mq_quiesce_queue_nowait`. The context will be crucial here to determine if this change introduces an interesting fuzzing surface.
|
| 22/2 | 2026/09/29 13:53 | tool | grepper |
0mArgs:{
"Expression": "blk_mq_quiesce_queue_nowait"
}Results: {
"Output": "block/blk-mq.c=255=EXPORT_SYMBOL_GPL(blk_mq_unfreeze_queue_non_owner);\n--\nblock/blk-mq.c-260- */\nblock/blk-mq.c:261:void blk_mq_quiesce_queue_nowait(struct request_queue *q)\nblock/blk-mq.c-262-{\n--\nblock/blk-mq.c-269-}\nblock/blk-mq.c:270:EXPORT_SYMBOL_GPL(blk_mq_quiesce_queue_nowait);\nblock/blk-mq.c-271-\n--\nblock/blk-mq.c-278- * function only waits for the quiesce on those request_queues that had\nblock/blk-mq.c:279: * the quiesce flag set using blk_mq_quiesce_queue_nowait.\nblock/blk-mq.c-280- */\n--\nblock/blk-mq.c=299=void blk_mq_quiesce_queue(struct request_queue *q)\nblock/blk-mq.c-300-{\nblock/blk-mq.c:301:\tblk_mq_quiesce_queue_nowait(q);\nblock/blk-mq.c-302-\t/* nothing to wait for non-mq queues */\n--\nblock/blk-mq.c=335=void blk_mq_quiesce_tagset(struct blk_mq_tag_set *set)\n--\nblock/blk-mq.c-341-\t\tif (!blk_queue_skip_tagset_quiesce(q))\nblock/blk-mq.c:342:\t\t\tblk_mq_quiesce_queue_nowait(q);\nblock/blk-mq.c-343-\t}\n--\ndrivers/scsi/scsi_lib.c=2939=static void scsi_stop_queue(struct scsi_device *sdev)\n--\ndrivers/scsi/scsi_lib.c-2947-\tif (!cmpxchg(\u0026sdev-\u003equeue_stopped, 0, 1))\ndrivers/scsi/scsi_lib.c:2948:\t\tblk_mq_quiesce_queue_nowait(sdev-\u003erequest_queue);\ndrivers/scsi/scsi_lib.c-2949-}\n--\ninclude/linux/blk-mq.h=977=void blk_mq_update_nr_hw_queues(struct blk_mq_tag_set *set, int nr_hw_queues);\ninclude/linux/blk-mq.h-978-\ninclude/linux/blk-mq.h:979:void blk_mq_quiesce_queue_nowait(struct request_queue *q);\ninclude/linux/blk-mq.h-980-\n"
} |
| 23/2 | 2026/09/29 13:54 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 27765 output: 35 thoughts: 54 Thoughts: Okay, let's dive into `block/blk-mq.c`, specifically around lines 260 to 310. I need to refresh my memory on the exact nuances of `blk_mq_quiesce_queue_nowait` and `blk_mq_quiesce_queue`. It's crucial to understand how these functions handle the process of quiescing a block queue. Are they achieving full quiescence, or are they just stopping the submission of new requests and how does that work in detail? I recall there being important differences between the two, especially regarding whether they actually *wait* for any in-flight requests to complete and release resources, or if they just signal for a more or less instant halt of activity. I'll focus on how they interact with the queue's state and data structures and how that differs based on whether or not we are invoking the nowait variant. I really need to remember if there are any subtle differences to how these interact with the hardware queue, and if there are specific cases in which one is preferred over the other. I'll need to pay close attention to the lock interactions too. |
| 24/2 | 2026/09/29 13:54 | tool | read-file |
0mArgs:{
"File": "block/blk-mq.c",
"FirstLine": 260,
"LineCount": 50
}Results: {
"Contents": " 260:\t */\n 261:\tvoid blk_mq_quiesce_queue_nowait(struct request_queue *q)\n 262:\t{\n 263:\t\tunsigned long flags;\n 264:\t\n 265:\t\tspin_lock_irqsave(\u0026q-\u003equeue_lock, flags);\n 266:\t\tif (!q-\u003equiesce_depth++)\n 267:\t\t\tblk_queue_flag_set(QUEUE_FLAG_QUIESCED, q);\n 268:\t\tspin_unlock_irqrestore(\u0026q-\u003equeue_lock, flags);\n 269:\t}\n 270:\tEXPORT_SYMBOL_GPL(blk_mq_quiesce_queue_nowait);\n 271:\t\n 272:\t/**\n 273:\t * blk_mq_wait_quiesce_done() - wait until in-progress quiesce is done\n 274:\t * @set: tag_set to wait on\n 275:\t *\n 276:\t * Note: it is driver's responsibility for making sure that quiesce has\n 277:\t * been started on or more of the request_queues of the tag_set. This\n 278:\t * function only waits for the quiesce on those request_queues that had\n 279:\t * the quiesce flag set using blk_mq_quiesce_queue_nowait.\n 280:\t */\n 281:\tvoid blk_mq_wait_quiesce_done(struct blk_mq_tag_set *set)\n 282:\t{\n 283:\t\tif (set-\u003eflags \u0026 BLK_MQ_F_BLOCKING)\n 284:\t\t\tsynchronize_srcu(set-\u003esrcu);\n 285:\t\telse\n 286:\t\t\tsynchronize_rcu();\n 287:\t}\n 288:\tEXPORT_SYMBOL_GPL(blk_mq_wait_quiesce_done);\n 289:\t\n 290:\t/**\n 291:\t * blk_mq_quiesce_queue() - wait until all ongoing dispatches have finished\n 292:\t * @q: request queue.\n 293:\t *\n 294:\t * Note: this function does not prevent that the struct request end_io()\n 295:\t * callback function is invoked. Once this function is returned, we make\n 296:\t * sure no dispatch can happen until the queue is unquiesced via\n 297:\t * blk_mq_unquiesce_queue().\n 298:\t */\n 299:\tvoid blk_mq_quiesce_queue(struct request_queue *q)\n 300:\t{\n 301:\t\tblk_mq_quiesce_queue_nowait(q);\n 302:\t\t/* nothing to wait for non-mq queues */\n 303:\t\tif (queue_is_mq(q))\n 304:\t\t\tblk_mq_wait_quiesce_done(q-\u003etag_set);\n 305:\t}\n 306:\tEXPORT_SYMBOL_GPL(blk_mq_quiesce_queue);\n 307:\t\n 308:\t/*\n 309:\t * blk_mq_unquiesce_queue() - counterpart of blk_mq_quiesce_queue()\n"
} |
| 25/2 | 2026/09/29 13:54 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 28964 output: 22 thoughts: 1950 Thoughts: **Reachability Analysis of virtblk_freeze_priv** Okay, let's break this down. My initial focus is on the change from `blk_mq_quiesce_queue_nowait()` to `blk_mq_quiesce_queue()` within `virtblk_freeze_priv`. The comment clarifies the critical reason: to ensure all ongoing block dispatches complete before freeing resources. This is essential for data integrity. The question now becomes: is this code path reachable by syzkaller fuzzing? First, I recall the core triage philosophy: reachability is paramount. Code must be executable in a standard virtualized environment (like QEMU) to be fuzzed. Specifically, the patch is only considered worth fuzzing if the code is reachable and executable. We must not fuzz code that is structurally unreachable. Considering the negative criteria, this is not a vendor-specific device, nor architecture specific, nor driver unbinding as mentioned, so those negative criteria don't apply. The positive criteria gives more information. *Reachable Drivers and Protocols*: Drivers accessible via virtual buses (virtio, etc.) are fuzzed. And this is a virtio driver! Virtio-blk is very much a virtualized block device and accessible via virtio. Okay, virtio is good, that's positive. However, just because virtio is reachable doesn't mean *this specific function*, `virtblk_freeze_priv`, is reachable. We need to determine if `virtblk_freeze_priv` can be executed. It looks like it is reachable via `virtblk_freeze`. The question is, how do we trigger it? My initial thought is suspend/hibernate, but syzkaller often disables suspend. However, `virtblk_reset_prepare` is related to freezing and could be a good starting point to trigger `virtblk_freeze`. Now, how does `virtblk_reset_prepare` get called? Looking at `virtio_pci_common.c`, `virtio_pci_reset_prepare` calls `virtio_device_reset_prepare`, which could invoke `virtblk_freeze`. Crucially, I see that the `virtio_pci_driver` has an `err_handler`. Specifically, `reset_prepare` in `err_handler` could call `virtio_pci_reset_prepare` when called via `pci_reset_function`, which is exposed via the `reset` sysfs entry: `/sys/bus/pci/devices/.../reset`. Ah! Now we're getting somewhere. Can userspace write to this `reset` file? Yes! And is this path considered unreachable? The notes say that `.remove`, `.shutdown`, and `pci_unregister_driver` are the things not reached by fuzzing, but this is a *reset*, not a driver unbind/remove/shutdown. Therefore, it is reachable. To summarize, triggering a PCI reset via the `/sys/bus/pci/devices/.../reset` interface provides a reachable execution path to `virtblk_freeze_priv`. |
| 26/2 | 2026/09/29 13:54 | tool | grepper |
0mArgs:{
"Expression": "virtio_device_reset_prepare"
}Results: {
"Output": "drivers/virtio/virtio.c=695=EXPORT_SYMBOL_GPL(virtio_device_restore);\n--\ndrivers/virtio/virtio.c-697-\ndrivers/virtio/virtio.c:698:int virtio_device_reset_prepare(struct virtio_device *dev)\ndrivers/virtio/virtio.c-699-{\n--\ndrivers/virtio/virtio.c-717-}\ndrivers/virtio/virtio.c:718:EXPORT_SYMBOL_GPL(virtio_device_reset_prepare);\ndrivers/virtio/virtio.c-719-\n--\ndrivers/virtio/virtio_pci_common.c=798=static void virtio_pci_reset_prepare(struct pci_dev *pci_dev)\n--\ndrivers/virtio/virtio_pci_common.c-802-\ndrivers/virtio/virtio_pci_common.c:803:\tret = virtio_device_reset_prepare(\u0026vp_dev-\u003evdev);\ndrivers/virtio/virtio_pci_common.c-804-\tif (ret) {\n--\ninclude/linux/virtio.h=216=void virtio_device_shutdown(struct virtio_device *dev);\ninclude/linux/virtio.h:217:int virtio_device_reset_prepare(struct virtio_device *dev);\ninclude/linux/virtio.h-218-int virtio_device_reset_done(struct virtio_device *dev);\n"
} |
| 27/2 | 2026/09/29 13:54 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 31988 output: 28 thoughts: 467 Thoughts: **Investigating Potential Bugs Related to PCI Device Reset and Power Management**
Okay, wait, VFIO... that's a direction I need to explore. Can VFIO actually reset PCI devices? Yes, I think so! The VFIO ioctls `VFIO_DEVICE_PCI_HOT_RESET` and `VFIO_DEVICE_RESET` are key – they call `pci_reset_function`, which is exactly what I need. And then there's the sysfs `/sys/bus/pci/devices/.../reset` that, again, invokes `pci_reset_function`. This is starting to look promising.
Now, what about the Advanced Error Reporting (AER) and PCI error recovery mechanisms? When PCI errors occur, or if they're injected for testing, `reset_prepare` gets called. Right, right... Need to keep that in mind. And then, there's power management: the `freeze` operation. I wonder, has syzkaller been fuzzing Power Management specifically, or even suspend and hibernation? That's a definite area for investigation.
Let's check if syzkaller has suspend or PM as reachable. Okay, and while I'm at it, I should also check if virtio_blk is even used in QEMU. Thinking about it, the root drive, or even an auxiliary drive, *can* be virtio-blk, like `/dev/vda`. When syzkaller runs in QEMU, that's often the root disk, or there could be additional virtio block devices.
Wait a second... what happens if a virtio device is reset while I/O is in flight? That could be a really interesting race condition. I should see if there is a crash reported, and then I should look at the code! Let's check what the bug was...
```c
static int virtblk_freeze_priv(struct virtio_device *vdev)
{
struct virtio_blk *vblk = vdev->priv;
struct request_queue *q = vblk->disk->queue;
unsigned int memflags;
/* Ensure no requests in virtqueues before deleting vqs. */
memflags = blk_mq_freeze_queue(q);
blk_mq_quiesce_queue(q);
blk_mq_unfreeze_queue(q, memflags);
```
Okay, I see the sequence. First: `blk_mq_freeze_queue(q)` - it's meant to wait for all existing requests on the queue to complete. Wait! What exactly does `blk_mq_freeze_queue` *do*? I need to dig into that function's implementation and how it interacts with the rest of the system.
|
| 28/2 | 2026/09/29 13:54 | tool | grepper |
0mArgs:{
"Expression": "blk_mq_freeze_queue",
"PathPrefix": "block"
}Results: {
"Output": "block/bfq-iosched.c=7196=static int bfq_init_queue(struct request_queue *q, struct elevator_queue *eq)\n--\nblock/bfq-iosched.c-7329-\t * (bfq_create_group_hierarchy-\u003eblkcg_activate_policy-\u003e\nblock/bfq-iosched.c:7330:\t * blk_mq_freeze_queue) that may lead to the invocation of the\nblock/bfq-iosched.c-7331-\t * has_work hook function. For this reason,\n--\nblock/blk-cgroup.c=1586=int blkcg_activate_policy(struct gendisk *disk, const struct blkcg_policy *pol)\n--\nblock/blk-cgroup.c-1605-\tif (queue_is_mq(q))\nblock/blk-cgroup.c:1606:\t\tmemflags = blk_mq_freeze_queue(q);\nblock/blk-cgroup.c-1607-\n--\nblock/blk-cgroup.c=1700=void blkcg_deactivate_policy(struct gendisk *disk,\n--\nblock/blk-cgroup.c-1709-\tif (queue_is_mq(q))\nblock/blk-cgroup.c:1710:\t\tmemflags = blk_mq_freeze_queue(q);\nblock/blk-cgroup.c-1711-\n--\nblock/blk-iocost.c=3273=static ssize_t ioc_qos_write(struct kernfs_open_file *of, char *input,\n--\nblock/blk-iocost.c-3298-\nblock/blk-iocost.c:3299:\tmemflags = blk_mq_freeze_queue(ctx.bdev-\u003ebd_queue);\nblock/blk-iocost.c-3300-\tmutex_lock(\u0026ctx.bdev-\u003ebd_queue-\u003erq_qos_mutex);\n--\nblock/blk-iocost.c=3476=static ssize_t ioc_cost_model_write(struct kernfs_open_file *of, char *input,\n--\nblock/blk-iocost.c-3508-\nblock/blk-iocost.c:3509:\tmemflags = blk_mq_freeze_queue(q);\nblock/blk-iocost.c-3510-\tblk_mq_quiesce_queue(q);\n--\nblock/blk-iolatency.c=728=static void blkiolatency_enable_work_fn(struct work_struct *work)\n--\nblock/blk-iolatency.c-747-\nblock/blk-iolatency.c:748:\t\tmemflags = blk_mq_freeze_queue(blkiolat-\u003erqos.disk-\u003equeue);\nblock/blk-iolatency.c-749-\t\tblkiolat-\u003eenabled = enabled;\n--\nblock/blk-mq.c=187=EXPORT_SYMBOL_GPL(blk_freeze_queue_start);\nblock/blk-mq.c-188-\nblock/blk-mq.c:189:void blk_mq_freeze_queue_wait(struct request_queue *q)\nblock/blk-mq.c-190-{\n--\nblock/blk-mq.c-192-}\nblock/blk-mq.c:193:EXPORT_SYMBOL_GPL(blk_mq_freeze_queue_wait);\nblock/blk-mq.c-194-\nblock/blk-mq.c:195:int blk_mq_freeze_queue_wait_timeout(struct request_queue *q,\nblock/blk-mq.c-196-\t\t\t\t unsigned long timeout)\n--\nblock/blk-mq.c-201-}\nblock/blk-mq.c:202:EXPORT_SYMBOL_GPL(blk_mq_freeze_queue_wait_timeout);\nblock/blk-mq.c-203-\nblock/blk-mq.c:204:void blk_mq_freeze_queue_nomemsave(struct request_queue *q)\nblock/blk-mq.c-205-{\nblock/blk-mq.c-206-\tblk_freeze_queue_start(q);\nblock/blk-mq.c:207:\tblk_mq_freeze_queue_wait(q);\nblock/blk-mq.c-208-}\nblock/blk-mq.c:209:EXPORT_SYMBOL_GPL(blk_mq_freeze_queue_nomemsave);\nblock/blk-mq.c-210-\n--\nblock/blk-mq.c=4299=static void blk_mq_update_tag_set_shared(struct blk_mq_tag_set *set,\n--\nblock/blk-mq.c-4307-\tlist_for_each_entry(q, \u0026set-\u003etag_list, tag_set_list) {\nblock/blk-mq.c:4308:\t\tmemflags = blk_mq_freeze_queue(q);\nblock/blk-mq.c-4309-\t\tqueue_set_hctx_shared(q, shared);\n--\nblock/blk-mq.c=4443=void blk_mq_destroy_queue(struct request_queue *q)\n--\nblock/blk-mq.c-4451-\tblk_queue_start_drain(q);\nblock/blk-mq.c:4452:\tblk_mq_freeze_queue_wait(q);\nblock/blk-mq.c-4453-\n--\nblock/blk-mq.c=5107=static void __blk_mq_update_nr_hw_queues(struct blk_mq_tag_set *set,\n--\nblock/blk-mq.c-5154-\tlist_for_each_entry(q, \u0026set-\u003etag_list, tag_set_list)\nblock/blk-mq.c:5155:\t\tblk_mq_freeze_queue_nomemsave(q);\nblock/blk-mq.c-5156-\tqueues_frozen = true;\n--\nblock/blk-mq.c-5185-\t\tif (!queues_frozen)\nblock/blk-mq.c:5186:\t\t\tblk_mq_freeze_queue_nomemsave(q);\nblock/blk-mq.c-5187-\t\tblk_mq_elv_switch_back(q, \u0026elv_tbl);\n--\nblock/blk-rq-qos.c=325=int rq_qos_add(struct rq_qos *rqos, struct gendisk *disk, enum rq_qos_id id,\n--\nblock/blk-rq-qos.c-340-\t */\nblock/blk-rq-qos.c:341:\tmemflags = blk_mq_freeze_queue(q);\nblock/blk-rq-qos.c-342-\n--\nblock/blk-rq-qos.c=356=void rq_qos_del(struct rq_qos *rqos)\n--\nblock/blk-rq-qos.c-363-\nblock/blk-rq-qos.c:364:\tmemflags = blk_mq_freeze_queue(q);\nblock/blk-rq-qos.c-365-\tfor (cur = \u0026q-\u003erq_qos; *cur; cur = \u0026(*cur)-\u003enext) {\n--\nblock/blk-settings.c=584=int queue_limits_commit_update_frozen(struct request_queue *q,\n--\nblock/blk-settings.c-589-\nblock/blk-settings.c:590:\tmemflags = blk_mq_freeze_queue(q);\nblock/blk-settings.c-591-\tret = queue_limits_commit_update(q, lim);\n--\nblock/blk-sysfs.c=66=queue_requests_store(struct gendisk *disk, const char *page, size_t count)\n--\nblock/blk-sysfs.c-122-\nblock/blk-sysfs.c:123:\tmemflags = blk_mq_freeze_queue(q);\nblock/blk-sysfs.c-124-\tmutex_lock(\u0026q-\u003eelevator_lock);\n--\nblock/blk-sysfs.c=145=queue_async_depth_store(struct gendisk *disk, const char *page, size_t count)\n--\nblock/blk-sysfs.c-161-\nblock/blk-sysfs.c:162:\tmemflags = blk_mq_freeze_queue(q);\nblock/blk-sysfs.c-163-\tscoped_guard(mutex, \u0026q-\u003eelevator_lock) {\n--\nblock/blk-sysfs.c=400=static ssize_t queue_zoned_qd1_writes_store(struct gendisk *disk,\n--\nblock/blk-sysfs.c-411-\nblock/blk-sysfs.c:412:\tmemflags = blk_mq_freeze_queue(q);\nblock/blk-sysfs.c-413-\tblk_mq_quiesce_queue(q);\n--\nblock/blk-throttle.c=1318=static int blk_throtl_init(struct gendisk *disk)\n--\nblock/blk-throttle.c-1331-\nblock/blk-throttle.c:1332:\tmemflags = blk_mq_freeze_queue(disk-\u003equeue);\nblock/blk-throttle.c-1333-\tblk_mq_quiesce_queue(disk-\u003equeue);\n--\nblock/blk-wbt.c=990=int wbt_set_lat(struct gendisk *disk, s64 val)\n--\nblock/blk-wbt.c-1008-\t */\nblock/blk-wbt.c:1009:\tmemflags = blk_mq_freeze_queue(q);\nblock/blk-wbt.c-1010-\tif (!rqos) {\n--\nblock/blk-zoned.c=2058=static int disk_update_zone_resources(struct gendisk *disk,\n--\nblock/blk-zoned.c-2068-\nblock/blk-zoned.c:2069:\tmemflags = blk_mq_freeze_queue(q);\nblock/blk-zoned.c-2070-\n--\nblock/blk-zoned.c=2314=int blk_revalidate_disk_zones(struct gendisk *disk)\n--\nblock/blk-zoned.c-2384-\tkfree(args.zones_cond);\nblock/blk-zoned.c:2385:\tmemflags = blk_mq_freeze_queue(q);\nblock/blk-zoned.c-2386-\tdisk_free_zone_resources(disk);\n--\nblock/elevator.c=609=static void elv_exit_and_release(struct elv_change_ctx *ctx,\n--\nblock/elevator.c-614-\nblock/elevator.c:615:\tmemflags = blk_mq_freeze_queue(q);\nblock/elevator.c-616-\tmutex_lock(\u0026q-\u003eelevator_lock);\n--\nblock/elevator.c=653=static int elevator_change(struct request_queue *q, struct elv_change_ctx *ctx)\n--\nblock/elevator.c-667-\nblock/elevator.c:668:\tmemflags = blk_mq_freeze_queue(q);\nblock/elevator.c-669-\t/*\n--\nblock/genhd.c=697=static void __del_gendisk(struct gendisk *disk)\n--\nblock/genhd.c-758-\nblock/genhd.c:759:\tblk_mq_freeze_queue_wait(q);\nblock/genhd.c-760-\n"
} |
| 29/2 | 2026/09/29 13:54 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 36035 output: 20 thoughts: 170 Thoughts: **Investigating `virtblk_freeze_priv` in `virtio_blk.c`** Okay, so I'm looking at `drivers/block/virtio_blk.c` and specifically focusing on `virtblk_freeze_priv`. I can see that it's called by `virtblk_freeze`, which makes sense because we are preparing for a power management sleep state. I'd expect that kind of thing to have a dedicated freeze routine. I'm also seeing it's called by `virtblk_reset_prepare`. Hmm, that's interesting; a reset prepares things in a way that appears to be similar to freezing. It suggests that there's some commonality in the cleanup or state saving required. But, I need to know if it is called anywhere else. Is this the *only* place it's invoked? I'm going to quickly check with `grepper` to be absolutely certain. It would be easy to miss something in a quick scan, and I want to be certain about the scope of the function's usage. |
| 30/2 | 2026/09/29 13:54 | tool | grepper |
0mArgs:{
"Expression": "virtblk_freeze_priv"
}Results: {
"Output": "drivers/block/virtio_blk.c=1564=static void virtblk_remove(struct virtio_device *vdev)\n--\ndrivers/block/virtio_blk.c-1589-\ndrivers/block/virtio_blk.c:1590:static int virtblk_freeze_priv(struct virtio_device *vdev)\ndrivers/block/virtio_blk.c-1591-{\n--\ndrivers/block/virtio_blk.c=1635=static int virtblk_freeze(struct virtio_device *vdev)\ndrivers/block/virtio_blk.c-1636-{\ndrivers/block/virtio_blk.c:1637:\treturn virtblk_freeze_priv(vdev);\ndrivers/block/virtio_blk.c-1638-}\n--\ndrivers/block/virtio_blk.c=1646=static int virtblk_reset_prepare(struct virtio_device *vdev)\ndrivers/block/virtio_blk.c-1647-{\ndrivers/block/virtio_blk.c:1648:\treturn virtblk_freeze_priv(vdev);\ndrivers/block/virtio_blk.c-1649-}\n"
} |
| 31/2 | 2026/09/29 13:54 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 36766 output: 39 thoughts: 37 Thoughts: Okay, here's my take on those thoughts, tailored for an expert audience: **Analyzing the virtblk Module Removal Process** Alright, so the immediate concern here is `virtblk_remove` and its relationship, or lack thereof, with `virtblk_freeze_priv`. That omission is a red flag. My initial thought is, "Wait a minute...`virtblk_remove` *doesn't* call `virtblk_freeze_priv`? Why not?" It's a critical point to establish right away. This discrepancy demands immediate investigation. I need to understand the control flow. The next step is clear: I need to deeply examine the implementation of `virtblk_remove`. I need to figure out *what* it *does* do, and how it handles resource management, state transitions, and device shutdown. This will help determine where the potential issues might lie due to the missing freeze operation. I need to understand the full picture to assess the implications of that oversight. Let's dig in. |
| 32/2 | 2026/09/29 13:55 | tool | read-file |
0mArgs:{
"File": "drivers/block/virtio_blk.c",
"FirstLine": 1560,
"LineCount": 35
}Results: {
"Contents": "1560:\tout:\n1561:\t\treturn err;\n1562:\t}\n1563:\t\n1564:\tstatic void virtblk_remove(struct virtio_device *vdev)\n1565:\t{\n1566:\t\tstruct virtio_blk *vblk = vdev-\u003epriv;\n1567:\t\n1568:\t\t/* Make sure no work handler is accessing the device. */\n1569:\t\tflush_work(\u0026vblk-\u003econfig_work);\n1570:\t\n1571:\t\tdel_gendisk(vblk-\u003edisk);\n1572:\t\tblk_mq_free_tag_set(\u0026vblk-\u003etag_set);\n1573:\t\n1574:\t\tmutex_lock(\u0026vblk-\u003evdev_mutex);\n1575:\t\n1576:\t\t/* Stop all the virtqueues. */\n1577:\t\tvirtio_reset_device(vdev);\n1578:\t\n1579:\t\t/* Virtqueues are stopped, nothing can use vblk-\u003evdev anymore. */\n1580:\t\tvblk-\u003evdev = NULL;\n1581:\t\n1582:\t\tvdev-\u003econfig-\u003edel_vqs(vdev);\n1583:\t\tkfree(vblk-\u003evqs);\n1584:\t\n1585:\t\tmutex_unlock(\u0026vblk-\u003evdev_mutex);\n1586:\t\n1587:\t\tput_disk(vblk-\u003edisk);\n1588:\t}\n1589:\t\n1590:\tstatic int virtblk_freeze_priv(struct virtio_device *vdev)\n1591:\t{\n1592:\t\tstruct virtio_blk *vblk = vdev-\u003epriv;\n1593:\t\tstruct request_queue *q = vblk-\u003edisk-\u003equeue;\n1594:\t\tunsigned int memflags;\n"
} |
| 33/2 | 2026/09/29 13:55 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 37553 output: 29 thoughts: 2287 Thoughts: **My Assessment of the WorthFuzzing Decision**
Okay, let's break this down. First, I see `virtblk_remove` is a driver teardown, but the real point of interest is `virtblk_freeze_priv`. I need to figure out if syzkaller can reach either the `.reset_prepare` or `.freeze` functions, as those are what `virtblk_freeze_priv` implements.
I need to refer back to the core triage philosophy. Let's make sure that I understand the guidelines.
* **Reachability is Key:** Fuzzing only applies to code that can run in standard emulated environments (like QEMU) with emulated devices.
* I must NOT fuzz unreachable code.
Now let's revisit this:
* **Section 2** defines when to return `WorthFuzzing=false`. The only situation is if *all* modified code falls into certain categories:
* Non-kernel changes (documentation, scripts, etc.)
* Structurally unreachable hardware (PCIe cards requiring physical hardware).
* Unreachable execution paths:
* Teardown callbacks only triggered by hot-unplug or manual unbinding.
I need to see if the changes fall into any of those categories. I'm modifying `drivers/block/virtio_blk.c`, which is kernel code, so it's not a non-kernel change. Virtio is *not* structurally unreachable because it's virtual hardware and emulated in QEMU. Finally, `virtblk_freeze_priv` is used for `.freeze` and `.reset_prepare`, and I understand that `reset_prepare` can be triggered by a PCI device reset such as sysfs write, not just PCI hot-unplug.
The code does NOT fall into those categories!
* **Section 3** defines when to return `WorthFuzzing=true`. The conditions are:
* Changes to core subsystems
* Refactorings
* Assertions
* Reachable drivers.
The relevant point here is "Reachable Drivers." Virtio is explicitly listed in this section! It's a virtual bus and is perfectly reachable. I need to make sure I understand syzkaller, but I know it's generic sysfs write and it has `syz_mount_image`, and ioctls. I should be able to trigger `reset` or `freeze` or something similar, and it's looking promising.
Okay, so I think `WorthFuzzing=true` is the right answer.
Now, let's dive deeper into `blk_mq_quiesce_queue`!
I need to know: Does calling `blk_mq_quiesce_queue(q)` block? Is it a potential source of deadlocks? `blk_mq_quiesce_queue(q)` calls `blk_mq_wait_quiesce_done(q->tag_set)` which in turn calls `synchronize_rcu()` and blocks, or potentially deadlocks!
Looking at the code, in `virtblk_freeze_priv`, it does this:
`memflags = blk_mq_freeze_queue(q);`
`blk_mq_quiesce_queue(q);`
`blk_mq_unfreeze_queue(q, memflags);`
What is the effect? First, the queue is frozen. Then, the queue is quiesced. Then, the queue is unfrozen, but not unquiesced!
The queue remains quiesced until `blk_mq_unquiesce_queue` is called in `virtblk_restore_priv`
This change from `blk_mq_quiesce_queue_nowait` to `blk_mq_quiesce_queue` is significant! The new function *waits*, introducing a significant blocking operation and potentially a deadlock! This needs fuzzing, as I can see how blocking operations can cause lock inversion and/or deadlock!
|
| 34/2 | 2026/09/29 13:55 | tool | grepper |
0mArgs:{
"Expression": "config VIRTIO_BLK",
"PathPrefix": "drivers/block"
}Results: {
"Output": "drivers/block/Kconfig=286=config XEN_BLKDEV_BACKEND\n--\ndrivers/block/Kconfig-306-\ndrivers/block/Kconfig:307:config VIRTIO_BLK\ndrivers/block/Kconfig-308-\ttristate \"Virtio block driver\"\n"
} |
| 35/2 | 2026/09/29 13:55 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 40824 output: 34 thoughts: 19 Thoughts: Okay, here's my interpretation of that thought process, tailored for an expert audience, and written in the first person: **Navigating the Block Device Configuration Landscape** Right, let's dive into the guts of the block device configuration. I need to zero in on something specific, so I'm thinking the `Kconfig` file in the `drivers/block` directory is a good starting point. Specifically, I'm thinking around line 307. That area is likely to be a high-level grouping or definition of features, which is exactly what I'm looking for right now. I'm hoping I can find a relevant section to help answer my question, I should quickly be able to find it and move on. |
| 36/2 | 2026/09/29 13:55 | tool | read-file |
0mArgs:{
"File": "drivers/block/Kconfig",
"FirstLine": 305,
"LineCount": 25
}Results: {
"Contents": " 305:\t\n 306:\t\n 307:\tconfig VIRTIO_BLK\n 308:\t\ttristate \"Virtio block driver\"\n 309:\t\tdepends on VIRTIO\n 310:\t\tselect SG_POOL\n 311:\t\thelp\n 312:\t\t This is the virtual block driver for virtio. It can be used with\n 313:\t QEMU based VMMs (like KVM or Xen). Say Y or M.\n 314:\t\n 315:\tconfig BLK_DEV_RBD\n 316:\t\ttristate \"Rados block device (RBD)\"\n 317:\t\tdepends on INET \u0026\u0026 BLOCK\n 318:\t\tselect CEPH_LIB\n 319:\t\thelp\n 320:\t\t Say Y here if you want include the Rados block device, which stripes\n 321:\t\t a block device over objects stored in the Ceph distributed object\n 322:\t\t store.\n 323:\t\n 324:\t\t More information at http://ceph.newdream.net/.\n 325:\t\n 326:\t\t If unsure, say N.\n 327:\t\n 328:\tconfig BLK_DEV_UBLK\n 329:\t\ttristate \"Userspace block driver (Experimental)\"\n"
} |
| 37/2 | 2026/09/29 13:55 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 41386 output: 30 thoughts: 482 Thoughts: **Analyzing the `virtio_blk` and `virtio_pci` Reset Handling**
Okay, let's break this down. My initial observation is that `VIRTIO_BLK` is obviously dependent on `VIRTIO`, and `BLOCK` is a general dependency for the block drivers. Now, I'm specifically interested in the reset procedures. I see that `virtblk_freeze` is conditionally compiled under `#ifdef CONFIG_PM_SLEEP`, which is as expected for power management hooks. However, `virtblk_reset_prepare` appears to be *always* compiled. This is interesting.
Let's examine line 1634 in `drivers/block/virtio_blk.c` to confirm my observations.
```c
#ifdef CONFIG_PM_SLEEP
static int virtblk_freeze(struct virtio_device *vdev)
{
return virtblk_freeze_priv(vdev);
}
static int virtblk_restore(struct virtio_device *vdev)
{
return virtblk_restore_priv(vdev);
}
#endif
static int virtblk_reset_prepare(struct virtio_device *vdev)
{
return virtblk_freeze_priv(vdev);
}
static int virtblk_reset_done(struct virtio_device *vdev)
{
return virtblk_restore_priv(vdev);
}
```
Okay, confirmed. `virtblk_reset_prepare` is *indeed* outside the `CONFIG_PM_SLEEP` conditional. This means `virtblk_reset_prepare` is always present and I can see that `virtio_blk` driver has pointers to these handlers in its device structure.
```c
.reset_prepare = virtblk_reset_prepare,
.reset_done = virtblk_reset_done,
```
Now, let's follow the call chain. I recall `virtio_pci` being relevant here. Let's see how `virtio_pci` interacts. Ah, here it is:
```c
static void virtio_pci_reset_prepare(struct pci_dev *pci_dev)
{
struct virtio_pci_device *vp_dev = pci_get_drvdata(pci_dev);
int ret;
ret = virtio_device_reset_prepare(&vp_dev->vdev);
...
```
Right, `virtio_pci_reset_prepare` calls `virtio_device_reset_prepare`, passing in the `virtio_device` structure. This looks like the hook for block device reset!
So `virtio_pci` depends on `VIRTIO_PCI` and `PCI`, as expected, and also on `VIRTIO_BLK`. Let's confirm that by checking `drivers/virtio/Kconfig` to see the dependencies of `VIRTIO_PCI`. I want to make sure I haven't missed anything obvious.
|
| 38/2 | 2026/09/29 13:56 | tool | grepper |
0mArgs:{
"Expression": "config VIRTIO_PCI",
"PathPrefix": "drivers/virtio"
}Results: {
"Output": "drivers/virtio/Kconfig=5=config VIRTIO\n--\ndrivers/virtio/Kconfig-12-\ndrivers/virtio/Kconfig:13:config VIRTIO_PCI_LIB\ndrivers/virtio/Kconfig-14-\ttristate\n--\ndrivers/virtio/Kconfig-20-\ndrivers/virtio/Kconfig:21:config VIRTIO_PCI_LIB_LEGACY\ndrivers/virtio/Kconfig-22-\ttristate\n--\ndrivers/virtio/Kconfig=36=config VIRTIO_HARDEN_NOTIFICATION\n--\ndrivers/virtio/Kconfig-49-\ndrivers/virtio/Kconfig:50:config VIRTIO_PCI\ndrivers/virtio/Kconfig-51-\ttristate \"PCI driver for virtio devices\"\n--\ndrivers/virtio/Kconfig-62-\ndrivers/virtio/Kconfig:63:config VIRTIO_PCI_ADMIN_LEGACY\ndrivers/virtio/Kconfig-64-\tbool\n--\ndrivers/virtio/Kconfig-67-\ndrivers/virtio/Kconfig:68:config VIRTIO_PCI_LEGACY\ndrivers/virtio/Kconfig-69-\tbool \"Support for legacy virtio draft 0.9.X and older devices\"\n"
} |
| 39/2 | 2026/09/29 13:56 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 42892 output: 34 thoughts: 19 Thoughts: Okay, let's dive into this. I'm going to take a look at the `drivers/virtio/Kconfig` file, specifically around line 50. I'm expecting something related to the configuration of Virtio drivers, but I need to pinpoint the exact section I want to refresh my memory on. Knowing the file name and the general area allows me to quickly zero in on a specific part of the source code. |
| 40/2 | 2026/09/29 13:56 | tool | read-file |
0mArgs:{
"File": "drivers/virtio/Kconfig",
"FirstLine": 45,
"LineCount": 20
}Results: {
"Contents": " 45:\t notifications is enforced; depending on the subset of\n 46:\t drivers and devices you use, this may or may not work.\n 47:\t\n 48:\t If unsure, say N.\n 49:\t\n 50:\tconfig VIRTIO_PCI\n 51:\t\ttristate \"PCI driver for virtio devices\"\n 52:\t\tdepends on PCI\n 53:\t\tselect VIRTIO_PCI_LIB\n 54:\t\tselect VIRTIO\n 55:\t\thelp\n 56:\t\t This driver provides support for virtio based paravirtual device\n 57:\t\t drivers over PCI. This requires that your VMM has appropriate PCI\n 58:\t\t virtio backends. Most QEMU based VMMs should support these devices\n 59:\t\t (like KVM or Xen).\n 60:\t\n 61:\t\t If unsure, say M.\n 62:\t\n 63:\tconfig VIRTIO_PCI_ADMIN_LEGACY\n 64:\t\tbool\n"
} |
| 41/2 | 2026/09/29 13:56 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 43307 output: 172 thoughts: 1532 Thoughts: **Fuzzing Recommendation: VIRTIO_BLK** Okay, let's analyze this patch for `VIRTIO_BLK` and determine if fuzzing is warranted. My initial assessment is that it looks promising, so let's carefully go through the criteria. First, is the `WorthFuzzing` flag true? Yes! This patch touches reachable, executable code, specifically within the "Reachable Drivers and Protocols" category. `virtio_blk` is clearly a driver accessible via a virtual bus (virtio). The modified code, `virtblk_freeze_priv` within `drivers/block/virtio_blk.c`, is reachable. It's called by `virtblk_reset_prepare` (triggered by PCI/virtio resets, e.g., via sysfs, VFIO, or error recovery) and `virtblk_freeze` (during PM sleep/hibernate/suspend). Now, let's rule out any reasons *not* to fuzz. There are no "Non-kernel and non-executable changes," no "Structurally unreachable hardware," and no "Unreachable execution paths" that apply here. This is executable C code in a standard virtualized environment (QEMU). The patch focuses on how requests and dispatch are quiesced/waited during freeze and reset prepare: the switch from `blk_mq_quiesce_queue_nowait` to `blk_mq_quiesce_queue` affects queue state and synchronization. Next, the crucial step: identifying the `FocusSymbols`. We must avoid ubiquitous lifecycle hot-paths, and instead target specific feature logic and entrypoints. I'm focusing on the significant functions: `virtblk_freeze_priv`, `virtblk_reset_prepare`, and `virtblk_freeze`. These are the key functions involved in the code change, the patch's core. Finally, the `EnableConfigs`. We'll need `VIRTIO_BLK` as it's the primary configuration. `VIRTIO` and `VIRTIO_PCI` are dependencies, and we'll also include `PM_SLEEP` because `virtblk_freeze` is compiled when `PM_SLEEP` is enabled. Therefore, the essential configurations are: `VIRTIO_BLK`, `VIRTIO`, `VIRTIO_PCI`, and `PM_SLEEP`. Double-checking, `WorthFuzzing` is true. The change focuses on queue quiescing in `virtblk_freeze_priv` of `drivers/block/virtio_blk.c`, switching the queue quiescing from asynchronous to synchronous; this affects queue synchronization during virtio-blk reset (`reset_prepare`) and suspend (`freeze`). The `FocusSymbols` are: `virtblk_freeze_priv`, `virtblk_reset_prepare`, and `virtblk_freeze`. The `EnableConfigs` are: `VIRTIO_BLK`, `VIRTIO`, `VIRTIO_PCI`, and `PM_SLEEP`. This all lines up perfectly with the guidelines. I'm ready to proceed. Let's call `set-results`. |
| 42/2 | 2026/09/29 13:56 | tool | set-results |
0mArgs:{
"EnableConfigs": [
"VIRTIO_BLK",
"VIRTIO",
"VIRTIO_PCI",
"PM_SLEEP"
],
"FocusSymbols": [
"virtblk_freeze_priv",
"virtblk_reset_prepare",
"virtblk_freeze"
],
"Reasoning": "The patch modifies virtblk_freeze_priv() in drivers/block/virtio_blk.c, changing the quiesce call from blk_mq_quiesce_queue_nowait() to blk_mq_quiesce_queue() to ensure ongoing request dispatches have fully completed before resetting virtqueues. This affects reachable virtio block device reset and suspend/freeze paths in standard QEMU environments.",
"WorthFuzzing": true
}Results: {
"EnableConfigs": [
"VIRTIO_BLK",
"VIRTIO",
"VIRTIO_PCI",
"PM_SLEEP"
],
"FocusSymbols": [
"virtblk_freeze_priv",
"virtblk_reset_prepare",
"virtblk_freeze"
],
"Reasoning": "The patch modifies virtblk_freeze_priv() in drivers/block/virtio_blk.c, changing the quiesce call from blk_mq_quiesce_queue_nowait() to blk_mq_quiesce_queue() to ensure ongoing request dispatches have fully completed before resetting virtqueues. This affects reachable virtio block device reset and suspend/freeze paths in standard QEMU environments.",
"WorthFuzzing": true
} |
| 43/1 | 2026/09/29 13:56 | action | If |
0mArgs:{
"WorthFuzzing": true
}Results: null |
| 44/2 | 2026/09/29 13:56 | agent | kmsan-evaluator |
0mModel:core Args: null Results: {
"KMSANReasoning": "The patch modifies virtblk_freeze_priv() in drivers/block/virtio_blk.c by changing blk_mq_quiesce_queue_nowait(q) to blk_mq_quiesce_queue(q). This ensures that the block request queue is properly quiesced and synchronized before the virtqueues are deleted and freed.\n\nThis change is strictly related to queue synchronization and device power management lifecycle to prevent race conditions and potential use-after-free issues during device freeze/suspend. It does not introduce, allocate, or modify any uninitialized stack or heap data, nor does it affect data copies to user space or conditional branching on uninitialized memory. Such concurrency and lifecycle issues are covered by standard bug detectors, KASAN, and LOCKDEP, not KMSAN.",
"NeedsKMSAN": false
}Instruction: You are an expert Linux kernel security engineer specializing in kernel memory
error detectors (KASAN and KMSAN). Your job is to review the provided patch series and
determine if the code changes justify spawning a dedicated KMSAN (KernelMemorySanitizer)
fuzzing session in addition to standard KASAN fuzzing.
CRITICAL DISTINCTION BETWEEN KASAN AND KMSAN:
- Standard KASAN kernel builds (upstream-apparmor-kasan.config) already enable
a comprehensive suite of debugging tools and sanitizers, including KASAN
(out-of-bounds accesses, use-after-free, double free, invalid free), LOCKDEP
(locking bugs and deadlocks), UB-sanitizers, and memory corruption checks.
- KMSAN (KernelMemorySanitizer) detects reads of UNINITIALIZED memory (stack, heap,
or page allocations) and kernel-to-user memory info-leaks.
Rule: THERE IS NO SENSE IN RUNNING A KMSAN SESSION IF A BUG CAN BE CAUGHT BY KASAN,
LOCKDEP, OR OTHER STANDARD BUG DETECTORS.
A dedicated KMSAN fuzzing session incurs significant resource costs. You must ONLY
set NeedsKMSAN=true if the code changes introduce or expose UNINITIALIZED MEMORY risks
that are detected ONLY by KMSAN.
Look holistically at the patch series and surrounding code. Even if no direct
uninitialized field accesses or new buffer allocations are added in the diff itself,
a patch may alter control flow, bounds checking, or data length calculations in ways
that change how the rest of the code operates on existing buffers (e.g. allowing
uninitialized stack/heap memory to be read, copied to user space, or used in control
flow). Do not hesitate to use your code access tools to inspect the surrounding code,
called functions, and callers.
Set NeedsKMSAN=true ONLY IF the patch introduces or modifies:
1. Kernel structures sent to user space (via copy_to_user, put_user, netlink skb
attributes, ioctl output arguments, socket options, or BPF buffers) where fields
or structure padding might not be fully initialized/zeroed.
2. Conditional logic or branching that depends on potentially uninitialized variables
or struct fields.
3. Allocation or initialization of complex data structures where uninitialized fields
could be read later in reachable code paths.
4. Bounds checks, lengths, or logic in a way that allows surrounding code to access
uninitialized bytes of existing buffers.
Set NeedsKMSAN=false IF:
- The code changes primarily risk out-of-bounds access, array overflows, NULL pointer
dereferences, locking deadlocks, or use-after-free bugs (these are already caught
by KASAN, LOCKDEP, or standard bug detectors).
- All stack/heap structures touched or introduced by the patch are fully zeroed
or initialized (e.g. using = {0}, memset, kzalloc) before being read or copied.
- The patch does not introduce any risk of uninitialized memory usage or info-leaks.
Use your code access tools to inspect the surrounding code if necessary, then provide
detailed KMSANReasoning contrasting KASAN vs KMSAN applicability for this patch.
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 01cbd6d9b82823dc0fd0f2f7eb96d39234630983
Author: syz-cluster <triage@syzkaller.com>
Date: Tue Sep 29 13:51:51 2026 +0000
syz-cluster: applied patch under review
diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
index 32bf3ba07a9dc..7a570591e040a 100644
--- a/drivers/block/virtio_blk.c
+++ b/drivers/block/virtio_blk.c
@@ -1595,7 +1595,7 @@ static int virtblk_freeze_priv(struct virtio_device *vdev)
/* Ensure no requests in virtqueues before deleting vqs. */
memflags = blk_mq_freeze_queue(q);
- blk_mq_quiesce_queue_nowait(q);
+ blk_mq_quiesce_queue(q);
blk_mq_unfreeze_queue(q, memflags);
/* Ensure we don't receive any more interrupts */
|
| 45/3 | 2026/09/29 13:56 | llm | kmsan-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 2100 output: 39 thoughts: 296 Thoughts: **Analyzing a Virtio Block Device Patch** Okay, so I've got a patch here for `drivers/block/virtio_blk.c` that I need to evaluate. Let's see... the diff is relatively small, focusing on the `virtblk_freeze_priv` function, specifically around how the block queue is handled during a freeze operation. It looks like they're changing `blk_mq_quiesce_queue_nowait` to `blk_mq_quiesce_queue`. Interesting. My initial thought is to figure out *why* this change was made. `blk_mq_quiesce_queue` is a blocking call, while `blk_mq_quiesce_queue_nowait` presumably is not. So, the question is what's the rationale for making this blocking, or if there is a bug? I need more context here to understand the implications of this change. I'll take a quick look around line 1595 in the source file, using `read-file`, to see how the queue is used around this point. What's the impact on the overall freeze/thaw process and any associated synchronization primitives? I also want to determine if there's any obvious explanation for why this change was done, like a race condition or a specific workload that would require a blocking quiesce. I will be looking for any comments in the code and surrounding code to understand the intent. Based on that context I should be able to determine if this is a reasonable change or if there are any risks or design concerns. |
| 46/3 | 2026/09/29 13:56 | tool | read-file |
0mArgs:{
"File": "drivers/block/virtio_blk.c",
"FirstLine": 1580,
"LineCount": 40
}Results: {
"Contents": "1580:\t\tvblk-\u003evdev = NULL;\n1581:\t\n1582:\t\tvdev-\u003econfig-\u003edel_vqs(vdev);\n1583:\t\tkfree(vblk-\u003evqs);\n1584:\t\n1585:\t\tmutex_unlock(\u0026vblk-\u003evdev_mutex);\n1586:\t\n1587:\t\tput_disk(vblk-\u003edisk);\n1588:\t}\n1589:\t\n1590:\tstatic int virtblk_freeze_priv(struct virtio_device *vdev)\n1591:\t{\n1592:\t\tstruct virtio_blk *vblk = vdev-\u003epriv;\n1593:\t\tstruct request_queue *q = vblk-\u003edisk-\u003equeue;\n1594:\t\tunsigned int memflags;\n1595:\t\n1596:\t\t/* Ensure no requests in virtqueues before deleting vqs. */\n1597:\t\tmemflags = blk_mq_freeze_queue(q);\n1598:\t\tblk_mq_quiesce_queue(q);\n1599:\t\tblk_mq_unfreeze_queue(q, memflags);\n1600:\t\n1601:\t\t/* Ensure we don't receive any more interrupts */\n1602:\t\tvirtio_reset_device(vdev);\n1603:\t\n1604:\t\t/* Make sure no work handler is accessing the device. */\n1605:\t\tflush_work(\u0026vblk-\u003econfig_work);\n1606:\t\n1607:\t\tvdev-\u003econfig-\u003edel_vqs(vdev);\n1608:\t\tkfree(vblk-\u003evqs);\n1609:\t\t/*\n1610:\t\t * Set to NULL to prevent freeing vqs again after a failed vqs\n1611:\t\t * allocation during resume. Note that kfree() already handles NULL\n1612:\t\t * pointers safely.\n1613:\t\t */\n1614:\t\tvblk-\u003evqs = NULL;\n1615:\t\n1616:\t\treturn 0;\n1617:\t}\n1618:\t\n1619:\tstatic int virtblk_restore_priv(struct virtio_device *vdev)\n"
} |
| 47/3 | 2026/09/29 13:56 | llm | kmsan-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 3349 output: 43 thoughts: 51 Thoughts: Okay, let's dive into this `blk_mq_quiesce_queue_nowait` function within the `virtblk_freeze_priv` context. I need to understand what triggered this modification or introduction. This usually indicates a change in the block I/O behavior, likely related to freezing or quiescing the virtual block device. My initial approach will be to leverage `git log` to trace the history. I'll focus on commits that specifically touch `blk_mq_quiesce_queue_nowait` or anything related to `virtblk_freeze_priv`. I'm expecting to find a patch description that explains the rationale behind this inclusion or change. If `git log` doesn't yield immediate answers, I'll fall back to `grepper` which should enable me to search the source and identify potentially interesting code or configuration options that could offer more context for this particular use of `blk_mq_quiesce_queue_nowait`. I am certain there is a compelling reason for this change. I must find it. |
| 48/3 | 2026/09/29 13:57 | tool | grepper |
0mArgs:{
"Expression": "blk_mq_quiesce_queue.*\\(q\\)",
"PathPrefix": "drivers/block/virtio_blk.c"
}Results: {
"Output": "drivers/block/virtio_blk.c=1590=static int virtblk_freeze_priv(struct virtio_device *vdev)\n--\ndrivers/block/virtio_blk.c-1597-\tmemflags = blk_mq_freeze_queue(q);\ndrivers/block/virtio_blk.c:1598:\tblk_mq_quiesce_queue(q);\ndrivers/block/virtio_blk.c-1599-\tblk_mq_unfreeze_queue(q, memflags);\n"
} |
| 49/3 | 2026/09/29 13:57 | llm | kmsan-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 3808 output: 193 thoughts: 819 Thoughts: **Analyzing the Impact of `blk_mq_quiesce_queue` vs. `blk_mq_quiesce_queue_nowait`** Okay, let's break this down. My initial thought was to examine the difference between `blk_mq_quiesce_queue_nowait` and `blk_mq_quiesce_queue`. It's clear that the former is a non-blocking quiesce, while the latter waits for completion of queue dispatching and requests – basically, it synchronizes with the hardware queues. Specifically in the `virtblk_freeze_priv` path, before deleting virtqueues, we *must* ensure that no requests are actively accessing them. Using `blk_mq_quiesce_queue_nowait` here would create a window for a race condition, a use-after-free, since requests could still be in flight while the virtqueues are being torn down. So, swapping in `blk_mq_quiesce_queue` makes perfect sense – we're guaranteeing that quiescing waits for everything to complete. Now, the important question: Does this trigger any KMSAN concerns related to uninitialized memory? Let's go through the checklist. * **First, Kernel structures to userspace:** Nope. This change has nothing to do with data structures sent to user space. It's purely synchronization related to hardware queue lifecycle. * **Second, Conditional logic on uninitialized variables:** No. This is about ensuring completion/synchronization, not conditional branching based on uninitialized data. * **Third, Allocation of complex data structures:** Absolutely not. The change doesn't allocate or initialize any new data structures. * **Fourth, Bounds checks leading to uninitialized byte access:** Nope. There's no modification of buffer bounds, nor is there any risk introduced by changing the call to `blk_mq_quiesce_queue`. This change is about concurrency and lifecycle management in the block layer, specifically within the virtio-blk freeze path. The main concern here is race conditions and use-after-free, specifically related to the removal of virtqueues while requests could still be running. The kind of issues that could arise would be deadlocks, or use-after-free, all of which are handled by LOCKDEP and KASAN. Therefore, after going through the KMSAN criteria, my conclusion is that `NeedsKMSAN` is definitively `false`. There is no risk of uninitialized memory being introduced or exposed. Okay, I'm satisfied. Let's do a final review and then call `set-results`. |
| 50/3 | 2026/09/29 13:57 | tool | set-results |
0mArgs:{
"KMSANReasoning": "The patch modifies virtblk_freeze_priv() in drivers/block/virtio_blk.c by changing blk_mq_quiesce_queue_nowait(q) to blk_mq_quiesce_queue(q). This ensures that the block request queue is properly quiesced and synchronized before the virtqueues are deleted and freed.\n\nThis change is strictly related to queue synchronization and device power management lifecycle to prevent race conditions and potential use-after-free issues during device freeze/suspend. It does not introduce, allocate, or modify any uninitialized stack or heap data, nor does it affect data copies to user space or conditional branching on uninitialized memory. Such concurrency and lifecycle issues are covered by standard bug detectors, KASAN, and LOCKDEP, not KMSAN.",
"NeedsKMSAN": false
}Results: {
"KMSANReasoning": "The patch modifies virtblk_freeze_priv() in drivers/block/virtio_blk.c by changing blk_mq_quiesce_queue_nowait(q) to blk_mq_quiesce_queue(q). This ensures that the block request queue is properly quiesced and synchronized before the virtqueues are deleted and freed.\n\nThis change is strictly related to queue synchronization and device power management lifecycle to prevent race conditions and potential use-after-free issues during device freeze/suspend. It does not introduce, allocate, or modify any uninitialized stack or heap data, nor does it affect data copies to user space or conditional branching on uninitialized memory. Such concurrency and lifecycle issues are covered by standard bug detectors, KASAN, and LOCKDEP, not KMSAN.",
"NeedsKMSAN": false
} |
| Total Calls | Total Tokens | Avg Tokens | Total Duration (Seconds) | Avg Duration (Seconds) |
|---|
| Total Calls | Total Duration (Seconds) | Avg Duration (Seconds) |
|---|