drivers/firmware/qcom/qcom_scm.c | 360 ++++++++++++++++-- drivers/firmware/qcom/qcom_scm.h | 1 + drivers/media/platform/qcom/iris/iris_core.c | 9 +- drivers/media/platform/qcom/iris/iris_core.h | 6 + .../media/platform/qcom/iris/iris_firmware.c | 156 +++++++- .../media/platform/qcom/iris/iris_firmware.h | 2 + drivers/remoteproc/qcom_q6v5_pas.c | 147 +++++-- drivers/soc/qcom/mdt_loader.c | 199 +++++++++- include/linux/firmware/qcom/qcom_scm.h | 27 +- include/linux/remoteproc.h | 269 +------------ include/linux/rsc_table.h | 306 +++++++++++++++ include/linux/soc/qcom/mdt_loader.h | 41 +- 12 files changed, 1144 insertions(+), 379 deletions(-) create mode 100644 include/linux/rsc_table.h
This is a further continuation with a new approach to the topic discussed in [1] regarding the enablement of Secure Peripheral Image Loader support on Qualcomm SoCs when Linux runs at EL2. A few months ago, we also discussed the challenges at Linaro Connect 2025 [2] related to enabling remoteproc when Linux is running at EL2. [1] https://lore.kernel.org/lkml/20241004212359.2263502-1-quic_mojha@quicinc.com/ [2] https://resources.linaro.org/en/resource/sF8jXifdb9V1mUefdbfafa Below, is the summary of the discussion. Qualcomm is working to enable remote processors on the SA8775p SoC with a Linux host running at EL2. In doing so, it has encountered several challenges related to how the remoteproc framework is handled when Linux runs at EL1. One of the main challenges arises from differences in how IOMMU translation is currently managed on SoCs running the Qualcomm EL2 hypervisor (QHEE), where IOMMU translation for any device is entirely owned by the hypervisor. Additionally, the firmware for remote processors does not contain a resource table, which would typically include the necessary IOMMU configuration settings. Qualcomm SoCs running with QHEE (EL2) have been utilizing the Peripheral Authentication Service (PAS) from TrustZone (TZ) firmware to securely authenticate and reset remote processors via a single SMC call, _auth_and_reset_. This call is first trapped by QHEE, which then invokes TZ for authentication. Once authentication is complete, the call returns to QHEE, which sets up the IOMMU translation scheme for the remote processors and subsequently brings them out of reset. The design of the Qualcomm EL2 hypervisor dictates that the Linux host OS running at EL1 is not permitted to configure IOMMU translation for remote processors, and only a single-stage translation is configured. To make the remote processor bring-up (PAS) sequence hypervisor-independent, the auth_and_reset SMC call is now handled entirely by TZ. However, the issue of IOMMU configuration remains unresolved, for example a scenario, when KVM host at EL2 has no knowledge of the remote processors’ IOMMU settings. This is being addressed by overlaying the IOMMU properties when the SoC runs a Linux host at EL2. SMC call is being provided from the TrustZone firmware to retrieve the resource table for a given subsystem. There are also remote processors—such as those for video, camera, and graphics—that do not use the remoteproc framework to manage their lifecycle. Instead, they rely on the Qualcomm PAS service to authenticate their firmware. These processors also need to be brought out of reset when Linux is running at EL2. The client drivers for these processors use the MDT loader function to load and authenticate firmware. Similar to the Qualcomm remoteproc PAS driver, they also need to retrieve the resource table, create a shared memory bridge (shmbridge), and map the resources before bringing the processors out of reset. This series has dependency on below patch for creating SHMbridge over carveout memory. https://lore.kernel.org/lkml/20250812-qcom-tee-using-tee-ss-without-mem-obj-v7-7-ce7a1a774803@oss.qualcomm.com/ Series is tested on SA8775p which is now called Lemans IOT platform and the series does not addresses DMA problem discussed at [2] which is future scope of the series. Changes in v2: https://lore.kernel.org/lkml/20241004212359.2263502-1-quic_mojha@quicinc.com/ - A lot has changed from the V1 and a fresh look would be preferred. - Removed approach where device tree contain devmem resources in remoteproc node. - SHMbridge need to created for both carveout and metadata memory shared to TZ in a new way. - Now, resource table would be given by SMC call which need to mapped along with carveout before triggering _auth_and_reset_. - IOMMU properties need to be added to firmware devices tree node when Linux control IOMMU. Mukesh Ojha (11): firmware: qcom_scm: Introduce PAS context initialization helper soc: qcom: mdtloader: Add context aware qcom_mdt_pas_load() helper firmware: qcom_scm: Add a prep version of auth_and_reset function firmware: qcom_scm: Simplify qcom_scm_pas_init_image() firmware: qcom_scm: Add shmbridge support to pas_init/release function remoteproc: Move resource table data structure to its own header firmware: qcom_scm: Add qcom_scm_pas_get_rsc_table() to get resource table soc: qcom: mdt_loader: Add helper functions to map and unmap resources remoteproc: pas: Extend parse_fw callback to parse resource table remoteproc: qcom: pas: Enable Secure PAS support with IOMMU managed by Linux media: iris: Enable Secure PAS support with IOMMU managed by Linux drivers/firmware/qcom/qcom_scm.c | 360 ++++++++++++++++-- drivers/firmware/qcom/qcom_scm.h | 1 + drivers/media/platform/qcom/iris/iris_core.c | 9 +- drivers/media/platform/qcom/iris/iris_core.h | 6 + .../media/platform/qcom/iris/iris_firmware.c | 156 +++++++- .../media/platform/qcom/iris/iris_firmware.h | 2 + drivers/remoteproc/qcom_q6v5_pas.c | 147 +++++-- drivers/soc/qcom/mdt_loader.c | 199 +++++++++- include/linux/firmware/qcom/qcom_scm.h | 27 +- include/linux/remoteproc.h | 269 +------------ include/linux/rsc_table.h | 306 +++++++++++++++ include/linux/soc/qcom/mdt_loader.h | 41 +- 12 files changed, 1144 insertions(+), 379 deletions(-) create mode 100644 include/linux/rsc_table.h -- 2.50.1
On 19/08/2025 17:54, Mukesh Ojha wrote: > This is a further continuation with a new approach to the topic > discussed in [1] regarding the enablement of Secure Peripheral Image > Loader support on Qualcomm SoCs when Linux runs at EL2. > > A few months ago, we also discussed the challenges at Linaro Connect > 2025 [2] related to enabling remoteproc when Linux is running at EL2. > > [1] > https://lore.kernel.org/lkml/20241004212359.2263502-1-quic_mojha@quicinc.com/ > > [2] > https://resources.linaro.org/en/resource/sF8jXifdb9V1mUefdbfafa > > Below, is the summary of the discussion. Which tree does this apply to exactly ? git-log-graph linux-stable/master * c17b750b3ad9f - (tag: v6.17-rc2, linux-stable/master, linux-stable/HEAD) Linux 6.17-rc2 (3 days ago) * 8d561baae505b - Merge tag 'x86_urgent_for_v6.17_rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip (3 days ago) b4 shazam 20250812-qcom-tee-using-tee-ss-without-mem-obj-v7-7-ce7a1a774803@oss.qualcomm.com b4 shazam 20250819165447.4149674-1-mukesh.ojha@oss.qualcomm.com Grabbing thread from lore.kernel.org/all/20250819165447.4149674-1-mukesh.ojha@oss.qualcomm.com/t.mbox.gz Checking for newer revisions Grabbing search results from lore.kernel.org Analyzing 18 messages in the thread Analyzing 0 code-review messages Checking attestation on all messages, may take a moment... --- ✓ [PATCH v2 1/11] firmware: qcom_scm: Introduce PAS context initialization helper ✓ [PATCH v2 2/11] soc: qcom: mdtloader: Add context aware qcom_mdt_pas_load() helper ✓ [PATCH v2 3/11] firmware: qcom_scm: Add a prep version of auth_and_reset function ✓ [PATCH v2 4/11] firmware: qcom_scm: Simplify qcom_scm_pas_init_image() ✓ [PATCH v2 5/11] firmware: qcom_scm: Add shmbridge support to pas_init/release function ✓ [PATCH v2 6/11] remoteproc: Move resource table data structure to its own header ✓ [PATCH v2 7/11] firmware: qcom_scm: Add qcom_scm_pas_get_rsc_table() to get resource table ✓ [PATCH v2 8/11] soc: qcom: mdt_loader: Add helper functions to map and unmap resources ✓ [PATCH v2 9/11] remoteproc: pas: Extend parse_fw callback to parse resource table ✓ [PATCH v2 10/11] remoteproc: qcom: pas: Enable Secure PAS support with IOMMU managed by Linux ✓ [PATCH v2 11/11] media: iris: Enable Secure PAS support with IOMMU managed by Linux --- ✓ Signed: DKIM/qualcomm.com (From: mukesh.ojha@oss.qualcomm.com) --- Total patches: 11 --- Applying: firmware: qcom_scm: Introduce PAS context initialization helper Applying: soc: qcom: mdtloader: Add context aware qcom_mdt_pas_load() helper Patch failed at 0002 soc: qcom: mdtloader: Add context aware qcom_mdt_pas_load() helper error: patch failed: drivers/remoteproc/qcom_q6v5_pas.c:235 error: drivers/remoteproc/qcom_q6v5_pas.c: patch does not apply error: patch failed: drivers/soc/qcom/mdt_loader.c:302 error: drivers/soc/qcom/mdt_loader.c: patch does not apply error: patch failed: include/linux/soc/qcom/mdt_loader.h:10 error: include/linux/soc/qcom/mdt_loader.h: patch does not apply hint: Use 'git am --show-current-patch=diff' to see the failed patch hint: When you have resolved this problem, run "git am --continue". hint: If you prefer to skip this patch, run "git am --skip" instead. hint: To restore the original branch and stop patching, run "git am --abort". hint: Disable this message with "git config set advice.mergeConflict false" --- bod
On Wed, Aug 20, 2025 at 12:03:16PM +0100, Bryan O'Donoghue wrote: > On 19/08/2025 17:54, Mukesh Ojha wrote: > > This is a further continuation with a new approach to the topic > > discussed in [1] regarding the enablement of Secure Peripheral Image > > Loader support on Qualcomm SoCs when Linux runs at EL2. > > > > A few months ago, we also discussed the challenges at Linaro Connect > > 2025 [2] related to enabling remoteproc when Linux is running at EL2. > > > > [1] > > https://lore.kernel.org/lkml/20241004212359.2263502-1-quic_mojha@quicinc.com/ > > > > [2] > > https://resources.linaro.org/en/resource/sF8jXifdb9V1mUefdbfafa > > > > Below, is the summary of the discussion. > > Which tree does this apply to exactly ? > > git-log-graph linux-stable/master > * c17b750b3ad9f - (tag: v6.17-rc2, linux-stable/master, linux-stable/HEAD) > Linux 6.17-rc2 (3 days ago) > * 8d561baae505b - Merge tag 'x86_urgent_for_v6.17_rc2' of > git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip (3 days ago) > > b4 shazam 20250812-qcom-tee-using-tee-ss-without-mem-obj-v7-7-ce7a1a774803@oss.qualcomm.com > > b4 shazam 20250819165447.4149674-1-mukesh.ojha@oss.qualcomm.com > > Grabbing thread from lore.kernel.org/all/20250819165447.4149674-1-mukesh.ojha@oss.qualcomm.com/t.mbox.gz > Checking for newer revisions > Grabbing search results from lore.kernel.org > Analyzing 18 messages in the thread > Analyzing 0 code-review messages > Checking attestation on all messages, may take a moment... > --- > ✓ [PATCH v2 1/11] firmware: qcom_scm: Introduce PAS context initialization > helper > ✓ [PATCH v2 2/11] soc: qcom: mdtloader: Add context aware > qcom_mdt_pas_load() helper > ✓ [PATCH v2 3/11] firmware: qcom_scm: Add a prep version of auth_and_reset > function > ✓ [PATCH v2 4/11] firmware: qcom_scm: Simplify qcom_scm_pas_init_image() > ✓ [PATCH v2 5/11] firmware: qcom_scm: Add shmbridge support to > pas_init/release function > ✓ [PATCH v2 6/11] remoteproc: Move resource table data structure to its > own header > ✓ [PATCH v2 7/11] firmware: qcom_scm: Add qcom_scm_pas_get_rsc_table() to > get resource table > ✓ [PATCH v2 8/11] soc: qcom: mdt_loader: Add helper functions to map and > unmap resources > ✓ [PATCH v2 9/11] remoteproc: pas: Extend parse_fw callback to parse > resource table > ✓ [PATCH v2 10/11] remoteproc: qcom: pas: Enable Secure PAS support with > IOMMU managed by Linux > ✓ [PATCH v2 11/11] media: iris: Enable Secure PAS support with IOMMU > managed by Linux > --- > ✓ Signed: DKIM/qualcomm.com (From: mukesh.ojha@oss.qualcomm.com) > --- > Total patches: 11 > --- > Applying: firmware: qcom_scm: Introduce PAS context initialization helper > Applying: soc: qcom: mdtloader: Add context aware qcom_mdt_pas_load() helper > Patch failed at 0002 soc: qcom: mdtloader: Add context aware > qcom_mdt_pas_load() helper > error: patch failed: drivers/remoteproc/qcom_q6v5_pas.c:235 > error: drivers/remoteproc/qcom_q6v5_pas.c: patch does not apply > error: patch failed: drivers/soc/qcom/mdt_loader.c:302 > error: drivers/soc/qcom/mdt_loader.c: patch does not apply > error: patch failed: include/linux/soc/qcom/mdt_loader.h:10 > error: include/linux/soc/qcom/mdt_loader.h: patch does not apply > hint: Use 'git am --show-current-patch=diff' to see the failed patch > hint: When you have resolved this problem, run "git am --continue". > hint: If you prefer to skip this patch, run "git am --skip" instead. > hint: To restore the original branch and stop patching, run "git am > --abort". > hint: Disable this message with "git config set advice.mergeConflict false" Very sorry for the error. Can you try with this next-20250814 tag ? But yes, forgive me for the minor manual edit I did https://lore.kernel.org/lkml/20250820111448.tjaz2wld2nxg52aq@hu-mojha-hyd.qualcomm.com/ > > --- > bod -- -Mukesh Ojha
On 8/20/25 1:22 PM, Mukesh Ojha wrote: > On Wed, Aug 20, 2025 at 12:03:16PM +0100, Bryan O'Donoghue wrote: >> On 19/08/2025 17:54, Mukesh Ojha wrote: >>> This is a further continuation with a new approach to the topic >>> discussed in [1] regarding the enablement of Secure Peripheral Image >>> Loader support on Qualcomm SoCs when Linux runs at EL2. >>> >>> A few months ago, we also discussed the challenges at Linaro Connect >>> 2025 [2] related to enabling remoteproc when Linux is running at EL2. >>> >>> [1] >>> https://lore.kernel.org/lkml/20241004212359.2263502-1-quic_mojha@quicinc.com/ >>> >>> [2] >>> https://resources.linaro.org/en/resource/sF8jXifdb9V1mUefdbfafa >>> >>> Below, is the summary of the discussion. >> >> Which tree does this apply to exactly ? >> >> git-log-graph linux-stable/master >> * c17b750b3ad9f - (tag: v6.17-rc2, linux-stable/master, linux-stable/HEAD) >> Linux 6.17-rc2 (3 days ago) >> * 8d561baae505b - Merge tag 'x86_urgent_for_v6.17_rc2' of >> git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip (3 days ago) >> >> b4 shazam 20250812-qcom-tee-using-tee-ss-without-mem-obj-v7-7-ce7a1a774803@oss.qualcomm.com >> >> b4 shazam 20250819165447.4149674-1-mukesh.ojha@oss.qualcomm.com >> >> Grabbing thread from lore.kernel.org/all/20250819165447.4149674-1-mukesh.ojha@oss.qualcomm.com/t.mbox.gz >> Checking for newer revisions >> Grabbing search results from lore.kernel.org >> Analyzing 18 messages in the thread >> Analyzing 0 code-review messages >> Checking attestation on all messages, may take a moment... >> --- >> ✓ [PATCH v2 1/11] firmware: qcom_scm: Introduce PAS context initialization >> helper >> ✓ [PATCH v2 2/11] soc: qcom: mdtloader: Add context aware >> qcom_mdt_pas_load() helper >> ✓ [PATCH v2 3/11] firmware: qcom_scm: Add a prep version of auth_and_reset >> function >> ✓ [PATCH v2 4/11] firmware: qcom_scm: Simplify qcom_scm_pas_init_image() >> ✓ [PATCH v2 5/11] firmware: qcom_scm: Add shmbridge support to >> pas_init/release function >> ✓ [PATCH v2 6/11] remoteproc: Move resource table data structure to its >> own header >> ✓ [PATCH v2 7/11] firmware: qcom_scm: Add qcom_scm_pas_get_rsc_table() to >> get resource table >> ✓ [PATCH v2 8/11] soc: qcom: mdt_loader: Add helper functions to map and >> unmap resources >> ✓ [PATCH v2 9/11] remoteproc: pas: Extend parse_fw callback to parse >> resource table >> ✓ [PATCH v2 10/11] remoteproc: qcom: pas: Enable Secure PAS support with >> IOMMU managed by Linux >> ✓ [PATCH v2 11/11] media: iris: Enable Secure PAS support with IOMMU >> managed by Linux >> --- >> ✓ Signed: DKIM/qualcomm.com (From: mukesh.ojha@oss.qualcomm.com) >> --- >> Total patches: 11 >> --- >> Applying: firmware: qcom_scm: Introduce PAS context initialization helper >> Applying: soc: qcom: mdtloader: Add context aware qcom_mdt_pas_load() helper >> Patch failed at 0002 soc: qcom: mdtloader: Add context aware >> qcom_mdt_pas_load() helper >> error: patch failed: drivers/remoteproc/qcom_q6v5_pas.c:235 >> error: drivers/remoteproc/qcom_q6v5_pas.c: patch does not apply >> error: patch failed: drivers/soc/qcom/mdt_loader.c:302 >> error: drivers/soc/qcom/mdt_loader.c: patch does not apply >> error: patch failed: include/linux/soc/qcom/mdt_loader.h:10 >> error: include/linux/soc/qcom/mdt_loader.h: patch does not apply >> hint: Use 'git am --show-current-patch=diff' to see the failed patch >> hint: When you have resolved this problem, run "git am --continue". >> hint: If you prefer to skip this patch, run "git am --skip" instead. >> hint: To restore the original branch and stop patching, run "git am >> --abort". >> hint: Disable this message with "git config set advice.mergeConflict false" > > Very sorry for the error. > > Can you try with this next-20250814 tag ? You sent it on the 19th, so it's in your best interest to run a quick git rebase --onto linux-next/master $(git describe --abbrev=0) and giving the series a prompt re-test before sending, because there might have been incompatible changes, whether ones that would prevent applying, or break things functionally Konrad
On 03/09/2025 12:56, Konrad Dybcio wrote: >> Can you try with this next-20250814 tag ? > You sent it on the 19th, so it's in your best interest to run a quick > > git rebase --onto linux-next/master $(git describe --abbrev=0) > > and giving the series a prompt re-test before sending, because there might have > been incompatible changes, whether ones that would prevent applying, or break > things functionally I can't even find that tag next-20250814 closets thing is | * \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 00062ea01d35e - Merge tag 'drm-xe-fixes-2025-08-14' of https://gitlab.freedesktop.org/drm/xe/kernel into drm-fixes (3 weeks ago) but patch #9 in this series stubbornly won't apply to any SHA I've tried. meh --- bod
On Wed, Sep 03, 2025 at 02:31:55PM +0100, Bryan O'Donoghue wrote: > On 03/09/2025 12:56, Konrad Dybcio wrote: > > > Can you try with this next-20250814 tag ? > > You sent it on the 19th, so it's in your best interest to run a quick > > > > git rebase --onto linux-next/master $(git describe --abbrev=0) > > > > and giving the series a prompt re-test before sending, because there might have > > been incompatible changes, whether ones that would prevent applying, or break > > things functionally > > I can't even find that tag next-20250814 closets thing is https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tag/?h=next-20250814 > > | * \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 00062ea01d35e - Merge tag > 'drm-xe-fixes-2025-08-14' of https://gitlab.freedesktop.org/drm/xe/kernel > into drm-fixes (3 weeks ago) > > but patch #9 in this series stubbornly won't apply to any SHA I've tried. > > meh > > --- > bod -- With best wishes Dmitry
On 03/09/2025 15:02, Dmitry Baryshkov wrote: > On Wed, Sep 03, 2025 at 02:31:55PM +0100, Bryan O'Donoghue wrote: >> On 03/09/2025 12:56, Konrad Dybcio wrote: >>>> Can you try with this next-20250814 tag ? >>> You sent it on the 19th, so it's in your best interest to run a quick >>> >>> git rebase --onto linux-next/master $(git describe --abbrev=0) >>> >>> and giving the series a prompt re-test before sending, because there might have >>> been incompatible changes, whether ones that would prevent applying, or break >>> things functionally >> >> I can't even find that tag next-20250814 closets thing is > > https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tag/?h=next-20250814 > >> >> | * \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 00062ea01d35e - Merge tag >> 'drm-xe-fixes-2025-08-14' of https://gitlab.freedesktop.org/drm/xe/kernel >> into drm-fixes (3 weeks ago) >> >> but patch #9 in this series stubbornly won't apply to any SHA I've tried. >> >> meh >> >> --- >> bod > Unfortunately that's not the right SHA though git checkout -b next-20250814-test next-20250814 Switched to a new branch 'next-20250814-test' b4 shazam 20250812-qcom-tee-using-tee-ss-without-mem-obj-v7-7-ce7a1a774803@oss.qualcomm.com Grabbing thread from lore.kernel.org/all/20250812-qcom-tee-using-tee-ss-without-mem-obj-v7-7-ce7a1a774803@oss.qualcomm.com/t.mbox.gz Checking for newer revisions Grabbing search results from lore.kernel.org Added from v8: 12 patches Added from v9: 12 patches Analyzing 60 messages in the thread Analyzing 163 code-review messages Will use the latest revision: v9 You can pick other revisions using the -vN flag Checking attestation on all messages, may take a moment... --- ✓ [PATCH v9 1/11] tee: allow a driver to allocate a tee_device without a pool ✓ [PATCH v9 2/11] tee: add close_context to TEE driver operation ✓ [PATCH v9 3/11] tee: add TEE_IOCTL_PARAM_ATTR_TYPE_UBUF ✓ [PATCH v9 4/11] tee: add TEE_IOCTL_PARAM_ATTR_TYPE_OBJREF ✓ [PATCH v9 5/11] tee: increase TEE_MAX_ARG_SIZE to 4096 ✓ [PATCH v9 6/11] firmware: qcom: scm: add support for object invocation ✓ [PATCH v9 7/11] firmware: qcom: tzmem: export shm_bridge create/delete ✓ [PATCH v9 8/11] tee: add Qualcomm TEE driver ✓ [PATCH v9 9/11] tee: qcom: add primordial object ✓ [PATCH v9 10/11] tee: qcom: enable TEE_IOC_SHM_ALLOC ioctl ✓ [PATCH v9 11/11] Documentation: tee: Add Qualcomm TEE driver --- ✓ Signed: DKIM/qualcomm.com (From: amirreza.zarrabi@oss.qualcomm.com) --- Total patches: 11 --- Base: using specified base-commit 33bcf93b9a6b028758105680f8b538a31bc563cf Applying: tee: allow a driver to allocate a tee_device without a pool Applying: tee: add close_context to TEE driver operation Applying: tee: add TEE_IOCTL_PARAM_ATTR_TYPE_UBUF Applying: tee: add TEE_IOCTL_PARAM_ATTR_TYPE_OBJREF Applying: tee: increase TEE_MAX_ARG_SIZE to 4096 Applying: firmware: qcom: scm: add support for object invocation Applying: firmware: qcom: tzmem: export shm_bridge create/delete Applying: tee: add Qualcomm TEE driver Applying: tee: qcom: add primordial object Applying: tee: qcom: enable TEE_IOC_SHM_ALLOC ioctl Applying: Documentation: tee: Add Qualcomm TEE driver b4 shazam 20250819165447.4149674-1-mukesh.ojha@oss.qualcomm.com Grabbing thread from lore.kernel.org/all/20250819165447.4149674-1-mukesh.ojha@oss.qualcomm.com/t.mbox.gz Checking for newer revisions Grabbing search results from lore.kernel.org Analyzing 70 messages in the thread Looking for additional code-review trailers on lore.kernel.org Analyzing 0 code-review messages Checking attestation on all messages, may take a moment... --- ✓ [PATCH v2 1/11] firmware: qcom_scm: Introduce PAS context initialization helper ✓ [PATCH v2 2/11] soc: qcom: mdtloader: Add context aware qcom_mdt_pas_load() helper ✓ [PATCH v2 3/11] firmware: qcom_scm: Add a prep version of auth_and_reset function ✓ [PATCH v2 4/11] firmware: qcom_scm: Simplify qcom_scm_pas_init_image() + Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> (✗ DKIM/linaro.org) ✓ [PATCH v2 5/11] firmware: qcom_scm: Add shmbridge support to pas_init/release function ✓ [PATCH v2 6/11] remoteproc: Move resource table data structure to its own header ✓ [PATCH v2 7/11] firmware: qcom_scm: Add qcom_scm_pas_get_rsc_table() to get resource table ✓ [PATCH v2 8/11] soc: qcom: mdt_loader: Add helper functions to map and unmap resources ✓ [PATCH v2 9/11] remoteproc: pas: Extend parse_fw callback to parse resource table ✓ [PATCH v2 10/11] remoteproc: qcom: pas: Enable Secure PAS support with IOMMU managed by Linux ✓ [PATCH v2 11/11] media: iris: Enable Secure PAS support with IOMMU managed by Linux --- ✓ Signed: DKIM/qualcomm.com (From: mukesh.ojha@oss.qualcomm.com) --- Total patches: 11 --- Applying: firmware: qcom_scm: Introduce PAS context initialization helper Applying: soc: qcom: mdtloader: Add context aware qcom_mdt_pas_load() helper Applying: firmware: qcom_scm: Add a prep version of auth_and_reset function Applying: firmware: qcom_scm: Simplify qcom_scm_pas_init_image() Applying: firmware: qcom_scm: Add shmbridge support to pas_init/release function Applying: remoteproc: Move resource table data structure to its own header Applying: firmware: qcom_scm: Add qcom_scm_pas_get_rsc_table() to get resource table Applying: soc: qcom: mdt_loader: Add helper functions to map and unmap resources Applying: remoteproc: pas: Extend parse_fw callback to parse resource table Patch failed at 0009 remoteproc: pas: Extend parse_fw callback to parse resource table error: patch failed: drivers/soc/qcom/mdt_loader.c:22 error: drivers/soc/qcom/mdt_loader.c: patch does not apply hint: Use 'git am --show-current-patch=diff' to see the failed patch hint: When you have resolved this problem, run "git am --continue". hint: If you prefer to skip this patch, run "git am --skip" instead. hint: To restore the original branch and stop patching, run "git am --abort". hint: Disable this message with "git config set advice.mergeConflict false"
On Wed, Sep 03, 2025 at 03:13:18PM +0100, Bryan O'Donoghue wrote: > On 03/09/2025 15:02, Dmitry Baryshkov wrote: > > On Wed, Sep 03, 2025 at 02:31:55PM +0100, Bryan O'Donoghue wrote: > > > On 03/09/2025 12:56, Konrad Dybcio wrote: > > > > > Can you try with this next-20250814 tag ? > > > > You sent it on the 19th, so it's in your best interest to run a quick > > > > > > > > git rebase --onto linux-next/master $(git describe --abbrev=0) > > > > > > > > and giving the series a prompt re-test before sending, because there might have > > > > been incompatible changes, whether ones that would prevent applying, or break > > > > things functionally > > > > > > I can't even find that tag next-20250814 closets thing is > > > > https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tag/?h=next-20250814 > > > > > > > > | * \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 00062ea01d35e - Merge tag > > > 'drm-xe-fixes-2025-08-14' of https://gitlab.freedesktop.org/drm/xe/kernel > > > into drm-fixes (3 weeks ago) > > > > > > but patch #9 in this series stubbornly won't apply to any SHA I've tried. > > > > > > meh > > > > > > --- > > > bod > > > > Unfortunately that's not the right SHA though Then let's wait for Mukesh to switch to b4 (and use b4 --edit-deps) or to use a proper git format-patch arguments. > > git checkout -b next-20250814-test next-20250814 > > Switched to a new branch 'next-20250814-test' > > b4 shazam 20250812-qcom-tee-using-tee-ss-without-mem-obj-v7-7-ce7a1a774803@oss.qualcomm.com > Grabbing thread from lore.kernel.org/all/20250812-qcom-tee-using-tee-ss-without-mem-obj-v7-7-ce7a1a774803@oss.qualcomm.com/t.mbox.gz > Checking for newer revisions > Grabbing search results from lore.kernel.org > Added from v8: 12 patches > Added from v9: 12 patches > Analyzing 60 messages in the thread > Analyzing 163 code-review messages > Will use the latest revision: v9 > You can pick other revisions using the -vN flag > Checking attestation on all messages, may take a moment... > --- > ✓ [PATCH v9 1/11] tee: allow a driver to allocate a tee_device without a > pool > ✓ [PATCH v9 2/11] tee: add close_context to TEE driver operation > ✓ [PATCH v9 3/11] tee: add TEE_IOCTL_PARAM_ATTR_TYPE_UBUF > ✓ [PATCH v9 4/11] tee: add TEE_IOCTL_PARAM_ATTR_TYPE_OBJREF > ✓ [PATCH v9 5/11] tee: increase TEE_MAX_ARG_SIZE to 4096 > ✓ [PATCH v9 6/11] firmware: qcom: scm: add support for object invocation > ✓ [PATCH v9 7/11] firmware: qcom: tzmem: export shm_bridge create/delete > ✓ [PATCH v9 8/11] tee: add Qualcomm TEE driver > ✓ [PATCH v9 9/11] tee: qcom: add primordial object > ✓ [PATCH v9 10/11] tee: qcom: enable TEE_IOC_SHM_ALLOC ioctl > ✓ [PATCH v9 11/11] Documentation: tee: Add Qualcomm TEE driver > --- > ✓ Signed: DKIM/qualcomm.com (From: amirreza.zarrabi@oss.qualcomm.com) > --- > Total patches: 11 > --- > Base: using specified base-commit 33bcf93b9a6b028758105680f8b538a31bc563cf > Applying: tee: allow a driver to allocate a tee_device without a pool > Applying: tee: add close_context to TEE driver operation > Applying: tee: add TEE_IOCTL_PARAM_ATTR_TYPE_UBUF > Applying: tee: add TEE_IOCTL_PARAM_ATTR_TYPE_OBJREF > Applying: tee: increase TEE_MAX_ARG_SIZE to 4096 > Applying: firmware: qcom: scm: add support for object invocation > Applying: firmware: qcom: tzmem: export shm_bridge create/delete > Applying: tee: add Qualcomm TEE driver > Applying: tee: qcom: add primordial object > Applying: tee: qcom: enable TEE_IOC_SHM_ALLOC ioctl > Applying: Documentation: tee: Add Qualcomm TEE driver > > b4 shazam 20250819165447.4149674-1-mukesh.ojha@oss.qualcomm.com > Grabbing thread from lore.kernel.org/all/20250819165447.4149674-1-mukesh.ojha@oss.qualcomm.com/t.mbox.gz > Checking for newer revisions > Grabbing search results from lore.kernel.org > Analyzing 70 messages in the thread > Looking for additional code-review trailers on lore.kernel.org > Analyzing 0 code-review messages > Checking attestation on all messages, may take a moment... > --- > ✓ [PATCH v2 1/11] firmware: qcom_scm: Introduce PAS context initialization > helper > ✓ [PATCH v2 2/11] soc: qcom: mdtloader: Add context aware > qcom_mdt_pas_load() helper > ✓ [PATCH v2 3/11] firmware: qcom_scm: Add a prep version of auth_and_reset > function > ✓ [PATCH v2 4/11] firmware: qcom_scm: Simplify qcom_scm_pas_init_image() > + Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> (✗ > DKIM/linaro.org) > ✓ [PATCH v2 5/11] firmware: qcom_scm: Add shmbridge support to > pas_init/release function > ✓ [PATCH v2 6/11] remoteproc: Move resource table data structure to its > own header > ✓ [PATCH v2 7/11] firmware: qcom_scm: Add qcom_scm_pas_get_rsc_table() to > get resource table > ✓ [PATCH v2 8/11] soc: qcom: mdt_loader: Add helper functions to map and > unmap resources > ✓ [PATCH v2 9/11] remoteproc: pas: Extend parse_fw callback to parse > resource table > ✓ [PATCH v2 10/11] remoteproc: qcom: pas: Enable Secure PAS support with > IOMMU managed by Linux > ✓ [PATCH v2 11/11] media: iris: Enable Secure PAS support with IOMMU > managed by Linux > --- > ✓ Signed: DKIM/qualcomm.com (From: mukesh.ojha@oss.qualcomm.com) > --- > Total patches: 11 > --- > Applying: firmware: qcom_scm: Introduce PAS context initialization helper > Applying: soc: qcom: mdtloader: Add context aware qcom_mdt_pas_load() helper > Applying: firmware: qcom_scm: Add a prep version of auth_and_reset function > Applying: firmware: qcom_scm: Simplify qcom_scm_pas_init_image() > Applying: firmware: qcom_scm: Add shmbridge support to pas_init/release > function > Applying: remoteproc: Move resource table data structure to its own header > Applying: firmware: qcom_scm: Add qcom_scm_pas_get_rsc_table() to get > resource table > Applying: soc: qcom: mdt_loader: Add helper functions to map and unmap > resources > Applying: remoteproc: pas: Extend parse_fw callback to parse resource table > Patch failed at 0009 remoteproc: pas: Extend parse_fw callback to parse > resource table > error: patch failed: drivers/soc/qcom/mdt_loader.c:22 > error: drivers/soc/qcom/mdt_loader.c: patch does not apply > hint: Use 'git am --show-current-patch=diff' to see the failed patch > hint: When you have resolved this problem, run "git am --continue". > hint: If you prefer to skip this patch, run "git am --skip" instead. > hint: To restore the original branch and stop patching, run "git am > --abort". > hint: Disable this message with "git config set advice.mergeConflict false" > -- With best wishes Dmitry
On 03/09/2025 15:13, Bryan O'Donoghue wrote: > On 03/09/2025 15:02, Dmitry Baryshkov wrote: >> On Wed, Sep 03, 2025 at 02:31:55PM +0100, Bryan O'Donoghue wrote: >>> On 03/09/2025 12:56, Konrad Dybcio wrote: >>>>> Can you try with this next-20250814 tag ? >>>> You sent it on the 19th, so it's in your best interest to run a quick >>>> >>>> git rebase --onto linux-next/master $(git describe --abbrev=0) >>>> >>>> and giving the series a prompt re-test before sending, because there >>>> might have >>>> been incompatible changes, whether ones that would prevent applying, >>>> or break >>>> things functionally >>> >>> I can't even find that tag next-20250814 closets thing is >> >> https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/ >> tag/?h=next-20250814 >> >>> >>> | * \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 00062ea01d35e - Merge >>> tag >>> 'drm-xe-fixes-2025-08-14' of https://gitlab.freedesktop.org/drm/xe/ >>> kernel >>> into drm-fixes (3 weeks ago) >>> >>> but patch #9 in this series stubbornly won't apply to any SHA I've >>> tried. >>> >>> meh >>> >>> --- >>> bod >> > > Unfortunately that's not the right SHA though > > git checkout -b next-20250814-test next-20250814 > Switched to a new branch 'next-20250814-test' > > b4 shazam 20250812-qcom-tee-using-tee-ss-without-mem-obj-v7-7- > ce7a1a774803@oss.qualcomm.com > Grabbing thread from lore.kernel.org/all/20250812-qcom-tee-using-tee-ss- > without-mem-obj-v7-7-ce7a1a774803@oss.qualcomm.com/t.mbox.gz > Checking for newer revisions > Grabbing search results from lore.kernel.org > Added from v8: 12 patches > Added from v9: 12 patches > Analyzing 60 messages in the thread > Analyzing 163 code-review messages > Will use the latest revision: v9 > You can pick other revisions using the -vN flag > Checking attestation on all messages, may take a moment... > --- > ✓ [PATCH v9 1/11] tee: allow a driver to allocate a tee_device > without a pool > ✓ [PATCH v9 2/11] tee: add close_context to TEE driver operation > ✓ [PATCH v9 3/11] tee: add TEE_IOCTL_PARAM_ATTR_TYPE_UBUF > ✓ [PATCH v9 4/11] tee: add TEE_IOCTL_PARAM_ATTR_TYPE_OBJREF > ✓ [PATCH v9 5/11] tee: increase TEE_MAX_ARG_SIZE to 4096 > ✓ [PATCH v9 6/11] firmware: qcom: scm: add support for object invocation > ✓ [PATCH v9 7/11] firmware: qcom: tzmem: export shm_bridge create/delete > ✓ [PATCH v9 8/11] tee: add Qualcomm TEE driver > ✓ [PATCH v9 9/11] tee: qcom: add primordial object > ✓ [PATCH v9 10/11] tee: qcom: enable TEE_IOC_SHM_ALLOC ioctl > ✓ [PATCH v9 11/11] Documentation: tee: Add Qualcomm TEE driver > --- > ✓ Signed: DKIM/qualcomm.com (From: amirreza.zarrabi@oss.qualcomm.com) > --- > Total patches: 11 > --- > Base: using specified base-commit > 33bcf93b9a6b028758105680f8b538a31bc563cf > Applying: tee: allow a driver to allocate a tee_device without a pool > Applying: tee: add close_context to TEE driver operation > Applying: tee: add TEE_IOCTL_PARAM_ATTR_TYPE_UBUF > Applying: tee: add TEE_IOCTL_PARAM_ATTR_TYPE_OBJREF > Applying: tee: increase TEE_MAX_ARG_SIZE to 4096 > Applying: firmware: qcom: scm: add support for object invocation > Applying: firmware: qcom: tzmem: export shm_bridge create/delete > Applying: tee: add Qualcomm TEE driver > Applying: tee: qcom: add primordial object > Applying: tee: qcom: enable TEE_IOC_SHM_ALLOC ioctl > Applying: Documentation: tee: Add Qualcomm TEE driver > > b4 shazam 20250819165447.4149674-1-mukesh.ojha@oss.qualcomm.com > Grabbing thread from lore.kernel.org/all/20250819165447.4149674-1- > mukesh.ojha@oss.qualcomm.com/t.mbox.gz > Checking for newer revisions > Grabbing search results from lore.kernel.org > Analyzing 70 messages in the thread > Looking for additional code-review trailers on lore.kernel.org > Analyzing 0 code-review messages > Checking attestation on all messages, may take a moment... > --- > ✓ [PATCH v2 1/11] firmware: qcom_scm: Introduce PAS context > initialization helper > ✓ [PATCH v2 2/11] soc: qcom: mdtloader: Add context aware > qcom_mdt_pas_load() helper > ✓ [PATCH v2 3/11] firmware: qcom_scm: Add a prep version of > auth_and_reset function > ✓ [PATCH v2 4/11] firmware: qcom_scm: Simplify qcom_scm_pas_init_image() > + Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> (✗ > DKIM/linaro.org) > ✓ [PATCH v2 5/11] firmware: qcom_scm: Add shmbridge support to > pas_init/release function > ✓ [PATCH v2 6/11] remoteproc: Move resource table data structure to > its own header > ✓ [PATCH v2 7/11] firmware: qcom_scm: Add > qcom_scm_pas_get_rsc_table() to get resource table > ✓ [PATCH v2 8/11] soc: qcom: mdt_loader: Add helper functions to map > and unmap resources > ✓ [PATCH v2 9/11] remoteproc: pas: Extend parse_fw callback to parse > resource table > ✓ [PATCH v2 10/11] remoteproc: qcom: pas: Enable Secure PAS support > with IOMMU managed by Linux > ✓ [PATCH v2 11/11] media: iris: Enable Secure PAS support with IOMMU > managed by Linux > --- > ✓ Signed: DKIM/qualcomm.com (From: mukesh.ojha@oss.qualcomm.com) > --- > Total patches: 11 > --- > Applying: firmware: qcom_scm: Introduce PAS context initialization helper > Applying: soc: qcom: mdtloader: Add context aware qcom_mdt_pas_load() > helper > Applying: firmware: qcom_scm: Add a prep version of auth_and_reset function > Applying: firmware: qcom_scm: Simplify qcom_scm_pas_init_image() > Applying: firmware: qcom_scm: Add shmbridge support to pas_init/release > function > Applying: remoteproc: Move resource table data structure to its own header > Applying: firmware: qcom_scm: Add qcom_scm_pas_get_rsc_table() to get > resource table > Applying: soc: qcom: mdt_loader: Add helper functions to map and unmap > resources > Applying: remoteproc: pas: Extend parse_fw callback to parse resource table > Patch failed at 0009 remoteproc: pas: Extend parse_fw callback to parse > resource table > error: patch failed: drivers/soc/qcom/mdt_loader.c:22 > error: drivers/soc/qcom/mdt_loader.c: patch does not apply > hint: Use 'git am --show-current-patch=diff' to see the failed patch > hint: When you have resolved this problem, run "git am --continue". > hint: If you prefer to skip this patch, run "git am --skip" instead. > hint: To restore the original branch and stop patching, run "git am -- > abort". > hint: Disable this message with "git config set advice.mergeConflict false" > Its also possible to apply it manually ... diff --git a/drivers/remoteproc/qcom_q6v5_pas.c b/drivers/remoteproc/qcom_q6v5_pas.c index 09cada92dfd56..1e0f09bf1ef29 100644 --- a/drivers/remoteproc/qcom_q6v5_pas.c +++ b/drivers/remoteproc/qcom_q6v5_pas.c @@ -408,6 +408,35 @@ static void *qcom_pas_da_to_va(struct rproc *rproc, u64 da, size_t len, bool *is return pas->mem_region + offset; } +static int qcom_pas_parse_firmware(struct rproc *rproc, const struct firmware *fw) +{ + struct qcom_pas *pas = rproc->priv; + size_t output_rt_size = MAX_RSCTABLE_SIZE; + void *output_rt; + int ret; + + ret = qcom_register_dump_segments(rproc, fw); + if (ret) { + dev_err(pas->dev, "Error in registering dump segments\n"); + return ret; + } + + if (!rproc->has_iommu) + return ret; + + ret = qcom_scm_pas_get_rsc_table(pas->pas_id, NULL, 0, &output_rt, &output_rt_size); + if (ret) { + dev_err(pas->dev, "error %d getting resource_table\n", ret); + return ret; + } + + rproc->cached_table = output_rt; + rproc->table_ptr = rproc->cached_table; + rproc->table_sz = output_rt_size; + + return ret; +} + static unsigned long qcom_pas_panic(struct rproc *rproc) { struct qcom_pas *pas = rproc->priv; @@ -420,7 +449,7 @@ static const struct rproc_ops qcom_pas_ops = { .start = qcom_pas_start, .stop = qcom_pas_stop, .da_to_va = qcom_pas_da_to_va, - .parse_fw = qcom_register_dump_segments, + .parse_fw = qcom_pas_parse_firmware, .load = qcom_pas_load, .panic = qcom_pas_panic, }; @@ -430,7 +459,7 @@ static const struct rproc_ops qcom_pas_minidump_ops = { .start = qcom_pas_start, .stop = qcom_pas_stop, .da_to_va = qcom_pas_da_to_va, - .parse_fw = qcom_register_dump_segments, + .parse_fw = qcom_pas_parse_firmware, .load = qcom_pas_load, .panic = qcom_pas_panic, .coredump = qcom_pas_minidump, diff --git a/drivers/soc/qcom/mdt_loader.c b/drivers/soc/qcom/mdt_loader.c index 3ac19e85d71df..a754e513cd541 100644 --- a/drivers/soc/qcom/mdt_loader.c +++ b/drivers/soc/qcom/mdt_loader.c @@ -22,7 +22,6 @@ #include <linux/slab.h> #include <linux/soc/qcom/mdt_loader.h> -#define MAX_RSCTABLE_SIZE SZ_16K #define RSC_TABLE_HASH_BITS 5 // 32 buckets DEFINE_HASHTABLE(qcom_pas_rsc_table_map, RSC_TABLE_HASH_BITS); diff --git a/include/linux/soc/qcom/mdt_loader.h b/include/linux/soc/qcom/mdt_loader.h index 38475fd528d62..8fb3309d2a71a 100644 --- a/include/linux/soc/qcom/mdt_loader.h +++ b/include/linux/soc/qcom/mdt_loader.h @@ -8,6 +8,8 @@ #define QCOM_MDT_TYPE_HASH (2 << 24) #define QCOM_MDT_RELOCATABLE BIT(27) +#define MAX_RSCTABLE_SIZE SZ_16K + struct device; struct firmware; struct qcom_scm_pas_ctx;
On 03/09/2025 15:02, Dmitry Baryshkov wrote: > On Wed, Sep 03, 2025 at 02:31:55PM +0100, Bryan O'Donoghue wrote: >> On 03/09/2025 12:56, Konrad Dybcio wrote: >>>> Can you try with this next-20250814 tag ? >>> You sent it on the 19th, so it's in your best interest to run a quick >>> >>> git rebase --onto linux-next/master $(git describe --abbrev=0) >>> >>> and giving the series a prompt re-test before sending, because there might have >>> been incompatible changes, whether ones that would prevent applying, or break >>> things functionally >> >> I can't even find that tag next-20250814 closets thing is > > https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tag/?h=next-20250814 > >> >> | * \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 00062ea01d35e - Merge tag >> 'drm-xe-fixes-2025-08-14' of https://gitlab.freedesktop.org/drm/xe/kernel >> into drm-fixes (3 weeks ago) >> >> but patch #9 in this series stubbornly won't apply to any SHA I've tried. >> >> meh >> >> --- >> bod > ah.. I fetched -stable --- bod
© 2016 - 2025 Red Hat, Inc.