| Seq | Timestamp | Type | Name | Duration |
|---|---|---|---|---|
| 0/0 | 2026/11/20 04:59 | flow | patch-triage |
2mArgs:null Results: {
"EnableConfigs": null,
"FocusSymbols": [],
"KMSANReasoning": "",
"NeedsKMSAN": false,
"Reasoning": "The patch series refactors Qualcomm-specific Peripheral Authentication Service (PAS) and MDT loader interfaces across Qualcomm SoC drivers (Qualcomm SCM, Adreno GPU, Iris, Venus, IPA, ath12k AHB, WCNSS). These drivers and firmware interfaces are exclusive to Qualcomm ARM/ARM64 platforms and rely on ARM SMC / TrustZone / device tree bindings for physical Qualcomm Snapdragon SoCs. They are structurally unreachable on the amd64 target architecture in standard virtualized QEMU/GCE fuzzing environments.",
"WorthFuzzing": false
} |
| 1/1 | 2026/11/20 04:59 | action | read-patch-diff |
0mArgs:null Results: {
"PatchDiff": "commit 51bb5761230951b837594a12b7d9dc295de96622\nAuthor: syz-cluster \u003ctriage@syzkaller.com\u003e\nDate: Fri Nov 20 04:59:30 2026 +0000\n\n syz-cluster: applied patch under review\n\ndiff --git a/drivers/firmware/qcom/qcom_pas.c b/drivers/firmware/qcom/qcom_pas.c\nindex ae21eed58c3c27..aa000c65c48681 100644\n--- a/drivers/firmware/qcom/qcom_pas.c\n+++ b/drivers/firmware/qcom/qcom_pas.c\n@@ -14,6 +14,27 @@\n \n static struct qcom_pas_ops *ops_ptr;\n \n+/**\n+ * qcom_pas_context_init() - Initialize a peripheral authentication service\n+ *\t\t\t context for a given peripheral\n+ *\n+ * @ctx:\t Caller-provided PAS context to initialize\n+ * @dev:\t PAS firmware device\n+ * @pas_id:\t peripheral authentication service id\n+ * @mem_phys:\t Subsystem reserve memory start address\n+ * @mem_size:\t Subsystem reserve memory size\n+ */\n+void qcom_pas_context_init(struct qcom_pas_context *ctx, struct device *dev,\n+\t\t\t u32 pas_id, phys_addr_t mem_phys, size_t mem_size)\n+{\n+\tmemset(ctx, 0, sizeof(*ctx));\n+\tctx-\u003edev = dev;\n+\tctx-\u003epas_id = pas_id;\n+\tctx-\u003emem_phys = mem_phys;\n+\tctx-\u003emem_size = mem_size;\n+}\n+EXPORT_SYMBOL_GPL(qcom_pas_context_init);\n+\n /**\n * devm_qcom_pas_context_alloc() - Allocate peripheral authentication service\n *\t\t\t\t context for a given peripheral\n@@ -39,10 +60,7 @@ struct qcom_pas_context *devm_qcom_pas_context_alloc(struct device *dev,\n \tif (!ctx)\n \t\treturn ERR_PTR(-ENOMEM);\n \n-\tctx-\u003edev = dev;\n-\tctx-\u003epas_id = pas_id;\n-\tctx-\u003emem_phys = mem_phys;\n-\tctx-\u003emem_size = mem_size;\n+\tqcom_pas_context_init(ctx, dev, pas_id, mem_phys, mem_size);\n \n \treturn ctx;\n }\n@@ -160,22 +178,6 @@ struct resource_table *qcom_pas_get_rsc_table(struct qcom_pas_context *ctx,\n }\n EXPORT_SYMBOL_GPL(qcom_pas_get_rsc_table);\n \n-/**\n- * qcom_pas_auth_and_reset() - Authenticate the given peripheral firmware\n- *\t\t\t and reset the remote processor\n- * @pas_id:\tperipheral authentication service id\n- *\n- * Return: 0 on success.\n- */\n-int qcom_pas_auth_and_reset(u32 pas_id)\n-{\n-\tif (!ops_ptr)\n-\t\treturn -ENODEV;\n-\n-\treturn ops_ptr-\u003eauth_and_reset(ops_ptr-\u003edev, pas_id);\n-}\n-EXPORT_SYMBOL_GPL(qcom_pas_auth_and_reset);\n-\n /**\n * qcom_pas_prepare_and_auth_reset() - Prepare, authenticate, and reset the\n *\t\t\t\t remote processor\ndiff --git a/drivers/firmware/qcom/qcom_pas.h b/drivers/firmware/qcom/qcom_pas.h\nindex 8643e2760602e0..a296be2be8c05f 100644\n--- a/drivers/firmware/qcom/qcom_pas.h\n+++ b/drivers/firmware/qcom/qcom_pas.h\n@@ -18,8 +18,6 @@ struct device;\n * @get_rsc_table:\t\tPeripheral get resource table callback.\n * @prepare_and_auth_reset:\tPeripheral prepare firmware authentication and\n *\t\t\t\treset callback.\n- * @auth_and_reset:\t\tPeripheral firmware authentication and reset\n- *\t\t\t\tcallback.\n * @set_remote_state:\t\tPeripheral set remote state callback.\n * @shutdown:\t\t\tPeripheral shutdown callback.\n * @metadata_release:\t\tImage metadata release callback.\n@@ -37,7 +35,6 @@ struct qcom_pas_ops {\n \t\t\t size_t *output_rt_size);\n \tint (*prepare_and_auth_reset)(struct device *dev,\n \t\t\t\t struct qcom_pas_context *ctx);\n-\tint (*auth_and_reset)(struct device *dev, u32 pas_id);\n \tint (*set_remote_state)(struct device *dev, u32 state, u32 pas_id);\n \tint (*shutdown)(struct device *dev, u32 pas_id);\n \tvoid (*metadata_release)(struct device *dev,\ndiff --git a/drivers/firmware/qcom/qcom_pas_tee.c b/drivers/firmware/qcom/qcom_pas_tee.c\nindex d248e2229c2f17..213c3153e407a4 100644\n--- a/drivers/firmware/qcom/qcom_pas_tee.c\n+++ b/drivers/firmware/qcom/qcom_pas_tee.c\n@@ -320,11 +320,6 @@ static int __qcom_pas_tee_auth_and_reset(struct device *dev, u32 pas_id,\n \treturn ret;\n }\n \n-static int qcom_pas_tee_auth_and_reset(struct device *dev, u32 pas_id)\n-{\n-\treturn __qcom_pas_tee_auth_and_reset(dev, pas_id, 0, 0);\n-}\n-\n static int qcom_pas_tee_prepare_and_auth_reset(struct device *dev,\n \t\t\t\t\t struct qcom_pas_context *ctx)\n {\n@@ -401,7 +396,6 @@ static struct qcom_pas_ops qcom_pas_ops_tee = {\n \t.init_image\t\t= qcom_pas_tee_init_image,\n \t.mem_setup\t\t= qcom_pas_tee_mem_setup,\n \t.get_rsc_table\t\t= qcom_pas_tee_get_rsc_table,\n-\t.auth_and_reset\t\t= qcom_pas_tee_auth_and_reset,\n \t.prepare_and_auth_reset\t= qcom_pas_tee_prepare_and_auth_reset,\n \t.set_remote_state\t= qcom_pas_tee_set_remote_state,\n \t.shutdown\t\t= qcom_pas_tee_shutdown,\ndiff --git a/drivers/firmware/qcom/qcom_scm.c b/drivers/firmware/qcom/qcom_scm.c\nindex b1a821d3b1bc0d..30f61e6e5818d4 100644\n--- a/drivers/firmware/qcom/qcom_scm.c\n+++ b/drivers/firmware/qcom/qcom_scm.c\n@@ -855,7 +855,7 @@ static void *qcom_scm_pas_get_rsc_table(struct device *dev,\n \treturn ret ? ERR_PTR(ret) : tbl_ptr;\n }\n \n-static int qcom_scm_pas_auth_and_reset(struct device *dev, u32 pas_id)\n+static int __qcom_scm_pas_auth_and_reset(struct device *dev, u32 pas_id)\n {\n \tint ret;\n \tstruct qcom_scm_desc desc = {\n@@ -896,7 +896,7 @@ static int qcom_scm_pas_prepare_and_auth_reset(struct device *dev,\n \t * memory region and then invokes a call to TrustZone to authenticate.\n \t */\n \tif (!ctx-\u003euse_tzmem)\n-\t\treturn qcom_scm_pas_auth_and_reset(dev, ctx-\u003epas_id);\n+\t\treturn __qcom_scm_pas_auth_and_reset(dev, ctx-\u003epas_id);\n \n \t/*\n \t * When Linux runs @ EL2 Linux must create the shmbridge itself and then\n@@ -906,7 +906,7 @@ static int qcom_scm_pas_prepare_and_auth_reset(struct device *dev,\n \tif (ret)\n \t\treturn ret;\n \n-\tret = qcom_scm_pas_auth_and_reset(dev, ctx-\u003epas_id);\n+\tret = __qcom_scm_pas_auth_and_reset(dev, ctx-\u003epas_id);\n \tqcom_tzmem_shm_bridge_delete(handle);\n \n \treturn ret;\n@@ -987,7 +987,6 @@ static struct qcom_pas_ops qcom_pas_ops_scm = {\n \t.init_image\t\t= qcom_scm_pas_init_image,\n \t.mem_setup\t\t= qcom_scm_pas_mem_setup,\n \t.get_rsc_table\t\t= qcom_scm_pas_get_rsc_table,\n-\t.auth_and_reset\t\t= qcom_scm_pas_auth_and_reset,\n \t.prepare_and_auth_reset\t= qcom_scm_pas_prepare_and_auth_reset,\n \t.set_remote_state\t= qcom_scm_pas_set_remote_state,\n \t.shutdown\t\t= qcom_scm_pas_shutdown,\ndiff --git a/drivers/gpu/drm/msm/adreno/adreno_gpu.c b/drivers/gpu/drm/msm/adreno/adreno_gpu.c\nindex dadfe4c6943841..12e35841763d8e 100644\n--- a/drivers/gpu/drm/msm/adreno/adreno_gpu.c\n+++ b/drivers/gpu/drm/msm/adreno/adreno_gpu.c\n@@ -34,11 +34,11 @@ static int zap_shader_load_mdt(struct msm_gpu *gpu, const char *fwname,\n \tstruct device *dev = \u0026gpu-\u003epdev-\u003edev;\n \tconst struct firmware *fw;\n \tconst char *signed_fwname = NULL;\n+\tstruct qcom_pas_context ctx;\n \tstruct device_node *np;\n \tstruct resource r;\n \tphys_addr_t mem_phys;\n \tssize_t mem_size;\n-\tvoid *mem_region = NULL;\n \tint ret;\n \n \tif (!IS_ENABLED(CONFIG_ARCH_QCOM)) {\n@@ -121,39 +121,32 @@ static int zap_shader_load_mdt(struct msm_gpu *gpu, const char *fwname,\n \t\tgoto out;\n \t}\n \n-\t/* Allocate memory for the firmware image */\n-\tmem_region = memremap(mem_phys, mem_size, MEMREMAP_WC);\n-\tif (!mem_region) {\n-\t\tret = -ENOMEM;\n-\t\tgoto out;\n-\t}\n+\tqcom_pas_context_init(\u0026ctx, dev, pasid, mem_phys, mem_size);\n \n \t/*\n \t * Load the rest of the MDT\n \t *\n \t * Note that we could be dealing with two different paths, since\n \t * with upstream linux-firmware it would be in a qcom/ subdir..\n-\t * adreno_request_fw() handles this, but qcom_mdt_load() does\n+\t * adreno_request_fw() handles this, but qcom_mdt_pas_load() does\n \t * not. But since we've already gotten through adreno_request_fw()\n \t * we know which of the two cases it is:\n \t */\n \tif (signed_fwname || (to_adreno_gpu(gpu)-\u003efwloc == FW_LOCATION_LEGACY)) {\n-\t\tret = qcom_mdt_load(dev, fw, fwname, pasid,\n-\t\t\t\tmem_region, mem_phys, mem_size, NULL);\n+\t\tret = qcom_mdt_pas_load(\u0026ctx, fw, fwname, NULL);\n \t} else {\n \t\tchar *newname;\n \n \t\tnewname = kasprintf(GFP_KERNEL, \"qcom/%s\", fwname);\n \n-\t\tret = qcom_mdt_load(dev, fw, newname, pasid,\n-\t\t\t\tmem_region, mem_phys, mem_size, NULL);\n+\t\tret = qcom_mdt_pas_load(\u0026ctx, fw, newname, NULL);\n \t\tkfree(newname);\n \t}\n \tif (ret)\n \t\tgoto out;\n \n \t/* Send the image to the secure world */\n-\tret = qcom_pas_auth_and_reset(pasid);\n+\tret = qcom_pas_prepare_and_auth_reset(\u0026ctx);\n \n \t/*\n \t * If the pas call returns -EOPNOTSUPP we assume that this target\n@@ -165,9 +158,6 @@ static int zap_shader_load_mdt(struct msm_gpu *gpu, const char *fwname,\n \t\tDRM_DEV_ERROR(dev, \"Unable to authorize the image\\n\");\n \n out:\n-\tif (mem_region)\n-\t\tmemunmap(mem_region);\n-\n \trelease_firmware(fw);\n \n \treturn ret;\ndiff --git a/drivers/media/platform/qcom/iris/iris_core.h b/drivers/media/platform/qcom/iris/iris_core.h\nindex 3e4cf652bf39a7..ac73bda072f85c 100644\n--- a/drivers/media/platform/qcom/iris/iris_core.h\n+++ b/drivers/media/platform/qcom/iris/iris_core.h\n@@ -9,6 +9,7 @@\n #include \u003clinux/types.h\u003e\n #include \u003clinux/dma-mapping.h\u003e\n #include \u003clinux/pm_domain.h\u003e\n+#include \u003clinux/firmware/qcom/qcom_pas.h\u003e\n #include \u003cmedia/v4l2-device.h\u003e\n \n #include \"iris_hfi_common.h\"\n@@ -129,6 +130,7 @@ struct iris_core {\n \tstruct platform_inst_fw_cap\t\tinst_fw_caps_dec[INST_FW_CAP_MAX];\n \tstruct platform_inst_fw_cap\t\tinst_fw_caps_enc[INST_FW_CAP_MAX];\n \tstruct dma_iova_state\t\t\t*iova_state;\n+\tstruct qcom_pas_context\t\t\tpas_ctx;\n };\n \n int iris_core_init(struct iris_core *core);\ndiff --git a/drivers/media/platform/qcom/iris/iris_firmware.c b/drivers/media/platform/qcom/iris/iris_firmware.c\nindex 21f57d37da1879..b701a7f43514b9 100644\n--- a/drivers/media/platform/qcom/iris/iris_firmware.c\n+++ b/drivers/media/platform/qcom/iris/iris_firmware.c\n@@ -201,21 +201,20 @@ static int iris_load_fw_to_memory(struct iris_core *core)\n \t\tgoto err_release_fw;\n \t}\n \n-\tmem_virt = memremap(mem_phys, res_size, MEMREMAP_WC);\n-\tif (!mem_virt) {\n-\t\tret = -ENOMEM;\n-\t\tgoto err_release_fw;\n-\t}\n-\n-\tmemset(mem_virt, 0, res_size);\n-\n-\tret = qcom_mdt_load(dev, firmware, fw_name,\n-\t\t\t IRIS_PAS_ID, mem_virt, mem_phys, res_size, NULL);\n+\tqcom_pas_context_init(\u0026core-\u003epas_ctx, dev, IRIS_PAS_ID, mem_phys,\n+\t\t\t res_size);\n+\n+\tret = qcom_mdt_pas_load(\u0026core-\u003epas_ctx, firmware, fw_name, NULL);\n+\tif (!ret) {\n+\t\tmem_virt = memremap(mem_phys, res_size, MEMREMAP_WC);\n+\t\tif (!mem_virt) {\n+\t\t\tret = -ENOMEM;\n+\t\t\tgoto err_release_fw;\n+\t\t}\n \n-\tif (!ret)\n \t\tiris_detect_firmware(core, fw_name, mem_virt, res_size, desc);\n-\n-\tmemunmap(mem_virt);\n+\t\tmemunmap(mem_virt);\n+\t}\n err_release_fw:\n \trelease_firmware(firmware);\n \n@@ -233,7 +232,7 @@ int iris_fw_load(struct iris_core *core)\n \t\treturn ret;\n \t}\n \n-\tret = qcom_pas_auth_and_reset(IRIS_PAS_ID);\n+\tret = qcom_pas_prepare_and_auth_reset(\u0026core-\u003epas_ctx);\n \tif (ret) {\n \t\tdev_err(core-\u003edev, \"auth and reset failed: %d\\n\", ret);\n \t\treturn ret;\ndiff --git a/drivers/media/platform/qcom/venus/core.h b/drivers/media/platform/qcom/venus/core.h\nindex 93fa77f05834ca..84a0d4a8426c34 100644\n--- a/drivers/media/platform/qcom/venus/core.h\n+++ b/drivers/media/platform/qcom/venus/core.h\n@@ -10,6 +10,7 @@\n #include \u003clinux/bitops.h\u003e\n #include \u003clinux/dma-mapping.h\u003e\n #include \u003clinux/list.h\u003e\n+#include \u003clinux/firmware/qcom/qcom_pas.h\u003e\n #include \u003cmedia/videobuf2-v4l2.h\u003e\n #include \u003cmedia/v4l2-ctrls.h\u003e\n #include \u003cmedia/v4l2-device.h\u003e\n@@ -228,6 +229,7 @@ struct venus_core {\n \t\tsize_t mapped_mem_size;\n \t\tphys_addr_t mem_phys;\n \t\tsize_t mem_size;\n+\t\tstruct qcom_pas_context pas_ctx;\n \t} fw;\n \tstruct mutex lock;\n \tstruct list_head instances;\ndiff --git a/drivers/media/platform/qcom/venus/firmware.c b/drivers/media/platform/qcom/venus/firmware.c\nindex 3a38ff985822ff..704343e241dc67 100644\n--- a/drivers/media/platform/qcom/venus/firmware.c\n+++ b/drivers/media/platform/qcom/venus/firmware.c\n@@ -117,21 +117,22 @@ static int venus_load_fw(struct venus_core *core, const char *fwname,\n \t\tgoto err_release_fw;\n \t}\n \n-\tmem_va = memremap(*mem_phys, *mem_size, MEMREMAP_WC);\n-\tif (!mem_va) {\n-\t\tdev_err(dev, \"unable to map memory region %pa size %#zx\\n\", mem_phys, *mem_size);\n-\t\tret = -ENOMEM;\n-\t\tgoto err_release_fw;\n-\t}\n-\n-\tif (core-\u003euse_tz)\n-\t\tret = qcom_mdt_load(dev, mdt, fwname, VENUS_PAS_ID,\n-\t\t\t\t mem_va, *mem_phys, *mem_size, NULL);\n-\telse\n+\tif (core-\u003euse_tz) {\n+\t\tqcom_pas_context_init(\u0026core-\u003efw.pas_ctx, dev, VENUS_PAS_ID,\n+\t\t\t\t *mem_phys, *mem_size);\n+\t\tret = qcom_mdt_pas_load(\u0026core-\u003efw.pas_ctx, mdt, fwname, NULL);\n+\t} else {\n+\t\tmem_va = memremap(*mem_phys, *mem_size, MEMREMAP_WC);\n+\t\tif (!mem_va) {\n+\t\t\tdev_err(dev, \"unable to map memory region %pa size %#zx\\n\",\n+\t\t\t\tmem_phys, *mem_size);\n+\t\t\tret = -ENOMEM;\n+\t\t\tgoto err_release_fw;\n+\t\t}\n \t\tret = qcom_mdt_load_no_init(dev, mdt, fwname, mem_va,\n \t\t\t\t\t *mem_phys, *mem_size, NULL);\n-\n-\tmemunmap(mem_va);\n+\t\tmemunmap(mem_va);\n+\t}\n err_release_fw:\n \trelease_firmware(mdt);\n \treturn ret;\n@@ -237,7 +238,7 @@ int venus_boot(struct venus_core *core)\n \tcore-\u003efw.mem_phys = mem_phys;\n \n \tif (core-\u003euse_tz)\n-\t\tret = qcom_pas_auth_and_reset(VENUS_PAS_ID);\n+\t\tret = qcom_pas_prepare_and_auth_reset(\u0026core-\u003efw.pas_ctx);\n \telse\n \t\tret = venus_boot_no_tz(core, mem_phys, mem_size);\n \ndiff --git a/drivers/net/ipa/ipa_main.c b/drivers/net/ipa/ipa_main.c\nindex 14ac2d2faf7c23..0a37741c228581 100644\n--- a/drivers/net/ipa/ipa_main.c\n+++ b/drivers/net/ipa/ipa_main.c\n@@ -585,12 +585,11 @@ static void ipa_deconfig(struct ipa *ipa)\n \n static int ipa_firmware_load(struct device *dev)\n {\n+\tstruct qcom_pas_context ctx;\n \tconst struct firmware *fw;\n \tstruct resource res;\n \tphys_addr_t phys;\n \tconst char *path;\n-\tssize_t size;\n-\tvoid *virt;\n \tint ret;\n \n \tret = of_reserved_mem_region_to_resource(dev-\u003eof_node, 0, \u0026res);\n@@ -615,24 +614,18 @@ static int ipa_firmware_load(struct device *dev)\n \t}\n \n \tphys = res.start;\n-\tsize = (size_t)resource_size(\u0026res);\n-\tvirt = memremap(phys, size, MEMREMAP_WC);\n-\tif (!virt) {\n-\t\tdev_err(dev, \"unable to remap firmware memory\\n\");\n-\t\tret = -ENOMEM;\n-\t\tgoto out_release_firmware;\n-\t}\n+\tqcom_pas_context_init(\u0026ctx, dev, IPA_PAS_ID, phys, resource_size(\u0026res));\n \n-\tret = qcom_mdt_load(dev, fw, path, IPA_PAS_ID, virt, phys, size, NULL);\n+\tret = qcom_mdt_pas_load(\u0026ctx, fw, path, NULL);\n \tif (ret) {\n \t\tdev_err(dev, \"error %d loading \\\"%s\\\"\\n\", ret, path);\n-\t} else {\n-\t\tret = qcom_pas_auth_and_reset(IPA_PAS_ID);\n-\t\tif (ret)\n-\t\t\tdev_err(dev, \"error %d authenticating \\\"%s\\\"\\n\", ret, path);\n+\t\tgoto out_release_firmware;\n \t}\n \n-\tmemunmap(virt);\n+\tret = qcom_pas_prepare_and_auth_reset(\u0026ctx);\n+\tif (ret)\n+\t\tdev_err(dev, \"error %d authenticating \\\"%s\\\"\\n\", ret, path);\n+\n out_release_firmware:\n \trelease_firmware(fw);\n \ndiff --git a/drivers/net/wireless/ath/ath12k/ahb.c b/drivers/net/wireless/ath/ath12k/ahb.c\nindex e5bbfca2b2ac0f..a20efcaa0358be 100644\n--- a/drivers/net/wireless/ath/ath12k/ahb.c\n+++ b/drivers/net/wireless/ath/ath12k/ahb.c\n@@ -411,6 +411,7 @@ static int ath12k_ahb_power_up(struct ath12k_base *ab)\n \tstruct ath12k_ahb_rproc_info *rproc_info = ab_ahb-\u003erproc_info;\n \tchar fw_name[ATH12K_USERPD_FW_NAME_LEN];\n \tchar fw2_name[ATH12K_USERPD_FW_NAME_LEN];\n+\tstruct qcom_pas_context ctx;\n \tstruct device *dev = ab-\u003edev;\n \tconst struct firmware *fw, *fw2;\n \tunsigned long time_left;\n@@ -444,14 +445,15 @@ static int ath12k_ahb_power_up(struct ath12k_base *ab)\n \t\tATH12K_AHB_UPD_SWID;\n \n \t/* Load FW image to a reserved memory location */\n-\tif (ab_ahb-\u003escm_auth_enabled)\n-\t\tret = qcom_mdt_load(dev, fw, fw_name, pasid, rproc_info-\u003emem_region,\n-\t\t\t\t rproc_info-\u003emem_phys, rproc_info-\u003emem_size,\n-\t\t\t\t NULL);\n-\telse\n+\tif (ab_ahb-\u003escm_auth_enabled) {\n+\t\tqcom_pas_context_init(\u0026ctx, dev, pasid,\n+\t\t\t\t rproc_info-\u003emem_phys, rproc_info-\u003emem_size);\n+\t\tret = qcom_mdt_pas_load(\u0026ctx, fw, fw_name, NULL);\n+\t} else {\n \t\tret = qcom_mdt_load_no_init(dev, fw, fw_name, rproc_info-\u003emem_region,\n \t\t\t\t\t rproc_info-\u003emem_phys, rproc_info-\u003emem_size,\n \t\t\t\t\t NULL);\n+\t}\n \tif (ret) {\n \t\tath12k_err(ab, \"Failed to load MDT segments: %d\\n\", ret);\n \t\tgoto err_fw;\n@@ -485,7 +487,7 @@ static int ath12k_ahb_power_up(struct ath12k_base *ab)\n \n \tif (ab_ahb-\u003escm_auth_enabled) {\n \t\t/* Authenticate FW image using peripheral ID */\n-\t\tret = qcom_pas_auth_and_reset(pasid);\n+\t\tret = qcom_pas_prepare_and_auth_reset(\u0026ctx);\n \t\tif (ret) {\n \t\t\tath12k_err(ab, \"failed to boot the remote processor %d\\n\", ret);\n \t\t\tgoto err_fw2;\n@@ -1024,6 +1026,7 @@ static int ath12k_ahb_load_auth_shared_fw(struct ath12k_base *ab,\n \t\t\t\t\t struct ath12k_ahb_rproc_info *rproc_info,\n \t\t\t\t\t const char *fw_name, u32 pasid)\n {\n+\tstruct qcom_pas_context ctx;\n \tint ret;\n \n \tconst struct firmware *fw __free(firmware) = NULL;\n@@ -1042,14 +1045,16 @@ static int ath12k_ahb_load_auth_shared_fw(struct ath12k_base *ab,\n \tath12k_dbg(ab, ATH12K_DBG_AHB, \"loading firmware %s, size %zd\\n\", fw_name,\n \t\t fw-\u003esize);\n \n-\tret = qcom_mdt_load(ab-\u003edev, fw, fw_name, pasid, rproc_info-\u003emem_region,\n-\t\t\t rproc_info-\u003emem_phys, rproc_info-\u003emem_size, NULL);\n+\tqcom_pas_context_init(\u0026ctx, ab-\u003edev, pasid,\n+\t\t\t rproc_info-\u003emem_phys, rproc_info-\u003emem_size);\n+\n+\tret = qcom_mdt_pas_load(\u0026ctx, fw, fw_name, NULL);\n \tif (ret) {\n \t\tath12k_err(ab, \"failed to load RO firmware %s: %d\\n\", fw_name, ret);\n \t\treturn ret;\n \t}\n \n-\tret = qcom_pas_auth_and_reset(pasid);\n+\tret = qcom_pas_prepare_and_auth_reset(\u0026ctx);\n \tif (ret)\n \t\tath12k_err(ab, \"failed to authenticate and boot shared firmware: %d\\n\",\n \t\t\t ret);\ndiff --git a/drivers/remoteproc/qcom_wcnss.c b/drivers/remoteproc/qcom_wcnss.c\nindex 02f38fe29f20f4..840fa67a6928ba 100644\n--- a/drivers/remoteproc/qcom_wcnss.c\n+++ b/drivers/remoteproc/qcom_wcnss.c\n@@ -96,6 +96,7 @@ struct qcom_wcnss {\n \tphys_addr_t mem_reloc;\n \tvoid __iomem *mem_region;\n \tsize_t mem_size;\n+\tstruct qcom_pas_context *pas_ctx;\n \n \tstruct qcom_rproc_subdev smd_subdev;\n \tstruct qcom_sysmon *sysmon;\n@@ -157,9 +158,7 @@ static int wcnss_load(struct rproc *rproc, const struct firmware *fw)\n \tstruct qcom_wcnss *wcnss = rproc-\u003epriv;\n \tint ret;\n \n-\tret = qcom_mdt_load(wcnss-\u003edev, fw, rproc-\u003efirmware, WCNSS_PAS_ID,\n-\t\t\t (__force void *)wcnss-\u003emem_region, wcnss-\u003emem_phys,\n-\t\t\t wcnss-\u003emem_size, \u0026wcnss-\u003emem_reloc);\n+\tret = qcom_mdt_pas_load(wcnss-\u003epas_ctx, fw, rproc-\u003efirmware, \u0026wcnss-\u003emem_reloc);\n \tif (ret)\n \t\treturn ret;\n \n@@ -257,7 +256,7 @@ static int wcnss_start(struct rproc *rproc)\n \twcnss_indicate_nv_download(wcnss);\n \twcnss_configure_iris(wcnss);\n \n-\tret = qcom_pas_auth_and_reset(WCNSS_PAS_ID);\n+\tret = qcom_pas_prepare_and_auth_reset(wcnss-\u003epas_ctx);\n \tif (ret) {\n \t\tdev_err(wcnss-\u003edev,\n \t\t\t\"failed to authenticate image and release reset\\n\");\n@@ -599,6 +598,11 @@ static int wcnss_probe(struct platform_device *pdev)\n \tif (ret)\n \t\treturn ret;\n \n+\twcnss-\u003epas_ctx = devm_qcom_pas_context_alloc(wcnss-\u003edev, WCNSS_PAS_ID,\n+\t\t\t\t\t\t wcnss-\u003emem_phys, wcnss-\u003emem_size);\n+\tif (IS_ERR(wcnss-\u003epas_ctx))\n+\t\treturn PTR_ERR(wcnss-\u003epas_ctx);\n+\n \twcnss-\u003epmu_cfg = mmio + data-\u003epmu_offset;\n \twcnss-\u003espare_out = mmio + data-\u003espare_offset;\n \ndiff --git a/drivers/soc/qcom/mdt_loader.c b/drivers/soc/qcom/mdt_loader.c\nindex 002100fe2d3237..436d8bc4847a33 100644\n--- a/drivers/soc/qcom/mdt_loader.c\n+++ b/drivers/soc/qcom/mdt_loader.c\n@@ -326,7 +326,8 @@ static bool qcom_mdt_bins_are_split(const struct firmware *fw)\n * @dev:\tdevice handle to associate resources with\n * @fw:\t\tfirmware object for the mdt file\n * @fw_name:\tname of the firmware, for construction of segment file names\n- * @mem_region:\tallocated memory region to load firmware into\n+ * @mem_region:\tvirtual address of the memory region to load firmware into,\n+ *\t\tor NULL to have the region mapped internally with ioremap_wc()\n * @mem_phys:\tphysical address of allocated memory region\n * @mem_size:\tsize of the allocated memory region\n * @reloc_base:\tadjusted physical address after relocation\n@@ -341,6 +342,7 @@ int qcom_mdt_load_no_init(struct device *dev, const struct firmware *fw,\n \tconst struct elf32_phdr *phdrs;\n \tconst struct elf32_phdr *phdr;\n \tconst struct elf32_hdr *ehdr;\n+\tvoid __iomem *mapped = NULL;\n \tphys_addr_t mem_reloc;\n \tphys_addr_t min_addr = PHYS_ADDR_MAX;\n \tssize_t offset;\n@@ -350,12 +352,22 @@ int qcom_mdt_load_no_init(struct device *dev, const struct firmware *fw,\n \tint ret = 0;\n \tint i;\n \n-\tif (!fw || !mem_region || !mem_phys || !mem_size)\n+\tif (!fw || !mem_phys || !mem_size)\n \t\treturn -EINVAL;\n \n \tif (!mdt_header_valid(fw))\n \t\treturn -EINVAL;\n \n+\tif (!mem_region) {\n+\t\tmapped = ioremap_wc(mem_phys, mem_size);\n+\t\tif (!mapped) {\n+\t\t\tdev_err(dev, \"unable to map memory region: %pa+%zx\\n\",\n+\t\t\t\t\u0026mem_phys, mem_size);\n+\t\t\treturn -ENOMEM;\n+\t\t}\n+\t\tmem_region = (__force void *)mapped;\n+\t}\n+\n \tis_split = qcom_mdt_bins_are_split(fw);\n \tehdr = (struct elf32_hdr *)fw-\u003edata;\n \tphdrs = (struct elf32_phdr *)(fw-\u003edata + ehdr-\u003ee_phoff);\n@@ -434,47 +446,21 @@ int qcom_mdt_load_no_init(struct device *dev, const struct firmware *fw,\n \tif (reloc_base)\n \t\t*reloc_base = mem_reloc;\n \n+\tif (mapped)\n+\t\tiounmap(mapped);\n+\n \treturn ret;\n }\n EXPORT_SYMBOL_GPL(qcom_mdt_load_no_init);\n \n-/**\n- * qcom_mdt_load() - load the firmware which header is loaded as fw\n- * @dev:\tdevice handle to associate resources with\n- * @fw:\t\tfirmware object for the mdt file\n- * @fw_name:\tname of the firmware, for construction of segment file names\n- * @pas_id:\tPAS identifier\n- * @mem_region:\tallocated memory region to load firmware into\n- * @mem_phys:\tphysical address of allocated memory region\n- * @mem_size:\tsize of the allocated memory region\n- * @reloc_base:\tadjusted physical address after relocation\n- *\n- * Returns 0 on success, negative errno otherwise.\n- */\n-int qcom_mdt_load(struct device *dev, const struct firmware *fw,\n-\t\t const char *fw_name, int pas_id, void *mem_region,\n-\t\t phys_addr_t mem_phys, size_t mem_size,\n-\t\t phys_addr_t *reloc_base)\n-{\n-\tint ret;\n-\n-\tret = __qcom_mdt_pas_init(dev, fw, fw_name, pas_id, mem_phys, NULL);\n-\tif (ret)\n-\t\treturn ret;\n-\n-\treturn qcom_mdt_load_no_init(dev, fw, fw_name, mem_region, mem_phys,\n-\t\t\t\t mem_size, reloc_base);\n-}\n-EXPORT_SYMBOL_GPL(qcom_mdt_load);\n-\n /**\n * qcom_mdt_pas_load - Loads and authenticates the metadata of the firmware\n * (typically contained in the .mdt file), followed by loading the actual\n * firmware segments (e.g., .bXX files). Authentication of the segments done\n * by a separate call.\n *\n- * The PAS context must be initialized using devm_qcom_pas_context_alloc()\n- * prior to invoking this function.\n+ * The PAS context must be initialized using qcom_pas_context_init() or\n+ * devm_qcom_pas_context_alloc() prior to invoking this function.\n *\n * @ctx: Pointer to the PAS (Peripheral Authentication Service) context\n * @fw: Firmware object representing the .mdt file\n@@ -486,21 +472,14 @@ EXPORT_SYMBOL_GPL(qcom_mdt_load);\n int qcom_mdt_pas_load(struct qcom_pas_context *ctx, const struct firmware *fw,\n \t\t const char *firmware, phys_addr_t *reloc_base)\n {\n-\tvoid __iomem *mem_region;\n \tint ret;\n \n \tret = __qcom_mdt_pas_init(ctx-\u003edev, fw, firmware, ctx-\u003epas_id, ctx-\u003emem_phys, ctx);\n \tif (ret)\n \t\treturn ret;\n \n-\tmem_region = qcom_pas_ctx_map(ctx);\n-\tif (!mem_region)\n-\t\treturn -ENOMEM;\n-\n-\tret = qcom_mdt_load_no_init(ctx-\u003edev, fw, firmware, (__force void *)mem_region,\n-\t\t\t\t ctx-\u003emem_phys, ctx-\u003emem_size, reloc_base);\n-\tiounmap(mem_region);\n-\treturn ret;\n+\treturn qcom_mdt_load_no_init(ctx-\u003edev, fw, firmware, NULL,\n+\t\t\t\t ctx-\u003emem_phys, ctx-\u003emem_size, reloc_base);\n }\n EXPORT_SYMBOL_GPL(qcom_mdt_pas_load);\n \ndiff --git a/include/linux/firmware/qcom/qcom_pas.h b/include/linux/firmware/qcom/qcom_pas.h\nindex fb2ec3be6a1698..d5b9833c70c7be 100644\n--- a/include/linux/firmware/qcom/qcom_pas.h\n+++ b/include/linux/firmware/qcom/qcom_pas.h\n@@ -35,6 +35,8 @@ static inline void __iomem *qcom_pas_ctx_map(struct qcom_pas_context *ctx)\n }\n \n bool qcom_pas_is_available(void);\n+void qcom_pas_context_init(struct qcom_pas_context *ctx, struct device *dev,\n+\t\t\t u32 pas_id, phys_addr_t mem_phys, size_t mem_size);\n struct qcom_pas_context *devm_qcom_pas_context_alloc(struct device *dev,\n \t\t\t\t\t\t u32 pas_id,\n \t\t\t\t\t\t phys_addr_t mem_phys,\n@@ -45,7 +47,6 @@ struct resource_table *qcom_pas_get_rsc_table(struct qcom_pas_context *ctx,\n \t\t\t\t\t void *input_rt, size_t input_rt_size,\n \t\t\t\t\t size_t *output_rt_size);\n int qcom_pas_mem_setup(u32 pas_id, phys_addr_t addr, phys_addr_t size);\n-int qcom_pas_auth_and_reset(u32 pas_id);\n int qcom_pas_prepare_and_auth_reset(struct qcom_pas_context *ctx);\n int qcom_pas_set_remote_state(u32 state, u32 pas_id);\n int qcom_pas_shutdown(u32 pas_id);\ndiff --git a/include/linux/soc/qcom/mdt_loader.h b/include/linux/soc/qcom/mdt_loader.h\nindex 74886f772d46d0..f49de7b388bc88 100644\n--- a/include/linux/soc/qcom/mdt_loader.h\n+++ b/include/linux/soc/qcom/mdt_loader.h\n@@ -15,10 +15,6 @@ struct qcom_pas_context;\n #if IS_ENABLED(CONFIG_QCOM_MDT_LOADER)\n \n ssize_t qcom_mdt_get_size(const struct firmware *fw);\n-int qcom_mdt_load(struct device *dev, const struct firmware *fw,\n-\t\t const char *fw_name, int pas_id, void *mem_region,\n-\t\t phys_addr_t mem_phys, size_t mem_size,\n-\t\t phys_addr_t *reloc_base);\n \n int qcom_mdt_pas_load(struct qcom_pas_context *ctx, const struct firmware *fw,\n \t\t const char *firmware, phys_addr_t *reloc_base);\n@@ -37,14 +33,6 @@ static inline ssize_t qcom_mdt_get_size(const struct firmware *fw)\n \treturn -ENODEV;\n }\n \n-static inline int qcom_mdt_load(struct device *dev, const struct firmware *fw,\n-\t\t\t\tconst char *fw_name, int pas_id,\n-\t\t\t\tvoid *mem_region, phys_addr_t mem_phys,\n-\t\t\t\tsize_t mem_size, phys_addr_t *reloc_base)\n-{\n-\treturn -ENODEV;\n-}\n-\n static inline int qcom_mdt_pas_load(struct qcom_pas_context *ctx,\n \t\t\t\t const struct firmware *fw, const char *firmware,\n \t\t\t\t phys_addr_t *reloc_base)\n"
} |
| 2/1 | 2026/11/20 04:59 | agent | patch-evaluator |
2mModel:core Args: null Results: {
"EnableConfigs": null,
"FocusSymbols": [],
"Reasoning": "The patch series refactors Qualcomm-specific Peripheral Authentication Service (PAS) and MDT loader interfaces across Qualcomm SoC drivers (Qualcomm SCM, Adreno GPU, Iris, Venus, IPA, ath12k AHB, WCNSS). These drivers and firmware interfaces are exclusive to Qualcomm ARM/ARM64 platforms and rely on ARM SMC / TrustZone / device tree bindings for physical Qualcomm Snapdragon SoCs. They are structurally unreachable on the amd64 target architecture in standard virtualized QEMU/GCE fuzzing environments.",
"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 51bb5761230951b837594a12b7d9dc295de96622
Author: syz-cluster <triage@syzkaller.com>
Date: Fri Nov 20 04:59:30 2026 +0000
syz-cluster: applied patch under review
diff --git a/drivers/firmware/qcom/qcom_pas.c b/drivers/firmware/qcom/qcom_pas.c
index ae21eed58c3c27..aa000c65c48681 100644
--- a/drivers/firmware/qcom/qcom_pas.c
+++ b/drivers/firmware/qcom/qcom_pas.c
@@ -14,6 +14,27 @@
static struct qcom_pas_ops *ops_ptr;
+/**
+ * qcom_pas_context_init() - Initialize a peripheral authentication service
+ * context for a given peripheral
+ *
+ * @ctx: Caller-provided PAS context to initialize
+ * @dev: PAS firmware device
+ * @pas_id: peripheral authentication service id
+ * @mem_phys: Subsystem reserve memory start address
+ * @mem_size: Subsystem reserve memory size
+ */
+void qcom_pas_context_init(struct qcom_pas_context *ctx, struct device *dev,
+ u32 pas_id, phys_addr_t mem_phys, size_t mem_size)
+{
+ memset(ctx, 0, sizeof(*ctx));
+ ctx->dev = dev;
+ ctx->pas_id = pas_id;
+ ctx->mem_phys = mem_phys;
+ ctx->mem_size = mem_size;
+}
+EXPORT_SYMBOL_GPL(qcom_pas_context_init);
+
/**
* devm_qcom_pas_context_alloc() - Allocate peripheral authentication service
* context for a given peripheral
@@ -39,10 +60,7 @@ struct qcom_pas_context *devm_qcom_pas_context_alloc(struct device *dev,
if (!ctx)
return ERR_PTR(-ENOMEM);
- ctx->dev = dev;
- ctx->pas_id = pas_id;
- ctx->mem_phys = mem_phys;
- ctx->mem_size = mem_size;
+ qcom_pas_context_init(ctx, dev, pas_id, mem_phys, mem_size);
return ctx;
}
@@ -160,22 +178,6 @@ struct resource_table *qcom_pas_get_rsc_table(struct qcom_pas_context *ctx,
}
EXPORT_SYMBOL_GPL(qcom_pas_get_rsc_table);
-/**
- * qcom_pas_auth_and_reset() - Authenticate the given peripheral firmware
- * and reset the remote processor
- * @pas_id: peripheral authentication service id
- *
- * Return: 0 on success.
- */
-int qcom_pas_auth_and_reset(u32 pas_id)
-{
- if (!ops_ptr)
- return -ENODEV;
-
- return ops_ptr->auth_and_reset(ops_ptr->dev, pas_id);
-}
-EXPORT_SYMBOL_GPL(qcom_pas_auth_and_reset);
-
/**
* qcom_pas_prepare_and_auth_reset() - Prepare, authenticate, and reset the
* remote processor
diff --git a/drivers/firmware/qcom/qcom_pas.h b/drivers/firmware/qcom/qcom_pas.h
index 8643e2760602e0..a296be2be8c05f 100644
--- a/drivers/firmware/qcom/qcom_pas.h
+++ b/drivers/firmware/qcom/qcom_pas.h
@@ -18,8 +18,6 @@ struct device;
* @get_rsc_table: Peripheral get resource table callback.
* @prepare_and_auth_reset: Peripheral prepare firmware authentication and
* reset callback.
- * @auth_and_reset: Peripheral firmware authentication and reset
- * callback.
* @set_remote_state: Peripheral set remote state callback.
* @shutdown: Peripheral shutdown callback.
* @metadata_release: Image metadata release callback.
@@ -37,7 +35,6 @@ struct qcom_pas_ops {
size_t *output_rt_size);
int (*prepare_and_auth_reset)(struct device *dev,
struct qcom_pas_context *ctx);
- int (*auth_and_reset)(struct device *dev, u32 pas_id);
int (*set_remote_state)(struct device *dev, u32 state, u32 pas_id);
int (*shutdown)(struct device *dev, u32 pas_id);
void (*metadata_release)(struct device *dev,
diff --git a/drivers/firmware/qcom/qcom_pas_tee.c b/drivers/firmware/qcom/qcom_pas_tee.c
index d248e2229c2f17..213c3153e407a4 100644
--- a/drivers/firmware/qcom/qcom_pas_tee.c
+++ b/drivers/firmware/qcom/qcom_pas_tee.c
@@ -320,11 +320,6 @@ static int __qcom_pas_tee_auth_and_reset(struct device *dev, u32 pas_id,
return ret;
}
-static int qcom_pas_tee_auth_and_reset(struct device *dev, u32 pas_id)
-{
- return __qcom_pas_tee_auth_and_reset(dev, pas_id, 0, 0);
-}
-
static int qcom_pas_tee_prepare_and_auth_reset(struct device *dev,
struct qcom_pas_context *ctx)
{
@@ -401,7 +396,6 @@ static struct qcom_pas_ops qcom_pas_ops_tee = {
.init_image = qcom_pas_tee_init_image,
.mem_setup = qcom_pas_tee_mem_setup,
.get_rsc_table = qcom_pas_tee_get_rsc_table,
- .auth_and_reset = qcom_pas_tee_auth_and_reset,
.prepare_and_auth_reset = qcom_pas_tee_prepare_and_auth_reset,
.set_remote_state = qcom_pas_tee_set_remote_state,
.shutdown = qcom_pas_tee_shutdown,
diff --git a/drivers/firmware/qcom/qcom_scm.c b/drivers/firmware/qcom/qcom_scm.c
index b1a821d3b1bc0d..30f61e6e5818d4 100644
--- a/drivers/firmware/qcom/qcom_scm.c
+++ b/drivers/firmware/qcom/qcom_scm.c
@@ -855,7 +855,7 @@ static void *qcom_scm_pas_get_rsc_table(struct device *dev,
return ret ? ERR_PTR(ret) : tbl_ptr;
}
-static int qcom_scm_pas_auth_and_reset(struct device *dev, u32 pas_id)
+static int __qcom_scm_pas_auth_and_reset(struct device *dev, u32 pas_id)
{
int ret;
struct qcom_scm_desc desc = {
@@ -896,7 +896,7 @@ static int qcom_scm_pas_prepare_and_auth_reset(struct device *dev,
* memory region and then invokes a call to TrustZone to authenticate.
*/
if (!ctx->use_tzmem)
- return qcom_scm_pas_auth_and_reset(dev, ctx->pas_id);
+ return __qcom_scm_pas_auth_and_reset(dev, ctx->pas_id);
/*
* When Linux runs @ EL2 Linux must create the shmbridge itself and then
@@ -906,7 +906,7 @@ static int qcom_scm_pas_prepare_and_auth_reset(struct device *dev,
if (ret)
return ret;
- ret = qcom_scm_pas_auth_and_reset(dev, ctx->pas_id);
+ ret = __qcom_scm_pas_auth_and_reset(dev, ctx->pas_id);
qcom_tzmem_shm_bridge_delete(handle);
return ret;
@@ -987,7 +987,6 @@ static struct qcom_pas_ops qcom_pas_ops_scm = {
.init_image = qcom_scm_pas_init_image,
.mem_setup = qcom_scm_pas_mem_setup,
.get_rsc_table = qcom_scm_pas_get_rsc_table,
- .auth_and_reset = qcom_scm_pas_auth_and_reset,
.prepare_and_auth_reset = qcom_scm_pas_prepare_and_auth_reset,
.set_remote_state = qcom_scm_pas_set_remote_state,
.shutdown = qcom_scm_pas_shutdown,
diff --git a/drivers/gpu/drm/msm/adreno/adreno_gpu.c b/drivers/gpu/drm/msm/adreno/adreno_gpu.c
index dadfe4c6943841..12e35841763d8e 100644
--- a/drivers/gpu/drm/msm/adreno/adreno_gpu.c
+++ b/drivers/gpu/drm/msm/adreno/adreno_gpu.c
@@ -34,11 +34,11 @@ static int zap_shader_load_mdt(struct msm_gpu *gpu, const char *fwname,
struct device *dev = &gpu->pdev->dev;
const struct firmware *fw;
const char *signed_fwname = NULL;
+ struct qcom_pas_context ctx;
struct device_node *np;
struct resource r;
phys_addr_t mem_phys;
ssize_t mem_size;
- void *mem_region = NULL;
int ret;
if (!IS_ENABLED(CONFIG_ARCH_QCOM)) {
@@ -121,39 +121,32 @@ static int zap_shader_load_mdt(struct msm_gpu *gpu, const char *fwname,
goto out;
}
- /* Allocate memory for the firmware image */
- mem_region = memremap(mem_phys, mem_size, MEMREMAP_WC);
- if (!mem_region) {
- ret = -ENOMEM;
- goto out;
- }
+ qcom_pas_context_init(&ctx, dev, pasid, mem_phys, mem_size);
/*
* Load the rest of the MDT
*
* Note that we could be dealing with two different paths, since
* with upstream linux-firmware it would be in a qcom/ subdir..
- * adreno_request_fw() handles this, but qcom_mdt_load() does
+ * adreno_request_fw() handles this, but qcom_mdt_pas_load() does
* not. But since we've already gotten through adreno_request_fw()
* we know which of the two cases it is:
*/
if (signed_fwname || (to_adreno_gpu(gpu)->fwloc == FW_LOCATION_LEGACY)) {
- ret = qcom_mdt_load(dev, fw, fwname, pasid,
- mem_region, mem_phys, mem_size, NULL);
+ ret = qcom_mdt_pas_load(&ctx, fw, fwname, NULL);
} else {
char *newname;
newname = kasprintf(GFP_KERNEL, "qcom/%s", fwname);
- ret = qcom_mdt_load(dev, fw, newname, pasid,
- mem_region, mem_phys, mem_size, NULL);
+ ret = qcom_mdt_pas_load(&ctx, fw, newname, NULL);
kfree(newname);
}
if (ret)
goto out;
/* Send the image to the secure world */
- ret = qcom_pas_auth_and_reset(pasid);
+ ret = qcom_pas_prepare_and_auth_reset(&ctx);
/*
* If the pas call returns -EOPNOTSUPP we assume that this target
@@ -165,9 +158,6 @@ static int zap_shader_load_mdt(struct msm_gpu *gpu, const char *fwname,
DRM_DEV_ERROR(dev, "Unable to authorize the image\n");
out:
- if (mem_region)
- memunmap(mem_region);
-
release_firmware(fw);
return ret;
diff --git a/drivers/media/platform/qcom/iris/iris_core.h b/drivers/media/platform/qcom/iris/iris_core.h
index 3e4cf652bf39a7..ac73bda072f85c 100644
--- a/drivers/media/platform/qcom/iris/iris_core.h
+++ b/drivers/media/platform/qcom/iris/iris_core.h
@@ -9,6 +9,7 @@
#include <linux/types.h>
#include <linux/dma-mapping.h>
#include <linux/pm_domain.h>
+#include <linux/firmware/qcom/qcom_pas.h>
#include <media/v4l2-device.h>
#include "iris_hfi_common.h"
@@ -129,6 +130,7 @@ struct iris_core {
struct platform_inst_fw_cap inst_fw_caps_dec[INST_FW_CAP_MAX];
struct platform_inst_fw_cap inst_fw_caps_enc[INST_FW_CAP_MAX];
struct dma_iova_state *iova_state;
+ struct qcom_pas_context pas_ctx;
};
int iris_core_init(struct iris_core *core);
diff --git a/drivers/media/platform/qcom/iris/iris_firmware.c b/drivers/media/platform/qcom/iris/iris_firmware.c
index 21f57d37da1879..b701a7f43514b9 100644
--- a/drivers/media/platform/qcom/iris/iris_firmware.c
+++ b/drivers/media/platform/qcom/iris/iris_firmware.c
@@ -201,21 +201,20 @@ static int iris_load_fw_to_memory(struct iris_core *core)
goto err_release_fw;
}
- mem_virt = memremap(mem_phys, res_size, MEMREMAP_WC);
- if (!mem_virt) {
- ret = -ENOMEM;
- goto err_release_fw;
- }
-
- memset(mem_virt, 0, res_size);
-
- ret = qcom_mdt_load(dev, firmware, fw_name,
- IRIS_PAS_ID, mem_virt, mem_phys, res_size, NULL);
+ qcom_pas_context_init(&core->pas_ctx, dev, IRIS_PAS_ID, mem_phys,
+ res_size);
+
+ ret = qcom_mdt_pas_load(&core->pas_ctx, firmware, fw_name, NULL);
+ if (!ret) {
+ mem_virt = memremap(mem_phys, res_size, MEMREMAP_WC);
+ if (!mem_virt) {
+ ret = -ENOMEM;
+ goto err_release_fw;
+ }
- if (!ret)
iris_detect_firmware(core, fw_name, mem_virt, res_size, desc);
-
- memunmap(mem_virt);
+ memunmap(mem_virt);
+ }
err_release_fw:
release_firmware(firmware);
@@ -233,7 +232,7 @@ int iris_fw_load(struct iris_core *core)
return ret;
}
- ret = qcom_pas_auth_and_reset(IRIS_PAS_ID);
+ ret = qcom_pas_prepare_and_auth_reset(&core->pas_ctx);
if (ret) {
dev_err(core->dev, "auth and reset failed: %d\n", ret);
return ret;
diff --git a/drivers/media/platform/qcom/venus/core.h b/drivers/media/platform/qcom/venus/core.h
index 93fa77f05834ca..84a0d4a8426c34 100644
--- a/drivers/media/platform/qcom/venus/core.h
+++ b/drivers/media/platform/qcom/venus/core.h
@@ -10,6 +10,7 @@
#include <linux/bitops.h>
#include <linux/dma-mapping.h>
#include <linux/list.h>
+#include <linux/firmware/qcom/qcom_pas.h>
#include <media/videobuf2-v4l2.h>
#include <media/v4l2-ctrls.h>
#include <media/v4l2-device.h>
@@ -228,6 +229,7 @@ struct venus_core {
size_t mapped_mem_size;
phys_addr_t mem_phys;
size_t mem_size;
+ struct qcom_pas_context pas_ctx;
} fw;
struct mutex lock;
struct list_head instances;
diff --git a/drivers/media/platform/qcom/venus/firmware.c b/drivers/media/platform/qcom/venus/firmware.c
index 3a38ff985822ff..704343e241dc67 100644
--- a/drivers/media/platform/qcom/venus/firmware.c
+++ b/drivers/media/platform/qcom/venus/firmware.c
@@ -117,21 +117,22 @@ static int venus_load_fw(struct venus_core *core, const char *fwname,
goto err_release_fw;
}
- mem_va = memremap(*mem_phys, *mem_size, MEMREMAP_WC);
- if (!mem_va) {
- dev_err(dev, "unable to map memory region %pa size %#zx\n", mem_phys, *mem_size);
- ret = -ENOMEM;
- goto err_release_fw;
- }
-
- if (core->use_tz)
- ret = qcom_mdt_load(dev, mdt, fwname, VENUS_PAS_ID,
- mem_va, *mem_phys, *mem_size, NULL);
- else
+ if (core->use_tz) {
+ qcom_pas_context_init(&core->fw.pas_ctx, dev, VENUS_PAS_ID,
+ *mem_phys, *mem_size);
+ ret = qcom_mdt_pas_load(&core->fw.pas_ctx, mdt, fwname, NULL);
+ } else {
+ mem_va = memremap(*mem_phys, *mem_size, MEMREMAP_WC);
+ if (!mem_va) {
+ dev_err(dev, "unable to map memory region %pa size %#zx\n",
+ mem_phys, *mem_size);
+ ret = -ENOMEM;
+ goto err_release_fw;
+ }
ret = qcom_mdt_load_no_init(dev, mdt, fwname, mem_va,
*mem_phys, *mem_size, NULL);
-
- memunmap(mem_va);
+ memunmap(mem_va);
+ }
err_release_fw:
release_firmware(mdt);
return ret;
@@ -237,7 +238,7 @@ int venus_boot(struct venus_core *core)
core->fw.mem_phys = mem_phys;
if (core->use_tz)
- ret = qcom_pas_auth_and_reset(VENUS_PAS_ID);
+ ret = qcom_pas_prepare_and_auth_reset(&core->fw.pas_ctx);
else
ret = venus_boot_no_tz(core, mem_phys, mem_size);
diff --git a/drivers/net/ipa/ipa_main.c b/drivers/net/ipa/ipa_main.c
index 14ac2d2faf7c23..0a37741c228581 100644
--- a/drivers/net/ipa/ipa_main.c
+++ b/drivers/net/ipa/ipa_main.c
@@ -585,12 +585,11 @@ static void ipa_deconfig(struct ipa *ipa)
static int ipa_firmware_load(struct device *dev)
{
+ struct qcom_pas_context ctx;
const struct firmware *fw;
struct resource res;
phys_addr_t phys;
const char *path;
- ssize_t size;
- void *virt;
int ret;
ret = of_reserved_mem_region_to_resource(dev->of_node, 0, &res);
@@ -615,24 +614,18 @@ static int ipa_firmware_load(struct device *dev)
}
phys = res.start;
- size = (size_t)resource_size(&res);
- virt = memremap(phys, size, MEMREMAP_WC);
- if (!virt) {
- dev_err(dev, "unable to remap firmware memory\n");
- ret = -ENOMEM;
- goto out_release_firmware;
- }
+ qcom_pas_context_init(&ctx, dev, IPA_PAS_ID, phys, resource_size(&res));
- ret = qcom_mdt_load(dev, fw, path, IPA_PAS_ID, virt, phys, size, NULL);
+ ret = qcom_mdt_pas_load(&ctx, fw, path, NULL);
if (ret) {
dev_err(dev, "error %d loading \"%s\"\n", ret, path);
- } else {
- ret = qcom_pas_auth_and_reset(IPA_PAS_ID);
- if (ret)
- dev_err(dev, "error %d authenticating \"%s\"\n", ret, path);
+ goto out_release_firmware;
}
- memunmap(virt);
+ ret = qcom_pas_prepare_and_auth_reset(&ctx);
+ if (ret)
+ dev_err(dev, "error %d authenticating \"%s\"\n", ret, path);
+
out_release_firmware:
release_firmware(fw);
diff --git a/drivers/net/wireless/ath/ath12k/ahb.c b/drivers/net/wireless/ath/ath12k/ahb.c
index e5bbfca2b2ac0f..a20efcaa0358be 100644
--- a/drivers/net/wireless/ath/ath12k/ahb.c
+++ b/drivers/net/wireless/ath/ath12k/ahb.c
@@ -411,6 +411,7 @@ static int ath12k_ahb_power_up(struct ath12k_base *ab)
struct ath12k_ahb_rproc_info *rproc_info = ab_ahb->rproc_info;
char fw_name[ATH12K_USERPD_FW_NAME_LEN];
char fw2_name[ATH12K_USERPD_FW_NAME_LEN];
+ struct qcom_pas_context ctx;
struct device *dev = ab->dev;
const struct firmware *fw, *fw2;
unsigned long time_left;
@@ -444,14 +445,15 @@ static int ath12k_ahb_power_up(struct ath12k_base *ab)
ATH12K_AHB_UPD_SWID;
/* Load FW image to a reserved memory location */
- if (ab_ahb->scm_auth_enabled)
- ret = qcom_mdt_load(dev, fw, fw_name, pasid, rproc_info->mem_region,
- rproc_info->mem_phys, rproc_info->mem_size,
- NULL);
- else
+ if (ab_ahb->scm_auth_enabled) {
+ qcom_pas_context_init(&ctx, dev, pasid,
+ rproc_info->mem_phys, rproc_info->mem_size);
+ ret = qcom_mdt_pas_load(&ctx, fw, fw_name, NULL);
+ } else {
ret = qcom_mdt_load_no_init(dev, fw, fw_name, rproc_info->mem_region,
rproc_info->mem_phys, rproc_info->mem_size,
NULL);
+ }
if (ret) {
ath12k_err(ab, "Failed to load MDT segments: %d\n", ret);
goto err_fw;
@@ -485,7 +487,7 @@ static int ath12k_ahb_power_up(struct ath12k_base *ab)
if (ab_ahb->scm_auth_enabled) {
/* Authenticate FW image using peripheral ID */
- ret = qcom_pas_auth_and_reset(pasid);
+ ret = qcom_pas_prepare_and_auth_reset(&ctx);
if (ret) {
ath12k_err(ab, "failed to boot the remote processor %d\n", ret);
goto err_fw2;
@@ -1024,6 +1026,7 @@ static int ath12k_ahb_load_auth_shared_fw(struct ath12k_base *ab,
struct ath12k_ahb_rproc_info *rproc_info,
const char *fw_name, u32 pasid)
{
+ struct qcom_pas_context ctx;
int ret;
const struct firmware *fw __free(firmware) = NULL;
@@ -1042,14 +1045,16 @@ static int ath12k_ahb_load_auth_shared_fw(struct ath12k_base *ab,
ath12k_dbg(ab, ATH12K_DBG_AHB, "loading firmware %s, size %zd\n", fw_name,
fw->size);
- ret = qcom_mdt_load(ab->dev, fw, fw_name, pasid, rproc_info->mem_region,
- rproc_info->mem_phys, rproc_info->mem_size, NULL);
+ qcom_pas_context_init(&ctx, ab->dev, pasid,
+ rproc_info->mem_phys, rproc_info->mem_size);
+
+ ret = qcom_mdt_pas_load(&ctx, fw, fw_name, NULL);
if (ret) {
ath12k_err(ab, "failed to load RO firmware %s: %d\n", fw_name, ret);
return ret;
}
- ret = qcom_pas_auth_and_reset(pasid);
+ ret = qcom_pas_prepare_and_auth_reset(&ctx);
if (ret)
ath12k_err(ab, "failed to authenticate and boot shared firmware: %d\n",
ret);
diff --git a/drivers/remoteproc/qcom_wcnss.c b/drivers/remoteproc/qcom_wcnss.c
index 02f38fe29f20f4..840fa67a6928ba 100644
--- a/drivers/remoteproc/qcom_wcnss.c
+++ b/drivers/remoteproc/qcom_wcnss.c
@@ -96,6 +96,7 @@ struct qcom_wcnss {
phys_addr_t mem_reloc;
void __iomem *mem_region;
size_t mem_size;
+ struct qcom_pas_context *pas_ctx;
struct qcom_rproc_subdev smd_subdev;
struct qcom_sysmon *sysmon;
@@ -157,9 +158,7 @@ static int wcnss_load(struct rproc *rproc, const struct firmware *fw)
struct qcom_wcnss *wcnss = rproc->priv;
int ret;
- ret = qcom_mdt_load(wcnss->dev, fw, rproc->firmware, WCNSS_PAS_ID,
- (__force void *)wcnss->mem_region, wcnss->mem_phys,
- wcnss->mem_size, &wcnss->mem_reloc);
+ ret = qcom_mdt_pas_load(wcnss->pas_ctx, fw, rproc->firmware, &wcnss->mem_reloc);
if (ret)
return ret;
@@ -257,7 +256,7 @@ static int wcnss_start(struct rproc *rproc)
wcnss_indicate_nv_download(wcnss);
wcnss_configure_iris(wcnss);
- ret = qcom_pas_auth_and_reset(WCNSS_PAS_ID);
+ ret = qcom_pas_prepare_and_auth_reset(wcnss->pas_ctx);
if (ret) {
dev_err(wcnss->dev,
"failed to authenticate image and release reset\n");
@@ -599,6 +598,11 @@ static int wcnss_probe(struct platform_device *pdev)
if (ret)
return ret;
+ wcnss->pas_ctx = devm_qcom_pas_context_alloc(wcnss->dev, WCNSS_PAS_ID,
+ wcnss->mem_phys, wcnss->mem_size);
+ if (IS_ERR(wcnss->pas_ctx))
+ return PTR_ERR(wcnss->pas_ctx);
+
wcnss->pmu_cfg = mmio + data->pmu_offset;
wcnss->spare_out = mmio + data->spare_offset;
diff --git a/drivers/soc/qcom/mdt_loader.c b/drivers/soc/qcom/mdt_loader.c
index 002100fe2d3237..436d8bc4847a33 100644
--- a/drivers/soc/qcom/mdt_loader.c
+++ b/drivers/soc/qcom/mdt_loader.c
@@ -326,7 +326,8 @@ static bool qcom_mdt_bins_are_split(const struct firmware *fw)
* @dev: device handle to associate resources with
* @fw: firmware object for the mdt file
* @fw_name: name of the firmware, for construction of segment file names
- * @mem_region: allocated memory region to load firmware into
+ * @mem_region: virtual address of the memory region to load firmware into,
+ * or NULL to have the region mapped internally with ioremap_wc()
* @mem_phys: physical address of allocated memory region
* @mem_size: size of the allocated memory region
* @reloc_base: adjusted physical address after relocation
@@ -341,6 +342,7 @@ int qcom_mdt_load_no_init(struct device *dev, const struct firmware *fw,
const struct elf32_phdr *phdrs;
const struct elf32_phdr *phdr;
const struct elf32_hdr *ehdr;
+ void __iomem *mapped = NULL;
phys_addr_t mem_reloc;
phys_addr_t min_addr = PHYS_ADDR_MAX;
ssize_t offset;
@@ -350,12 +352,22 @@ int qcom_mdt_load_no_init(struct device *dev, const struct firmware *fw,
int ret = 0;
int i;
- if (!fw || !mem_region || !mem_phys || !mem_size)
+ if (!fw || !mem_phys || !mem_size)
return -EINVAL;
if (!mdt_header_valid(fw))
return -EINVAL;
+ if (!mem_region) {
+ mapped = ioremap_wc(mem_phys, mem_size);
+ if (!mapped) {
+ dev_err(dev, "unable to map memory region: %pa+%zx\n",
+ &mem_phys, mem_size);
+ return -ENOMEM;
+ }
+ mem_region = (__force void *)mapped;
+ }
+
is_split = qcom_mdt_bins_are_split(fw);
ehdr = (struct elf32_hdr *)fw->data;
phdrs = (struct elf32_phdr *)(fw->data + ehdr->e_phoff);
@@ -434,47 +446,21 @@ int qcom_mdt_load_no_init(struct device *dev, const struct firmware *fw,
if (reloc_base)
*reloc_base = mem_reloc;
+ if (mapped)
+ iounmap(mapped);
+
return ret;
}
EXPORT_SYMBOL_GPL(qcom_mdt_load_no_init);
-/**
- * qcom_mdt_load() - load the firmware which header is loaded as fw
- * @dev: device handle to associate resources with
- * @fw: firmware object for the mdt file
- * @fw_name: name of the firmware, for construction of segment file names
- * @pas_id: PAS identifier
- * @mem_region: allocated memory region to load firmware into
- * @mem_phys: physical address of allocated memory region
- * @mem_size: size of the allocated memory region
- * @reloc_base: adjusted physical address after relocation
- *
- * Returns 0 on success, negative errno otherwise.
- */
-int qcom_mdt_load(struct device *dev, const struct firmware *fw,
- const char *fw_name, int pas_id, void *mem_region,
- phys_addr_t mem_phys, size_t mem_size,
- phys_addr_t *reloc_base)
-{
- int ret;
-
- ret = __qcom_mdt_pas_init(dev, fw, fw_name, pas_id, mem_phys, NULL);
- if (ret)
- return ret;
-
- return qcom_mdt_load_no_init(dev, fw, fw_name, mem_region, mem_phys,
- mem_size, reloc_base);
-}
-EXPORT_SYMBOL_GPL(qcom_mdt_load);
-
/**
* qcom_mdt_pas_load - Loads and authenticates the metadata of the firmware
* (typically contained in the .mdt file), followed by loading the actual
* firmware segments (e.g., .bXX files). Authentication of the segments done
* by a separate call.
*
- * The PAS context must be initialized using devm_qcom_pas_context_alloc()
- * prior to invoking this function.
+ * The PAS context must be initialized using qcom_pas_context_init() or
+ * devm_qcom_pas_context_alloc() prior to invoking this function.
*
* @ctx: Pointer to the PAS (Peripheral Authentication Service) context
* @fw: Firmware object representing the .mdt file
@@ -486,21 +472,14 @@ EXPORT_SYMBOL_GPL(qcom_mdt_load);
int qcom_mdt_pas_load(struct qcom_pas_context *ctx, const struct firmware *fw,
const char *firmware, phys_addr_t *reloc_base)
{
- void __iomem *mem_region;
int ret;
ret = __qcom_mdt_pas_init(ctx->dev, fw, firmware, ctx->pas_id, ctx->mem_phys, ctx);
if (ret)
return ret;
- mem_region = qcom_pas_ctx_map(ctx);
- if (!mem_region)
- return -ENOMEM;
-
- ret = qcom_mdt_load_no_init(ctx->dev, fw, firmware, (__force void *)mem_region,
- ctx->mem_phys, ctx->mem_size, reloc_base);
- iounmap(mem_region);
- return ret;
+ return qcom_mdt_load_no_init(ctx->dev, fw, firmware, NULL,
+ ctx->mem_phys, ctx->mem_size, reloc_base);
}
EXPORT_SYMBOL_GPL(qcom_mdt_pas_load);
diff --git a/include/linux/firmware/qcom/qcom_pas.h b/include/linux/firmware/qcom/qcom_pas.h
index fb2ec3be6a1698..d5b9833c70c7be 100644
--- a/include/linux/firmware/qcom/qcom_pas.h
+++ b/include/linux/firmware/qcom/qcom_pas.h
@@ -35,6 +35,8 @@ static inline void __iomem *qcom_pas_ctx_map(struct qcom_pas_context *ctx)
}
bool qcom_pas_is_available(void);
+void qcom_pas_context_init(struct qcom_pas_context *ctx, struct device *dev,
+ u32 pas_id, phys_addr_t mem_phys, size_t mem_size);
struct qcom_pas_context *devm_qcom_pas_context_alloc(struct device *dev,
u32 pas_id,
phys_addr_t mem_phys,
@@ -45,7 +47,6 @@ struct resource_table *qcom_pas_get_rsc_table(struct qcom_pas_context *ctx,
void *input_rt, size_t input_rt_size,
size_t *output_rt_size);
int qcom_pas_mem_setup(u32 pas_id, phys_addr_t addr, phys_addr_t size);
-int qcom_pas_auth_and_reset(u32 pas_id);
int qcom_pas_prepare_and_auth_reset(struct qcom_pas_context *ctx);
int qcom_pas_set_remote_state(u32 state, u32 pas_id);
int qcom_pas_shutdown(u32 pas_id);
diff --git a/include/linux/soc/qcom/mdt_loader.h b/include/linux/soc/qcom/mdt_loader.h
index 74886f772d46d0..f49de7b388bc88 100644
--- a/include/linux/soc/qcom/mdt_loader.h
+++ b/include/linux/soc/qcom/mdt_loader.h
@@ -15,10 +15,6 @@ struct qcom_pas_context;
#if IS_ENABLED(CONFIG_QCOM_MDT_LOADER)
ssize_t qcom_mdt_get_size(const struct firmware *fw);
-int qcom_mdt_load(struct device *dev, const struct firmware *fw,
- const char *fw_name, int pas_id, void *mem_region,
- phys_addr_t mem_phys, size_t mem_size,
- phys_addr_t *reloc_base);
int qcom_mdt_pas_load(struct qcom_pas_context *ctx, const struct firmware *fw,
const char *firmware, phys_addr_t *reloc_base);
@@ -37,14 +33,6 @@ static inline ssize_t qcom_mdt_get_size(const struct firmware *fw)
return -ENODEV;
}
-static inline int qcom_mdt_load(struct device *dev, const struct firmware *fw,
- const char *fw_name, int pas_id,
- void *mem_region, phys_addr_t mem_phys,
- size_t mem_size, phys_addr_t *reloc_base)
-{
- return -ENODEV;
-}
-
static inline int qcom_mdt_pas_load(struct qcom_pas_context *ctx,
const struct firmware *fw, const char *firmware,
phys_addr_t *reloc_base)
|
| 3/2 | 2026/11/20 04:59 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 13570 output: 45 thoughts: 703 Thoughts: **My Initial Assessment of the Patch Series for syzkaller Fuzzing on amd64** Okay, so the task is to evaluate this patch series submitted for syzkaller fuzzing. The target architecture is amd64, which is the standard, but I need to be careful with assumptions. Let's dig in. First, I need to know exactly which files are touched: * `drivers/firmware/qcom/qcom_pas.c` * `drivers/firmware/qcom/qcom_pas.h` * `drivers/firmware/qcom/qcom_pas_tee.c` * `drivers/firmware/qcom/qcom_scm.c` * `drivers/gpu/drm/msm/adreno/adreno_gpu.c` * `drivers/media/platform/qcom/iris/iris_core.h` * `drivers/media/platform/qcom/iris/iris_firmware.c` * `drivers/media/platform/qcom/venus/core.h` * `drivers/media/platform/qcom/venus/firmware.c` * `drivers/net/ipa/ipa_main.c` * `drivers/net/wireless/ath/ath12k/ahb.c` * `drivers/remoteproc/qcom_wcnss.c` * `drivers/soc/qcom/mdt_loader.c` * `include/linux/firmware/qcom/qcom_pas.h` * `include/linux/soc/qcom/mdt_loader.h` Alright, that's a lot of files. The pattern jumps out immediately: it’s all Qualcomm (qcom) platform drivers, SoC drivers and firmware related code! * Qualcomm Peripheral Authentication Service (PAS) * Qualcomm SCM (Secure Channel Manager / TrustZone) * Qualcomm Adreno GPU (DRM MSM) * Qualcomm Iris video decoder/encoder * Qualcomm Venus video decoder/encoder * Qualcomm IPA (IP Accelerator) * ath12k AHB (Qualcomm Atheros wireless on AHB bus) * Qualcomm WCNSS remoteproc * Qualcomm MDT loader My first thought is, are any of these actually *reachable* on amd64 in a standard virtualized environment like QEMU or Google Compute Engine? This immediately triggers a red flag, because I know that a lot of this hardware and functionality is specific to mobile platforms or embedded SoCs. Let's check the patch instructions on reachability: * Vendor-specific PCIe switches, SmartNICs, or GPU drivers requiring physical ASIC/PCIe cards not emulated in standard QEMU are unreachable, e.g., mlxsw, pds\_core, qed, ionic, amdgpu. * Driver teardown callbacks that get executed only in a physical PCI hot-unplug or manual sysfs driver unbinding. * Code paths exclusive to architectures other than the target architecture. Given that these are *Qualcomm* drivers, specifically those related to Secure Channel Management (SCM), MDT loading, and potentially even PAS (Peripheral Authentication Service), my immediate concern is whether or not these components, or any significant portion of their code paths, are actually built or reachable on amd64, even in a "generic" kernel. Qualcomm SCM, PAS, and MDT loader, these are not things you normally see running on a standard amd64 system. My next step has to be to confirm this. I need to check the Kconfig files for these drivers to understand if they are even *configurable* on amd64, or if they're conditional on an ARM architecture or a specific Qualcomm platform. Let's use `grepper` to search for `QCOM_PAS`, `QCOM_SCM`, `QCOM_MDT_LOADER`, and so on. That should give a clear picture of whether these are even candidates for fuzzing in the specified environment. If these Kconfig options aren't available for amd64, then this whole patch set is likely structurally unreachable and a waste of time and effort to pursue. |
| 4/2 | 2026/11/20 04:59 | tool | grepper |
0mArgs:{
"Expression": "config QCOM_PAS|config QCOM_SCM|config QCOM_MDT_LOADER",
"PathPrefixes": [
"drivers/"
]
}Results: {
"Output": "drivers/firmware/qcom/Kconfig=7=menu \"Qualcomm firmware drivers\"\ndrivers/firmware/qcom/Kconfig-8-\ndrivers/firmware/qcom/Kconfig:9:config QCOM_PAS\ndrivers/firmware/qcom/Kconfig-10-\ttristate \"Qualcomm generic PAS interface driver\" if COMPILE_TEST\n--\ndrivers/firmware/qcom/Kconfig-16-\ndrivers/firmware/qcom/Kconfig:17:config QCOM_PAS_TEE\ndrivers/firmware/qcom/Kconfig-18-\ttristate \"Qualcomm PAS TEE interface driver\"\n--\ndrivers/firmware/qcom/Kconfig-27-\ndrivers/firmware/qcom/Kconfig:28:config QCOM_SCM\ndrivers/firmware/qcom/Kconfig-29-\ttristate \"Qualcomm PAS SCM interface driver\" if ARCH_QCOM || COMPILE_TEST\n--\ndrivers/soc/qcom/Kconfig=300=config QCOM_KRYO_L2_ACCESSORS\n--\ndrivers/soc/qcom/Kconfig-303-\ndrivers/soc/qcom/Kconfig:304:config QCOM_MDT_LOADER\ndrivers/soc/qcom/Kconfig-305-\ttristate\n"
} |
| 5/2 | 2026/11/20 04:59 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 15585 output: 36 thoughts: 21 Thoughts: Okay, here's the summary, tailored for an expert audience, in the first person, reflecting the specified thought process: **Diving into the QCOM Firmware Configuration** Right, let's get down to brass tacks. I need to understand the dependencies related to this firmware configuration. My immediate move is to head over to the `drivers/firmware/qcom/Kconfig` file. I'm thinking that's the canonical place to find the relevant Kconfig options and their dependencies. I need to figure out what other components or features are gating this particular firmware, or conversely, what this firmware might be enabling or requiring. Parsing the Kconfig file will give me a clear picture of its integration within the broader system configuration. This is where the magic happens and the relationships are defined, so let's get to it. |
| 6/2 | 2026/11/20 04:59 | tool | read-file |
0mArgs:{
"File": "drivers/firmware/qcom/Kconfig",
"FirstLine": 1,
"LineCount": 50
}Results: {
"Contents": " 1:\t# SPDX-License-Identifier: GPL-2.0-only\n 2:\t#\n 3:\t# For a description of the syntax of this configuration file,\n 4:\t# see Documentation/kbuild/kconfig-language.rst.\n 5:\t#\n 6:\t\n 7:\tmenu \"Qualcomm firmware drivers\"\n 8:\t\n 9:\tconfig QCOM_PAS\n 10:\t\ttristate \"Qualcomm generic PAS interface driver\" if COMPILE_TEST\n 11:\t\thelp\n 12:\t\t Enable the generic Peripheral Authentication Service (PAS) provided\n 13:\t\t by the firmware. It acts as the common layer with different TZ\n 14:\t\t backends plugged in whether it's an SCM implementation or a proper\n 15:\t\t TEE bus based PAS service implementation.\n 16:\t\n 17:\tconfig QCOM_PAS_TEE\n 18:\t\ttristate \"Qualcomm PAS TEE interface driver\"\n 19:\t\tdepends on ARCH_QCOM || COMPILE_TEST\n 20:\t\tselect QCOM_PAS\n 21:\t\tdepends on TEE\n 22:\t\tdepends on !CPU_BIG_ENDIAN\n 23:\t\tdefault m if ARCH_QCOM\n 24:\t\thelp\n 25:\t\t Enable the generic Peripheral Authentication Service (PAS) provided\n 26:\t\t by the firmware TEE implementation as the backend.\n 27:\t\n 28:\tconfig QCOM_SCM\n 29:\t\ttristate \"Qualcomm PAS SCM interface driver\" if ARCH_QCOM || COMPILE_TEST\n 30:\t\tselect QCOM_PAS\n 31:\t\tselect QCOM_TZMEM\n 32:\t\tdefault y if ARCH_QCOM\n 33:\t\n 34:\tconfig QCOM_TZMEM\n 35:\t\ttristate\n 36:\t\tselect GENERIC_ALLOCATOR\n 37:\t\n 38:\tconfig QCOM_TZMEM_MODE_SHMBRIDGE\n 39:\t\tbool \"TrustZone interface memory allocator: SHM Bridge\"\n 40:\t\tdepends on QCOM_TZMEM\n 41:\t\thelp\n 42:\t\t Use Qualcomm Shared Memory Bridge as memory allocator. The memory has the\n 43:\t\t same alignment as in the 'Generic' allocator, which is used when this option\n 44:\t\t is disabled, but is also explicitly marked as an SHM Bridge buffer.\n 45:\t\n 46:\t\t With this selected, all buffers passed to the TrustZone must be allocated\n 47:\t\t using the TZMem allocator or else the TrustZone will refuse to use them.\n 48:\t\n 49:\tconfig QCOM_QSEECOM\n 50:\t\tbool \"Qualcomm QSEECOM interface driver\"\n"
} |
| 7/2 | 2026/11/20 04:59 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 16507 output: 48 thoughts: 128 Thoughts: Okay, let's break this down. **Diving into the QCOM Architecture** Alright, I need to understand how these Qualcomm devices are attaching, specifically focusing on how they're probed. My immediate thought is to check the `ARCH_QCOM` configuration and see where these interfaces are tied together. I'm seeing a few key players here that I need to investigate in more detail: `qcom_pas`, `qcom_pas_tee`, and `qcom_scm`. Now, if I understand this correctly: `qcom_pas` is likely a firmware driver registered by either `qcom_pas_tee` or `qcom_scm`. `qcom_pas_tee` appears to be the TEE bus client driver using `tee_client_driver` - so that is pretty straightforward. `qcom_scm`, on the other hand, is registered as a `platform_driver` using an `of_device_id` called `qcom_scm_dt_match`. Okay, that's my entry point for diving deeper into the driver's initialization and device matching. Time to open up `qcom_scm.c` and dig into its probe function and Device Tree matching logic. |
| 8/2 | 2026/11/20 04:59 | tool | grepper |
0mArgs:{
"Expression": "qcom_scm_driver|qcom_scm_probe",
"PathPrefixes": [
"drivers/firmware/qcom/qcom_scm.c"
]
}Results: {
"Output": "drivers/firmware/qcom/qcom_scm.c=2504=bool qcom_scm_is_available(void)\ndrivers/firmware/qcom/qcom_scm.c-2505-{\ndrivers/firmware/qcom/qcom_scm.c:2506:\t/* Paired with smp_store_release() in qcom_scm_probe */\ndrivers/firmware/qcom/qcom_scm.c-2507-\treturn !!smp_load_acquire(\u0026__scm);\n--\ndrivers/firmware/qcom/qcom_scm.c=2648=static int set_download_mode(const char *val, const struct kernel_param *kp)\n--\ndrivers/firmware/qcom/qcom_scm.c-2665-\tdownload_mode = ret;\ndrivers/firmware/qcom/qcom_scm.c:2666:\t/* Pairs with smp_store_release() in qcom_scm_probe(). */\ndrivers/firmware/qcom/qcom_scm.c-2667-\tscm = smp_load_acquire(\u0026__scm);\n--\ndrivers/firmware/qcom/qcom_scm.c=2693=static int set_minidump_dest(const char *val, const struct kernel_param *kp)\n--\ndrivers/firmware/qcom/qcom_scm.c-2706-\ndrivers/firmware/qcom/qcom_scm.c:2707:\t/* Pairs with smp_store_release() in qcom_scm_probe(). */\ndrivers/firmware/qcom/qcom_scm.c-2708-\tscm = smp_load_acquire(\u0026__scm);\n--\ndrivers/firmware/qcom/qcom_scm.c=2721=MODULE_PARM_DESC(minidump_dest, \"Minidump SRAM destination: usb (default) or storage\");\ndrivers/firmware/qcom/qcom_scm.c-2722-\ndrivers/firmware/qcom/qcom_scm.c:2723:static int qcom_scm_probe(struct platform_device *pdev)\ndrivers/firmware/qcom/qcom_scm.c-2724-{\n--\ndrivers/firmware/qcom/qcom_scm.c=2892=MODULE_DEVICE_TABLE(of, qcom_scm_dt_match);\ndrivers/firmware/qcom/qcom_scm.c-2893-\ndrivers/firmware/qcom/qcom_scm.c:2894:static struct platform_driver qcom_scm_driver = {\ndrivers/firmware/qcom/qcom_scm.c-2895-\t.driver = {\n--\ndrivers/firmware/qcom/qcom_scm.c-2899-\t},\ndrivers/firmware/qcom/qcom_scm.c:2900:\t.probe = qcom_scm_probe,\ndrivers/firmware/qcom/qcom_scm.c-2901-\t.shutdown = qcom_scm_shutdown,\n--\ndrivers/firmware/qcom/qcom_scm.c=2904=static int __init qcom_scm_init(void)\ndrivers/firmware/qcom/qcom_scm.c-2905-{\ndrivers/firmware/qcom/qcom_scm.c:2906:\treturn platform_driver_register(\u0026qcom_scm_driver);\ndrivers/firmware/qcom/qcom_scm.c-2907-}\n"
} |
| 9/2 | 2026/11/20 04:59 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 17831 output: 45 thoughts: 135 Thoughts: **My Initial Thoughts on `qcom_scm`** Okay, so `qcom_scm` is a Device Tree platform driver specifically for Qualcomm's Secure Configuration Management (SCM) or TrustZone interface on their SoCs. The immediate question is, can we even probe these OF platform devices on an amd64 system, especially within QEMU? That seems a bit off, doesn't it? Right, and here's the rub. In the standard x86/amd64 QEMU or Google Compute Engine setup, we typically don't see Device Trees unless something unusual is configured. And even *then*, Qualcomm's Snapdragon chips leverage their TrustZone functionality and firmware through those SCM calls, which, of course, are executed using SMC instructions – those ARM or ARM64 Secure Monitor Calls! I need to see how the SCM calls are actually implemented within `qcom_scm.c`. Time to dig into the code. |
| 10/2 | 2026/11/20 05:00 | tool | grepper |
0mArgs:{
"Expression": "arm_smccc_smc|__arm_smccc_smc",
"PathPrefixes": [
"drivers/firmware/qcom/"
]
}Results: {
"Output": "drivers/firmware/qcom/qcom_scm-legacy.c=110=static void __scm_legacy_do(const struct arm_smccc_args *smc,\n--\ndrivers/firmware/qcom/qcom_scm-legacy.c-113-\tdo {\ndrivers/firmware/qcom/qcom_scm-legacy.c:114:\t\tarm_smccc_smc(smc-\u003eargs[0], smc-\u003eargs[1], smc-\u003eargs[2],\ndrivers/firmware/qcom/qcom_scm-legacy.c-115-\t\t\t smc-\u003eargs[3], smc-\u003eargs[4], smc-\u003eargs[5],\n--\ndrivers/firmware/qcom/qcom_scm-legacy.c=224=int scm_legacy_call_atomic(struct device *unused,\n--\ndrivers/firmware/qcom/qcom_scm-legacy.c-233-\ndrivers/firmware/qcom/qcom_scm-legacy.c:234:\tarm_smccc_smc(SCM_LEGACY_ATOMIC_ID(desc-\u003esvc, desc-\u003ecmd, arglen),\ndrivers/firmware/qcom/qcom_scm-legacy.c-235-\t\t (unsigned long)\u0026context_id,\n--\ndrivers/firmware/qcom/qcom_scm-smc.c=41=static void __scm_smc_do_quirk(const struct arm_smccc_args *smc,\n--\ndrivers/firmware/qcom/qcom_scm-smc.c-50-\t\ttrace_scm_smc_request(a0, smc);\ndrivers/firmware/qcom/qcom_scm-smc.c:51:\t\tarm_smccc_smc_quirk(a0, smc-\u003eargs[1], smc-\u003eargs[2],\ndrivers/firmware/qcom/qcom_scm-smc.c-52-\t\t\t\t smc-\u003eargs[3], smc-\u003eargs[4], smc-\u003eargs[5],\n"
} |
| 11/2 | 2026/11/20 05:00 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 18726 output: 45 thoughts: 138 Thoughts: Okay, here's the summary, tailored for an expert audience, in the first person: **Initial Assessment and Targeted Investigation** Right, `arm_smccc_smc`! That's a clear indicator of an ARM Secure Monitor Call. My initial thought is to immediately recognize this and move to analyze where else it could have been modified. I need to get a full picture, so it is necessary to go through all of the other modified drivers, starting with a review of the changes that have taken place. I see a modification in `drivers/gpu/drm/msm/adreno/adreno_gpu.c`. Hang on...the code includes an `if (!IS_ENABLED(CONFIG_ARCH_QCOM))` check. Let's see...I need to quickly parse this, right? Okay, back to line 42 in `adreno_gpu.c`. This is where the core conditional resides. I need to understand the logic flow, so I'll read a bit around line 42, just to clarify the context and understand the surrounding logic. This conditional is likely to provide some insight, given that `CONFIG_ARCH_QCOM` is being checked. |
| 12/2 | 2026/11/20 05:00 | tool | read-file |
0mArgs:{
"File": "drivers/gpu/drm/msm/adreno/adreno_gpu.c",
"FirstLine": 35,
"LineCount": 30
}Results: {
"Contents": " 35:\t\tconst struct firmware *fw;\n 36:\t\tconst char *signed_fwname = NULL;\n 37:\t\tstruct qcom_pas_context ctx;\n 38:\t\tstruct device_node *np;\n 39:\t\tstruct resource r;\n 40:\t\tphys_addr_t mem_phys;\n 41:\t\tssize_t mem_size;\n 42:\t\tint ret;\n 43:\t\n 44:\t\tif (!IS_ENABLED(CONFIG_ARCH_QCOM)) {\n 45:\t\t\tzap_available = false;\n 46:\t\t\treturn -EINVAL;\n 47:\t\t}\n 48:\t\n 49:\t\tnp = of_get_available_child_by_name(dev-\u003eof_node, \"zap-shader\");\n 50:\t\tif (!np) {\n 51:\t\t\tzap_available = false;\n 52:\t\t\treturn -ENODEV;\n 53:\t\t}\n 54:\t\n 55:\t\t/* We need PAS to be able to load the firmware */\n 56:\t\tif (!qcom_pas_is_available()) {\n 57:\t\t\tDRM_DEV_ERROR(dev, \"PAS is not available\\n\");\n 58:\t\t\treturn -EPROBE_DEFER;\n 59:\t\t}\n 60:\t\n 61:\t\tret = of_reserved_mem_region_to_resource(np, 0, \u0026r);\n 62:\t\tif (ret) {\n 63:\t\t\tzap_available = false;\n 64:\t\t\treturn ret;\n"
} |
| 13/2 | 2026/11/20 05:00 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 19565 output: 19 thoughts: 67 Thoughts: Here's my take: **Investigating a Platform Restriction** Okay, so I'm seeing this conditional check: `if (!IS_ENABLED(CONFIG_ARCH_QCOM)) return -EINVAL;`. My first thought is, "Wait a minute, *why* are we explicitly rejecting this on a non-QCOM architecture?". It's immediately obvious, but I want to make sure I understand the design decision. Can we even *configure* `CONFIG_ARCH_QCOM` on an amd64 system? That seems unlikely, but it's always best to be precise. Let's start with a sanity check: I'll quickly poke around in the `arch/x86/` directory to see if there's any mention of `config ARCH_QCOM` there. I also consider hitting Grep to quickly scan the entire codebase. This will give a quick overview of how this configuration option is used and if there are any conflicting definitions. I need to understand the intent of this specific check before diving deeper. |
| 14/2 | 2026/11/20 05:00 | tool | grepper |
0mArgs:{
"Expression": "config ARCH_QCOM"
}Results: {
"Output": "arch/arm/mach-qcom/Kconfig-1-# SPDX-License-Identifier: GPL-2.0-only\narch/arm/mach-qcom/Kconfig:2:menuconfig ARCH_QCOM\narch/arm/mach-qcom/Kconfig-3-\tbool \"Qualcomm Support\"\n--\narch/arm/mach-qcom/Kconfig=16=if ARCH_QCOM\narch/arm/mach-qcom/Kconfig-17-\narch/arm/mach-qcom/Kconfig:18:config ARCH_QCOM_RESERVE_SMEM\narch/arm/mach-qcom/Kconfig-19-\tbool \"Reserve SMEM at the beginning of RAM\"\n--\narch/arm64/Kconfig.platforms=322=config ARCH_PENSANDO\n--\narch/arm64/Kconfig.platforms-333-\narch/arm64/Kconfig.platforms:334:config ARCH_QCOM\narch/arm64/Kconfig.platforms-335-\tbool \"Qualcomm Platforms\"\n"
} |
| 15/2 | 2026/11/20 05:00 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 20134 output: 31 thoughts: 311 Thoughts: **My Analysis of This Patch Series** Okay, so the initial flag, `CONFIG_ARCH_QCOM`, is clearly architecture-specific, only present under `arm` and `arm64`. That's a red flag – a hard dependency on an ARM environment means it's definitely not going to apply to an `amd64` system. I need to understand why this is being touched in this context. Now, let's look at the other files this patch series is interacting with. I'm going to run through them methodically: 1. `drivers/firmware/qcom/qcom_pas.c` 2. `drivers/firmware/qcom/qcom_pas_tee.c` 3. `drivers/firmware/qcom/qcom_scm.c` 4. `drivers/gpu/drm/msm/adreno/adreno_gpu.c` 5. `drivers/media/platform/qcom/iris/iris_core.h`, `iris_firmware.c` 6. `drivers/media/platform/qcom/venus/core.h`, `venus/firmware.c` 7. `drivers/net/ipa/ipa_main.c` 8. `drivers/net/wireless/ath/ath12k/ahb.c` 9. `drivers/remoteproc/qcom_wcnss.c` 10. `drivers/soc/qcom/mdt_loader.c` I need to quickly assess if any of these are _capable_ of running on an `amd64` architecture. They are all QCOM drivers and firmware which means that most likely they are used for mobile/embedded devices. I am going to have a closer look at `iris`, since it is common to have to drivers for media devices on both architectures. Let's begin checking `iris`: I should check the `Kconfig` file in `drivers/media/platform/qcom/iris/Kconfig` to see the dependencies of the module. |
| 16/2 | 2026/11/20 05:00 | tool | grepper |
0mArgs:{
"Expression": "VIDEO_QCOM_IRIS",
"PathPrefixes": [
"drivers/media/"
]
}Results: {
"Output": "drivers/media/platform/qcom/iris/Kconfig:1:config VIDEO_QCOM_IRIS\ndrivers/media/platform/qcom/iris/Kconfig-2-\ttristate \"Qualcomm iris V4L2 decoder driver\"\n--\ndrivers/media/platform/qcom/iris/Makefile=1=qcom-iris-objs += iris_buffer.o \\\n--\ndrivers/media/platform/qcom/iris/Makefile-33-\ndrivers/media/platform/qcom/iris/Makefile:34:obj-$(CONFIG_VIDEO_QCOM_IRIS) += qcom-iris.o\n--\ndrivers/media/platform/qcom/venus/core.c=1027=static const struct venus_resources sc7180_res = {\n--\ndrivers/media/platform/qcom/venus/core.c-1057-\ndrivers/media/platform/qcom/venus/core.c:1058:#if (!IS_ENABLED(CONFIG_VIDEO_QCOM_IRIS))\ndrivers/media/platform/qcom/venus/core.c-1059-static const struct freq_tbl sm8250_freq_table[] = {\n--\ndrivers/media/platform/qcom/venus/core.c=1233=static const struct of_device_id venus_dt_match[] = {\n--\ndrivers/media/platform/qcom/venus/core.c-1237-\t{ .compatible = \"qcom,msm8998-venus\", .data = \u0026msm8998_res, },\ndrivers/media/platform/qcom/venus/core.c:1238:#if (!IS_ENABLED(CONFIG_VIDEO_QCOM_IRIS))\ndrivers/media/platform/qcom/venus/core.c-1239-\t{ .compatible = \"qcom,qcm2290-venus\", .data = \u0026qcm2290_res, },\n--\ndrivers/media/platform/qcom/venus/core.c-1244-\t{ .compatible = \"qcom,sdm845-venus-v2\", .data = \u0026sdm845_res_v2, },\ndrivers/media/platform/qcom/venus/core.c:1245:#if (!IS_ENABLED(CONFIG_VIDEO_QCOM_IRIS))\ndrivers/media/platform/qcom/venus/core.c-1246-\t{ .compatible = \"qcom,sc7280-venus\", .data = \u0026sc7280_res, },\n--\ndrivers/media/platform/qcom/venus/core.h=58=enum vpu_version {\n--\ndrivers/media/platform/qcom/venus/core.h-61-\tVPU_VERSION_IRIS1,\ndrivers/media/platform/qcom/venus/core.h:62:#if (!IS_ENABLED(CONFIG_VIDEO_QCOM_IRIS))\ndrivers/media/platform/qcom/venus/core.h-63-\tVPU_VERSION_IRIS2,\n--\ndrivers/media/platform/qcom/venus/core.h=469=struct venus_inst {\n--\ndrivers/media/platform/qcom/venus/core.h-543-#define IS_V4(core)\t((core)-\u003eres-\u003ehfi_version == HFI_VERSION_4XX)\ndrivers/media/platform/qcom/venus/core.h:544:#if (!IS_ENABLED(CONFIG_VIDEO_QCOM_IRIS))\ndrivers/media/platform/qcom/venus/core.h-545-#define IS_V6(core)\t((core)-\u003eres-\u003ehfi_version == HFI_VERSION_6XX)\n--\ndrivers/media/platform/qcom/venus/core.h-552-#define IS_IRIS1(core)\t\t((core)-\u003eres-\u003evpu_version == VPU_VERSION_IRIS1)\ndrivers/media/platform/qcom/venus/core.h:553:#if (!IS_ENABLED(CONFIG_VIDEO_QCOM_IRIS))\ndrivers/media/platform/qcom/venus/core.h-554-#define IS_IRIS2(core)\t\t((core)-\u003eres-\u003evpu_version == VPU_VERSION_IRIS2)\n"
} |
| 17/2 | 2026/11/20 05:00 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 21960 output: 39 thoughts: 19 Thoughts: Here's a summary of my thought process, as requested: **Navigating the QCOM Iris Driver Configuration** Okay, so I need to understand the configuration options for the QCOM Iris driver. My first instinct, and the correct approach, is to dive straight into the `Kconfig` file. That's the place where all the configuration options are defined for the kernel, and the `iris` driver. This file, specifically, `drivers/media/platform/qcom/iris/Kconfig`, is my starting point. It'll give me the lay of the land, detailing what features are controllable, what dependencies exist, and what the default settings might be. This is where I'll get the core of the configurable aspects. |
| 18/2 | 2026/11/20 05:00 | tool | read-file |
0mArgs:{
"File": "drivers/media/platform/qcom/iris/Kconfig",
"FirstLine": 1,
"LineCount": 25
}Results: {
"Contents": " 1:\tconfig VIDEO_QCOM_IRIS\n 2:\t\ttristate \"Qualcomm iris V4L2 decoder driver\"\n 3:\t\tdepends on VIDEO_DEV\n 4:\t\tdepends on ARCH_QCOM || COMPILE_TEST\n 5:\t\tdepends on QCOM_SMEM || QCOM_SMEM=n\n 6:\t\tselect V4L2_MEM2MEM_DEV\n 7:\t\tselect QCOM_MDT_LOADER\n 8:\t\tselect QCOM_SCM\n 9:\t\tselect QCOM_PAS\n 10:\t\tselect QCOM_UBWC_CONFIG if ARCH_QCOM \u0026\u0026 QCOM_SMEM\n 11:\t\tselect VIDEOBUF2_DMA_CONTIG\n 12:\t\thelp\n 13:\t\t This is a V4L2 driver for Qualcomm iris video accelerator\n 14:\t\t hardware. It accelerates decoding operations on various\n 15:\t\t Qualcomm SoCs.\n 16:\t\t To compile this driver as a module choose m here.\n"
} |
| 19/2 | 2026/11/20 05:00 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 22426 output: 33 thoughts: 55 Thoughts: Here's my thought process, as requested: **Navigating the Qualcomm Video Acceleration Landscape** Okay, so I'm looking at `VIDEO_QCOM_IRIS`, which I know is a platform driver related to Qualcomm's video accelerator. But, I need a clearer picture of its context. My first instinct is to explore other related drivers, specifically the `drivers/media/platform/qcom/venus/` path. I suspect it's another part of the ecosystem. To get a better understanding of how `VIDEO_QCOM_IRIS` fits in, I'll examine the configuration options associated with `venus` – to see what kind of dependencies or relationships it might have. So, let's dive into that `drivers/media/platform/qcom/venus/Kconfig` file. That should give me a good starting point for assessing the overall architecture. |
| 20/2 | 2026/11/20 05:00 | tool | grepper |
0mArgs:{
"Expression": "config VIDEO_QCOM_VENUS",
"PathPrefixes": [
"drivers/media/"
]
}Results: {
"Output": "drivers/media/platform/qcom/venus/Kconfig:1:config VIDEO_QCOM_VENUS\ndrivers/media/platform/qcom/venus/Kconfig-2-\ttristate \"Qualcomm Venus V4L2 encoder/decoder driver\"\n"
} |
| 21/2 | 2026/11/20 05:00 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 22769 output: 39 thoughts: 19 Thoughts: Here's my summary, as though I'm reading and processing the `drivers/media/platform/qcom/venus/Kconfig` file: **Dissecting the Kconfig for QCOM Venus Drivers** Okay, let's dive into the `drivers/media/platform/qcom/venus/Kconfig` file. Right away, I'm expecting this to be the configuration file that dictates which QCOM Venus-related video and multimedia drivers get built into the kernel, and under what circumstances. It’s the gatekeeper, basically. I'm looking for the dependencies, the *how* and *why* these drivers are enabled or disabled. This is where I find the conditions that determine the build options, the conditionals that decide the resulting configuration of the Venus video codec hardware support. I’ll start by reviewing the device's feature support, in order to determine the configuration that will support the target video or multimedia function. I expect to see things like dependencies on specific Qualcomm SoCs (System-on-Chip) – that's a given. I'll likely see conditional dependencies tied to other kernel features, maybe even other media frameworks or hardware modules. I'm also anticipating options related to specific Venus hardware revisions or feature sets, like specific codec support. The configuration is typically a layered approach, with the high-level options deciding which underlying functions or modules are exposed, and low-level detail to control specific feature settings. The Kconfig syntax should be relatively straightforward, but I'll be focused on understanding the *logic* behind the options, the relationships between the different configurations. It's about figuring out the rationale for each option. |
| 22/2 | 2026/11/20 05:00 | tool | read-file |
0mArgs:{
"File": "drivers/media/platform/qcom/venus/Kconfig",
"FirstLine": 1,
"LineCount": 25
}Results: {
"Contents": " 1:\tconfig VIDEO_QCOM_VENUS\n 2:\t\ttristate \"Qualcomm Venus V4L2 encoder/decoder driver\"\n 3:\t\tdepends on V4L_MEM2MEM_DRIVERS\n 4:\t\tdepends on VIDEO_DEV \u0026\u0026 QCOM_SMEM\n 5:\t\tdepends on (ARCH_QCOM \u0026\u0026 ARM64 \u0026\u0026 IOMMU_API) || COMPILE_TEST\n 6:\t\tselect OF_DYNAMIC if ARCH_QCOM\n 7:\t\tselect QCOM_MDT_LOADER\n 8:\t\tselect QCOM_SCM\n 9:\t\tselect QCOM_PAS\n 10:\t\tselect VIDEOBUF2_DMA_CONTIG\n 11:\t\tselect V4L2_MEM2MEM_DEV\n 12:\t\thelp\n 13:\t\t This is a V4L2 driver for Qualcomm Venus video accelerator\n 14:\t\t hardware. It accelerates encoding and decoding operations\n 15:\t\t on various Qualcomm SoCs.\n 16:\t\t To compile this driver as a module choose m here.\n"
} |
| 23/2 | 2026/11/20 05:00 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 23435 output: 41 thoughts: 62 Thoughts: Okay, here's my take on those thoughts, framed as my own: **Analyzing Kernel Configuration Dependencies** Alright, I'm taking a look at this configuration snippet. The first thing that jumps out is that `depends on (ARCH_QCOM && ARM64 && IOMMU_API) || COMPILE_TEST`. That's a fairly specific dependency, but I'm immediately wondering about its implications. The part I'm *really* curious about is how this affects specific drivers. My brain immediately goes to `ath12k/ahb.c`. I need to figure out how this plays into wireless driver. Okay, so that means I need to go dig into the relevant Kconfig file and double-check exactly how these conditions ripple through the driver config. Let's see what's in `drivers/net/wireless/ath/ath12k/Kconfig`. I'll need to understand if the configuration in the code applies in this location. That's where I need to start. |
| 24/2 | 2026/11/20 05:00 | tool | grepper |
0mArgs:{
"Expression": "ATH12K_AHB",
"PathPrefixes": [
"drivers/net/wireless/ath/ath12k/"
]
}Results: {
"Output": "drivers/net/wireless/ath/ath12k/Kconfig=2=config ATH12K\n--\ndrivers/net/wireless/ath/ath12k/Kconfig-16-\ndrivers/net/wireless/ath/ath12k/Kconfig:17:config ATH12K_AHB\ndrivers/net/wireless/ath/ath12k/Kconfig-18-\tbool \"Qualcomm ath12k AHB support\"\n--\ndrivers/net/wireless/ath/ath12k/Makefile=3=ath12k-y += core.o \\\n--\ndrivers/net/wireless/ath/ath12k/Makefile-24-\ndrivers/net/wireless/ath/ath12k/Makefile:25:ath12k-$(CONFIG_ATH12K_AHB) += ahb.o\ndrivers/net/wireless/ath/ath12k/Makefile-26-\n--\ndrivers/net/wireless/ath/ath12k/ahb.c=408=static int ath12k_ahb_power_up(struct ath12k_base *ab)\n--\ndrivers/net/wireless/ath/ath12k/ahb.c-425-\tsnprintf(fw_name, sizeof(fw_name), \"%s/%s/%s%d%s\", ATH12K_FW_DIR,\ndrivers/net/wireless/ath/ath12k/ahb.c:426:\t\t ab-\u003ehw_params-\u003efw.dir, ATH12K_AHB_FW_PREFIX, ab_ahb-\u003euserpd_id,\ndrivers/net/wireless/ath/ath12k/ahb.c:427:\t\t ATH12K_AHB_FW_SUFFIX);\ndrivers/net/wireless/ath/ath12k/ahb.c-428-\n--\ndrivers/net/wireless/ath/ath12k/ahb.c-444-\tpasid = (u32_encode_bits(ab_ahb-\u003euserpd_id, ATH12K_USERPD_ID_MASK)) |\ndrivers/net/wireless/ath/ath12k/ahb.c:445:\t\tATH12K_AHB_UPD_SWID;\ndrivers/net/wireless/ath/ath12k/ahb.c-446-\n--\ndrivers/net/wireless/ath/ath12k/ahb.c-462-\tsnprintf(fw2_name, sizeof(fw2_name), \"%s/%s/%s\", ATH12K_FW_DIR,\ndrivers/net/wireless/ath/ath12k/ahb.c:463:\t\t ab-\u003ehw_params-\u003efw.dir, ATH12K_AHB_FW2);\ndrivers/net/wireless/ath/ath12k/ahb.c-464-\n--\ndrivers/net/wireless/ath/ath12k/ahb.c=532=static void ath12k_ahb_power_down(struct ath12k_base *ab, bool is_suspend)\n--\ndrivers/net/wireless/ath/ath12k/ahb.c-552-\t\tpasid = (u32_encode_bits(ab_ahb-\u003euserpd_id, ATH12K_USERPD_ID_MASK)) |\ndrivers/net/wireless/ath/ath12k/ahb.c:553:\t\t\t ATH12K_AHB_UPD_SWID;\ndrivers/net/wireless/ath/ath12k/ahb.c-554-\t\t/* Release the firmware */\n--\ndrivers/net/wireless/ath/ath12k/ahb.c=1064=static int ath12k_ahb_load_shared_firmware(struct ath12k_base *ab)\n--\ndrivers/net/wireless/ath/ath12k/ahb.c-1081-\tsnprintf(fw_name, sizeof(fw_name), \"%s/%s/%s%d%s\", ATH12K_FW_DIR,\ndrivers/net/wireless/ath/ath12k/ahb.c:1082:\t\t ab-\u003ehw_params-\u003efw.dir, ATH12K_AHB_FW_PREFIX, ATH12K_AHB_RO_ID,\ndrivers/net/wireless/ath/ath12k/ahb.c:1083:\t\t ATH12K_AHB_FW_SUFFIX);\ndrivers/net/wireless/ath/ath12k/ahb.c-1084-\ndrivers/net/wireless/ath/ath12k/ahb.c:1085:\tpasid = u32_encode_bits(ATH12K_AHB_RO_ID, ATH12K_USERPD_ID_MASK) |\ndrivers/net/wireless/ath/ath12k/ahb.c:1086:\t\tATH12K_AHB_UPD_SWID;\ndrivers/net/wireless/ath/ath12k/ahb.c-1087-\n--\ndrivers/net/wireless/ath/ath12k/ahb.c=1154=static void ath12k_ahb_deconfigure_rproc(struct ath12k_base *ab)\n--\ndrivers/net/wireless/ath/ath12k/ahb.c-1171-\t\tif (g_rproc_info-\u003eshared_fw_loaded) {\ndrivers/net/wireless/ath/ath12k/ahb.c:1172:\t\t\tpasid = u32_encode_bits(ATH12K_AHB_RO_ID, ATH12K_USERPD_ID_MASK) |\ndrivers/net/wireless/ath/ath12k/ahb.c:1173:\t\t\t\tATH12K_AHB_UPD_SWID;\ndrivers/net/wireless/ath/ath12k/ahb.c-1174-\t\t\tret = qcom_pas_shutdown(pasid);\n--\ndrivers/net/wireless/ath/ath12k/ahb.c=1429=static void ath12k_ahb_remove_prepare(struct ath12k_base *ab)\n--\ndrivers/net/wireless/ath/ath12k/ahb.c-1434-\t\tleft = wait_for_completion_timeout(\u0026ab-\u003edriver_recovery,\ndrivers/net/wireless/ath/ath12k/ahb.c:1435:\t\t\t\t\t\t ATH12K_AHB_RECOVERY_TIMEOUT);\ndrivers/net/wireless/ath/ath12k/ahb.c-1436-\t\tif (!left)\n--\ndrivers/net/wireless/ath/ath12k/ahb.h-5- */\ndrivers/net/wireless/ath/ath12k/ahb.h:6:#ifndef ATH12K_AHB_H\ndrivers/net/wireless/ath/ath12k/ahb.h:7:#define ATH12K_AHB_H\ndrivers/net/wireless/ath/ath12k/ahb.h-8-\n--\ndrivers/net/wireless/ath/ath12k/ahb.h-13-\ndrivers/net/wireless/ath/ath12k/ahb.h:14:#define ATH12K_AHB_RECOVERY_TIMEOUT (3 * HZ)\ndrivers/net/wireless/ath/ath12k/ahb.h-15-\ndrivers/net/wireless/ath/ath12k/ahb.h:16:#define ATH12K_AHB_SMP2P_SMEM_MSG\t\tGENMASK(15, 0)\ndrivers/net/wireless/ath/ath12k/ahb.h:17:#define ATH12K_AHB_SMP2P_SMEM_SEQ_NO\t\tGENMASK(31, 16)\ndrivers/net/wireless/ath/ath12k/ahb.h:18:#define ATH12K_AHB_SMP2P_SMEM_VALUE_MASK\t0xFFFFFFFF\ndrivers/net/wireless/ath/ath12k/ahb.h-19-#define ATH12K_PCI_CE_WAKE_IRQ\t\t\t2\n--\ndrivers/net/wireless/ath/ath12k/ahb.h-22-#define ATH12K_RPROC_AFTER_POWERUP\t\tQCOM_SSR_AFTER_POWERUP\ndrivers/net/wireless/ath/ath12k/ahb.h:23:#define ATH12K_AHB_FW_PREFIX\t\t\t\"q6_fw\"\ndrivers/net/wireless/ath/ath12k/ahb.h:24:#define ATH12K_AHB_FW_SUFFIX\t\t\t\".mbn\"\ndrivers/net/wireless/ath/ath12k/ahb.h:25:#define ATH12K_AHB_FW2\t\t\t\t\"iu_fw.mbn\"\ndrivers/net/wireless/ath/ath12k/ahb.h:26:#define ATH12K_AHB_UPD_SWID\t\t\t0x12\ndrivers/net/wireless/ath/ath12k/ahb.h-27-#define ATH12K_USERPD_SPAWN_TIMEOUT\t\t(5 * HZ)\n--\ndrivers/net/wireless/ath/ath12k/ahb.h-33-/* Shared read-only firmware ID, mandated by MultiPD firmware architecture */\ndrivers/net/wireless/ath/ath12k/ahb.h:34:#define ATH12K_AHB_RO_ID\t\t\t4\ndrivers/net/wireless/ath/ath12k/ahb.h-35-\ndrivers/net/wireless/ath/ath12k/ahb.h=36=enum ath12k_ahb_userpd_id {\ndrivers/net/wireless/ath/ath12k/ahb.h:37:\tATH12K_AHB_USERPD_ID_0 = 1,\ndrivers/net/wireless/ath/ath12k/ahb.h:38:\tATH12K_AHB_USERPD_ID_1,\ndrivers/net/wireless/ath/ath12k/ahb.h:39:\tATH12K_AHB_USERPD_ID_2,\ndrivers/net/wireless/ath/ath12k/ahb.h-40-};\n--\ndrivers/net/wireless/ath/ath12k/ahb.h=55=enum ath12k_ahb_smp2p_msg_id {\ndrivers/net/wireless/ath/ath12k/ahb.h:56:\tATH12K_AHB_POWER_SAVE_ENTER = 1,\ndrivers/net/wireless/ath/ath12k/ahb.h:57:\tATH12K_AHB_POWER_SAVE_EXIT,\ndrivers/net/wireless/ath/ath12k/ahb.h-58-};\n--\ndrivers/net/wireless/ath/ath12k/wifi7/Makefile=3=ath12k_wifi7-y += core.o \\\n--\ndrivers/net/wireless/ath/ath12k/wifi7/Makefile-19-\ndrivers/net/wireless/ath/ath12k/wifi7/Makefile:20:ath12k_wifi7-$(CONFIG_ATH12K_AHB) += ahb.o\n--\ndrivers/net/wireless/ath/ath12k/wifi7/ahb.c=45=static int ath12k_wifi7_ahb_probe(struct platform_device *pdev)\n--\ndrivers/net/wireless/ath/ath12k/wifi7/ahb.c-61-\tab_ahb-\u003escm_auth_enabled = desc-\u003eauth_enabled;\ndrivers/net/wireless/ath/ath12k/wifi7/ahb.c:62:\tab_ahb-\u003euserpd_id = ATH12K_AHB_USERPD_ID_0;\ndrivers/net/wireless/ath/ath12k/wifi7/ahb.c-63-\tif (!ab_ahb-\u003euserpd_id)\n--\ndrivers/net/wireless/ath/ath12k/wifi7/ahb.h-5- */\ndrivers/net/wireless/ath/ath12k/wifi7/ahb.h:6:#ifndef ATH12K_AHB_WIFI7_H\ndrivers/net/wireless/ath/ath12k/wifi7/ahb.h:7:#define ATH12K_AHB_WIFI7_H\ndrivers/net/wireless/ath/ath12k/wifi7/ahb.h-8-\ndrivers/net/wireless/ath/ath12k/wifi7/ahb.h:9:#ifdef CONFIG_ATH12K_AHB\ndrivers/net/wireless/ath/ath12k/wifi7/ahb.h-10-int ath12k_wifi7_ahb_init(void);\n--\ndrivers/net/wireless/ath/ath12k/wifi7/ahb.h=18=static inline void ath12k_wifi7_ahb_exit(void) {}\ndrivers/net/wireless/ath/ath12k/wifi7/ahb.h-19-#endif\ndrivers/net/wireless/ath/ath12k/wifi7/ahb.h:20:#endif /* ATH12K_AHB_WIFI7_H */\n"
} |
| 25/2 | 2026/11/20 05:00 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 27034 output: 30 thoughts: 41 Thoughts: Okay, here's my interpretation of that thought process, tailored for an expert audience: **Diving into the IPA Driver** Alright, I need to get a handle on this IPA situation, and the starting point seems to be the core driver file, `drivers/net/ipa/ipa_main.c`. My mind immediately snaps to the acronym; IPA, right, it’s the Qualcomm IP Accelerator. This makes sense; it's a dedicated hardware block for network traffic. I should be able to get a solid overview from here. Now, I should double check to see if there is any general information in the Kconfig file by checking `drivers/net/ipa/Kconfig`. |
| 26/2 | 2026/11/20 05:00 | tool | grepper |
0mArgs:{
"Expression": "config QCOM_IPA",
"PathPrefixes": [
"drivers/net/"
]
}Results: {
"Output": "drivers/net/ipa/Kconfig:1:config QCOM_IPA\ndrivers/net/ipa/Kconfig-2-\ttristate \"Qualcomm IPA support\"\n"
} |
| 27/2 | 2026/11/20 05:00 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 27301 output: 34 thoughts: 14 Thoughts: Here's my take on those thoughts, tailored for an expert audience: **Diving into the IPA Kconfig** Alright, let's get down to brass tacks. My initial thought is to dive straight into the `drivers/net/ipa/Kconfig` file. I'm assuming, given the context, this is the configuration file for the IPA (Integrated Packet Accelerator) driver within the Linux kernel. That means this is where all the critical compile-time options for the IPA are defined and exposed to the user during the kernel configuration phase. I need to understand what's controllable here – what features are modular, what dependencies exist, and, frankly, what knobs I can tweak to optimize this thing for a specific target platform. I'm especially interested in things like the various hardware revisions, feature enables/disables, any specific clock frequency settings, and potentially memory allocation constraints defined via Kconfig. I want to see how granular the control is, and if the developers have exposed the right variables for my use case. Furthermore, I’ll be checking for any undocumented dependencies and interactions; it's always the subtleties that matter! This file will lay the groundwork for how this driver will behave during compilation and, by extension, at runtime. |
| 28/2 | 2026/11/20 05:00 | tool | read-file |
0mArgs:{
"File": "drivers/net/ipa/Kconfig",
"FirstLine": 1,
"LineCount": 25
}Results: {
"Contents": " 1:\tconfig QCOM_IPA\n 2:\t\ttristate \"Qualcomm IPA support\"\n 3:\t\tdepends on NET \u0026\u0026 QCOM_SMEM\n 4:\t\tdepends on ARCH_QCOM || COMPILE_TEST\n 5:\t\tdepends on INTERCONNECT\n 6:\t\tdepends on QCOM_RPROC_COMMON || (QCOM_RPROC_COMMON=n \u0026\u0026 COMPILE_TEST)\n 7:\t\tdepends on QCOM_AOSS_QMP || QCOM_AOSS_QMP=n\n 8:\t\tselect QCOM_MDT_LOADER\n 9:\t\tselect QCOM_PAS\n 10:\t\tselect QCOM_QMI_HELPERS\n 11:\t\thelp\n 12:\t\t Choose Y or M here to include support for the Qualcomm\n 13:\t\t IP Accelerator (IPA), a hardware block present in some\n 14:\t\t Qualcomm SoCs. The IPA is a programmable protocol processor\n 15:\t\t that is capable of generic hardware handling of IP packets,\n 16:\t\t including routing, filtering, and NAT. Currently the IPA\n 17:\t\t driver supports only basic transport of network traffic\n 18:\t\t between the AP and modem.\n 19:\t\n 20:\t\t Note that if selected, the selection type must match that\n 21:\t\t of QCOM_Q6V5_COMMON (Y or M).\n 22:\t\n 23:\t\t If unsure, say N.\n"
} |
| 29/2 | 2026/11/20 05:00 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 27972 output: 34 thoughts: 34 Thoughts: Here's my summary, as if I were thinking these thoughts: **Analyzing the Remoteproc Driver** Okay, time to dive into this. First, I need to take a look at the actual driver code, specifically the `drivers/remoteproc/qcom_wcnss.c` file. That's the core implementation I need to understand. I know I'll probably find the key functionality and any specific hardware interactions there. Then, just to be thorough and grasp the bigger picture, I should also check the `drivers/remoteproc/Kconfig` file. That will give me the configuration options and dependencies associated with this particular remote processor driver. It will show me how it's enabled and any prerequisites it might have. This approach allows me to start with the specific driver and its implementation details, and then move to the bigger picture by looking at the configuration options. |
| 30/2 | 2026/11/20 05:01 | tool | grepper |
0mArgs:{
"Expression": "QCOM_WCNSS",
"PathPrefixes": [
"drivers/remoteproc/"
]
}Results: {
"Output": "drivers/remoteproc/Kconfig=269=config QCOM_SYSMON\n--\ndrivers/remoteproc/Kconfig-283-\ndrivers/remoteproc/Kconfig:284:config QCOM_WCNSS_PIL\ndrivers/remoteproc/Kconfig-285-\ttristate \"Qualcomm WCNSS Peripheral Image Loader\"\n--\ndrivers/remoteproc/Makefile=32=obj-$(CONFIG_QCOM_SYSMON)\t\t+= qcom_sysmon.o\ndrivers/remoteproc/Makefile:33:obj-$(CONFIG_QCOM_WCNSS_PIL)\t\t+= qcom_wcnss_pil.o\ndrivers/remoteproc/Makefile-34-qcom_wcnss_pil-y\t\t\t+= qcom_wcnss.o\n"
} |
| 31/2 | 2026/11/20 05:01 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 28441 output: 37 thoughts: 22 Thoughts: Here's a summary of my thought process, as requested: **Diving into the Remoteproc Configuration** Okay, let's get down to brass tacks. I'm going to dig into the `drivers/remoteproc/Kconfig` file, specifically focusing around line 284. I have a feeling there's something specific in that area that needs my attention right now, a particular option or dependency that's piquing my curiosity. I'm expecting to find a core configuration setting or conditional block related to remoteproc, perhaps something defining a feature or setting up a particular driver option. I'll need to absorb the surrounding context quickly to fully understand what I'm looking at in that specific line. |
| 32/2 | 2026/11/20 05:01 | tool | read-file |
0mArgs:{
"File": "drivers/remoteproc/Kconfig",
"FirstLine": 280,
"LineCount": 25
}Results: {
"Contents": " 280:\t\n 281:\t\t Say y here if your system runs firmware on any other subsystems, e.g.\n 282:\t\t modem or DSP.\n 283:\t\n 284:\tconfig QCOM_WCNSS_PIL\n 285:\t\ttristate \"Qualcomm WCNSS Peripheral Image Loader\"\n 286:\t\tdepends on OF \u0026\u0026 ARCH_QCOM\n 287:\t\tdepends on RPMSG_QCOM_SMD || RPMSG_QCOM_SMD=n\n 288:\t\tdepends on RPMSG_QCOM_GLINK_SMEM || RPMSG_QCOM_GLINK_SMEM=n\n 289:\t\tdepends on QCOM_SMEM\n 290:\t\tdepends on QCOM_SYSMON || QCOM_SYSMON=n\n 291:\t\tdepends on RPMSG_QCOM_GLINK || RPMSG_QCOM_GLINK=n\n 292:\t\tselect QCOM_MDT_LOADER\n 293:\t\tselect QCOM_PIL_INFO\n 294:\t\tselect QCOM_RPROC_COMMON\n 295:\t\tselect QCOM_PAS\n 296:\t\thelp\n 297:\t\t Say y here to support the Peripheral Image Loader for loading WCNSS\n 298:\t\t firmware and boot the core on e.g. MSM8974, MSM8916. The firmware is\n 299:\t\t verified and booted with the help of the Peripheral Authentication\n 300:\t\t System (PAS) in TrustZone.\n 301:\t\n 302:\tconfig RCAR_REMOTEPROC\n 303:\t\ttristate \"Renesas R-Car Gen3 remoteproc support\"\n 304:\t\tdepends on ARCH_RENESAS || COMPILE_TEST\n"
} |
| 33/2 | 2026/11/20 05:01 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 29120 output: 19 thoughts: 1165 Thoughts: **Analyzing Qualcomm Driver Reachability on amd64** Okay, so I'm looking at this `QCOM_WCNSS_PIL` config option. It's dependent on `OF` and `ARCH_QCOM`. Given the context, I immediately start thinking about whether any of these Qualcomm-specific drivers could *possibly* be instantiated or even probed on an amd64 architecture. The target is explicitly amd64, so that's the crucial question. I remember section 2 of the instructions, mentioning structurally unreachable hardware. Things like vendor-specific PCIe switches, SmartNICs, or GPU drivers are clearly out because QEMU, in a standard setup, doesn't emulate the ASICs or PCIe cards needed. Driver teardown callbacks during physical hot-unplug is out too. Execution paths tied to non-target architectures are also a no-go. Now, the real question pops up: Are *any* of these Qualcomm SoC drivers even *remotely* reachable on amd64 when using QEMU? I have to consider the underlying hardware and the nature of these drivers. What exactly are Qualcomm PAS, MDT loader, and SCM? A quick refresh reminds me that Qualcomm PAS is a firmware verification interface for their ARM/ARM64 SoCs, heavily tied to TrustZone (SCM) or TEE. That's a huge red flag: these don't exist on amd64! We're talking about proprietary hardware, not standard PC hardware. No Qualcomm Snapdragon SoCs run amd64, and the standard QEMU setup emulates the typical PC setup. Could any of these be USB or PCI devices? Let's check. I go through the drivers: `qcom_pas.c` is PAS library, `qcom_pas_tee.c` is for TEE bus, `qcom_scm.c` is platform specific, `adreno_gpu.c` is for Adreno GPU and has an early check for `CONFIG_ARCH_QCOM`, `iris_firmware.c` and `venus/firmware.c` are V4L2 drivers, `ipa_main.c` is for an IP accelerator, `ath12k/ahb.c` is an Atheros wireless driver, `qcom_wcnss.c` is the WCNSS remoteproc driver, and `mdt_loader.c` is the MDT loader. Most of these are platform drivers that match DT compatibles or use the OF framework. The SCM driver won't work on amd64 because there is no Qualcomm SCM device in ACPI/DT, and `arm_smccc_smc` is ARM-only. The Adreno GPU driver explicitly fails if not built for a Qualcomm architecture. The rest are likely platform drivers using reserved memory, clocks, power domains, etc. That means they all rely on device tree nodes and that stuff doesn't exist on amd64. Even if some dummy platform device was created in userspace, none of these would match ACPI, nor can they probe without DT nodes. Their hardware simply isn't in QEMU or on amd64. The architecture is explicit: `amd64`. The code paths involved are `qcom_pas_context_init`, `devm_qcom_pas_context_alloc` and the removal of `qcom_pas_auth_and_reset`, `__qcom_scm_pas_auth_and_reset`, functions associated with loading firmware like `zap_shader_load_mdt`, `iris_load_fw_to_memory`, `venus_load_fw`, `ipa_firmware_load` and WCNSS, and the MDT loader. All of these points to Qualcomm specific code. Just to be absolutely sure, I'll quickly check if any of the `qcom_mdt_*` or `qcom_pas_*` functions are called outside of Qualcomm drivers with a quick grep. This confirms what I already know: None of this is reachable. |
| 34/2 | 2026/11/20 05:01 | tool | grepper |
0mArgs:{
"Expression": "qcom_pas_"
}Results: {
"Output": "\nFull output is too long, showing 200 out of 1171 lines.\nUse more precise expression or PathPrefixes if possible.\n\nNumber of matching lines per file (20 files in total):\nMAINTAINERS:1\ndrivers/firmware/qcom/Makefile:1\ndrivers/firmware/qcom/qcom_pas.c:46\ndrivers/firmware/qcom/qcom_pas.h:8\ndrivers/firmware/qcom/qcom_pas_tee.c:44\ndrivers/firmware/qcom/qcom_scm.c:9\ndrivers/gpu/drm/msm/adreno/a5xx_gpu.c:1\ndrivers/gpu/drm/msm/adreno/adreno_gpu.c:4\ndrivers/media/platform/qcom/iris/iris_core.h:1\ndrivers/media/platform/qcom/iris/iris_firmware.c:5\ndrivers/media/platform/qcom/venus/core.h:1\ndrivers/media/platform/qcom/venus/firmware.c:6\ndrivers/net/ipa/ipa_main.c:4\ndrivers/net/wireless/ath/ath12k/ahb.c:8\ndrivers/remoteproc/qcom_q6v5_mss.c:2\ndrivers/remoteproc/qcom_q6v5_pas.c:159\ndrivers/remoteproc/qcom_wcnss.c:7\ndrivers/soc/qcom/mdt_loader.c:6\ninclude/linux/firmware/qcom/qcom_pas.h:14\ninclude/linux/soc/qcom/mdt_loader.h:3\n\nMAINTAINERS=23234=F:\tdrivers/firmware/qcom/qcom_pas.h\nMAINTAINERS:23235:F:\tdrivers/firmware/qcom/qcom_pas_tee.c\nMAINTAINERS-23236-F:\tinclude/linux/firmware/qcom/qcom_pas.h\n--\ndrivers/firmware/qcom/Makefile=12=obj-$(CONFIG_QCOM_PAS)\t\t+= qcom_pas.o\ndrivers/firmware/qcom/Makefile:13:obj-$(CONFIG_QCOM_PAS_TEE)\t+= qcom_pas_tee.o\n--\ndrivers/firmware/qcom/qcom_pas.c-14-\ndrivers/firmware/qcom/qcom_pas.c:15:static struct qcom_pas_ops *ops_ptr;\ndrivers/firmware/qcom/qcom_pas.c-16-\ndrivers/firmware/qcom/qcom_pas.c-17-/**\ndrivers/firmware/qcom/qcom_pas.c:18: * qcom_pas_context_init() - Initialize a peripheral authentication service\ndrivers/firmware/qcom/qcom_pas.c-19- *\t\t\t context for a given peripheral\n--\ndrivers/firmware/qcom/qcom_pas.c-26- */\ndrivers/firmware/qcom/qcom_pas.c:27:void qcom_pas_context_init(struct qcom_pas_context *ctx, struct device *dev,\ndrivers/firmware/qcom/qcom_pas.c-28-\t\t\t u32 pas_id, phys_addr_t mem_phys, size_t mem_size)\n--\ndrivers/firmware/qcom/qcom_pas.c-35-}\ndrivers/firmware/qcom/qcom_pas.c:36:EXPORT_SYMBOL_GPL(qcom_pas_context_init);\ndrivers/firmware/qcom/qcom_pas.c-37-\ndrivers/firmware/qcom/qcom_pas.c-38-/**\ndrivers/firmware/qcom/qcom_pas.c:39: * devm_qcom_pas_context_alloc() - Allocate peripheral authentication service\ndrivers/firmware/qcom/qcom_pas.c-40- *\t\t\t\t context for a given peripheral\n--\ndrivers/firmware/qcom/qcom_pas.c-51- */\ndrivers/firmware/qcom/qcom_pas.c:52:struct qcom_pas_context *devm_qcom_pas_context_alloc(struct device *dev,\ndrivers/firmware/qcom/qcom_pas.c-53-\t\t\t\t\t\t u32 pas_id,\n--\ndrivers/firmware/qcom/qcom_pas.c-56-{\ndrivers/firmware/qcom/qcom_pas.c:57:\tstruct qcom_pas_context *ctx;\ndrivers/firmware/qcom/qcom_pas.c-58-\n--\ndrivers/firmware/qcom/qcom_pas.c-62-\ndrivers/firmware/qcom/qcom_pas.c:63:\tqcom_pas_context_init(ctx, dev, pas_id, mem_phys, mem_size);\ndrivers/firmware/qcom/qcom_pas.c-64-\n--\ndrivers/firmware/qcom/qcom_pas.c-66-}\ndrivers/firmware/qcom/qcom_pas.c:67:EXPORT_SYMBOL_GPL(devm_qcom_pas_context_alloc);\ndrivers/firmware/qcom/qcom_pas.c-68-\ndrivers/firmware/qcom/qcom_pas.c-69-/**\ndrivers/firmware/qcom/qcom_pas.c:70: * qcom_pas_init_image() - Initialize peripheral authentication service state\ndrivers/firmware/qcom/qcom_pas.c-71- *\t\t\t machine for a given peripheral, using the metadata\n--\ndrivers/firmware/qcom/qcom_pas.c-82- * track the metadata allocation, this needs to be released by invoking\ndrivers/firmware/qcom/qcom_pas.c:83: * qcom_pas_metadata_release() by the caller.\ndrivers/firmware/qcom/qcom_pas.c-84- */\ndrivers/firmware/qcom/qcom_pas.c:85:int qcom_pas_init_image(u32 pas_id, const void *metadata, size_t size,\ndrivers/firmware/qcom/qcom_pas.c:86:\t\t\tstruct qcom_pas_context *ctx)\ndrivers/firmware/qcom/qcom_pas.c-87-{\n--\ndrivers/firmware/qcom/qcom_pas.c-92-}\ndrivers/firmware/qcom/qcom_pas.c:93:EXPORT_SYMBOL_GPL(qcom_pas_init_image);\ndrivers/firmware/qcom/qcom_pas.c-94-\ndrivers/firmware/qcom/qcom_pas.c-95-/**\ndrivers/firmware/qcom/qcom_pas.c:96: * qcom_pas_metadata_release() - release metadata context\ndrivers/firmware/qcom/qcom_pas.c-97- * @ctx:\tpas context\ndrivers/firmware/qcom/qcom_pas.c-98- */\ndrivers/firmware/qcom/qcom_pas.c:99:void qcom_pas_metadata_release(struct qcom_pas_context *ctx)\ndrivers/firmware/qcom/qcom_pas.c-100-{\n--\ndrivers/firmware/qcom/qcom_pas.c-105-}\ndrivers/firmware/qcom/qcom_pas.c:106:EXPORT_SYMBOL_GPL(qcom_pas_metadata_release);\ndrivers/firmware/qcom/qcom_pas.c-107-\ndrivers/firmware/qcom/qcom_pas.c-108-/**\ndrivers/firmware/qcom/qcom_pas.c:109: * qcom_pas_mem_setup() - Prepare the memory related to a given peripheral\ndrivers/firmware/qcom/qcom_pas.c-110- *\t\t\t for firmware loading\n--\ndrivers/firmware/qcom/qcom_pas.c-116- */\ndrivers/firmware/qcom/qcom_pas.c:117:int qcom_pas_mem_setup(u32 pas_id, phys_addr_t addr, phys_addr_t size)\ndrivers/firmware/qcom/qcom_pas.c-118-{\n--\ndrivers/firmware/qcom/qcom_pas.c-123-}\ndrivers/firmware/qcom/qcom_pas.c:124:EXPORT_SYMBOL_GPL(qcom_pas_mem_setup);\ndrivers/firmware/qcom/qcom_pas.c-125-\ndrivers/firmware/qcom/qcom_pas.c-126-/**\ndrivers/firmware/qcom/qcom_pas.c:127: * qcom_pas_get_rsc_table() - Retrieve the resource table in passed output buffer\ndrivers/firmware/qcom/qcom_pas.c-128- *\t\t\t for a given peripheral.\n--\ndrivers/firmware/qcom/qcom_pas.c-165- */\ndrivers/firmware/qcom/qcom_pas.c:166:struct resource_table *qcom_pas_get_rsc_table(struct qcom_pas_context *ctx,\ndrivers/firmware/qcom/qcom_pas.c-167-\t\t\t\t\t void *input_rt,\n--\ndrivers/firmware/qcom/qcom_pas.c-178-}\ndrivers/firmware/qcom/qcom_pas.c:179:EXPORT_SYMBOL_GPL(qcom_pas_get_rsc_table);\ndrivers/firmware/qcom/qcom_pas.c-180-\ndrivers/firmware/qcom/qcom_pas.c-181-/**\ndrivers/firmware/qcom/qcom_pas.c:182: * qcom_pas_prepare_and_auth_reset() - Prepare, authenticate, and reset the\ndrivers/firmware/qcom/qcom_pas.c-183- *\t\t\t\t remote processor\ndrivers/firmware/qcom/qcom_pas.c-184- *\ndrivers/firmware/qcom/qcom_pas.c:185: * @ctx:\tContext saved during call to devm_qcom_pas_context_alloc()\ndrivers/firmware/qcom/qcom_pas.c-186- *\n--\ndrivers/firmware/qcom/qcom_pas.c-199- */\ndrivers/firmware/qcom/qcom_pas.c:200:int qcom_pas_prepare_and_auth_reset(struct qcom_pas_context *ctx)\ndrivers/firmware/qcom/qcom_pas.c-201-{\n--\ndrivers/firmware/qcom/qcom_pas.c-208-}\ndrivers/firmware/qcom/qcom_pas.c:209:EXPORT_SYMBOL_GPL(qcom_pas_prepare_and_auth_reset);\ndrivers/firmware/qcom/qcom_pas.c-210-\ndrivers/firmware/qcom/qcom_pas.c-211-/**\ndrivers/firmware/qcom/qcom_pas.c:212: * qcom_pas_set_remote_state() - Set the remote processor state\ndrivers/firmware/qcom/qcom_pas.c-213- * @state:\tperipheral state\n--\ndrivers/firmware/qcom/qcom_pas.c-217- */\ndrivers/firmware/qcom/qcom_pas.c:218:int qcom_pas_set_remote_state(u32 state, u32 pas_id)\ndrivers/firmware/qcom/qcom_pas.c-219-{\n--\ndrivers/firmware/qcom/qcom_pas.c-224-}\ndrivers/firmware/qcom/qcom_pas.c:225:EXPORT_SYMBOL_GPL(qcom_pas_set_remote_state);\ndrivers/firmware/qcom/qcom_pas.c-226-\ndrivers/firmware/qcom/qcom_pas.c-227-/**\ndrivers/firmware/qcom/qcom_pas.c:228: * qcom_pas_shutdown() - Shut down the remote processor\ndrivers/firmware/qcom/qcom_pas.c-229- * @pas_id:\tperipheral authentication service id\n--\ndrivers/firmware/qcom/qcom_pas.c-232- */\ndrivers/firmware/qcom/qcom_pas.c:233:int qcom_pas_shutdown(u32 pas_id)\ndrivers/firmware/qcom/qcom_pas.c-234-{\n--\ndrivers/firmware/qcom/qcom_pas.c-239-}\ndrivers/firmware/qcom/qcom_pas.c:240:EXPORT_SYMBOL_GPL(qcom_pas_shutdown);\ndrivers/firmware/qcom/qcom_pas.c-241-\ndrivers/firmware/qcom/qcom_pas.c-242-/**\ndrivers/firmware/qcom/qcom_pas.c:243: * qcom_pas_supported() - Check if the peripheral authentication service is\ndrivers/firmware/qcom/qcom_pas.c-244- *\t\t\t supported for the given peripheral\n--\ndrivers/firmware/qcom/qcom_pas.c-248- */\ndrivers/firmware/qcom/qcom_pas.c:249:bool qcom_pas_supported(u32 pas_id)\ndrivers/firmware/qcom/qcom_pas.c-250-{\n--\ndrivers/firmware/qcom/qcom_pas.c-255-}\ndrivers/firmware/qcom/qcom_pas.c:256:EXPORT_SYMBOL_GPL(qcom_pas_supported);\ndrivers/firmware/qcom/qcom_pas.c-257-\ndrivers/firmware/qcom/qcom_pas.c-258-/**\ndrivers/firmware/qcom/qcom_pas.c:259: * qcom_pas_is_available() - Check if the peripheral authentication service is\ndrivers/firmware/qcom/qcom_pas.c-260- *\t\t\t available. Note that it is mandatory for any PAS\n--\ndrivers/firmware/qcom/qcom_pas.c-265- */\ndrivers/firmware/qcom/qcom_pas.c:266:bool qcom_pas_is_available(void)\ndrivers/firmware/qcom/qcom_pas.c-267-{\n--\ndrivers/firmware/qcom/qcom_pas.c-278-}\ndrivers/firmware/qcom/qcom_pas.c:279:EXPORT_SYMBOL_GPL(qcom_pas_is_available);\ndrivers/firmware/qcom/qcom_pas.c-280-\ndrivers/firmware/qcom/qcom_pas.c:281:void qcom_pas_ops_register(struct qcom_pas_ops *ops)\ndrivers/firmware/qcom/qcom_pas.c-282-{\ndrivers/firmware/qcom/qcom_pas.c:283:\tif (!qcom_pas_is_available())\ndrivers/firmware/qcom/qcom_pas.c:284:\t\t/* Paired with smp_load_acquire() in qcom_pas_is_available() */\ndrivers/firmware/qcom/qcom_pas.c-285-\t\tsmp_store_release(\u0026ops_ptr, ops);\n--\ndrivers/firmware/qcom/qcom_pas.c-289-}\ndrivers/firmware/qcom/qcom_pas.c:290:EXPORT_SYMBOL_GPL(qcom_pas_ops_register);\ndrivers/firmware/qcom/qcom_pas.c-291-\ndrivers/firmware/qcom/qcom_pas.c:292:void qcom_pas_ops_unregister(void)\ndrivers/firmware/qcom/qcom_pas.c-293-{\ndrivers/firmware/qcom/qcom_pas.c:294:\t/* Paired with smp_load_acquire() in qcom_pas_is_available() */\ndrivers/firmware/qcom/qcom_pas.c-295-\tsmp_store_release(\u0026ops_ptr, NULL);\ndrivers/firmware/qcom/qcom_pas.c-296-}\ndrivers/firmware/qcom/qcom_pas.c:297:EXPORT_SYMBOL_GPL(qcom_pas_ops_unregister);\ndrivers/firmware/qcom/qcom_pas.c-298-\n--\ndrivers/firmware/qcom/qcom_pas.h=9=struct device;\n--\ndrivers/firmware/qcom/qcom_pas.h-11-/**\ndrivers/firmware/qcom/qcom_pas.h:12: * struct qcom_pas_ops - Qcom Peripheral Authentication Service (PAS) ops\ndrivers/firmware/qcom/qcom_pas.h-13- * @drv_name:\t\t\tPAS driver name.\n--\ndrivers/firmware/qcom/qcom_pas.h-24- */\ndrivers/firmware/qcom/qcom_pas.h:25:struct qcom_pas_ops {\ndrivers/firmware/qcom/qcom_pas.h-26-\tconst char *drv_name;\n--\ndrivers/firmware/qcom/qcom_pas.h-29-\tint (*init_image)(struct device *dev, u32 pas_id, const void *metadata,\ndrivers/firmware/qcom/qcom_pas.h:30:\t\t\t size_t size, struct qcom_pas_context *ctx);\ndrivers/firmware/qcom/qcom_pas.h-31-\tint (*mem_setup)(struct device *dev, u32 pas_id, phys_addr_t addr,\ndrivers/firmware/qcom/qcom_pas.h-32-\t\t\t phys_addr_t size);\ndrivers/firmware/qcom/qcom_pas.h:33:\tvoid *(*get_rsc_table)(struct device *dev, struct qcom_pas_context *ctx,\ndrivers/firmware/qcom/qcom_pas.h-34-\t\t\t void *input_rt, size_t input_rt_size,\n--\ndrivers/firmware/qcom/qcom_pas.h-36-\tint (*prepare_and_auth_reset)(struct device *dev,\ndrivers/firmware/qcom/qcom_pas.h:37:\t\t\t\t struct qcom_pas_context *ctx);\ndrivers/firmware/qcom/qcom_pas.h-38-\tint (*set_remote_state)(struct device *dev, u32 state, u32 pas_id);\n--\ndrivers/firmware/qcom/qcom_pas.h-40-\tvoid (*metadata_release)(struct device *dev,\ndrivers/firmware/qcom/qcom_pas.h:41:\t\t\t\t struct qcom_pas_context *ctx);\ndrivers/firmware/qcom/qcom_pas.h-42-};\ndrivers/firmware/qcom/qcom_pas.h-43-\ndrivers/firmware/qcom/qcom_pas.h:44:void qcom_pas_ops_register(struct qcom_pas_ops *ops);\ndrivers/firmware/qcom/qcom_pas.h:45:void qcom_pas_ops_unregister(void);\ndrivers/firmware/qcom/qcom_pas.h-46-\n--\ndrivers/firmware/qcom/qcom_pas_tee.c-86-/**\ndrivers/firmware/qcom/qcom_pas_tee.c:87: * struct qcom_pas_tee_private - PAS service private data\ndrivers/firmware/qcom/qcom_pas_tee.c-88- * @dev:\t\tPAS service device.\n--\ndrivers/firmware/qcom/qcom_pas_tee.c-91- */\ndrivers/firmware/qcom/qcom_pas_tee.c:92:struct qcom_pas_tee_private {\ndrivers/firmware/qcom/qcom_pas_tee.c-93-\tstruct device *dev;\n--\ndrivers/firmware/qcom/qcom_pas_tee.c-97-\ndrivers/firmware/qcom/qcom_pas_tee.c:98:static bool qcom_pas_tee_supported(struct device *dev, u32 pas_id)\n\n"
} |
| 35/2 | 2026/11/20 05:01 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 36338 output: 140 thoughts: 1150 Thoughts: **Analysis of the Qualcomm PAS/MDT Refactoring and its Relevance to amd64 Fuzzing** Okay, let's break this down. My initial assessment is that this patch series is a refactoring within the Qualcomm PAS and MDT loader subsystems. Specifically, we're seeing a shift from direct `qcom_pas_auth_and_reset(pas_id)` calls to a context-based approach with `qcom_pas_prepare_and_auth_reset(&ctx)`. The `qcom_mdt_pas_load` function is now handling its internal memory mappings differently, and some unused functions have been removed, which is good housekeeping. Now, the important part: where is this code *used*? It looks like this refactoring impacts several Qualcomm-specific drivers: the Adreno GPU, Iris video decoder, Venus video encoder/decoder, the IPA accelerator, ath12k Wi-Fi on AHB, WCNSS remoteproc, SCM (Secure Channel Manager), and the PAS TEE interface, along with core PAS and MDT loader code. Crucially, all of these are tied to Qualcomm Snapdragon SoCs and ARM-based firmware interfaces. The question then is, is any of this code reachable on an `amd64` architecture? Considering that the fuzzing target is `amd64`, the answer seems clear: No. First, this is not an x86 architecture. Second, everything is Qualcomm and ARM specific. Standard virtualization environments like QEMU, even if running amd64, emulate x86 PC hardware - things like ACPI, Intel/AMD CPUs, PCI/PCIe, USB, virtio – none of which is relevant here. We don't have Qualcomm SoCs, TrustZone interfaces, or AHB buses in these environments. Specifically, the code contains explicit checks and dependencies that are always false on amd64. `adreno_gpu.c` has a check for `!IS_ENABLED(CONFIG_ARCH_QCOM)`, which we know is only defined for ARM and ARM64 architectures. The SCM requires ARM SMC calls and Qualcomm TrustZone firmware, which are not present on x86/amd64. The ath12k AHB driver runs on ARM. The WCNSS code also depends on `ARCH_QCOM`. The Iris and Venus drivers deal with Qualcomm multimedia hardware. All these depend on hardware or firmware that is unreachable. Now let's apply the rule-set: We're looking for whether it's worth fuzzing on amd64. The criteria say "Return WorthFuzzing=false ONLY IF all modified code falls strictly into one or more of these categories..." and then lists, among others: * "Structurally unreachable hardware: Vendor-specific... GPU drivers... requiring physical ASIC/PCIe cards not emulated in standard QEMU" * "Unreachable execution paths... Code paths exclusive to architectures other than the target architecture." This code *absolutely* falls under both of those. It's Qualcomm-specific hardware and ARM architecture code which are not emulated on x86/amd64, and is unreachable on amd64 systems. Therefore, `WorthFuzzing` is `false`. There are no specific symbols of interest for amd64 fuzzing, so `FocusSymbols` is an empty list `[]`. There are no configuration options that need to be enabled on amd64 for this, so `EnableConfigs` is `[]`. The reasoning is that the modified code pertains exclusively to Qualcomm ARM/ARM64 SoCs, requiring hardware and firmware (TrustZone/SCM/TEE) that does not exist or are not emulated on amd64, thus making it unreachable. I've carefully verified that everything aligns with the instructions and the logic. I am ready to `set-results`. |
| 36/2 | 2026/11/20 05:02 | tool | set-results |
0mArgs:{
"EnableConfigs": [],
"FocusSymbols": [],
"Reasoning": "The patch series refactors Qualcomm-specific Peripheral Authentication Service (PAS) and MDT loader interfaces across Qualcomm SoC drivers (Qualcomm SCM, Adreno GPU, Iris, Venus, IPA, ath12k AHB, WCNSS). These drivers and firmware interfaces are exclusive to Qualcomm ARM/ARM64 platforms and rely on ARM SMC / TrustZone / device tree bindings for physical Qualcomm Snapdragon SoCs. They are structurally unreachable on the amd64 target architecture in standard virtualized QEMU/GCE fuzzing environments.",
"WorthFuzzing": false
}Results: {
"EnableConfigs": null,
"FocusSymbols": [],
"Reasoning": "The patch series refactors Qualcomm-specific Peripheral Authentication Service (PAS) and MDT loader interfaces across Qualcomm SoC drivers (Qualcomm SCM, Adreno GPU, Iris, Venus, IPA, ath12k AHB, WCNSS). These drivers and firmware interfaces are exclusive to Qualcomm ARM/ARM64 platforms and rely on ARM SMC / TrustZone / device tree bindings for physical Qualcomm Snapdragon SoCs. They are structurally unreachable on the amd64 target architecture in standard virtualized QEMU/GCE fuzzing environments.",
"WorthFuzzing": false
} |
| 37/1 | 2026/11/20 05:02 | action | If |
0mArgs:{
"WorthFuzzing": false
}Results: null |
| Total Calls | Total Tokens | Avg Tokens | Total Duration (Seconds) | Avg Duration (Seconds) |
|---|
| Total Calls | Total Duration (Seconds) | Avg Duration (Seconds) |
|---|