AI Trajectory


Trajectory: (Expand/Collapse All)
Seq Timestamp Type Name Duration
0/0 2026/10/04 12:17 flow patch-triage
0m Args:
null

Results:
{
  "EnableConfigs": null,
  "FocusSymbols": [],
  "KMSANReasoning": "",
  "NeedsKMSAN": false,
  "Reasoning": "The patch modifies the STMicroelectronics / Synopsys DesignWare Ethernet MAC (stmmac) driver, specifically auxiliary snapshot and hardware timestamping support for Synopsys XGMAC and SoC FPGA hardware. This driver requires physical SoC/PCIe hardware that is not emulated in standard QEMU or GCE virtualized environments on amd64, making the modified code structurally unreachable for fuzzing.",
  "WorthFuzzing": false
}

1/1 2026/10/04 12:17 action read-patch-diff
0m Args:
null

Results:
{
  "PatchDiff": "commit f5b8ea3d1365df4e67ee9af3808db25b06dbc8ec\nAuthor: syz-cluster \u003ctriage@syzkaller.com\u003e\nDate:   Sun Oct 4 12:17:38 2026 +0000\n\n    syz-cluster: applied patch under review\n\ndiff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c\nindex 1d7f0a57d2889..9030cc1cc6778 100644\n--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c\n+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c\n@@ -311,6 +311,7 @@ static int smtg_crosststamp(ktime_t *device, struct system_counterval_t *system,\n \t\treturn -EBUSY;\n \n \tmutex_lock(\u0026priv-\u003eaux_ts_lock);\n+\tpriv-\u003eplat-\u003eflags |= STMMAC_FLAG_INT_SNAPSHOT_EN;\n \t/* Enable Internal snapshot trigger */\n \tacr_value = readl(ptpaddr + PTP_ACR);\n \tacr_value \u0026= ~PTP_ACR_MASK;\n@@ -328,6 +329,7 @@ static int smtg_crosststamp(ktime_t *device, struct system_counterval_t *system,\n \t\tacr_value |= PTP_ACR_ATSEN3;\n \t\tbreak;\n \tdefault:\n+\t\tpriv-\u003eplat-\u003eflags \u0026= ~STMMAC_FLAG_INT_SNAPSHOT_EN;\n \t\tmutex_unlock(\u0026priv-\u003eaux_ts_lock);\n \t\treturn -EINVAL;\n \t}\n@@ -337,8 +339,19 @@ static int smtg_crosststamp(ktime_t *device, struct system_counterval_t *system,\n \tacr_value = readl(ptpaddr + PTP_ACR);\n \tacr_value |= PTP_ACR_ATSFC;\n \twritel(acr_value, ptpaddr + PTP_ACR);\n-\t/* Release the mutex */\n-\tmutex_unlock(\u0026priv-\u003eaux_ts_lock);\n+\n+\t/* Wait for the FIFO clear to complete, so the poll below only\n+\t * observes snapshots latched by this trigger.\n+\t */\n+\tret = readl_poll_timeout(ptpaddr + PTP_ACR, acr_value,\n+\t\t\t\t !(acr_value \u0026 PTP_ACR_ATSFC), 10, 10000);\n+\tif (ret) {\n+\t\tpriv-\u003eplat-\u003eflags \u0026= ~STMMAC_FLAG_INT_SNAPSHOT_EN;\n+\t\tmutex_unlock(\u0026priv-\u003eaux_ts_lock);\n+\t\tnetdev_err(priv-\u003edev, \"%s: Failed to clear snapshot FIFO\\n\",\n+\t\t\t   __func__);\n+\t\treturn ret;\n+\t}\n \n \t/* Trigger Internal snapshot signal. Create a rising edge by just toggle\n \t * the GPO0 to low and back to high.\n@@ -349,10 +362,17 @@ static int smtg_crosststamp(ktime_t *device, struct system_counterval_t *system,\n \tgpio_value |= XGMAC_GPIO_GPO0;\n \twritel(gpio_value, ioaddr + XGMAC_GPIO_STATUS);\n \n-\t/* Poll for time sync operation done */\n-\tret = readl_poll_timeout(priv-\u003eioaddr + XGMAC_INT_STATUS, v,\n-\t\t\t\t (v \u0026 XGMAC_INT_TSIS), 100, 10000);\n+\t/* Wait for the auxiliary snapshot to be latched: the ATSNS count\n+\t * is the FIFO level and is not affected by reading\n+\t * XGMAC_TIMESTAMP_STATUS, so concurrent readers cannot disturb\n+\t * the poll.\n+\t */\n+\tret = readl_poll_timeout(ioaddr + XGMAC_TIMESTAMP_STATUS, v,\n+\t\t\t\t FIELD_GET(XGMAC_TIMESTAMP_ATSNS_MASK, v),\n+\t\t\t\t 100, 10000);\n \tif (ret) {\n+\t\tpriv-\u003eplat-\u003eflags \u0026= ~STMMAC_FLAG_INT_SNAPSHOT_EN;\n+\t\tmutex_unlock(\u0026priv-\u003eaux_ts_lock);\n \t\tnetdev_err(priv-\u003edev, \"%s: Wait for time sync operation timeout\\n\",\n \t\t\t   __func__);\n \t\treturn ret;\n@@ -364,8 +384,7 @@ static int smtg_crosststamp(ktime_t *device, struct system_counterval_t *system,\n \t\t.use_nsecs = false,\n \t};\n \n-\tnum_snapshot = FIELD_GET(XGMAC_TIMESTAMP_ATSNS_MASK,\n-\t\t\t\t readl(ioaddr + XGMAC_TIMESTAMP_STATUS));\n+\tnum_snapshot = FIELD_GET(XGMAC_TIMESTAMP_ATSNS_MASK, v);\n \n \t/* Repeat until the timestamps are from the FIFO last segment */\n \tfor (i = 0; i \u003c num_snapshot; i++) {\n@@ -375,6 +394,9 @@ static int smtg_crosststamp(ktime_t *device, struct system_counterval_t *system,\n \t\tread_unlock_irqrestore(\u0026priv-\u003eptp_lock, flags);\n \t}\n \n+\tpriv-\u003eplat-\u003eflags \u0026= ~STMMAC_FLAG_INT_SNAPSHOT_EN;\n+\tmutex_unlock(\u0026priv-\u003eaux_ts_lock);\n+\n \tget_smtgtime(priv-\u003emii, SMTG_MDIO_ADDR, \u0026smtg_time);\n \tsystem-\u003ecycles = smtg_time;\n \ndiff --git a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c\nindex 1a88cbaed70ca..313c24e9a49d7 100644\n--- a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c\n+++ b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c\n@@ -42,6 +42,12 @@ static void dwxgmac2_irq_modify(struct mac_device_info *hw, u32 disable,\n \tspin_unlock_irqrestore(\u0026hw-\u003eirq_ctrl_lock, flags);\n }\n \n+static void dwxgmac2_timestamp_interrupt_cfg(struct stmmac_priv *priv, bool en)\n+{\n+\tstmmac_mac_irq_modify(priv, en ? 0 : XGMAC_TSIE,\n+\t\t\t      en ? XGMAC_TSIE : 0);\n+}\n+\n static void dwxgmac2_update_caps(struct stmmac_priv *priv)\n {\n \tif (!priv-\u003edma_cap.mbps_10_100)\n@@ -1154,6 +1160,57 @@ static int dwxgmac2_get_mac_tx_timestamp(struct mac_device_info *hw, u64 *ts)\n \treturn 0;\n }\n \n+void dwxgmac2_timestamp_interrupt(struct stmmac_priv *priv)\n+{\n+\tu32 ts_status, pending_snapshots, acr_value, channel;\n+\tstruct ptp_clock_event event;\n+\tunsigned long flags;\n+\tu64 ptp_time;\n+\tint i;\n+\n+\tif (priv-\u003eplat-\u003eflags \u0026 STMMAC_FLAG_INT_SNAPSHOT_EN) {\n+\t\t/* Read the status to clear the timestamp interrupt source;\n+\t\t * the FIFO belongs to the cross-timestamp path.\n+\t\t */\n+\t\treadl(priv-\u003eioaddr + XGMAC_TIMESTAMP_STATUS);\n+\t\treturn;\n+\t}\n+\n+\t/* Reading XGMAC_TIMESTAMP_STATUS clears the TSIS and AUXTSTRIG\n+\t * bits, so the ATSNS count is the only reliable indication of\n+\t * pending auxiliary snapshots.  TXTSC is cleared by\n+\t * XGMAC_TXTIMESTAMP_SEC and is not affected by this read.\n+\t */\n+\tts_status = readl(priv-\u003eioaddr + XGMAC_TIMESTAMP_STATUS);\n+\n+\tif (!(priv-\u003eplat-\u003eflags \u0026 STMMAC_FLAG_EXT_SNAPSHOT_EN) || !priv-\u003eptp_clock)\n+\t\treturn;\n+\n+\tpending_snapshots = FIELD_GET(XGMAC_TIMESTAMP_ATSNS_MASK, ts_status);\n+\tif (!pending_snapshots)\n+\t\treturn;\n+\n+\tacr_value = readl(priv-\u003eptpaddr + PTP_ACR);\n+\t/* Entries observed while the FIFO is being flushed are stale. */\n+\tif (acr_value \u0026 PTP_ACR_ATSFC)\n+\t\treturn;\n+\tchannel = FIELD_GET(PTP_ACR_MASK, acr_value);\n+\tif (!channel)\n+\t\treturn;\n+\tchannel = ilog2(channel);\n+\n+\tfor (i = 0; i \u003c pending_snapshots; i++) {\n+\t\tread_lock_irqsave(\u0026priv-\u003eptp_lock, flags);\n+\t\tstmmac_get_ptptime(priv, priv-\u003eptpaddr, \u0026ptp_time);\n+\t\tread_unlock_irqrestore(\u0026priv-\u003eptp_lock, flags);\n+\n+\t\tevent.type = PTP_CLOCK_EXTTS;\n+\t\tevent.index = channel;\n+\t\tevent.timestamp = ptp_time;\n+\t\tptp_clock_event(priv-\u003eptp_clock, \u0026event);\n+\t}\n+}\n+\n static int dwxgmac2_flex_pps_config(void __iomem *ioaddr, int index,\n \t\t\t\t    struct stmmac_pps_cfg *cfg, bool enable,\n \t\t\t\t    u32 sub_second_inc, u32 systime_flags)\n@@ -1413,6 +1470,7 @@ static int dwxgmac2_config_l4_filter(struct mac_device_info *hw, u32 filter_no,\n const struct stmmac_ops dwxgmac210_ops = {\n \t.core_init = dwxgmac2_core_init,\n \t.irq_modify = dwxgmac2_irq_modify,\n+\t.timestamp_interrupt_cfg = dwxgmac2_timestamp_interrupt_cfg,\n \t.update_caps = dwxgmac2_update_caps,\n \t.set_mac = dwxgmac2_set_mac,\n \t.rx_ipc = dwxgmac2_rx_ipc,\n@@ -1468,6 +1526,7 @@ static void dwxlgmac2_rx_queue_enable(struct mac_device_info *hw, u8 mode,\n const struct stmmac_ops dwxlgmac2_ops = {\n \t.core_init = dwxgmac2_core_init,\n \t.irq_modify = dwxgmac2_irq_modify,\n+\t.timestamp_interrupt_cfg = dwxgmac2_timestamp_interrupt_cfg,\n \t.set_mac = dwxgmac2_set_mac,\n \t.rx_ipc = dwxgmac2_rx_ipc,\n \t.rx_queue_enable = dwxlgmac2_rx_queue_enable,\ndiff --git a/drivers/net/ethernet/stmicro/stmmac/hwif.c b/drivers/net/ethernet/stmicro/stmmac/hwif.c\nindex 265671170bf6e..eba87410f985a 100644\n--- a/drivers/net/ethernet/stmicro/stmmac/hwif.c\n+++ b/drivers/net/ethernet/stmicro/stmmac/hwif.c\n@@ -258,7 +258,7 @@ static const struct stmmac_hwif_entry {\n \t\t.dma = \u0026dwxgmac210_dma_ops,\n \t\t.mac = \u0026dwxgmac210_ops,\n \t\t.vlan = \u0026dwxgmac210_vlan_ops,\n-\t\t.hwtimestamp = \u0026stmmac_ptp,\n+\t\t.hwtimestamp = \u0026dwxgmac2_ptp,\n \t\t.ptp = \u0026stmmac_ptp_clock_ops,\n \t\t.mode = NULL,\n \t\t.tc = \u0026dwmac510_tc_ops,\n@@ -280,7 +280,7 @@ static const struct stmmac_hwif_entry {\n \t\t.dma = \u0026dwxgmac210_dma_ops,\n \t\t.mac = \u0026dwxlgmac2_ops,\n \t\t.vlan = \u0026dwxlgmac2_vlan_ops,\n-\t\t.hwtimestamp = \u0026stmmac_ptp,\n+\t\t.hwtimestamp = \u0026dwxgmac2_ptp,\n \t\t.ptp = \u0026stmmac_ptp_clock_ops,\n \t\t.mode = NULL,\n \t\t.tc = \u0026dwmac510_tc_ops,\ndiff --git a/drivers/net/ethernet/stmicro/stmmac/hwif.h b/drivers/net/ethernet/stmicro/stmmac/hwif.h\nindex a8a5c8fdd5edb..14a47d68399f0 100644\n--- a/drivers/net/ethernet/stmicro/stmmac/hwif.h\n+++ b/drivers/net/ethernet/stmicro/stmmac/hwif.h\n@@ -317,6 +317,8 @@ struct stmmac_ops {\n \tvoid (*update_caps)(struct stmmac_priv *priv);\n \t/* Change the interrupt enable setting. Enable takes precedence. */\n \tvoid (*irq_modify)(struct mac_device_info *hw, u32 disable, u32 enable);\n+\t/* Arm or disarm the timestamp interrupt on demand (optional) */\n+\tvoid (*timestamp_interrupt_cfg)(struct stmmac_priv *priv, bool en);\n \t/* Enable the MAC RX/TX */\n \tvoid (*set_mac)(void __iomem *ioaddr, bool enable);\n \t/* Enable and verify that the IPC module is supported */\n@@ -420,6 +422,8 @@ struct stmmac_ops {\n \tstmmac_do_void_callback(__priv, mac, update_caps, __priv)\n #define stmmac_mac_irq_modify(__priv, __args...) \\\n \tstmmac_do_void_callback(__priv, mac, irq_modify, (__priv)-\u003ehw, __args)\n+#define stmmac_mac_timestamp_interrupt_cfg(__priv, __args...) \\\n+\tstmmac_do_void_callback(__priv, mac, timestamp_interrupt_cfg, __priv, __args)\n #define stmmac_mac_set(__priv, __args...) \\\n \tstmmac_do_void_callback(__priv, mac, set_mac, __args)\n #define stmmac_rx_ipc(__priv, __args...) \\\n@@ -672,6 +676,7 @@ extern const struct stmmac_desc_ops ndesc_ops;\n \n extern const struct stmmac_hwtimestamp stmmac_ptp;\n extern const struct stmmac_hwtimestamp dwmac1000_ptp;\n+extern const struct stmmac_hwtimestamp dwxgmac2_ptp;\n \n extern const struct stmmac_mode_ops ring_mode_ops;\n extern const struct stmmac_mode_ops chain_mode_ops;\ndiff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c\nindex b9a985fa772c9..4b906bc33d266 100644\n--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c\n+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c\n@@ -242,7 +242,10 @@ static void timestamp_interrupt(struct stmmac_priv *priv)\n \t\t       GMAC_TIMESTAMP_ATSNS_SHIFT;\n \n \tacr_value = readl(priv-\u003eptpaddr + PTP_ACR);\n-\tchannel = ilog2(FIELD_GET(PTP_ACR_MASK, acr_value));\n+\tchannel = FIELD_GET(PTP_ACR_MASK, acr_value);\n+\tif (!channel)\n+\t\treturn;\n+\tchannel = ilog2(channel);\n \n \tfor (i = 0; i \u003c num_snapshot; i++) {\n \t\tread_lock_irqsave(\u0026priv-\u003eptp_lock, flags);\n@@ -277,3 +280,15 @@ const struct stmmac_hwtimestamp dwmac1000_ptp = {\n \t.get_ptptime = dwmac1000_get_ptptime,\n \t.timestamp_interrupt = dwmac1000_timestamp_interrupt,\n };\n+\n+const struct stmmac_hwtimestamp dwxgmac2_ptp = {\n+\t.config_hw_tstamping = config_hw_tstamping,\n+\t.init_systime = init_systime,\n+\t.config_sub_second_increment = config_sub_second_increment,\n+\t.config_addend = config_addend,\n+\t.adjust_systime = adjust_systime,\n+\t.get_systime = get_systime,\n+\t.get_ptptime = get_ptptime,\n+\t.timestamp_interrupt = dwxgmac2_timestamp_interrupt,\n+\t.hwtstamp_correct_latency = hwtstamp_correct_latency,\n+};\ndiff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c\nindex 3ad9252bf6aea..53aaf2716c467 100644\n--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c\n+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c\n@@ -18,6 +18,7 @@\n #include \u003clinux/clk.h\u003e\n #include \u003clinux/kernel.h\u003e\n #include \u003clinux/interrupt.h\u003e\n+#include \u003clinux/iopoll.h\u003e\n #include \u003clinux/ip.h\u003e\n #include \u003clinux/tcp.h\u003e\n #include \u003clinux/skbuff.h\u003e\n@@ -894,6 +895,54 @@ static int stmmac_init_ptp_clk_freq(struct stmmac_priv *priv)\n \treturn 0;\n }\n \n+/**\n+ * stmmac_rearm_timestamp_irq - re-arm the timestamp interrupt\n+ * @priv: driver private structure\n+ * Description: this re-arms the on-demand timestamp interrupt if an\n+ * auxiliary snapshot channel was left enabled.\n+ */\n+static void stmmac_rearm_timestamp_irq(struct stmmac_priv *priv)\n+{\n+\tu32 acr_value;\n+\tint ret, num;\n+\n+\tif (!(priv-\u003eplat-\u003eflags \u0026 STMMAC_FLAG_EXT_SNAPSHOT_EN) ||\n+\t    !priv-\u003eptp_clock)\n+\t\treturn;\n+\n+\t/* Flush the FIFO, re-program the enabled auxiliary snapshot\n+\t * trigger and re-arm the interrupt only if the flush completed.\n+\t */\n+\tif (priv-\u003eplat-\u003ecore_type != DWMAC_CORE_XGMAC)\n+\t\treturn;\n+\n+\tmutex_lock(\u0026priv-\u003eaux_ts_lock);\n+\t/* Snapshot the channel under the lock: a concurrent disable may\n+\t * have dropped it since the gate check above.\n+\t */\n+\tnum = priv-\u003eplat-\u003eext_snapshot_num;\n+\tif (num \u003c 0) {\n+\t\tmutex_unlock(\u0026priv-\u003eaux_ts_lock);\n+\t\treturn;\n+\t}\n+\tacr_value = readl(priv-\u003eptpaddr + PTP_ACR);\n+\tacr_value \u0026= ~PTP_ACR_MASK;\n+\tacr_value |= PTP_ACR_ATSFC;\n+\twritel(acr_value, priv-\u003eptpaddr + PTP_ACR);\n+\tret = readl_poll_timeout(priv-\u003eptpaddr + PTP_ACR, acr_value,\n+\t\t\t\t !(acr_value \u0026 PTP_ACR_ATSFC), 10, 10000);\n+\tif (!ret) {\n+\t\tacr_value |= PTP_ACR_ATSEN(num);\n+\t\twritel(acr_value, priv-\u003eptpaddr + PTP_ACR);\n+\t\tstmmac_mac_timestamp_interrupt_cfg(priv, true);\n+\t} else {\n+\t\tnetdev_err(priv-\u003edev,\n+\t\t\t   \"%s: Failed to restore auxiliary snapshot channel\\n\",\n+\t\t\t   __func__);\n+\t}\n+\tmutex_unlock(\u0026priv-\u003eaux_ts_lock);\n+}\n+\n /**\n  * stmmac_init_timestamping - initialise timestamping\n  * @priv: driver private structure\n@@ -8418,6 +8467,8 @@ int stmmac_resume(struct device *dev)\n \t\tret = stmmac_init_timestamping(priv);\n \t\tif (ret)\n \t\t\tgoto error_stop_dma;\n+\n+\t\tstmmac_rearm_timestamp_irq(priv);\n \t}\n \n init_coalesce:\ndiff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c\nindex 3bfcc9760dce7..19fa79839e465 100644\n--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c\n+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c\n@@ -239,13 +239,20 @@ static int stmmac_enable(struct ptp_clock_info *ptp,\n \t\t\t\treturn -EBUSY;\n \t\t\t}\n \n+\t\t\tif (rq-\u003eextts.index \u003e= PTP_ACR_ATSEN_NUM) {\n+\t\t\t\tmutex_unlock(\u0026priv-\u003eaux_ts_lock);\n+\t\t\t\treturn -EINVAL;\n+\t\t\t}\n+\n \t\t\tpriv-\u003eplat-\u003eflags |= STMMAC_FLAG_EXT_SNAPSHOT_EN;\n+\t\t\tpriv-\u003eplat-\u003eext_snapshot_num = rq-\u003eextts.index;\n \n \t\t\t/* Enable External snapshot trigger */\n \t\t\tacr_value |= PTP_ACR_ATSEN(rq-\u003eextts.index);\n \t\t\tacr_value |= PTP_ACR_ATSFC;\n \t\t} else {\n \t\t\tpriv-\u003eplat-\u003eflags \u0026= ~STMMAC_FLAG_EXT_SNAPSHOT_EN;\n+\t\t\tpriv-\u003eplat-\u003eext_snapshot_num = -1;\n \t\t}\n \t\tnetdev_dbg(priv-\u003edev, \"Auxiliary Snapshot %d %s.\\n\",\n \t\t\t   rq-\u003eextts.index, on ? \"enabled\" : \"disabled\");\n@@ -255,6 +262,17 @@ static int stmmac_enable(struct ptp_clock_info *ptp,\n \t\tret = readl_poll_timeout(ptpaddr + PTP_ACR, acr_value,\n \t\t\t\t\t !(acr_value \u0026 PTP_ACR_ATSFC),\n \t\t\t\t\t 10, 10000);\n+\t\t/* Arm or disarm the timestamp interrupt only once the FIFO\n+\t\t * clear has completed, so the handler does not observe a\n+\t\t * snapshot that the clear is about to discard.\n+\t\t */\n+\t\tif (!ret) {\n+\t\t\tstmmac_mac_timestamp_interrupt_cfg(priv, on);\n+\t\t} else if (on) {\n+\t\t\tmutex_lock(\u0026priv-\u003eaux_ts_lock);\n+\t\t\tpriv-\u003eplat-\u003eext_snapshot_num = -1;\n+\t\t\tmutex_unlock(\u0026priv-\u003eaux_ts_lock);\n+\t\t}\n \t\tbreak;\n \t}\n \n@@ -355,7 +373,7 @@ void stmmac_ptp_register(struct stmmac_priv *priv)\n \tif (pps_out_num)\n \t\tpriv-\u003eptp_clock_ops.n_per_out = pps_out_num;\n \n-\tn_ext_ts = priv-\u003edma_cap.aux_snapshot_n;\n+\tn_ext_ts = min(priv-\u003edma_cap.aux_snapshot_n, PTP_ACR_ATSEN_NUM);\n \tif (n_ext_ts)\n \t\tpriv-\u003eptp_clock_ops.n_ext_ts = n_ext_ts;\n \n@@ -394,6 +412,9 @@ void stmmac_ptp_unregister(struct stmmac_priv *priv)\n \t\tpr_debug(\"Removed PTP HW clock successfully on %s\\n\",\n \t\t\t priv-\u003edev-\u003ename);\n \n+\t\tstmmac_mac_timestamp_interrupt_cfg(priv, false);\n+\t\tpriv-\u003eplat-\u003eflags \u0026= ~STMMAC_FLAG_EXT_SNAPSHOT_EN;\n+\n \t\tmutex_destroy(\u0026priv-\u003eaux_ts_lock);\n \t}\n }\ndiff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.h b/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.h\nindex 3fe0e3a80e80a..a2082e1299b8b 100644\n--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.h\n+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.h\n@@ -81,6 +81,7 @@\n #define\tPTP_ACR_ATSEN3\t\tBIT(7)\t/* Auxiliary Snapshot 3 Enable */\n #define\tPTP_ACR_ATSEN(index)\t(PTP_ACR_ATSEN0 \u003c\u003c (index))\n #define\tPTP_ACR_MASK\t\tGENMASK(7, 4)\t/* Aux Snapshot Mask */\n+#define\tPTP_ACR_ATSEN_NUM\t4\t/* Aux Snapshot 0-3 */\n #define\tPMC_ART_VALUE0\t\t0x01\t/* PMC_ART[15:0] timer value */\n #define\tPMC_ART_VALUE1\t\t0x02\t/* PMC_ART[31:16] timer value */\n #define\tPMC_ART_VALUE2\t\t0x03\t/* PMC_ART[47:32] timer value */\n@@ -103,6 +104,7 @@ int dwmac1000_ptp_enable(struct ptp_clock_info *ptp,\n \n void dwmac1000_get_ptptime(void __iomem *ptpaddr, u64 *ptp_time);\n void dwmac1000_timestamp_interrupt(struct stmmac_priv *priv);\n+void dwxgmac2_timestamp_interrupt(struct stmmac_priv *priv);\n \n extern const struct ptp_clock_info stmmac_ptp_clock_ops;\n extern const struct ptp_clock_info dwmac1000_ptp_clock_ops;\ndiff --git a/include/linux/stmmac.h b/include/linux/stmmac.h\nindex 00be2df63d220..487dd492c4b12 100644\n--- a/include/linux/stmmac.h\n+++ b/include/linux/stmmac.h\n@@ -351,6 +351,7 @@ struct plat_stmmacenet_data {\n \tu8 vlan_fail_q;\n \tbool provide_bus_info;\n \tint int_snapshot_num;\n+\tint ext_snapshot_num;\n \tint msi_mac_vec;\n \tint msi_wol_vec;\n \tint msi_sfty_ce_vec;\n"
}

2/1 2026/10/04 12:17 agent patch-evaluator
0m Model:
core

Args:
null

Results:
{
  "EnableConfigs": null,
  "FocusSymbols": [],
  "Reasoning": "The patch modifies the STMicroelectronics / Synopsys DesignWare Ethernet MAC (stmmac) driver, specifically auxiliary snapshot and hardware timestamping support for Synopsys XGMAC and SoC FPGA hardware. This driver requires physical SoC/PCIe hardware that is not emulated in standard QEMU or GCE virtualized environments on amd64, making the modified code structurally unreachable for fuzzing.",
  "WorthFuzzing": false
}

Instruction:
You are an expert Linux kernel maintainer and security engineer.
Your job is to review a provided patch series and evaluate whether it warrants fuzzing with syzkaller.

IMPORTANT: The changes have ALREADY been applied and committed as the HEAD commit in
your workspace. Do NOT rely on internal assumptions. You must actively use your code access
tools to inspect the actual source code, callers, and surrounding context.

================================================================================
1. CORE TRIAGE PHILOSOPHY
================================================================================
The goal of patch fuzzing is to discover crashes, regressions, exposed latent bugs,
and newly triggered assertions introduced by the patch series.

- REACHABILITY IS THE PRIMARY GATE:
  Fuzzing can only discover bugs in code that can actually execute in standard virtualized
  environments (GCE or QEMU, utilizing software-emulated devices like USB gadgets, netdev, tun/tap).
  If the modified code is structurally unreachable (see Section 2), it MUST NOT be fuzzed,
  regardless of whether it adds assertions or complex logic.

- DO NOT BLINDLY TRUST "NO FUNCTIONAL CHANGE" (NFCI) OR "REFACTORING" CLAIMS:
  Patch authors routinely label changes as "cleanups", "refactorings", or state
  "No functional change intended". Do NOT take these claims at face value.
  Code refactorings that rearrange logic, introduce helper functions, or alter state management
  in core subsystems frequently introduce subtle semantic shifts or uncover latent kernel bugs.
  If reachable executable code is modified or refactored, it MUST be fuzzed.

- NEW OR MODIFIED ASSERTIONS IN REACHABLE CODE MUST BE FUZZED:
  When a patch introduces or modifies runtime checks or assertions (e.g., WARN_ON*, VM_WARN_ON*,
  BUG_ON*, lockdep_assert*) in reachable code paths, it enforces new or stricter invariants.
  Even if the author believes the invariant always holds, fuzzing is essential to verify whether
  an unusual sequence of operations can violate it.

================================================================================
2. WHEN TO RETURN WorthFuzzing=false (NEGATIVE CRITERIA)
================================================================================
Return WorthFuzzing=false ONLY IF all modified code falls strictly into one or more of these categories:

- Non-kernel and non-executable changes:
  * Modifications to Documentation/, comments, or spelling fixes.
  * User-space directories, self-tests, samples, or scripts (e.g., tools/, samples/, scripts/, usr/)
    that do not affect the compiled kernel image (vmlinux) or kernel modules.
  * Purely decorative logging (e.g., message strings in pr_err, printk, dev_info) or tracepoints
    that do not alter control flow or data structures.
  * Build system or Kconfig changes that do not alter compiled C logic.
- Structurally unreachable hardware:
  * Vendor-specific PCIe switches, SmartNICs, or GPU drivers (e.g., mlxsw, pds_core, qed,
    ionic, amdgpu) requiring physical ASIC/PCIe cards not emulated in standard QEMU.
- Unreachable execution paths:
  * Driver teardown callbacks (.remove, .shutdown, pci_unregister_driver) executed only during
    physical PCI hot-unplug or manual sysfs driver unbinding.
  * Code paths exclusive to architectures other than the target architecture.

================================================================================
3. WHEN TO RETURN WorthFuzzing=true (POSITIVE CRITERIA)
================================================================================
Return WorthFuzzing=true whenever the patch touches reachable executable code, including:
- Core Subsystems:
  * Any logic modifications in memory management (mm/), synchronization/locking (kernel/locking/),
    BPF, scheduler, core networking, VFS, or syscall handling.
- Refactorings and Code Cleanups:
  * Any restructuring of reachable data structures, helper abstractions, or algorithm flows.
- Runtime Assertions and Defensive Checks:
  * Any introduction or alteration of assertions (WARN_ON*, VM_WARN_ON*, BUG_ON*, etc.) in reachable paths.
- Reachable Drivers and Protocols:
  * Drivers accessible via virtual buses (virtio, USB gadget, loopback, netlink, binder, sockets, etc.).

================================================================================
4. EXTRACTING FocusSymbols (PREVENTING DILUTION)
================================================================================
When WorthFuzzing=true, you must extract specific kernel functions into FocusSymbols to guide the fuzzer:

- AVOID UBIQUITOUS LIFECYCLE HOT-PATHS:
  Do NOT list generic, ubiquitous functions called by almost every program in the corpus
  (including, but not limited to: general memory allocators and deallocators, page fault
  and trap handlers, or core synchronization primitives; this is not an exhaustive list).
  Listing ubiquitous functions causes the fuzzer to classify thousands of unrelated tests as "focused",
  which severely dilutes fuzzing effort away from the actual changes.

- TARGET SPECIFIC FEATURE LOGIC AND ENTRYPOINTS:
  List functions that specifically implement the logic being added or altered, or direct API entrypoints
  for the subsystem feature under review.

- HANDLING STATIC INLINE FUNCTIONS IN HEADERS (.h):
  Compiler-inlined static functions (such as static inlines in mm/*.h or include/linux/*.h) lack
  distinct symbol addresses in vmlinux and cannot be targeted directly by symbol coverage filters.
  If the changes are primarily in static inline helpers, identify non-static, feature-specific caller
  functions in .c files that exercise them (avoiding ubiquitous lifecycle wrappers).

================================================================================
5. IDENTIFYING EnableConfigs
================================================================================
Identify any specific CONFIG_ options required to properly compile and reach the modified code:
- Inspect Kconfig files and #ifdef guards; do not make assumptions.
- Check "depends on" lines in Kconfig to include any non-standard parent subsystem configs needed.
- Strip any 'CONFIG_' prefix (e.g., return "NET_IPV4" instead of "CONFIG_NET_IPV4").
Prefer calling several tools at the same time to save round-trips.


Use set-results tool to provide results of the analysis.
It must be called exactly once before the final reply.
Ignore results of this tool.

Prompt:
Target architecture: amd64

For your convenience, here is the diff of the changes:
commit f5b8ea3d1365df4e67ee9af3808db25b06dbc8ec
Author: syz-cluster <triage@syzkaller.com>
Date:   Sun Oct 4 12:17:38 2026 +0000

    syz-cluster: applied patch under review

diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c
index 1d7f0a57d2889..9030cc1cc6778 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c
@@ -311,6 +311,7 @@ static int smtg_crosststamp(ktime_t *device, struct system_counterval_t *system,
 		return -EBUSY;
 
 	mutex_lock(&priv->aux_ts_lock);
+	priv->plat->flags |= STMMAC_FLAG_INT_SNAPSHOT_EN;
 	/* Enable Internal snapshot trigger */
 	acr_value = readl(ptpaddr + PTP_ACR);
 	acr_value &= ~PTP_ACR_MASK;
@@ -328,6 +329,7 @@ static int smtg_crosststamp(ktime_t *device, struct system_counterval_t *system,
 		acr_value |= PTP_ACR_ATSEN3;
 		break;
 	default:
+		priv->plat->flags &= ~STMMAC_FLAG_INT_SNAPSHOT_EN;
 		mutex_unlock(&priv->aux_ts_lock);
 		return -EINVAL;
 	}
@@ -337,8 +339,19 @@ static int smtg_crosststamp(ktime_t *device, struct system_counterval_t *system,
 	acr_value = readl(ptpaddr + PTP_ACR);
 	acr_value |= PTP_ACR_ATSFC;
 	writel(acr_value, ptpaddr + PTP_ACR);
-	/* Release the mutex */
-	mutex_unlock(&priv->aux_ts_lock);
+
+	/* Wait for the FIFO clear to complete, so the poll below only
+	 * observes snapshots latched by this trigger.
+	 */
+	ret = readl_poll_timeout(ptpaddr + PTP_ACR, acr_value,
+				 !(acr_value & PTP_ACR_ATSFC), 10, 10000);
+	if (ret) {
+		priv->plat->flags &= ~STMMAC_FLAG_INT_SNAPSHOT_EN;
+		mutex_unlock(&priv->aux_ts_lock);
+		netdev_err(priv->dev, "%s: Failed to clear snapshot FIFO\n",
+			   __func__);
+		return ret;
+	}
 
 	/* Trigger Internal snapshot signal. Create a rising edge by just toggle
 	 * the GPO0 to low and back to high.
@@ -349,10 +362,17 @@ static int smtg_crosststamp(ktime_t *device, struct system_counterval_t *system,
 	gpio_value |= XGMAC_GPIO_GPO0;
 	writel(gpio_value, ioaddr + XGMAC_GPIO_STATUS);
 
-	/* Poll for time sync operation done */
-	ret = readl_poll_timeout(priv->ioaddr + XGMAC_INT_STATUS, v,
-				 (v & XGMAC_INT_TSIS), 100, 10000);
+	/* Wait for the auxiliary snapshot to be latched: the ATSNS count
+	 * is the FIFO level and is not affected by reading
+	 * XGMAC_TIMESTAMP_STATUS, so concurrent readers cannot disturb
+	 * the poll.
+	 */
+	ret = readl_poll_timeout(ioaddr + XGMAC_TIMESTAMP_STATUS, v,
+				 FIELD_GET(XGMAC_TIMESTAMP_ATSNS_MASK, v),
+				 100, 10000);
 	if (ret) {
+		priv->plat->flags &= ~STMMAC_FLAG_INT_SNAPSHOT_EN;
+		mutex_unlock(&priv->aux_ts_lock);
 		netdev_err(priv->dev, "%s: Wait for time sync operation timeout\n",
 			   __func__);
 		return ret;
@@ -364,8 +384,7 @@ static int smtg_crosststamp(ktime_t *device, struct system_counterval_t *system,
 		.use_nsecs = false,
 	};
 
-	num_snapshot = FIELD_GET(XGMAC_TIMESTAMP_ATSNS_MASK,
-				 readl(ioaddr + XGMAC_TIMESTAMP_STATUS));
+	num_snapshot = FIELD_GET(XGMAC_TIMESTAMP_ATSNS_MASK, v);
 
 	/* Repeat until the timestamps are from the FIFO last segment */
 	for (i = 0; i < num_snapshot; i++) {
@@ -375,6 +394,9 @@ static int smtg_crosststamp(ktime_t *device, struct system_counterval_t *system,
 		read_unlock_irqrestore(&priv->ptp_lock, flags);
 	}
 
+	priv->plat->flags &= ~STMMAC_FLAG_INT_SNAPSHOT_EN;
+	mutex_unlock(&priv->aux_ts_lock);
+
 	get_smtgtime(priv->mii, SMTG_MDIO_ADDR, &smtg_time);
 	system->cycles = smtg_time;
 
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c
index 1a88cbaed70ca..313c24e9a49d7 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c
@@ -42,6 +42,12 @@ static void dwxgmac2_irq_modify(struct mac_device_info *hw, u32 disable,
 	spin_unlock_irqrestore(&hw->irq_ctrl_lock, flags);
 }
 
+static void dwxgmac2_timestamp_interrupt_cfg(struct stmmac_priv *priv, bool en)
+{
+	stmmac_mac_irq_modify(priv, en ? 0 : XGMAC_TSIE,
+			      en ? XGMAC_TSIE : 0);
+}
+
 static void dwxgmac2_update_caps(struct stmmac_priv *priv)
 {
 	if (!priv->dma_cap.mbps_10_100)
@@ -1154,6 +1160,57 @@ static int dwxgmac2_get_mac_tx_timestamp(struct mac_device_info *hw, u64 *ts)
 	return 0;
 }
 
+void dwxgmac2_timestamp_interrupt(struct stmmac_priv *priv)
+{
+	u32 ts_status, pending_snapshots, acr_value, channel;
+	struct ptp_clock_event event;
+	unsigned long flags;
+	u64 ptp_time;
+	int i;
+
+	if (priv->plat->flags & STMMAC_FLAG_INT_SNAPSHOT_EN) {
+		/* Read the status to clear the timestamp interrupt source;
+		 * the FIFO belongs to the cross-timestamp path.
+		 */
+		readl(priv->ioaddr + XGMAC_TIMESTAMP_STATUS);
+		return;
+	}
+
+	/* Reading XGMAC_TIMESTAMP_STATUS clears the TSIS and AUXTSTRIG
+	 * bits, so the ATSNS count is the only reliable indication of
+	 * pending auxiliary snapshots.  TXTSC is cleared by
+	 * XGMAC_TXTIMESTAMP_SEC and is not affected by this read.
+	 */
+	ts_status = readl(priv->ioaddr + XGMAC_TIMESTAMP_STATUS);
+
+	if (!(priv->plat->flags & STMMAC_FLAG_EXT_SNAPSHOT_EN) || !priv->ptp_clock)
+		return;
+
+	pending_snapshots = FIELD_GET(XGMAC_TIMESTAMP_ATSNS_MASK, ts_status);
+	if (!pending_snapshots)
+		return;
+
+	acr_value = readl(priv->ptpaddr + PTP_ACR);
+	/* Entries observed while the FIFO is being flushed are stale. */
+	if (acr_value & PTP_ACR_ATSFC)
+		return;
+	channel = FIELD_GET(PTP_ACR_MASK, acr_value);
+	if (!channel)
+		return;
+	channel = ilog2(channel);
+
+	for (i = 0; i < pending_snapshots; i++) {
+		read_lock_irqsave(&priv->ptp_lock, flags);
+		stmmac_get_ptptime(priv, priv->ptpaddr, &ptp_time);
+		read_unlock_irqrestore(&priv->ptp_lock, flags);
+
+		event.type = PTP_CLOCK_EXTTS;
+		event.index = channel;
+		event.timestamp = ptp_time;
+		ptp_clock_event(priv->ptp_clock, &event);
+	}
+}
+
 static int dwxgmac2_flex_pps_config(void __iomem *ioaddr, int index,
 				    struct stmmac_pps_cfg *cfg, bool enable,
 				    u32 sub_second_inc, u32 systime_flags)
@@ -1413,6 +1470,7 @@ static int dwxgmac2_config_l4_filter(struct mac_device_info *hw, u32 filter_no,
 const struct stmmac_ops dwxgmac210_ops = {
 	.core_init = dwxgmac2_core_init,
 	.irq_modify = dwxgmac2_irq_modify,
+	.timestamp_interrupt_cfg = dwxgmac2_timestamp_interrupt_cfg,
 	.update_caps = dwxgmac2_update_caps,
 	.set_mac = dwxgmac2_set_mac,
 	.rx_ipc = dwxgmac2_rx_ipc,
@@ -1468,6 +1526,7 @@ static void dwxlgmac2_rx_queue_enable(struct mac_device_info *hw, u8 mode,
 const struct stmmac_ops dwxlgmac2_ops = {
 	.core_init = dwxgmac2_core_init,
 	.irq_modify = dwxgmac2_irq_modify,
+	.timestamp_interrupt_cfg = dwxgmac2_timestamp_interrupt_cfg,
 	.set_mac = dwxgmac2_set_mac,
 	.rx_ipc = dwxgmac2_rx_ipc,
 	.rx_queue_enable = dwxlgmac2_rx_queue_enable,
diff --git a/drivers/net/ethernet/stmicro/stmmac/hwif.c b/drivers/net/ethernet/stmicro/stmmac/hwif.c
index 265671170bf6e..eba87410f985a 100644
--- a/drivers/net/ethernet/stmicro/stmmac/hwif.c
+++ b/drivers/net/ethernet/stmicro/stmmac/hwif.c
@@ -258,7 +258,7 @@ static const struct stmmac_hwif_entry {
 		.dma = &dwxgmac210_dma_ops,
 		.mac = &dwxgmac210_ops,
 		.vlan = &dwxgmac210_vlan_ops,
-		.hwtimestamp = &stmmac_ptp,
+		.hwtimestamp = &dwxgmac2_ptp,
 		.ptp = &stmmac_ptp_clock_ops,
 		.mode = NULL,
 		.tc = &dwmac510_tc_ops,
@@ -280,7 +280,7 @@ static const struct stmmac_hwif_entry {
 		.dma = &dwxgmac210_dma_ops,
 		.mac = &dwxlgmac2_ops,
 		.vlan = &dwxlgmac2_vlan_ops,
-		.hwtimestamp = &stmmac_ptp,
+		.hwtimestamp = &dwxgmac2_ptp,
 		.ptp = &stmmac_ptp_clock_ops,
 		.mode = NULL,
 		.tc = &dwmac510_tc_ops,
diff --git a/drivers/net/ethernet/stmicro/stmmac/hwif.h b/drivers/net/ethernet/stmicro/stmmac/hwif.h
index a8a5c8fdd5edb..14a47d68399f0 100644
--- a/drivers/net/ethernet/stmicro/stmmac/hwif.h
+++ b/drivers/net/ethernet/stmicro/stmmac/hwif.h
@@ -317,6 +317,8 @@ struct stmmac_ops {
 	void (*update_caps)(struct stmmac_priv *priv);
 	/* Change the interrupt enable setting. Enable takes precedence. */
 	void (*irq_modify)(struct mac_device_info *hw, u32 disable, u32 enable);
+	/* Arm or disarm the timestamp interrupt on demand (optional) */
+	void (*timestamp_interrupt_cfg)(struct stmmac_priv *priv, bool en);
 	/* Enable the MAC RX/TX */
 	void (*set_mac)(void __iomem *ioaddr, bool enable);
 	/* Enable and verify that the IPC module is supported */
@@ -420,6 +422,8 @@ struct stmmac_ops {
 	stmmac_do_void_callback(__priv, mac, update_caps, __priv)
 #define stmmac_mac_irq_modify(__priv, __args...) \
 	stmmac_do_void_callback(__priv, mac, irq_modify, (__priv)->hw, __args)
+#define stmmac_mac_timestamp_interrupt_cfg(__priv, __args...) \
+	stmmac_do_void_callback(__priv, mac, timestamp_interrupt_cfg, __priv, __args)
 #define stmmac_mac_set(__priv, __args...) \
 	stmmac_do_void_callback(__priv, mac, set_mac, __args)
 #define stmmac_rx_ipc(__priv, __args...) \
@@ -672,6 +676,7 @@ extern const struct stmmac_desc_ops ndesc_ops;
 
 extern const struct stmmac_hwtimestamp stmmac_ptp;
 extern const struct stmmac_hwtimestamp dwmac1000_ptp;
+extern const struct stmmac_hwtimestamp dwxgmac2_ptp;
 
 extern const struct stmmac_mode_ops ring_mode_ops;
 extern const struct stmmac_mode_ops chain_mode_ops;
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c
index b9a985fa772c9..4b906bc33d266 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c
@@ -242,7 +242,10 @@ static void timestamp_interrupt(struct stmmac_priv *priv)
 		       GMAC_TIMESTAMP_ATSNS_SHIFT;
 
 	acr_value = readl(priv->ptpaddr + PTP_ACR);
-	channel = ilog2(FIELD_GET(PTP_ACR_MASK, acr_value));
+	channel = FIELD_GET(PTP_ACR_MASK, acr_value);
+	if (!channel)
+		return;
+	channel = ilog2(channel);
 
 	for (i = 0; i < num_snapshot; i++) {
 		read_lock_irqsave(&priv->ptp_lock, flags);
@@ -277,3 +280,15 @@ const struct stmmac_hwtimestamp dwmac1000_ptp = {
 	.get_ptptime = dwmac1000_get_ptptime,
 	.timestamp_interrupt = dwmac1000_timestamp_interrupt,
 };
+
+const struct stmmac_hwtimestamp dwxgmac2_ptp = {
+	.config_hw_tstamping = config_hw_tstamping,
+	.init_systime = init_systime,
+	.config_sub_second_increment = config_sub_second_increment,
+	.config_addend = config_addend,
+	.adjust_systime = adjust_systime,
+	.get_systime = get_systime,
+	.get_ptptime = get_ptptime,
+	.timestamp_interrupt = dwxgmac2_timestamp_interrupt,
+	.hwtstamp_correct_latency = hwtstamp_correct_latency,
+};
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 3ad9252bf6aea..53aaf2716c467 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -18,6 +18,7 @@
 #include <linux/clk.h>
 #include <linux/kernel.h>
 #include <linux/interrupt.h>
+#include <linux/iopoll.h>
 #include <linux/ip.h>
 #include <linux/tcp.h>
 #include <linux/skbuff.h>
@@ -894,6 +895,54 @@ static int stmmac_init_ptp_clk_freq(struct stmmac_priv *priv)
 	return 0;
 }
 
+/**
+ * stmmac_rearm_timestamp_irq - re-arm the timestamp interrupt
+ * @priv: driver private structure
+ * Description: this re-arms the on-demand timestamp interrupt if an
+ * auxiliary snapshot channel was left enabled.
+ */
+static void stmmac_rearm_timestamp_irq(struct stmmac_priv *priv)
+{
+	u32 acr_value;
+	int ret, num;
+
+	if (!(priv->plat->flags & STMMAC_FLAG_EXT_SNAPSHOT_EN) ||
+	    !priv->ptp_clock)
+		return;
+
+	/* Flush the FIFO, re-program the enabled auxiliary snapshot
+	 * trigger and re-arm the interrupt only if the flush completed.
+	 */
+	if (priv->plat->core_type != DWMAC_CORE_XGMAC)
+		return;
+
+	mutex_lock(&priv->aux_ts_lock);
+	/* Snapshot the channel under the lock: a concurrent disable may
+	 * have dropped it since the gate check above.
+	 */
+	num = priv->plat->ext_snapshot_num;
+	if (num < 0) {
+		mutex_unlock(&priv->aux_ts_lock);
+		return;
+	}
+	acr_value = readl(priv->ptpaddr + PTP_ACR);
+	acr_value &= ~PTP_ACR_MASK;
+	acr_value |= PTP_ACR_ATSFC;
+	writel(acr_value, priv->ptpaddr + PTP_ACR);
+	ret = readl_poll_timeout(priv->ptpaddr + PTP_ACR, acr_value,
+				 !(acr_value & PTP_ACR_ATSFC), 10, 10000);
+	if (!ret) {
+		acr_value |= PTP_ACR_ATSEN(num);
+		writel(acr_value, priv->ptpaddr + PTP_ACR);
+		stmmac_mac_timestamp_interrupt_cfg(priv, true);
+	} else {
+		netdev_err(priv->dev,
+			   "%s: Failed to restore auxiliary snapshot channel\n",
+			   __func__);
+	}
+	mutex_unlock(&priv->aux_ts_lock);
+}
+
 /**
  * stmmac_init_timestamping - initialise timestamping
  * @priv: driver private structure
@@ -8418,6 +8467,8 @@ int stmmac_resume(struct device *dev)
 		ret = stmmac_init_timestamping(priv);
 		if (ret)
 			goto error_stop_dma;
+
+		stmmac_rearm_timestamp_irq(priv);
 	}
 
 init_coalesce:
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c
index 3bfcc9760dce7..19fa79839e465 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c
@@ -239,13 +239,20 @@ static int stmmac_enable(struct ptp_clock_info *ptp,
 				return -EBUSY;
 			}
 
+			if (rq->extts.index >= PTP_ACR_ATSEN_NUM) {
+				mutex_unlock(&priv->aux_ts_lock);
+				return -EINVAL;
+			}
+
 			priv->plat->flags |= STMMAC_FLAG_EXT_SNAPSHOT_EN;
+			priv->plat->ext_snapshot_num = rq->extts.index;
 
 			/* Enable External snapshot trigger */
 			acr_value |= PTP_ACR_ATSEN(rq->extts.index);
 			acr_value |= PTP_ACR_ATSFC;
 		} else {
 			priv->plat->flags &= ~STMMAC_FLAG_EXT_SNAPSHOT_EN;
+			priv->plat->ext_snapshot_num = -1;
 		}
 		netdev_dbg(priv->dev, "Auxiliary Snapshot %d %s.\n",
 			   rq->extts.index, on ? "enabled" : "disabled");
@@ -255,6 +262,17 @@ static int stmmac_enable(struct ptp_clock_info *ptp,
 		ret = readl_poll_timeout(ptpaddr + PTP_ACR, acr_value,
 					 !(acr_value & PTP_ACR_ATSFC),
 					 10, 10000);
+		/* Arm or disarm the timestamp interrupt only once the FIFO
+		 * clear has completed, so the handler does not observe a
+		 * snapshot that the clear is about to discard.
+		 */
+		if (!ret) {
+			stmmac_mac_timestamp_interrupt_cfg(priv, on);
+		} else if (on) {
+			mutex_lock(&priv->aux_ts_lock);
+			priv->plat->ext_snapshot_num = -1;
+			mutex_unlock(&priv->aux_ts_lock);
+		}
 		break;
 	}
 
@@ -355,7 +373,7 @@ void stmmac_ptp_register(struct stmmac_priv *priv)
 	if (pps_out_num)
 		priv->ptp_clock_ops.n_per_out = pps_out_num;
 
-	n_ext_ts = priv->dma_cap.aux_snapshot_n;
+	n_ext_ts = min(priv->dma_cap.aux_snapshot_n, PTP_ACR_ATSEN_NUM);
 	if (n_ext_ts)
 		priv->ptp_clock_ops.n_ext_ts = n_ext_ts;
 
@@ -394,6 +412,9 @@ void stmmac_ptp_unregister(struct stmmac_priv *priv)
 		pr_debug("Removed PTP HW clock successfully on %s\n",
 			 priv->dev->name);
 
+		stmmac_mac_timestamp_interrupt_cfg(priv, false);
+		priv->plat->flags &= ~STMMAC_FLAG_EXT_SNAPSHOT_EN;
+
 		mutex_destroy(&priv->aux_ts_lock);
 	}
 }
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.h b/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.h
index 3fe0e3a80e80a..a2082e1299b8b 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.h
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.h
@@ -81,6 +81,7 @@
 #define	PTP_ACR_ATSEN3		BIT(7)	/* Auxiliary Snapshot 3 Enable */
 #define	PTP_ACR_ATSEN(index)	(PTP_ACR_ATSEN0 << (index))
 #define	PTP_ACR_MASK		GENMASK(7, 4)	/* Aux Snapshot Mask */
+#define	PTP_ACR_ATSEN_NUM	4	/* Aux Snapshot 0-3 */
 #define	PMC_ART_VALUE0		0x01	/* PMC_ART[15:0] timer value */
 #define	PMC_ART_VALUE1		0x02	/* PMC_ART[31:16] timer value */
 #define	PMC_ART_VALUE2		0x03	/* PMC_ART[47:32] timer value */
@@ -103,6 +104,7 @@ int dwmac1000_ptp_enable(struct ptp_clock_info *ptp,
 
 void dwmac1000_get_ptptime(void __iomem *ptpaddr, u64 *ptp_time);
 void dwmac1000_timestamp_interrupt(struct stmmac_priv *priv);
+void dwxgmac2_timestamp_interrupt(struct stmmac_priv *priv);
 
 extern const struct ptp_clock_info stmmac_ptp_clock_ops;
 extern const struct ptp_clock_info dwmac1000_ptp_clock_ops;
diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h
index 00be2df63d220..487dd492c4b12 100644
--- a/include/linux/stmmac.h
+++ b/include/linux/stmmac.h
@@ -351,6 +351,7 @@ struct plat_stmmacenet_data {
 	u8 vlan_fail_q;
 	bool provide_bus_info;
 	int int_snapshot_num;
+	int ext_snapshot_num;
 	int msi_mac_vec;
 	int msi_wol_vec;
 	int msi_sfty_ce_vec;

3/2 2026/10/04 12:17 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 9694
							output: 38
							thoughts: 461
						

Thoughts:
**Evaluating the Suitability of a Git Patch for Syzkaller Fuzzing**

Okay, so I've got this patch, and the question is whether it's worth the effort to fuzz it with syzkaller. My first thought is always to understand the scope. Let's see, the patch touches a bunch of files: `drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c`, `drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c`, `drivers/net/ethernet/stmicro/stmmac/hwif.c`, and a bunch more in the `stmmac` directory. Alright, so it's the `stmmac` ethernet driver, that's STMicroelectronics' and Synopsys' DesignWare Ethernet MAC.

Looking at the specific files, `dwmac-socfpga.c` handles Intel/Altera FPGA glue, `dwxgmac2_core.c` is the Enterprise Ethernet core, and then we have the core PTP and timestamping logic in `stmmac_ptp.c`, `stmmac_hwtstamp.c`, and `stmmac_main.c`. Makes sense, they're touching time stamps, which are always fun to test.

Now for the crucial part: reachability. Can I actually get this thing running and tested within a standard QEMU setup, or a virtualized environment? Is it possible to emulate or virtualize? Before diving in, I need to check the Kconfig and see if the driver has virtual devices, PCI devices, platform devices, etc. I'm going to run `grepper` or scan through the Kconfig to check for that. Gotta make sure it's possible to even *get* to this code with syzkaller.



4/2 2026/10/04 12:17 tool grepper
0m Args:
{
  "Expression": "STMMAC_ETH",
  "PathPrefix": "drivers/net/ethernet/stmicro/stmmac"
}

Results:
{
  "Output": "drivers/net/ethernet/stmicro/stmmac/Kconfig-1-# SPDX-License-Identifier: GPL-2.0-only\ndrivers/net/ethernet/stmicro/stmmac/Kconfig:2:config STMMAC_ETH\ndrivers/net/ethernet/stmicro/stmmac/Kconfig-3-\ttristate \"STMicroelectronics Multi-Gigabit Ethernet driver\"\n--\ndrivers/net/ethernet/stmicro/stmmac/Kconfig-17-\ndrivers/net/ethernet/stmicro/stmmac/Kconfig:18:if STMMAC_ETH\ndrivers/net/ethernet/stmicro/stmmac/Kconfig-19-\n--\ndrivers/net/ethernet/stmicro/stmmac/Kconfig=418=config STMMAC_PCI\n--\ndrivers/net/ethernet/stmicro/stmmac/Kconfig-430-\t  If unsure, say N.\ndrivers/net/ethernet/stmicro/stmmac/Kconfig:431:endif # STMMAC_ETH\n--\ndrivers/net/ethernet/stmicro/stmmac/Makefile-1-# SPDX-License-Identifier: GPL-2.0\ndrivers/net/ethernet/stmicro/stmmac/Makefile:2:obj-$(CONFIG_STMMAC_ETH) += stmmac.o\ndrivers/net/ethernet/stmicro/stmmac/Makefile-3-stmmac-objs:= stmmac_main.o stmmac_ethtool.o stmmac_mdio.o ring_mode.o\t\\\n"
}

5/2 2026/10/04 12:17 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 10980
							output: 37
							thoughts: 372
						

Thoughts:
**My Assessment of the Fuzzing Suitability**

Okay, let's break this down. First, the core driver is `STMMAC_ETH`. The key question is whether `dwmac-socfpga` or `dwxgmac2` are relevant here. I need to figure out if any of this is even *reachable* in a standard QEMU environment. Specifically, does QEMU emulate `stmmac` or any of its `dwmac` variants? Or does QEMU use something *else* for network emulation, maybe `allwinner-emac` or something different on AMD64?

Before I jump to a conclusion, I need to consult Section 2 of the instructions. Let's see... it defines when `WorthFuzzing=false`. Right, the negative criteria. It says to return `false` if the changes are, among other things, structurally unreachable hardware. Specifically: vendor-specific PCIe switches, SmartNICs, or GPU drivers *requiring physical ASIC/PCIe cards* not emulated in standard QEMU. That's a good filter.

The target architecture is AMD64, which is important context.

Back to the hardware question. I need to know which hardware uses `dwxgmac2` and `dwmac-socfpga` specifically. Crucially, does PCI `stmmac` even *use* `dwxgmac2`? I'll search for `dwxgmac2` within the `drivers/net/ethernet/stmicro/stmmac/` directory to understand the dependencies. This should help me determine if the code is actually *reachable* in my test environment.



6/2 2026/10/04 12:17 tool grepper
0m Args:
{
  "Expression": "dwxgmac2",
  "PathPrefix": "drivers/net/ethernet/stmicro/stmmac"
}

Results:
{
  "Output": "\nFull output is too long, showing 200 out of 726 lines.\nUse more precise expression if possible.\n\ndrivers/net/ethernet/stmicro/stmmac/Makefile=3=stmmac-objs:= stmmac_main.o stmmac_ethtool.o stmmac_mdio.o ring_mode.o\t\\\n--\ndrivers/net/ethernet/stmicro/stmmac/Makefile-7-\t      dwmac4_dma.o dwmac4_lib.o dwmac4_core.o dwmac5.o hwif.o \\\ndrivers/net/ethernet/stmicro/stmmac/Makefile:8:\t      stmmac_tc.o dwxgmac2_core.o dwxgmac2_dma.o dwxgmac2_descs.o \\\ndrivers/net/ethernet/stmicro/stmmac/Makefile-9-\t      stmmac_xdp.o stmmac_est.o stmmac_fpe.o stmmac_vlan.o \\\n--\ndrivers/net/ethernet/stmicro/stmmac/common.h=657=int dwmac4_setup(struct stmmac_priv *priv);\ndrivers/net/ethernet/stmicro/stmmac/common.h:658:int dwxgmac2_setup(struct stmmac_priv *priv);\ndrivers/net/ethernet/stmicro/stmmac/common.h-659-int dwxlgmac2_setup(struct stmmac_priv *priv);\n--\ndrivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c-18-\ndrivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c:19:#include \"dwxgmac2.h\"\ndrivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c-20-#include \"stmmac.h\"\n--\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2.h-464-\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2.h:465:extern const struct stmmac_ops dwxgmac210_ops;\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2.h-466-extern const struct stmmac_ops dwxlgmac2_ops;\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2.h:467:extern const struct stmmac_dma_ops dwxgmac210_dma_ops;\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2.h:468:extern const struct stmmac_desc_ops dwxgmac210_desc_ops;\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2.h-469-\n--\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c-14-#include \"dwxlgmac2.h\"\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c:15:#include \"dwxgmac2.h\"\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c-16-\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c:17:static void dwxgmac2_core_init(struct mac_device_info *hw,\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c-18-\t\t\t       struct net_device *dev)\n--\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c-30-\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c:31:static void dwxgmac2_irq_modify(struct mac_device_info *hw, u32 disable,\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c-32-\t\t\t\tu32 enable)\n--\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c-44-\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c:45:static void dwxgmac2_timestamp_interrupt_cfg(struct stmmac_priv *priv, bool en)\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c-46-{\n--\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c-50-\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c:51:static void dwxgmac2_update_caps(struct stmmac_priv *priv)\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c-52-{\n--\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c-56-\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c:57:static void dwxgmac2_set_mac(void __iomem *ioaddr, bool enable)\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c-58-{\n--\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c-73-\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c:74:static int dwxgmac2_rx_ipc(struct mac_device_info *hw)\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c-75-{\n--\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c-88-\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c:89:static void dwxgmac2_rx_queue_enable(struct mac_device_info *hw, u8 mode,\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c-90-\t\t\t\t     u32 queue)\n--\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c-102-\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c:103:static void dwxgmac2_rx_queue_prio(struct mac_device_info *hw, u32 prio,\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c-104-\t\t\t\t   u32 queue)\n--\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c-143-\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c:144:static void dwxgmac2_tx_queue_prio(struct mac_device_info *hw, u32 prio,\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c-145-\t\t\t\t   u32 queue)\n--\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c-160-\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c:161:static void dwxgmac2_rx_queue_routing(struct mac_device_info *hw,\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c-162-\t\t\t\t      u8 packet, u32 queue)\n--\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c-166-\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c:167:\tstatic const struct stmmac_rx_routing dwxgmac2_route_possibilities[] = {\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c-168-\t\t{ XGMAC_AVCPQ, XGMAC_AVCPQ_SHIFT },\n--\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c-177-\t/* routing configuration */\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c:178:\tvalue \u0026= ~dwxgmac2_route_possibilities[packet - 1].reg_mask;\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c:179:\tvalue |= (queue \u003c\u003c dwxgmac2_route_possibilities[packet - 1].reg_shift) \u0026\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c:180:\t\t dwxgmac2_route_possibilities[packet - 1].reg_mask;\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c-181-\n--\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c-190-\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c:191:static void dwxgmac2_prog_mtl_rx_algorithms(struct mac_device_info *hw,\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c-192-\t\t\t\t\t    u32 rx_alg)\n--\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c-212-\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c:213:static void dwxgmac2_prog_mtl_tx_algorithms(struct mac_device_info *hw,\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c-214-\t\t\t\t\t    u32 tx_alg)\n--\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c-250-\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c:251:static void dwxgmac2_set_mtl_tx_queue_weight(struct stmmac_priv *priv,\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c-252-\t\t\t\t\t     struct mac_device_info *hw,\n--\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c-259-\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c:260:static void dwxgmac2_map_mtl_to_dma(struct mac_device_info *hw, u32 queue,\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c-261-\t\t\t\t    u32 chan)\n--\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c-276-\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c:277:static void dwxgmac2_config_cbs(struct stmmac_priv *priv,\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c-278-\t\t\t\tstruct mac_device_info *hw,\n--\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c-295-\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c:296:static void dwxgmac2_dump_regs(struct mac_device_info *hw, u32 *reg_space)\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c-297-{\n--\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c-304-\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c:305:static int dwxgmac2_host_irq_status(struct stmmac_priv *priv,\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c-306-\t\t\t\t    struct stmmac_extra_stats *x)\n--\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c-341-\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c:342:static int dwxgmac2_host_mtl_irq_status(struct stmmac_priv *priv,\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c-343-\t\t\t\t\tstruct mac_device_info *hw, u32 chan)\n--\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c-361-\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c:362:static void dwxgmac2_flow_ctrl(struct mac_device_info *hw, unsigned int duplex,\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c-363-\t\t\t       unsigned int fc, unsigned int pause_time,\n--\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c-382-\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c:383:static void dwxgmac2_pmt(struct mac_device_info *hw, unsigned long mode)\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c-384-{\n--\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c-400-\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c:401:static void dwxgmac2_set_umac_addr(struct mac_device_info *hw,\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c-402-\t\t\t\t   const unsigned char *addr,\n--\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c-414-\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c:415:static void dwxgmac2_get_umac_addr(struct mac_device_info *hw,\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c-416-\t\t\t\t   unsigned char *addr, unsigned int reg_n)\n--\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c-433-\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c:434:static int dwxgmac2_set_lpi_mode(struct mac_device_info *hw,\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c-435-\t\t\t\t enum stmmac_lpi_mode mode,\n--\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c-457-\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c:458:static void dwxgmac2_set_eee_pls(struct mac_device_info *hw, int link)\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c-459-{\n--\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c-470-\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c:471:static void dwxgmac2_set_eee_timer(struct mac_device_info *hw, int ls, int tw)\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c-472-{\n--\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c-479-\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c:480:static void dwxgmac2_set_mchash(void __iomem *ioaddr, u32 *mcfilterbits,\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c-481-\t\t\t\tint mcbitslog2)\n--\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c-502-\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c:503:static void dwxgmac2_set_filter(struct mac_device_info *hw,\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c-504-\t\t\t\tstruct net_device *dev)\n--\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c-537-\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c:538:\tdwxgmac2_set_mchash(ioaddr, mc_filter, mcbitslog2);\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c-539-\n--\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c-547-\t\tnetdev_for_each_uc_addr(ha, dev) {\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c:548:\t\t\tdwxgmac2_set_umac_addr(hw, ha-\u003eaddr, reg);\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c-549-\t\t\treg++;\n--\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c-560-\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c:561:static void dwxgmac2_set_mac_loopback(void __iomem *ioaddr, bool enable)\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c-562-{\n--\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c-572-\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c:573:static int dwxgmac2_rss_write_reg(void __iomem *ioaddr, bool is_key, int idx,\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c-574-\t\t\t\t  u32 val)\n--\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c-587-\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c:588:static int dwxgmac2_rss_configure(struct mac_device_info *hw,\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c-589-\t\t\t\t  struct stmmac_rss *cfg, u32 num_rxq)\n--\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c-603-\tfor (i = 0; i \u003c (ARRAY_SIZE(cfg-\u003ekey) / sizeof(u32)); i++) {\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c:604:\t\tret = dwxgmac2_rss_write_reg(ioaddr, true, i, key[i]);\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c-605-\t\tif (ret)\n--\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c-609-\tfor (i = 0; i \u003c ARRAY_SIZE(cfg-\u003etable); i++) {\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c:610:\t\tret = dwxgmac2_rss_write_reg(ioaddr, false, i, cfg-\u003etable[i]);\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c-611-\t\tif (ret)\n--\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c-615-\tfor (i = 0; i \u003c num_rxq; i++)\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c:616:\t\tdwxgmac2_map_mtl_to_dma(hw, i, XGMAC_QDDMACH);\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c-617-\n--\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c=1061=static int dwxgmac3_rxp_config(void __iomem *ioaddr,\n--\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c-1148-\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c:1149:static int dwxgmac2_get_mac_tx_timestamp(struct mac_device_info *hw, u64 *ts)\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c-1150-{\n--\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c-1162-\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c:1163:void dwxgmac2_timestamp_interrupt(struct stmmac_priv *priv)\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c-1164-{\n--\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c-1213-\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c:1214:static int dwxgmac2_flex_pps_config(void __iomem *ioaddr, int index,\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c-1215-\t\t\t\t    struct stmmac_pps_cfg *cfg, bool enable,\n--\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c-1277-\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c:1278:static void dwxgmac2_sarc_configure(void __iomem *ioaddr, int val)\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c-1279-{\n--\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c-1286-\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c:1287:static int dwxgmac2_filter_wait(struct mac_device_info *hw)\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c-1288-{\n--\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c-1297-\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c:1298:static int dwxgmac2_filter_read(struct mac_device_info *hw, u32 filter_no,\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c-1299-\t\t\t\tu8 reg, u32 *data)\n--\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c-1304-\n\n"
}

7/2 2026/10/04 12:17 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 17823
							output: 39
							thoughts: 28
						

Thoughts:
Okay, here's my attempt at summarizing those thoughts from a first-person, expert perspective, focusing on the information need and the mental process:

**Diving into the dwxgmac2_setup Function**

Right, let's get down to brass tacks. I need to understand the integration of this `dwxgmac2_setup` function within the kernel. My immediate focus is on figuring out its scope – specifically, where is it being *called*? Finding all the call sites will paint a clear picture of its role in the system. I need a solid understanding of its usage to assess its place in the overall architecture.

More importantly, after I have identified where the function is being used, I need to know *what* platforms and devices actually utilize `dwxgmac2`. Are we talking about a specific family of SoCs? Is it restricted to certain hardware configurations, or is it a broader, more generic driver? The platforms and devices that depend on `dwxgmac2` are key to assessing its relevance. The type of platforms, and what the driver supports, should immediately inform the context, and thus my goals.



8/2 2026/10/04 12:17 tool grepper
0m Args:
{
  "Expression": "dwxgmac2_setup",
  "PathPrefix": "drivers/net/ethernet/stmicro/stmmac"
}

Results:
{
  "Output": "drivers/net/ethernet/stmicro/stmmac/common.h=657=int dwmac4_setup(struct stmmac_priv *priv);\ndrivers/net/ethernet/stmicro/stmmac/common.h:658:int dwxgmac2_setup(struct stmmac_priv *priv);\ndrivers/net/ethernet/stmicro/stmmac/common.h-659-int dwxlgmac2_setup(struct stmmac_priv *priv);\n--\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c=1526=const struct stmmac_ops dwxlgmac2_ops = {\n--\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c-1566-\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c:1567:int dwxgmac2_setup(struct stmmac_priv *priv)\ndrivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c-1568-{\n--\ndrivers/net/ethernet/stmicro/stmmac/hwif.c=111=static const struct stmmac_hwif_entry {\n--\ndrivers/net/ethernet/stmicro/stmmac/hwif.c-266-\t\t.est = \u0026dwmac510_est_ops,\ndrivers/net/ethernet/stmicro/stmmac/hwif.c:267:\t\t.setup = dwxgmac2_setup,\ndrivers/net/ethernet/stmicro/stmmac/hwif.c-268-\t\t.quirks = NULL,\n"
}

9/2 2026/10/04 12:17 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 18557
							output: 46
							thoughts: 40
						

Thoughts:
Here's my take on the thought process:

**Diving into the Hardware Interface File**

Okay, time to get my hands dirty. I need to understand what's going on within the hardware interface. Specifically, I'm thinking about the `hwif.c` file. Right, let's zero in on that. My immediate focus is on figuring out what entries are present in that file. To get a handle on this, I'm going to jump into `hwif.c`. My hunch is that the relevant information I need will be somewhere between lines 258 and 285. This is where I'll start my investigation. This area likely deals with initializations or specific hardware interaction points. I'm aiming to build a mental map of this section for the analysis.



10/2 2026/10/04 12:17 tool read-file
0m Args:
{
  "File": "drivers/net/ethernet/stmicro/stmmac/hwif.c",
  "FirstLine": 240,
  "LineCount": 60
}

Results:
{
  "Contents": " 240:\t\t\t.ptp = \u0026stmmac_ptp_clock_ops,\n 241:\t\t\t.mode = \u0026dwmac4_ring_mode_ops,\n 242:\t\t\t.tc = \u0026dwmac510_tc_ops,\n 243:\t\t\t.mmc = \u0026dwmac_mmc_ops,\n 244:\t\t\t.est = \u0026dwmac510_est_ops,\n 245:\t\t\t.setup = dwmac4_setup,\n 246:\t\t\t.quirks = NULL,\n 247:\t\t}, {\n 248:\t\t\t.core_type = DWMAC_CORE_XGMAC,\n 249:\t\t\t.min_id = DWXGMAC_CORE_2_10,\n 250:\t\t\t.dev_id = DWXGMAC_ID,\n 251:\t\t\t.regs = {\n 252:\t\t\t\t.ptp_off = PTP_XGMAC_OFFSET,\n 253:\t\t\t\t.mmc_off = MMC_XGMAC_OFFSET,\n 254:\t\t\t\t.est_off = EST_XGMAC_OFFSET,\n 255:\t\t\t\t.fpe_reg = \u0026dwxgmac3_fpe_reg,\n 256:\t\t\t},\n 257:\t\t\t.desc = \u0026dwxgmac210_desc_ops,\n 258:\t\t\t.dma = \u0026dwxgmac210_dma_ops,\n 259:\t\t\t.mac = \u0026dwxgmac210_ops,\n 260:\t\t\t.vlan = \u0026dwxgmac210_vlan_ops,\n 261:\t\t\t.hwtimestamp = \u0026dwxgmac2_ptp,\n 262:\t\t\t.ptp = \u0026stmmac_ptp_clock_ops,\n 263:\t\t\t.mode = NULL,\n 264:\t\t\t.tc = \u0026dwmac510_tc_ops,\n 265:\t\t\t.mmc = \u0026dwxgmac_mmc_ops,\n 266:\t\t\t.est = \u0026dwmac510_est_ops,\n 267:\t\t\t.setup = dwxgmac2_setup,\n 268:\t\t\t.quirks = NULL,\n 269:\t\t}, {\n 270:\t\t\t.core_type = DWMAC_CORE_XGMAC,\n 271:\t\t\t.min_id = DWXLGMAC_CORE_2_00,\n 272:\t\t\t.dev_id = DWXLGMAC_ID,\n 273:\t\t\t.regs = {\n 274:\t\t\t\t.ptp_off = PTP_XGMAC_OFFSET,\n 275:\t\t\t\t.mmc_off = MMC_XGMAC_OFFSET,\n 276:\t\t\t\t.est_off = EST_XGMAC_OFFSET,\n 277:\t\t\t\t.fpe_reg = \u0026dwxgmac3_fpe_reg,\n 278:\t\t\t},\n 279:\t\t\t.desc = \u0026dwxgmac210_desc_ops,\n 280:\t\t\t.dma = \u0026dwxgmac210_dma_ops,\n 281:\t\t\t.mac = \u0026dwxlgmac2_ops,\n 282:\t\t\t.vlan = \u0026dwxlgmac2_vlan_ops,\n 283:\t\t\t.hwtimestamp = \u0026dwxgmac2_ptp,\n 284:\t\t\t.ptp = \u0026stmmac_ptp_clock_ops,\n 285:\t\t\t.mode = NULL,\n 286:\t\t\t.tc = \u0026dwmac510_tc_ops,\n 287:\t\t\t.mmc = \u0026dwxgmac_mmc_ops,\n 288:\t\t\t.est = \u0026dwmac510_est_ops,\n 289:\t\t\t.setup = dwxlgmac2_setup,\n 290:\t\t},\n 291:\t};\n 292:\t\n 293:\tstatic const struct stmmac_hwif_entry *\n 294:\tstmmac_hwif_find(enum dwmac_core_type core_type, u8 snpsver, u8 dev_id)\n 295:\t{\n 296:\t\tconst struct stmmac_hwif_entry *entry;\n 297:\t\tint i;\n 298:\t\n 299:\t\tfor (i = ARRAY_SIZE(stmmac_hw) - 1; i \u003e= 0; i--) {\n"
}

11/2 2026/10/04 12:17 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 19941
							output: 31
							thoughts: 55
						

Thoughts:
Okay, let's break this down.

**Investigating the `stmmac` Driver**

Alright, my immediate thought is to trace the usage and initialization of `stmmac`. I need to figure out which devices actually utilize this driver and how its lifecycle begins within the system. My first step is to locate relevant files. I'll search the kernel source tree, specifically looking for `stmmac_pci.c` or similar driver files. I'll focus my search within the `drivers/net/ethernet/stmicro/stmmac/` directory, as that's the most likely location for the STMicroelectronics Ethernet MAC driver code. Once I find those files, I can examine the code to see where the driver is registered and initialized. From there, I'll be able to work backward and understand the driver's role in the system.



12/2 2026/10/04 12:17 tool codesearch-dir-index
0m Args:
{
  "Dir": "drivers/net/ethernet/stmicro/stmmac"
}

Results:
{
  "Files": [
    "chain_mode.c",
    "common.h",
    "descs.h",
    "descs_com.h",
    "dwmac-anarion.c",
    "dwmac-dwc-qos-eth.c",
    "dwmac-eic7700.c",
    "dwmac-generic.c",
    "dwmac-imx.c",
    "dwmac-ingenic.c",
    "dwmac-intel-plat.c",
    "dwmac-intel.c",
    "dwmac-intel.h",
    "dwmac-ipq806x.c",
    "dwmac-loongson.c",
    "dwmac-loongson1.c",
    "dwmac-lpc18xx.c",
    "dwmac-mediatek.c",
    "dwmac-meson.c",
    "dwmac-meson8b.c",
    "dwmac-motorcomm.c",
    "dwmac-nuvoton.c",
    "dwmac-qcom-ethqos.c",
    "dwmac-renesas-gbeth.c",
    "dwmac-rk.c",
    "dwmac-rzn1.c",
    "dwmac-s32.c",
    "dwmac-socfpga.c",
    "dwmac-sophgo.c",
    "dwmac-spacemit.c",
    "dwmac-starfive.c",
    "dwmac-sti.c",
    "dwmac-stm32.c",
    "dwmac-sun55i.c",
    "dwmac-sun8i.c",
    "dwmac-sunxi.c",
    "dwmac-tegra.c",
    "dwmac-thead.c",
    "dwmac-ultrarisc.c",
    "dwmac-visconti.c",
    "dwmac100.h",
    "dwmac1000.h",
    "dwmac1000_core.c",
    "dwmac1000_dma.c",
    "dwmac100_core.c",
    "dwmac100_dma.c",
    "dwmac4.h",
    "dwmac4_core.c",
    "dwmac4_descs.c",
    "dwmac4_descs.h",
    "dwmac4_dma.c",
    "dwmac4_dma.h",
    "dwmac4_lib.c",
    "dwmac5.c",
    "dwmac5.h",
    "dwmac_dma.h",
    "dwmac_lib.c",
    "dwxgmac2.h",
    "dwxgmac2_core.c",
    "dwxgmac2_descs.c",
    "dwxgmac2_dma.c",
    "dwxlgmac2.h",
    "enh_desc.c",
    "hwif.c",
    "hwif.h",
    "mmc.h",
    "mmc_core.c",
    "norm_desc.c",
    "ring_mode.c",
    "stmmac.h",
    "stmmac_est.c",
    "stmmac_est.h",
    "stmmac_ethtool.c",
    "stmmac_fpe.c",
    "stmmac_fpe.h",
    "stmmac_hwtstamp.c",
    "stmmac_libpci.c",
    "stmmac_libpci.h",
    "stmmac_main.c",
    "stmmac_mdio.c",
    "stmmac_pci.c",
    "stmmac_pcs.c",
    "stmmac_pcs.h",
    "stmmac_platform.c",
    "stmmac_platform.h",
    "stmmac_ptp.c",
    "stmmac_ptp.h",
    "stmmac_selftests.c",
    "stmmac_tc.c",
    "stmmac_vlan.c",
    "stmmac_vlan.h",
    "stmmac_xdp.c",
    "stmmac_xdp.h"
  ],
  "Subdirs": null
}

13/2 2026/10/04 12:17 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 21186
							output: 53
							thoughts: 70
						

Thoughts:
Here's my analysis of what I'm seeing:

**Analyzing Device Driver Implementations**

Okay, let's take a look at the landscape of these DWMAC Ethernet driver implementations. I'm seeing a few files here: `dwmac-socfpga.c`, `dwmac-intel.c`, and `stmmac_pci.c`. The naming convention hints at some interesting things, and I can start to make some educated guesses, but I need to be more precise.

Wait a minute, what is `dwmac-socfpga.c` representing? Is this some specific SoC implementation on an FPGA? I need to clarify the specifics of this driver. Let's delve into that specific file to gain a clearer understanding.



14/2 2026/10/04 12:18 tool grepper
0m Args:
{
  "Expression": "module_platform_driver|MODULE_DEVICE_TABLE",
  "PathPrefix": "drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c"
}

Results:
{
  "Output": "drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c=695=static const struct of_device_id socfpga_dwmac_match[] = {\n--\ndrivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c-700-};\ndrivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c:701:MODULE_DEVICE_TABLE(of, socfpga_dwmac_match);\ndrivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c-702-\ndrivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c=703=static struct platform_driver socfpga_dwmac_driver = {\n--\ndrivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c-710-};\ndrivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c:711:module_platform_driver(socfpga_dwmac_driver);\ndrivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c-712-\n"
}

15/2 2026/10/04 12:18 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 21777
							output: 37
							thoughts: 547
						

Thoughts:
**Analyzing the Implications of the `dwmac-socfpga.c` Modification**

Okay, so `dwmac-socfpga.c` – that's a DeviceTree platform driver specifically for Altera/Intel SoC FPGAs. My initial thought is to understand the scope, but then I realize there are other modified files. I need to get the full picture. Let's see...

Alright, the other modified files are: `drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c`, `drivers/net/ethernet/stmicro/stmmac/hwif.c`, `drivers/net/ethernet/stmicro/stmmac/hwif.h`, `drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c`, `drivers/net/ethernet/stmicro/stmmac/stmmac_main.c`, `drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c`, `drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.h`, and `include/linux/stmmac.h`. Interesting. This looks like a broader stmmac-related change.

Now, a crucial question arises: can this stmmac functionality even be tested reliably within QEMU/syzkaller on an amd64 host? Can I get an stmmac device running in QEMU? I need to quickly assess the feasibility of reproducing any issues here.

Does QEMU even have an emulation for stmmac or dwmac devices? Is it reachable via PCI, a platform device, or through the syzkaller probing mechanism? I need to confirm whether QEMU offers a way to interact with these devices on an amd64 setup.

Okay, what's available? The built-in ethernet device list in QEMU is: e1000, e1000e, igb, rtl8139, ne2k_pci, pcnet, vmxnet3, virtio-net-pci, usb-net, rocker, and sungem/sungem_pci. No dwmac. Perhaps ARM boards? Allwinner a10 emac, etc.? But on amd64, is there an stmmac / dwmac emulation? I have to confirm.

Nope. QEMU doesn't have stmmac or dwxgmac emulation directly. So, I need to verify: does the kernel itself provide a virtual stmmac, or can I somehow hook into a supported device type and get stmmac functionality that way? Time to investigate `stmmac_pci.c` and `dwmac-intel.c`.



16/2 2026/10/04 12:18 tool grepper
0m Args:
{
  "Expression": "PCI_DEVICE",
  "PathPrefix": "drivers/net/ethernet/stmicro/stmmac/"
}

Results:
{
  "Output": "drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c=1362=static void intel_eth_pci_remove(struct pci_dev *pdev)\n--\ndrivers/net/ethernet/stmicro/stmmac/dwmac-intel.c-1373-\ndrivers/net/ethernet/stmicro/stmmac/dwmac-intel.c:1374:#define PCI_DEVICE_ID_INTEL_QUARK\t\t0x0937\ndrivers/net/ethernet/stmicro/stmmac/dwmac-intel.c:1375:#define PCI_DEVICE_ID_INTEL_EHL_RGMII1G\t\t0x4b30\ndrivers/net/ethernet/stmicro/stmmac/dwmac-intel.c:1376:#define PCI_DEVICE_ID_INTEL_EHL_SGMII1G\t\t0x4b31\ndrivers/net/ethernet/stmicro/stmmac/dwmac-intel.c:1377:#define PCI_DEVICE_ID_INTEL_EHL_SGMII2G5\t0x4b32\ndrivers/net/ethernet/stmicro/stmmac/dwmac-intel.c-1378-/* Intel(R) Programmable Services Engine (Intel(R) PSE) consist of 2 MAC\n--\ndrivers/net/ethernet/stmicro/stmmac/dwmac-intel.c-1380- */\ndrivers/net/ethernet/stmicro/stmmac/dwmac-intel.c:1381:#define PCI_DEVICE_ID_INTEL_EHL_PSE0_RGMII1G\t0x4ba0\ndrivers/net/ethernet/stmicro/stmmac/dwmac-intel.c:1382:#define PCI_DEVICE_ID_INTEL_EHL_PSE0_SGMII1G\t0x4ba1\ndrivers/net/ethernet/stmicro/stmmac/dwmac-intel.c:1383:#define PCI_DEVICE_ID_INTEL_EHL_PSE0_SGMII2G5\t0x4ba2\ndrivers/net/ethernet/stmicro/stmmac/dwmac-intel.c:1384:#define PCI_DEVICE_ID_INTEL_EHL_PSE1_RGMII1G\t0x4bb0\ndrivers/net/ethernet/stmicro/stmmac/dwmac-intel.c:1385:#define PCI_DEVICE_ID_INTEL_EHL_PSE1_SGMII1G\t0x4bb1\ndrivers/net/ethernet/stmicro/stmmac/dwmac-intel.c:1386:#define PCI_DEVICE_ID_INTEL_EHL_PSE1_SGMII2G5\t0x4bb2\ndrivers/net/ethernet/stmicro/stmmac/dwmac-intel.c:1387:#define PCI_DEVICE_ID_INTEL_TGLH_SGMII1G_0\t0x43ac\ndrivers/net/ethernet/stmicro/stmmac/dwmac-intel.c:1388:#define PCI_DEVICE_ID_INTEL_TGLH_SGMII1G_1\t0x43a2\ndrivers/net/ethernet/stmicro/stmmac/dwmac-intel.c:1389:#define PCI_DEVICE_ID_INTEL_TGL_SGMII1G\t\t0xa0ac\ndrivers/net/ethernet/stmicro/stmmac/dwmac-intel.c:1390:#define PCI_DEVICE_ID_INTEL_ADLS_SGMII1G_0\t0x7aac\ndrivers/net/ethernet/stmicro/stmmac/dwmac-intel.c:1391:#define PCI_DEVICE_ID_INTEL_ADLS_SGMII1G_1\t0x7aad\ndrivers/net/ethernet/stmicro/stmmac/dwmac-intel.c:1392:#define PCI_DEVICE_ID_INTEL_ADLN_SGMII1G\t0x54ac\ndrivers/net/ethernet/stmicro/stmmac/dwmac-intel.c:1393:#define PCI_DEVICE_ID_INTEL_RPLP_SGMII1G\t0x51ac\ndrivers/net/ethernet/stmicro/stmmac/dwmac-intel.c-1394-\ndrivers/net/ethernet/stmicro/stmmac/dwmac-intel.c=1395=static const struct pci_device_id intel_eth_pci_id_table[] = {\ndrivers/net/ethernet/stmicro/stmmac/dwmac-intel.c:1396:\t{ PCI_DEVICE_DATA(INTEL, QUARK, \u0026quark_info) },\ndrivers/net/ethernet/stmicro/stmmac/dwmac-intel.c:1397:\t{ PCI_DEVICE_DATA(INTEL, EHL_RGMII1G, \u0026ehl_rgmii1g_info) },\ndrivers/net/ethernet/stmicro/stmmac/dwmac-intel.c:1398:\t{ PCI_DEVICE_DATA(INTEL, EHL_SGMII1G, \u0026ehl_sgmii1g_info) },\ndrivers/net/ethernet/stmicro/stmmac/dwmac-intel.c:1399:\t{ PCI_DEVICE_DATA(INTEL, EHL_SGMII2G5, \u0026ehl_sgmii1g_info) },\ndrivers/net/ethernet/stmicro/stmmac/dwmac-intel.c:1400:\t{ PCI_DEVICE_DATA(INTEL, EHL_PSE0_RGMII1G, \u0026ehl_pse0_rgmii1g_info) },\ndrivers/net/ethernet/stmicro/stmmac/dwmac-intel.c:1401:\t{ PCI_DEVICE_DATA(INTEL, EHL_PSE0_SGMII1G, \u0026ehl_pse0_sgmii1g_info) },\ndrivers/net/ethernet/stmicro/stmmac/dwmac-intel.c:1402:\t{ PCI_DEVICE_DATA(INTEL, EHL_PSE0_SGMII2G5, \u0026ehl_pse0_sgmii1g_info) },\ndrivers/net/ethernet/stmicro/stmmac/dwmac-intel.c:1403:\t{ PCI_DEVICE_DATA(INTEL, EHL_PSE1_RGMII1G, \u0026ehl_pse1_rgmii1g_info) },\ndrivers/net/ethernet/stmicro/stmmac/dwmac-intel.c:1404:\t{ PCI_DEVICE_DATA(INTEL, EHL_PSE1_SGMII1G, \u0026ehl_pse1_sgmii1g_info) },\ndrivers/net/ethernet/stmicro/stmmac/dwmac-intel.c:1405:\t{ PCI_DEVICE_DATA(INTEL, EHL_PSE1_SGMII2G5, \u0026ehl_pse1_sgmii1g_info) },\ndrivers/net/ethernet/stmicro/stmmac/dwmac-intel.c:1406:\t{ PCI_DEVICE_DATA(INTEL, TGL_SGMII1G, \u0026tgl_sgmii1g_phy0_info) },\ndrivers/net/ethernet/stmicro/stmmac/dwmac-intel.c:1407:\t{ PCI_DEVICE_DATA(INTEL, TGLH_SGMII1G_0, \u0026tgl_sgmii1g_phy0_info) },\ndrivers/net/ethernet/stmicro/stmmac/dwmac-intel.c:1408:\t{ PCI_DEVICE_DATA(INTEL, TGLH_SGMII1G_1, \u0026tgl_sgmii1g_phy1_info) },\ndrivers/net/ethernet/stmicro/stmmac/dwmac-intel.c:1409:\t{ PCI_DEVICE_DATA(INTEL, ADLS_SGMII1G_0, \u0026adls_sgmii1g_phy0_info) },\ndrivers/net/ethernet/stmicro/stmmac/dwmac-intel.c:1410:\t{ PCI_DEVICE_DATA(INTEL, ADLS_SGMII1G_1, \u0026adls_sgmii1g_phy1_info) },\ndrivers/net/ethernet/stmicro/stmmac/dwmac-intel.c:1411:\t{ PCI_DEVICE_DATA(INTEL, ADLN_SGMII1G, \u0026adln_sgmii1g_phy0_info) },\ndrivers/net/ethernet/stmicro/stmmac/dwmac-intel.c:1412:\t{ PCI_DEVICE_DATA(INTEL, RPLP_SGMII1G, \u0026adln_sgmii1g_phy0_info) },\ndrivers/net/ethernet/stmicro/stmmac/dwmac-intel.c-1413-\t{}\n--\ndrivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c-69-\ndrivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c:70:#define PCI_DEVICE_ID_LOONGSON_GMAC1\t0x7a03\ndrivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c:71:#define PCI_DEVICE_ID_LOONGSON_GMAC2\t0x7a23\ndrivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c:72:#define PCI_DEVICE_ID_LOONGSON_GNET\t0x7a13\ndrivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c-73-#define DWMAC_CORE_MULTICHAN_V1\t0x10\t/* Loongson custom ID 0x10 */\n--\ndrivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c=306=static int loongson_dwmac_setup(void *apriv, struct mac_device_info *mac)\n--\ndrivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c-351-\t */\ndrivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c:352:\tif (pdev-\u003edevice != PCI_DEVICE_ID_LOONGSON_GNET) {\ndrivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c-353-\t\tmac-\u003elink.caps = MAC_10 | MAC_100 | MAC_1000;\n--\ndrivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c=596=static const struct pci_device_id loongson_dwmac_id_table[] = {\ndrivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c:597:\t{ PCI_DEVICE_DATA(LOONGSON, GMAC1, \u0026loongson_gmac_pci_info) },\ndrivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c:598:\t{ PCI_DEVICE_DATA(LOONGSON, GMAC2, \u0026loongson_gmac_pci_info) },\ndrivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c:599:\t{ PCI_DEVICE_DATA(LOONGSON, GNET, \u0026loongson_gnet_pci_info) },\ndrivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c-600-\t{}\n--\ndrivers/net/ethernet/stmicro/stmmac/dwmac-motorcomm.c=367=static const struct pci_device_id dwmac_motorcomm_pci_id_table[] = {\ndrivers/net/ethernet/stmicro/stmmac/dwmac-motorcomm.c:368:\t{ PCI_DEVICE(PCI_VENDOR_ID_MOTORCOMM, 0x6801) },\ndrivers/net/ethernet/stmicro/stmmac/dwmac-motorcomm.c-369-\t{ },\n--\ndrivers/net/ethernet/stmicro/stmmac/stmmac_pci.c=192=static void stmmac_pci_remove(struct pci_dev *pdev)\n--\ndrivers/net/ethernet/stmicro/stmmac/stmmac_pci.c-199-\ndrivers/net/ethernet/stmicro/stmmac/stmmac_pci.c:200:#define PCI_DEVICE_ID_STMMAC_STMMAC\t\t0x1108\ndrivers/net/ethernet/stmicro/stmmac/stmmac_pci.c:201:#define PCI_DEVICE_ID_SYNOPSYS_GMAC5_ID\t\t0x7102\ndrivers/net/ethernet/stmicro/stmmac/stmmac_pci.c-202-\ndrivers/net/ethernet/stmicro/stmmac/stmmac_pci.c=203=static const struct pci_device_id stmmac_id_table[] = {\ndrivers/net/ethernet/stmicro/stmmac/stmmac_pci.c:204:\t{ PCI_DEVICE_DATA(STMMAC, STMMAC, \u0026stmmac_pci_info) },\ndrivers/net/ethernet/stmicro/stmmac/stmmac_pci.c:205:\t{ PCI_DEVICE_DATA(STMICRO, MAC, \u0026stmmac_pci_info) },\ndrivers/net/ethernet/stmicro/stmmac/stmmac_pci.c:206:\t{ PCI_DEVICE_DATA(SYNOPSYS, GMAC5_ID, \u0026snps_gmac5_pci_info) },\ndrivers/net/ethernet/stmicro/stmmac/stmmac_pci.c-207-\t{}\n"
}

17/2 2026/10/04 12:18 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 26443
							output: 39
							thoughts: 427
						

Thoughts:
**My Analysis of QEMU's Network Device Emulation Capabilities**

Okay, so none of the standard emulations seem to cover what I'm after. First, I need to confirm what hardware QEMU and GCE *do* emulate. Let's see... e1000, e1000e, igb, rtl8139, pcnet, ne2k_pci, vmxnet3, and virtio-net-pci. Right, that's the usual suspects. Now, the critical question: Does QEMU support stmmac, or the Synopsys GMAC/DWmac devices? Hmm, wait a minute, does QEMU even offer support for DWmac or stmmac on any platform, and specifically on amd64? No! QEMU has no stmmac/dwmac device model. Let's make absolutely sure. Even if it did exist, say, on some ARM board—wait, does QEMU even have DWmac on ARM? No, mostly cadenced_gem, imx_fec, smsc91c111, lan9118, etc. And my target architecture is *amd64*!

Okay, time to re-evaluate the reachability issue. This is crucial for fuzzing! The key is: fuzzing is only effective if the code *can* be executed in standard virtual environments. Stuff that's structurally unreachable—those are a no-go for fuzzing. Hardware that requires physical ASIC/PCIe cards that QEMU doesn't emulate (like vendor-specific PCIe switches, SmartNICs, GPU drivers like mlxsw, pds_core, qed, ionic, amdgpu, etc.), those are unreachable.

Now, a possibility to explore: Could I instantiate stmmac through some mock, virtual, or dummy platform device on amd64? Let's investigate that avenue. I need to check if stmmac can be instantiated via a platform device, device tree, sysfs, or anything similar. Okay, let's grep for `platform_device_register` or `stmmac` in the driver directory and see what pops up.



18/2 2026/10/04 12:18 tool grepper
0m Args:
{
  "Expression": "stmmac.*register",
  "PathPrefix": "drivers/net/ethernet/stmicro/stmmac/"
}

Results:
{
  "Output": "drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c=616=static int intel_mgbe_common_data(struct pci_dev *pdev,\n--\ndrivers/net/ethernet/stmicro/stmmac/dwmac-intel.c-690-\ndrivers/net/ethernet/stmicro/stmmac/dwmac-intel.c:691:\tplat-\u003estmmac_clk = clk_register_fixed_rate(\u0026pdev-\u003edev,\ndrivers/net/ethernet/stmicro/stmmac/dwmac-intel.c-692-\t\t\t\t\t\t   clk_name, NULL, 0,\n--\ndrivers/net/ethernet/stmicro/stmmac/mmc_core.c=235=static void dwmac_mmc_ctrl(void __iomem *mmcaddr, unsigned int mode)\n--\ndrivers/net/ethernet/stmicro/stmmac/mmc_core.c-242-\ndrivers/net/ethernet/stmicro/stmmac/mmc_core.c:243:\tpr_debug(\"stmmac: MMC ctrl register (offset 0x%x): 0x%08x\\n\",\ndrivers/net/ethernet/stmicro/stmmac/mmc_core.c-244-\t\t MMC_CNTRL, value);\n--\ndrivers/net/ethernet/stmicro/stmmac/stmmac.h=395=extern const struct dev_pm_ops stmmac_simple_pm_ops;\ndrivers/net/ethernet/stmicro/stmmac/stmmac.h-396-\ndrivers/net/ethernet/stmicro/stmmac/stmmac.h:397:int stmmac_mdio_unregister(struct net_device *ndev);\ndrivers/net/ethernet/stmicro/stmmac/stmmac.h:398:int stmmac_mdio_register(struct net_device *ndev);\ndrivers/net/ethernet/stmicro/stmmac/stmmac.h-399-int stmmac_mdio_reset(struct mii_bus *mii);\n--\ndrivers/net/ethernet/stmicro/stmmac/stmmac.h=404=void stmmac_set_ethtool_ops(struct net_device *netdev);\ndrivers/net/ethernet/stmicro/stmmac/stmmac.h-405-\ndrivers/net/ethernet/stmicro/stmmac/stmmac.h:406:void stmmac_ptp_register(struct stmmac_priv *priv);\ndrivers/net/ethernet/stmicro/stmmac/stmmac.h:407:void stmmac_ptp_unregister(struct stmmac_priv *priv);\ndrivers/net/ethernet/stmicro/stmmac/stmmac.h-408-int stmmac_xdp_open(struct net_device *dev);\n--\ndrivers/net/ethernet/stmicro/stmmac/stmmac_main.c=996=static int stmmac_setup_ptp(struct stmmac_priv *priv)\n--\ndrivers/net/ethernet/stmicro/stmmac/stmmac_main.c-1023-\ndrivers/net/ethernet/stmicro/stmmac/stmmac_main.c:1024:\tstmmac_ptp_register(priv);\ndrivers/net/ethernet/stmicro/stmmac/stmmac_main.c-1025-\tpriv-\u003eptp_enabled = true;\n--\ndrivers/net/ethernet/stmicro/stmmac/stmmac_main.c=1030=static void stmmac_release_ptp(struct stmmac_priv *priv)\n--\ndrivers/net/ethernet/stmicro/stmmac/stmmac_main.c-1034-\ndrivers/net/ethernet/stmicro/stmmac/stmmac_main.c:1035:\tstmmac_ptp_unregister(priv);\ndrivers/net/ethernet/stmicro/stmmac/stmmac_main.c-1036-\tclk_disable_unprepare(priv-\u003eplat-\u003eclk_ptp_ref);\n--\ndrivers/net/ethernet/stmicro/stmmac/stmmac_main.c=3226=static void stmmac_mmc_setup(struct stmmac_priv *priv)\n--\ndrivers/net/ethernet/stmicro/stmmac/stmmac_main.c-3240-/**\ndrivers/net/ethernet/stmicro/stmmac/stmmac_main.c:3241: * stmmac_get_hw_features - get MAC capabilities from the HW cap. register.\ndrivers/net/ethernet/stmicro/stmmac/stmmac_main.c-3242- * @priv: driver private structure\n--\ndrivers/net/ethernet/stmicro/stmmac/stmmac_main.c=7845=static const struct devlink_ops stmmac_devlink_ops = {};\ndrivers/net/ethernet/stmicro/stmmac/stmmac_main.c-7846-\ndrivers/net/ethernet/stmicro/stmmac/stmmac_main.c:7847:static int stmmac_register_devlink(struct stmmac_priv *priv)\ndrivers/net/ethernet/stmicro/stmmac/stmmac_main.c-7848-{\n--\ndrivers/net/ethernet/stmicro/stmmac/stmmac_main.c-7879-\ndrivers/net/ethernet/stmicro/stmmac/stmmac_main.c:7880:static void stmmac_unregister_devlink(struct stmmac_priv *priv)\ndrivers/net/ethernet/stmicro/stmmac/stmmac_main.c-7881-{\n--\ndrivers/net/ethernet/stmicro/stmmac/stmmac_main.c=7927=static int __stmmac_dvr_probe(struct device *device,\n--\ndrivers/net/ethernet/stmicro/stmmac/stmmac_main.c-8168-\ndrivers/net/ethernet/stmicro/stmmac/stmmac_main.c:8169:\tret = stmmac_mdio_register(ndev);\ndrivers/net/ethernet/stmicro/stmmac/stmmac_main.c-8170-\tif (ret \u003c 0) {\n--\ndrivers/net/ethernet/stmicro/stmmac/stmmac_main.c-8186-\ndrivers/net/ethernet/stmicro/stmmac/stmmac_main.c:8187:\tret = stmmac_register_devlink(priv);\ndrivers/net/ethernet/stmicro/stmmac/stmmac_main.c-8188-\tif (ret)\n--\ndrivers/net/ethernet/stmicro/stmmac/stmmac_main.c-8212-error_netdev_register:\ndrivers/net/ethernet/stmicro/stmmac/stmmac_main.c:8213:\tstmmac_unregister_devlink(priv);\ndrivers/net/ethernet/stmicro/stmmac/stmmac_main.c-8214-error_devlink_setup:\n--\ndrivers/net/ethernet/stmicro/stmmac/stmmac_main.c-8218-error_pcs_setup:\ndrivers/net/ethernet/stmicro/stmmac/stmmac_main.c:8219:\tstmmac_mdio_unregister(ndev);\ndrivers/net/ethernet/stmicro/stmmac/stmmac_main.c-8220-error_mdio_register:\n--\ndrivers/net/ethernet/stmicro/stmmac/stmmac_main.c=8265=void stmmac_dvr_remove(struct device *dev)\n--\ndrivers/net/ethernet/stmicro/stmmac/stmmac_main.c-8278-#endif\ndrivers/net/ethernet/stmicro/stmmac/stmmac_main.c:8279:\tstmmac_unregister_devlink(priv);\ndrivers/net/ethernet/stmicro/stmmac/stmmac_main.c-8280-\n--\ndrivers/net/ethernet/stmicro/stmmac/stmmac_main.c-8286-\tstmmac_pcs_clean(ndev);\ndrivers/net/ethernet/stmicro/stmmac/stmmac_main.c:8287:\tstmmac_mdio_unregister(ndev);\ndrivers/net/ethernet/stmicro/stmmac/stmmac_main.c-8288-\n--\ndrivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c=212=static int stmmac_xgmac2_mdio_write_c45(struct mii_bus *bus, int phyaddr,\n--\ndrivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c-224-/**\ndrivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c:225: * stmmac_mdio_format_addr() - format the address register\ndrivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c-226- * @priv: struct stmmac_priv pointer\n--\ndrivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c=567=static void stmmac_mdio_bus_config(struct stmmac_priv *priv)\n--\ndrivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c-590-/**\ndrivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c:591: * stmmac_mdio_register\ndrivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c-592- * @ndev: net device structure\n--\ndrivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c-594- */\ndrivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c:595:int stmmac_mdio_register(struct net_device *ndev)\ndrivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c-596-{\n--\ndrivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c-719-/**\ndrivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c:720: * stmmac_mdio_unregister\ndrivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c-721- * @ndev: net device structure\n--\ndrivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c-723- */\ndrivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c:724:int stmmac_mdio_unregister(struct net_device *ndev)\ndrivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c-725-{\n--\ndrivers/net/ethernet/stmicro/stmmac/stmmac_platform.c=69=static int dwmac1000_validate_ucast_entries(struct device *dev,\n--\ndrivers/net/ethernet/stmicro/stmmac/stmmac_platform.c-88-/**\ndrivers/net/ethernet/stmicro/stmmac/stmmac_platform.c:89: * stmmac_axi_setup - parse DT parameters for programming the AXI register\ndrivers/net/ethernet/stmicro/stmmac/stmmac_platform.c-90- * @pdev: platform device\n--\ndrivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c=314=const struct ptp_clock_info stmmac_ptp_clock_ops = {\n--\ndrivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c-318-\t.n_alarm = 0,\ndrivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c:319:\t.n_ext_ts = 0, /* will be overwritten in stmmac_ptp_register */\ndrivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c:320:\t.n_per_out = 0, /* will be overwritten in stmmac_ptp_register */\ndrivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c-321-\t.n_pins = 0,\n--\ndrivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c=331=const struct ptp_clock_info dwmac1000_ptp_clock_ops = {\n--\ndrivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c-347-/**\ndrivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c:348: * stmmac_ptp_register\ndrivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c-349- * @priv: driver private structure\n--\ndrivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c-352- */\ndrivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c:353:void stmmac_ptp_register(struct stmmac_priv *priv)\ndrivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c-354-{\n--\ndrivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c-401-/**\ndrivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c:402: * stmmac_ptp_unregister\ndrivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c-403- * @priv: driver private structure\n--\ndrivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c-406- */\ndrivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c:407:void stmmac_ptp_unregister(struct stmmac_priv *priv)\ndrivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c-408-{\n"
}

19/2 2026/10/04 12:18 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 31114
							output: 112
							thoughts: 2319
						

Thoughts:
**Analysis of stmmac Driver for Fuzzing Suitability**

Okay, let's break this down systematically. The `stmmac` driver, it seems, is a Synopsys DesignWare Ethernet MAC driver and an STMicroelectronics Ethernet driver. It primarily targets Ethernet MAC hardware controllers embedded in SoCs like STM32, Allwinner, Rockchip, Tegra, Intel Elkhart Lake/Tiger Lake, and similar, or connected via PCI for specific custom chips. The crucial point is that none of these specific chips or associated PCI IDs are emulated within the QEMU environment, which is the standard KVM/QEMU virtual machine used by syzkaller for fuzzing.

Now, let's double-check the fuzzing guidelines. Section 2's negative criteria are very clear: we return `WorthFuzzing=false` if *all* modified code falls into specific categories. One key category is "Structurally unreachable hardware," which explicitly calls out vendor-specific PCIe switches, SmartNICs, GPU drivers (examples given include `mlxsw`, `pds_core`, `qed`, `ionic`, and `amdgpu`) *requiring physical ASIC/PCIe cards not emulated in standard QEMU*.

Does `stmmac` fit this description? Yes, unequivocally. `stmmac` is an Ethernet MAC controller designed for *specific* physical hardware: Synopsys DesignWare Cores, STMicroelectronics MACs, or Intel SoC Ethernet MACs. It’s not a virtual network device; it's a driver for *real* hardware.

I need to confirm QEMU's capabilities. A quick review of QEMU's network card emulation reveals a wide range of virtual NICs like e1000, rtl8139, virtio-net, etc., and various ARM-specific emulations. However, there's absolutely *no* `dwmac`, `dwxgmac`, or `stmmac` emulation present.

Furthermore, `dwmac-socfpga.c`, specifically targets Intel/Altera SoC FPGAs (Cyclone V, Arria 10, Stratix 10, Agilex), which are ARM/ARM64 platforms. And we're dealing with the amd64 architecture here. The stmmac PCI devices, even on amd64, are linked to specific Intel SoC PCI devices (Elkhart Lake, Tiger Lake, Alder Lake, Raptor Lake PSE/SGMII) and Loongson/Motorcomm/Synopsys test PCI boards. These aren't emulated anywhere in standard QEMU or GCE (Google Compute Engine).

Can syzkaller somehow instantiate these `stmmac` devices through netlink, platform devices, USB, or any other method? No. `stmmac` is not a virtual netdev, like veth, tun, macvlan, etc. It doesn't expose any such virtual interface creation. It's a physical Ethernet driver (located in `drivers/net/ethernet/...`). The `stmmac_dvr_probe` function, crucial for driver initialization, will never be called without the physical hardware (or emulation). Consequently, no `net_device` will be registered, and functions like `dwxgmac2_timestamp_interrupt`, `stmmac_rearm_timestamp_irq`, `stmmac_enable` (in stmmac_ptp.c), or `smtg_crosststamp` are completely unreachable.

Let's confirm that crucial code paths like those in `stmmac_ptp.c` and `stmmac_hwtstamp.c` cannot be reached without a registered `stmmac` netdev. The `stmmac_ptp_register` function registers the ptp clock (`ptp_clock_register(&priv->ptp_clock_ops, priv->device)`), which is only called during stmmac probe if stmmac hardware is found. Without a probed `stmmac` device, no ptp clock gets registered and no PTP callbacks are reachable via PTP ioctls or sysfs.

Returning to Sections 1 and 2, the primary gate for fuzzing is reachability. The fuzzer can *only* discover bugs in code that's executable within standard virtualized environments (GCE or QEMU, using software-emulated devices). If the code is structurally unreachable, as per Section 2's negative criteria, it *must not* be fuzzed.

The modified code encompasses:

1.  `dwmac-socfpga.c`: Altera/Intel SoC FPGA glue (ARM/ARM64 exclusive, not emulated).
2.  `dwxgmac2_core.c`: Core operations for Synopsys XGMAC


20/2 2026/10/04 12:18 tool set-results
0m Args:
{
  "EnableConfigs": [],
  "FocusSymbols": [],
  "Reasoning": "The patch modifies the STMicroelectronics / Synopsys DesignWare Ethernet MAC (stmmac) driver, specifically auxiliary snapshot and hardware timestamping support for Synopsys XGMAC and SoC FPGA hardware. This driver requires physical SoC/PCIe hardware that is not emulated in standard QEMU or GCE virtualized environments on amd64, making the modified code structurally unreachable for fuzzing.",
  "WorthFuzzing": false
}

Results:
{
  "EnableConfigs": null,
  "FocusSymbols": [],
  "Reasoning": "The patch modifies the STMicroelectronics / Synopsys DesignWare Ethernet MAC (stmmac) driver, specifically auxiliary snapshot and hardware timestamping support for Synopsys XGMAC and SoC FPGA hardware. This driver requires physical SoC/PCIe hardware that is not emulated in standard QEMU or GCE virtualized environments on amd64, making the modified code structurally unreachable for fuzzing.",
  "WorthFuzzing": false
}

21/1 2026/10/04 12:18 action If
0m Args:
{
  "WorthFuzzing": false
}

Results:
null

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