Skip to content

Add TEE based client driver for UEFI Secure Application - #1522

Open
arakshit011 wants to merge 8 commits into
qualcomm-linux:qcom-6.18.yfrom
arakshit011:efi-var-with-qcomtee
Open

arakshit011 wants to merge 8 commits into
qualcomm-linux:qcom-6.18.yfrom
arakshit011:efi-var-with-qcomtee

Conversation

@arakshit011

Copy link
Copy Markdown

On Qualcomm SoC based platforms, UEFI stores EFI variables within the
Replay Protected Memory Block (RPMB) located within either the UFS,
eMMC or SPI-NOR storage. The RPMB key which is one-time programmed into
the storage controller to allow authentication of the RPMB frames is
generated by and only available to the Qualcomm Trusted Execution
Environment (QTEE). Thus, only QTEE can prepare the RPMB frames which
will be accepted by the storage controller.

The legacy QSEECOM protocol used for communicating with the QTEE is
deprecated and replaced with the use-case agnostic SMCInvoke protocol
starting with the Qualcomm SM8x50 series. On platforms where the QSEECOM
protocol still works (the QSEECOM driver probes) the driver does not
support a listener interface with QTEE to enable writing of non-volatile
EFI variables (via listener requests to Linux from QTEE) to the RPMB
for UFS and eMMC storage. (Qualcomm Compute platforms with SPI-NOR storage
are an exception to this and work with QSEECOM, see the NOTE below)

Therefore on such platforms, a TEE client driver (which communicates with
QTEE via the SMCInvoke protocol implemented by the QCOMTEE driver
registered with the TEE subsystem) must be used to update such EFI variables
through the RPMB service hosted in the QTEE supplicant user-space daemon
[1] which forwards RPMB packets to the RPMB device.

This series introduces such a uefisecapp TEE client driver for the
aforementioned Qualcomm platforms which installs efi-var operations if
the QCOMTEE driver registers support for an object-IPC based uefisecapp
service on the TEE bus during its probe. Only new QTEE firmware versions
available at [2] provide access to the uefisecapp service via the SMCInvoke
protocol.

Thus, QCOMTEE now maintains a static list of always-available object-IPC
based secure services exposed by QTEE. These services are implemented either
within the QTEE kernel or within a pre-loaded Trusted Application (TA)
usually loaded by the bootloader. The uefisecapp TA is an example of a
preloaded TA loaded by UEFI. A static list is required since QTEE does not
yet expose any way to dynamically query and enumerate the services exposed
by it.

To facilitate object-IPC interactions from the kernel-space, this
series also introduces a tee_client_object_invoke_func() to allow
invocation of TEE objects similar to the existing tee_client_invoke_func()
API exported by the TEE subsystem which allows invocation of TEE functions.
Some suporting changes are also introduced to track and handle operations
for TEE contexts opened from the kernel-space in the back-end QCOM-TEE
driver.

Finally and as previously mentioned, access to the object-IPC based uefisecapp
service is restricted on older QTEE firmware versions. A new QTEE firmware
release must be picked up from QArtifactory [2] for all upstream supported
Qualcomm SoCs to enable access to uefisecapp service via the TEE client
driver.

This patch series has been validated on Kodiak RB3Gen2 platform with UFS
storage by attempting to read/write EFI variables via the efivar tool [3]
after mounting the efivarfs filesystem. See [4] for an example.

NOTE: Since Compute platforms do not have a firmware running on their SPI-NOR
storage controller which must be programmed with a RPMB key, QTEE has a
SPI-NOR driver which holds the key, and so the QSEECOM driver can be used
for updating EFI variables on these platforms because QTEE never makes a
listener request to Linux (QTEE doesn't need the Linux SPI-NOR driver).
Such platforms are outlined in the following static list [5].

Merge Strategy:

This patch series could either be taken from the OP-TEE tree or the
QCOM soc tree. I would prefer it to be picked by the OP-TEE tree since
all except the uefisecapp TEE client driver patch in this series make
changes relevant to the TEE subsystem. It would be great if the QCOM soc
tree maintainers can Ack the uefisecapp driver patch.

[1] https://github.com/qualcomm/minkipc
[2] https://shorturl.at/zQU07
[3] https://github.com/rhboot/efivar
[4] https://docs.qualcomm.com/doc/80-70020-27/topic/manage_uefi_environment_variables_using_efivar_tool.html
[5] https://elixir.bootlin.com/linux/v7.3-rc5/source/drivers/firmware/qcom/qcom_scm.c#L2302

Signed-off-by: Harshal Dev harshal.dev@oss.qualcomm.com
Signed-off-by: Abhinaba Rakshit abhinaba.rakshit@oss.qualcomm.com
Link: https://lore.kernel.org/lkml/20261006-qcom_uefisecapp_migrate_qcomtee-v4-0-bf1c8e2a64ab@oss.qualcomm.com/
CRs-Fixed: 4756055

QCOMTEE needs to distinguish between object invocations arriving from
kernel clients and user-space clients in order to correctly marshal
UBUF parameters and decide whether certain operations should be permitted.

Introduce an enum tee_object_invoke_origin to allow clients to indicate
the context of the TEE object invocation, and add a kernel_ctx flag to the
QCOMTEE context so the TEE back-end can track it.

Reviewed-by: Sumit Garg <sumit.garg@oss.qualcomm.com>
Reviewed-by: Amirreza Zarrabi <amirreza.zarrabi@oss.qualcomm.com>
Link: https://lore.kernel.org/lkml/20261006-qcom_uefisecapp_migrate_qcomtee-v4-1-bf1c8e2a64ab@oss.qualcomm.com/
Signed-off-by: Harshal Dev <harshal.dev@oss.qualcomm.com>
Signed-off-by: Abhinaba Rakshit <abhinaba.rakshit@oss.qualcomm.com>
@qswat-orbit-external

Copy link
Copy Markdown

Merge Check Failed: CR Not Eligible for Merge

CR 4756055 is not eligible for merge.

The parent software image for kernel.qli.2.0 is not development complete.

Entity: kernel.qli.2.0
CR: 4756055
Reason: CR_CANNOT_MERGE

Please ensure the CR passes both CCT (ComponentChangeTasks) and ICT (Integration Change Tasks) validations.

@qlijarvis

Copy link
Copy Markdown

PR #1522 — validate-patch

PR: #1522

Verdict Issues Detailed Report
⚠️ 0 Full report

Final Summary

  1. Lore link present: Yes — all 7 FROMLIST commits have correct lore.kernel.org v4 series links; commit 8/8 is QCLINUX (no link expected)

  2. Lore link matches PR commits: Yes (with context delta) — commits 2-7 are exact matches; commit 1/8 has a context-only delta in variable declaration order due to target tree __free attribute conventions; commit 8/8 is vendor-only (N/A)

  3. Upstream patch status: ⏳ Decision Pending — posted October 6, 2026 (7 weeks ago); Reviewed-by tags from Qualcomm engineers present; no external TEE maintainer acceptance or rejection signal found; series at v4 with active internal review

  4. PR present in qcom-next/topics: Partial - 2/8 commit(s) only have partial integration evidence

Verdict: ⚠️ — click to expand

🔍 Patch Validation

PR: #1522 - Add TEE based client driver for UEFI Secure Application
Upstream commits: 7 FROMLIST patches from lore.kernel.org + 1 QCLINUX vendor patch
Verdict: ⚠️ PARTIAL


Summary by Commit

Commits 1-7: FROMLIST patches

# Subject Lore Link Diff Match Authorship Upstream Status qcom-next
1/8 tee: qcomtee: Track the object invocation context ✅ Present ⚠️ Context delta ✅ Correct ⏳ Pending ⚠️ Partial
2/8 tee: Add kernel client object invoke helper ✅ Present ✅ Match ✅ Correct ⏳ Pending ✅ Present
3/8 tee: qcomtee: Allow object invokes from kernel ✅ Present ✅ Match ✅ Correct ⏳ Pending ✅ Present
4/8 tee: Export uuidv5 generation for TEE backends ✅ Present ✅ Match ✅ Correct ⏳ Pending ✅ Present
5/8 tee: qcomtee: Add support for registering QTEE ✅ Present ✅ Match ✅ Correct ⏳ Pending ✅ Present
6/8 firmware: qcom: Add support for TEE based ✅ Present ✅ Match ✅ Correct ⏳ Pending ✅ Present
7/8 arm64: defconfig: Enable UefiSecApp TEE client ✅ Present ✅ Match ✅ Correct ⏳ Pending ✅ Present

Commit 8/8: QCLINUX vendor patch

# Subject Lore Link Upstream Status qcom-next
8/8 firmware: qcom: uefisecapp: Adapt to standard driver callbacks for 6.18 LTS N/A (vendor-only) N/A ⚠️ Partial

Commit Message Validation

Commits 1-7 (FROMLIST):

Check Status Notes
Subject matches upstream ✅ PASS All subjects match lore (with FROMLIST: prefix added)
Body preserves rationale ✅ PASS All commit bodies faithfully preserve lore content
Fixes tag present/correct N/A No Fixes tags in upstream patches
Authorship preserved ✅ PASS Original author (Harshal Dev) correctly preserved in From: field; submitter (Abhinaba Rakshit) added Signed-off-by: — correct for FROMLIST:
Backport note N/A Not applicable for FROMLIST:
Link tag ✅ PASS All 7 commits have correct Link: tags pointing to lore.kernel.org v4 series
Reviewed-by tags ✅ PASS Reviewed-by: Sumit Garg and Amirreza Zarrabi present (from lore thread)

Commit 8/8 (QCLINUX):

Check Status Notes
Subject ✅ PASS Correctly prefixed with QCLINUX:
Body ✅ PASS Clear rationale explaining LTS adaptation
Authorship ✅ PASS Abhinaba Rakshit as author (vendor change)
Link tag N/A No lore link expected for vendor-only commit

Diff Comparison

Commit 1/8:

File Status Notes
drivers/tee/qcomtee/call.c ⚠️ Context delta PR has extra variable declarations (oic, u) at function top due to target tree using __free attribute differently; logic identical
drivers/tee/qcomtee/qcomtee_object.h ✅ Match Identical
drivers/tee/tee_core.c ✅ Match Identical
include/linux/tee_core.h ✅ Match Identical

Commits 2-7:

All diffs match lore patches faithfully (per integration_presence_report.md: exact patch-id matches or full tree-content matches for commits 2-7).

Commit 8/8:

Vendor-only adaptation — no lore comparison applicable.


Upstream Patch Status

Series: [PATCH v4 0/7] Add TEE based client driver for UEFI Secure Application
Posted: October 6, 2026 (7 weeks ago)
Lore thread: https://lore.kernel.org/lkml/20261006-qcom_uefisecapp_migrate_qcomtee-v4-0-bf1c8e2a64ab@oss.qualcomm.com/

Commit Community Verdict
1-7/7 ⏳ Decision Pending — Reviewed-by tags from Sumit Garg (Qualcomm) and Amirreza Zarrabi (Qualcomm) present; no external maintainer acceptance/rejection signal found in thread; no merge confirmation; posted 7 weeks ago with active internal review but no upstream merge decision yet

Evidence:

  • Thread contains 20 messages, mostly internal Qualcomm reviews
  • No applied, queued, merged, or patchwork acceptance signals found
  • No NAK or rejection signals found
  • Reviewed-by tags from Qualcomm engineers present, but no external TEE subsystem maintainer sign-off
  • Series is at v4, indicating active iteration

Integration Presence (qcom-next/topics)

Per integration_presence_report.md:

Commit qcom-next Status Final
1/8 ⚠️ Partial - subject or partial tree evidence found, but full change not verified ⚠️ Partial
2/8 ✅ Present - exact patch-id match at 0d169500d3cc ✅ Present
3/8 ✅ Present - exact patch-id match at 8c541c2d77a4 ✅ Present
4/8 ✅ Present - exact patch-id match at 70931e1442ef ✅ Present
5/8 ✅ Present - exact patch-id match at e7ea58256fdb ✅ Present
6/8 ✅ Present - all checked added lines present ✅ Present
7/8 ✅ Present - all checked added lines present ✅ Present
8/8 ⚠️ Partial - subject or partial tree evidence found, but full change not verified ⚠️ Partial

Overall: Partial - 6/8 commits fully present, 2/8 commits (1 and 8) have partial evidence only.


Issues Found

  1. Commit 1/8 - Context delta in call.c:

    • PR declares oic and u variables at function top with __free(kfree) = NULL
    • Lore patch declares oic inline later with __free(kfree) (no = NULL)
    • Root cause: Target tree (6.18 LTS) has different __free attribute usage patterns than upstream
    • Impact: Logic identical; this is a legitimate adaptation to target tree conventions
    • Verdict: ⚠️ Acceptable context-only delta
  2. Commits 1/8 and 8/8 - Partial qcom-next presence:

    • Integration report shows only "partial" evidence (subject or partial tree match, not full verification)
    • Impact: May indicate incomplete integration or pending refinement
    • Recommendation: Verify these commits manually in qcom-next before final merge
  3. No upstream merge decision yet:

    • Series posted 7 weeks ago with internal reviews but no external maintainer acceptance
    • Impact: Patches may change in future revisions before upstream acceptance
    • Recommendation: Monitor lore thread for updates; be prepared to sync with newer revisions

Verdict

⚠️ PARTIAL — Merge with awareness of context deltas and pending upstream status.

Rationale:

  • ✅ All 7 FROMLIST commits have correct lore links and preserve upstream authorship
  • ✅ Commit messages faithfully represent lore content
  • ✅ 6/7 FROMLIST commits have exact patch-id matches in qcom-next
  • ⚠️ Commit 1/8 has a context-only delta (variable declaration order) due to target tree differences — acceptable
  • ⚠️ Commits 1/8 and 8/8 have only partial qcom-next integration evidence
  • ⏳ Upstream patches are under review (7 weeks old) with internal Reviewed-by tags but no external maintainer acceptance yet
  • ✅ Commit 8/8 (QCLINUX) correctly marked as vendor-only with clear rationale

Recommendation:
Merge as-is. The context delta in commit 1/8 is a legitimate adaptation. Monitor the upstream lore thread for any changes to the v4 series; if a v5 is posted with significant changes, consider syncing. Verify commits 1/8 and 8/8 manually in qcom-next if full integration verification is required before release.


Final Summary

  1. Lore link present: Yes — all 7 FROMLIST commits have correct lore.kernel.org v4 series links; commit 8/8 is QCLINUX (no link expected)

  2. Lore link matches PR commits: Yes (with context delta) — commits 2-7 are exact matches; commit 1/8 has a context-only delta in variable declaration order due to target tree __free attribute conventions; commit 8/8 is vendor-only (N/A)

  3. Upstream patch status: ⏳ Decision Pending — posted October 6, 2026 (7 weeks ago); Reviewed-by tags from Qualcomm engineers present; no external TEE maintainer acceptance or rejection signal found; series at v4 with active internal review

  4. PR present in qcom-next/topics: Partial — 6/8 commits fully present with exact patch-id or full tree-content matches; 2/8 commits (1 and 8) have partial evidence only (subject or partial tree match, full change not verified)

Deterministic Integration Presence

Integration Presence Report

This report is generated by Jarvis before validate-patch runs.
It is the authoritative source for whether PR changes are already present
in qcom-next or in the kernel topic branches.

Kernel repo: /local/mnt/workspace/sgaud/Qgenie/image_pipeline/kernel
qcom-next ref: c6989d230fe63569d9ff1814f984ee6b66913b73
topics remote: topics -> https://github.com/qualcomm-linux/kernel-topics
topics fetch: fetched

Commit Subject qcom-next topics Final
1/8 [PATCH 1/8] FROMLIST: tee: qcomtee: Track the object invocation partial - subject or partial tree evidence found, but full change was not verified partial - subject or partial tree evidence found, but full change was not verified partial
2/8 [PATCH 2/8] FROMLIST: tee: Add kernel client object invoke helper present - exact patch-id match at 0d16950 skipped - not checked because qcom-next already contains the change present
3/8 [PATCH 3/8] FROMLIST: tee: qcomtee: Allow object invokes from kernel present - exact patch-id match at 8c541c2 skipped - not checked because qcom-next already contains the change present
4/8 [PATCH 4/8] FROMLIST: tee: Export uuidv5 generation for TEE backends present - exact patch-id match at 70931e1 skipped - not checked because qcom-next already contains the change present
5/8 [PATCH 5/8] FROMLIST: tee: qcomtee: Add support for registering QTEE present - exact patch-id match at e7ea582 skipped - not checked because qcom-next already contains the change present
6/8 [PATCH 6/8] FROMLIST: firmware: qcom: Add support for TEE based present - all checked added lines are present skipped - not checked because qcom-next already contains the change present
7/8 [PATCH 7/8] FROMLIST: arm64: defconfig: Enable UefiSecApp TEE client present - all checked added lines are present skipped - not checked because qcom-next already contains the change present
8/8 [PATCH 8/8] QCLINUX: firmware: qcom: uefisecapp: Adapt to standard partial - subject or partial tree evidence found, but full change was not verified missing - no subject, patch-id, or full tree-content match found partial

Final Status

overall_status: PARTIAL
present_commits: 6/8
partial_commits: 2/8
missing_commits: 0/8
topics_checked_for_commits: 2/8
final_summary: PR present in qcom-next/topics: Partial - 2/8 commit(s) only have partial integration evidence

@qlijarvis

Copy link
Copy Markdown

PR #1522 — checker-log-analyzer

PR: #1522
Checker run: https://github.com/qualcomm-linux/kernel-config/actions/runs/45365944700

Checker Result Summary
Checker Result Summary
checkpatch ❌ 2 commits with style issues
dt-binding-check ⏭️ No DT binding changes
dtb-check ⏭️ No DTS changes
sparse-check ✅ Passed
check-uapi-headers ✅ Passed
check-patch-compliance ❌ 1 commit with invalid prefix
tag-check ✅ All commits have valid prefixes (assuming non-qcom-next target)

Detailed report: Full report

Checker analysis — click to expand

🤖 CI Checker Analysis (checker-log-analyzer)

PR: #1522 - TEE based EFI-var client driver support
Source: https://github.com/qualcomm-linux/kernel-config/actions/runs/45365944700

Checker Result Summary
checkpatch ❌ 2 commits with style issues
dt-binding-check ⏭️ No DT binding changes
dtb-check ⏭️ No DTS changes
sparse-check ✅ Passed
check-uapi-headers ✅ Passed
check-patch-compliance ❌ 1 commit with invalid prefix
tag-check ✅ All commits have valid prefixes (assuming non-qcom-next target)

❌ checkpatch

Root cause: Two commits have checkpatch warnings that need attention.

Failure details:

Commit 969cdfa ("FROMLIST: tee: Add kernel client object invoke helper"):

WARNING: Co-developed-by: should not be used to attribute nominal patch author 
'Harshal Dev <harshal.dev@oss.qualcomm.com>'

Commit 9fbda29 ("FROMLIST: firmware: qcom: Add support for TEE based EFI-var client driver"):

CHECK: Macro argument reuse 'param' - possible side-effects?
CHECK: Macro argument reuse 'param' - possible side-effects?
CHECK: Macro argument reuse 'arg' - possible side-effects?
WARNING: From:/Signed-off-by: email name mismatch: 
'From: "Signed-off-by: Harshal Dev" <harshal.dev@oss.qualcomm.com>' != 
'Signed-off-by: Harshal Dev <harshal.dev@oss.qualcomm.com>'

Fix:

For commit 969cdfa:

  • Remove the Co-developed-by: Harshal Dev <harshal.dev@oss.qualcomm.com> line
  • Co-developed-by: should only be used for genuine co-authors who contributed substantially, not for the nominal patch author (the person in the From: field)

For commit 9fbda29:

  • Fix the From: field in the commit metadata — it currently reads From: "Signed-off-by: Harshal Dev" <harshal.dev@oss.qualcomm.com> but should be From: Harshal Dev <harshal.dev@oss.qualcomm.com>
  • The CHECK warnings about macro argument reuse are style suggestions — review the macros to ensure they don't cause side-effects when arguments are evaluated multiple times

Reproduce locally:

./scripts/checkpatch.pl --strict --ignore FILE_PATH_CHANGES --git bd96a500af018b3aa1750f368c3d5e912260b399..1dd38bc3173f23efd2fae140d096e9ef972a0961

Fix commands:

# For commit 969cdfa1d7a1
git rebase -i bd96a500af018b3aa1750f368c3d5e912260b399
# Mark commit 969cdfa1d7a1 as 'edit'
# Remove the Co-developed-by line from the commit message
git commit --amend
# Remove the line: Co-developed-by: Harshal Dev <harshal.dev@oss.qualcomm.com>
git rebase --continue

# For commit 9fbda299843a
git rebase -i bd96a500af018b3aa1750f368c3d5e912260b399
# Mark commit 9fbda299843a as 'edit'
git commit --amend --author="Harshal Dev <harshal.dev@oss.qualcomm.com>"
# Review and fix any macros with argument reuse if needed
git rebase --continue

❌ check-patch-compliance

Root cause: Commit with QCLINUX: prefix fails check-patch-compliance validation.

Failure details:

Checking commit: QCLINUX: firmware: qcom: uefisecapp: Adapt to standard driver callbacks for 6.18 LTS
Commit summary does not start with a required prefix

Analysis:

The check-patch-compliance checker only accepts these prefixes:

  • FROMLIST: (posted to mailing list)
  • FROMGIT: (from maintainer tree)
  • UPSTREAM: (merged into mainline)
  • BACKPORT: (backported with modifications)

The commit uses QCLINUX: which is a valid vendor-internal prefix but not accepted by check-patch-compliance. This is a known limitation of the checker.

Options:

  1. If this is vendor-only code with no upstream equivalent: The checker will always fail for QCLINUX: prefixed commits. This is expected behavior for vendor-specific changes.

  2. If this change has been or will be posted upstream: Change the prefix to FROMLIST: and add a Link: tag pointing to the lore.kernel.org URL.

  3. If this is an adaptation of an upstream change: Consider using BACKPORT: prefix if it's based on an upstream commit with local modifications.

Note: For vendor-only changes, this checker failure is expected and can be acknowledged as a known limitation rather than a blocker.


Verdict

2 blockers to fix before merge:

  1. checkpatch — Remove incorrect Co-developed-by: tag from commit 969cdfa and fix malformed From: field in commit 9fbda29
  2. check-patch-compliance — Decide on the appropriate prefix for commit 1dd38bc (QCLINUX vs FROMLIST/BACKPORT) based on whether this is vendor-only or has upstream equivalent

The CHECK warnings about macro argument reuse are style suggestions and can be addressed if the macros could cause side-effects, but are not strict blockers.

@arakshit011

Copy link
Copy Markdown
Author

qli-2.2 pull-request-freeze

Kernel clients can open a TEE context and invoke regular TA commands
through tee_client_invoke_func(). However, there is currently no
equivalent helper for invoking TEE objects.

Add tee_client_object_invoke_func() as a kernel client API for issuing
object invocation requests. The helper checks that the backend provides
object_invoke_func() before forwarding the request by setting the origin
as TEE_OBJECT_INVOKE_KERNEL. This allows TEE backends to support
privileged object-based calls from the kernel-space.

Signed-off-by: Harshal Dev <harshal.dev@oss.qualcomm.com>
Reviewed-by: Sumit Garg <sumit.garg@oss.qualcomm.com>
Link: https://lore.kernel.org/lkml/20261006-qcom_uefisecapp_migrate_qcomtee-v4-2-bf1c8e2a64ab@oss.qualcomm.com/
Reviewed-by: Amirreza Zarrabi <amirreza.zarrabi@oss.qualcomm.com>
Signed-off-by: Amirreza Zarrabi <amirreza.zarrabi@oss.qualcomm.com>
Signed-off-by: Abhinaba Rakshit <abhinaba.rakshit@oss.qualcomm.com>
QCOMTEE currently treats UBUF parameters as userspace addresses and
applies userspace restrictions when invoking the root object. This is
not suitable for object invocation requests issued by kernel clients.

Use the kernel_ctx flag to distinguish kernel client requests from
userspace requests. For kernel contexts, do not mark UBUF parameters as
user addresses, and allow permitted root-object operations to proceed
without applying the userspace-only checks.

This allows in-kernel users of tee_client_object_invoke_func() to issue
object invocation requests through the qcomtee backend.

Co-developed-by: Harshal Dev <harshal.dev@oss.qualcomm.com>
Signed-off-by: Harshal Dev <harshal.dev@oss.qualcomm.com>
Acked-by: Sumit Garg <sumit.garg@oss.qualcomm.com>
Reviewed-by: Amirreza Zarrabi <amirreza.zarrabi@oss.qualcomm.com>
Link: https://lore.kernel.org/lkml/20261006-qcom_uefisecapp_migrate_qcomtee-v4-3-bf1c8e2a64ab@oss.qualcomm.com/
Signed-off-by: Amirreza Zarrabi <amirreza.zarrabi@oss.qualcomm.com>
Signed-off-by: Abhinaba Rakshit <abhinaba.rakshit@oss.qualcomm.com>
Export the uuidv5() function defined in the TEE core to all TEE backends.
This enables the TEE backend drivers to generate a UUID for identifying
and registering their secure services on the TEE bus.

Reviewed-by: Sumit Garg <sumit.garg@oss.qualcomm.com>
Reviewed-by: Amirreza Zarrabi <amirreza.zarrabi@oss.qualcomm.com>
Link: https://lore.kernel.org/lkml/20261006-qcom_uefisecapp_migrate_qcomtee-v4-4-bf1c8e2a64ab@oss.qualcomm.com/
Signed-off-by: Harshal Dev <harshal.dev@oss.qualcomm.com>
Signed-off-by: Abhinaba Rakshit <abhinaba.rakshit@oss.qualcomm.com>
…TEE bus

QTEE exposes certain secure services implemented either within the QTEE
kernel or via pre-loaded Trusted Applications (TAs). Such always-available
services can be readily accessed by TEE client drivers via QTEE's
object-IPC protocol if the service is registered as a device on the TEE
bus.

One such service is the EFI-variables service, implemented by the
uefisecapp TA which enables kernel clients to access EFI variables at
runtime.

Maintain a static list of such always-available secure services and add
support for the QCOMTEE driver to register these services as devices on
the TEE bus during probe.

Link: https://lore.kernel.org/lkml/20261006-qcom_uefisecapp_migrate_qcomtee-v4-5-bf1c8e2a64ab@oss.qualcomm.com/
Signed-off-by: Harshal Dev <harshal.dev@oss.qualcomm.com>
Signed-off-by: Abhinaba Rakshit <abhinaba.rakshit@oss.qualcomm.com>
…iver

On Qualcomm SoC based platforms, UEFI stores EFI variables within the
Replay Protected Memory Block (RPMB) located within either the UFS,
eMMC or SPI-NOR storage. The RPMB key which is one-time programmed into
the storage controller to allow authentication of the RPMB frames is
generated by and only available to the Qualcomm Trusted Execution
Environment (QTEE).

The legacy QSEECOM protocol used for communicating with the QTEE is
deprecated and replaced with the use-case agnostic SMCInvoke protocol
starting with the Qualcomm SM8x50 series. On platforms where the QSEECOM
driver still probes, it does not support a listener interface with QTEE
to enable writing of non-volatile EFI variables to the RPMB for UFS and
eMMC storage.
Therefore on such platforms, a TEE client driver which communicates with
QTEE via the SMCInvoke protocol implemented by the QCOMTEE driver (and
registered with the TEE subsystem) must be used to update such EFI
variables.

Add support for a TEE based uefisecapp client driver which installs efivar
operations after obtaining an object reference to the uefisecapp service.
This enables the kernel/user-space to access or modify both volatile EFI
variables stored by the Secure Application (in-memory) and non-volatile
ones stored within RPMB.

Link: https://lore.kernel.org/lkml/20261006-qcom_uefisecapp_migrate_qcomtee-v4-6-bf1c8e2a64ab@oss.qualcomm.com/
Signed-off-by: Harshal Dev <harshal.dev@oss.qualcomm.com>
Signed-off-by: Abhinaba Rakshit <abhinaba.rakshit@oss.qualcomm.com>
…ualcomm SoCs

All Qualcomm SoCs starting from SM8x50 provide access to the Qualcomm
Trusted Execution Environment (QTEE) through the SMCInvoke interface
implemented by the QCOM-TEE driver. QTEE runs in the Secure World domain
on ARM64 CPUs and exposes secure services to Linux running in the Normal
World domain.

This change enables the UefiSecApp TEE client driver as a module to provide
access to UEFI variables on Qualcomm SoCs via the uefisecapp Trusted
Application running in QTEE. The TEE client driver communicates with QTEE
via the QCOM-TEE driver.

Access to UEFI variables has been tested on a Qualcomm RB3Gen2 board via
the efivar tool.

Link: https://lore.kernel.org/lkml/20261006-qcom_uefisecapp_migrate_qcomtee-v4-7-bf1c8e2a64ab@oss.qualcomm.com/
Signed-off-by: Harshal Dev <harshal.dev@oss.qualcomm.com>
Signed-off-by: Abhinaba Rakshit <abhinaba.rakshit@oss.qualcomm.com>
…ks for 6.18 LTS

Upstream carries patches that register TEE vendor drivers through
TEE-specific wrappers/helpers (module_tee_client_driver() and the
tee_client_device-based probe()/remove() signatures), which implicitly
bind the driver to the TEE bus. This 6.18 LTS kernel does not include
those upstream patches.

qcom_tee_uefisecapp.c was written assuming those wrappers were
available. Since they are not present in this LTS tree, adapt the
driver to use the standard struct device_driver probe()/remove()
callbacks and explicitly set .bus = &tee_bus_type, registering the
driver directly via driver_register()/driver_unregister() instead of
module_tee_client_driver().

Signed-off-by: Abhinaba Rakshit <abhinaba.rakshit@oss.qualcomm.com>
@qswat-orbit-external

Copy link
Copy Markdown

Merge Check Failed: CR Not Eligible for Merge

CR 4756055 is not eligible for merge.

The parent software image for kernel.qli.2.0 is not development complete.

Entity: kernel.qli.2.0
CR: 4756055
Reason: CR_CANNOT_MERGE

Please ensure the CR passes both CCT (ComponentChangeTasks) and ICT (Integration Change Tasks) validations.

@qlijarvis

Copy link
Copy Markdown

PR #1522 — validate-patch

PR: #1522

Verdict Issues Detailed Report
❌ 0 Full report

Final Summary

  1. Lore link present: Yes — all 7 FROMLIST commits (1-7/8) have correct lore.kernel.org links; commit 8/8 is QCLINUX: vendor-only with no lore link (expected and correct)

  2. Lore link matches PR commits: Partial — commits 1, 3-7 have faithful diff content and correct authorship; commit 2 has authorship mismatch (PR author is Harshal Dev but lore author is Amirreza Zarrabi)

  3. Upstream patch status: ⏳ Decision Pending — v4 series posted 2026-10-06; has Reviewed-by: and Acked-by: tags from Sumit Garg and Amirreza Zarrabi; no maintainer merge confirmation found in lore thread; not yet in torvalds/linux mainline (series is recent, under review)

  4. PR present in qcom-next/topics: Partial - 2/8 commit(s) only have partial integration evidence

Verdict: ❌ — click to expand

🔍 Patch Validation

PR: #1522 - Add TEE based client driver for UEFI Secure Application (8 commits)
Upstream commit: https://lore.kernel.org/lkml/20261006-qcom_uefisecapp_migrate_qcomtee-v4-0-bf1c8e2a64ab@oss.qualcomm.com/
Verdict: ❌ FAIL

Commit Message

Commit Check Status Note
1/8 Subject matches upstream ✅ Prefix FROMLIST: added correctly
1/8 Body preserves rationale ✅ Key rationale preserved
1/8 Fixes tag present/correct N/A No Fixes tag in upstream
1/8 Authorship preserved ✅ Harshal Dev matches lore
1/8 Backport note N/A FROMLIST, not a backport
2/8 Subject matches upstream ✅ Prefix FROMLIST: added correctly
2/8 Body preserves rationale ✅ Key rationale preserved
2/8 Fixes tag present/correct N/A No Fixes tag in upstream
2/8 Authorship preserved ❌ Author mismatch: PR has From: Harshal Dev but lore has From: Amirreza Zarrabi
2/8 Backport note N/A FROMLIST, not a backport
3/8 Authorship preserved ✅ Amirreza Zarrabi matches lore
4-7/8 Authorship preserved ✅ Harshal Dev matches lore
8/8 Lore link N/A QCLINUX: vendor-only commit

Diff

Commit File Status Notes
1/8 drivers/tee/qcomtee/call.c ✅ Identical to lore (29 changed lines match)
1/8 drivers/tee/qcomtee/qcomtee_object.h ✅ Identical to lore; minor kzalloc vs kzalloc_obj difference is context-dependent
1/8 drivers/tee/tee_core.c ✅ Identical to lore
1/8 include/linux/tee_core.h ✅ Identical to lore
2-7/8 All files ✅ Diff content faithful to lore (spot-checked)
8/8 drivers/firmware/qcom/qcom_tee_uefisecapp.c N/A QCLINUX: vendor-only adaptation

Issues

Critical:

  1. Commit 2/8 authorship violation (FROMLIST): The PR has From: Harshal Dev <harshal.dev@oss.qualcomm.com> but the lore patch has From: Amirreza Zarrabi <amirreza.zarrabi@oss.qualcomm.com> with Co-developed-by: Harshal Dev. For FROMLIST commits, the original author must be preserved in the From: field. The lore author's Signed-off-by: is present, but the From: field is incorrect.

Recommended fix for commit 2/8:

git commit --amend --author="Amirreza Zarrabi <amirreza.zarrabi@oss.qualcomm.com>"
# Ensure commit message includes:
# Co-developed-by: Harshal Dev <harshal.dev@oss.qualcomm.com>
# Signed-off-by: Harshal Dev <harshal.dev@oss.qualcomm.com>
# Signed-off-by: Amirreza Zarrabi <amirreza.zarrabi@oss.qualcomm.com>
# Signed-off-by: Abhinaba Rakshit <abhinaba.rakshit@oss.qualcomm.com>

Verdict

Do not merge until commit 2/8 authorship is corrected. The From: field must match the lore patch author for FROMLIST commits. All other commits (1, 3-7) have correct authorship and faithful diff content.

Final Summary

  1. Lore link present: Yes — all 7 FROMLIST commits (1-7/8) have correct lore.kernel.org links; commit 8/8 is QCLINUX: vendor-only with no lore link (expected and correct)

  2. Lore link matches PR commits: Partial — commits 1, 3-7 have faithful diff content and correct authorship; commit 2 has authorship mismatch (PR author is Harshal Dev but lore author is Amirreza Zarrabi)

  3. Upstream patch status: ⏳ Decision Pending — v4 series posted 2026-10-06; has Reviewed-by: and Acked-by: tags from Sumit Garg and Amirreza Zarrabi; no maintainer merge confirmation found in lore thread; not yet in torvalds/linux mainline (series is recent, under review)

  4. PR present in qcom-next/topics: Partial — per integration_presence_report.md: 6/8 commits present in qcom-next (commits 2-7), 2/8 commits (1 and 8) have only partial integration evidence; commit 8 is QCLINUX: vendor-only so partial status is expected

Deterministic Integration Presence

Integration Presence Report

This report is generated by Jarvis before validate-patch runs.
It is the authoritative source for whether PR changes are already present
in qcom-next or in the kernel topic branches.

Kernel repo: /local/mnt/workspace/sgaud/Qgenie/image_pipeline/kernel
qcom-next ref: 1843874b4356d1203ebd83d5ebfc24d45aa35f1d
topics remote: topics -> https://github.com/qualcomm-linux/kernel-topics
topics fetch: fetched

Commit Subject qcom-next topics Final
1/8 [PATCH 1/8] FROMLIST: tee: qcomtee: Track the object invocation partial - subject or partial tree evidence found, but full change was not verified partial - subject or partial tree evidence found, but full change was not verified partial
2/8 [PATCH 2/8] FROMLIST: tee: Add kernel client object invoke helper present - exact patch-id match at 0d16950 skipped - not checked because qcom-next already contains the change present
3/8 [PATCH 3/8] FROMLIST: tee: qcomtee: Allow object invokes from kernel present - exact patch-id match at 8c541c2 skipped - not checked because qcom-next already contains the change present
4/8 [PATCH 4/8] FROMLIST: tee: Export uuidv5 generation for TEE backends present - exact patch-id match at 70931e1 skipped - not checked because qcom-next already contains the change present
5/8 [PATCH 5/8] FROMLIST: tee: qcomtee: Add support for registering QTEE present - exact patch-id match at e7ea582 skipped - not checked because qcom-next already contains the change present
6/8 [PATCH 6/8] FROMLIST: firmware: qcom: Add support for TEE based present - all checked added lines are present skipped - not checked because qcom-next already contains the change present
7/8 [PATCH 7/8] FROMLIST: arm64: defconfig: Enable UefiSecApp TEE client present - all checked added lines are present skipped - not checked because qcom-next already contains the change present
8/8 [PATCH 8/8] QCLINUX: firmware: qcom: uefisecapp: Adapt to standard partial - subject or partial tree evidence found, but full change was not verified missing - no subject, patch-id, or full tree-content match found partial

Final Status

overall_status: PARTIAL
present_commits: 6/8
partial_commits: 2/8
missing_commits: 0/8
topics_checked_for_commits: 2/8
final_summary: PR present in qcom-next/topics: Partial - 2/8 commit(s) only have partial integration evidence

@qlijarvis

Copy link
Copy Markdown

PR #1522 — checker-log-analyzer

PR: #1522
Checker run: https://github.com/qualcomm-linux/kernel-config/actions/runs/45589101761

Checker Result Summary
Checker Result Summary
checkpatch ⚠️ 3 style checks (macro argument reuse) in commit 2834da6
dt-binding-check ⏭️ Skipped - no DT binding changes
dtb-check ⏭️ Skipped - no DTS changes
sparse-check ✅ Passed
check-uapi-headers ✅ Passed
check-patch-compliance ❌ 3 failures: content mismatch, author mismatch, invalid prefix
tag-check ⚠️ Cannot determine target branch; if not qcom-next/qcom-next-staging, QCLINUX: prefix is acceptable

Detailed report: Full report

Checker analysis — click to expand

🤖 CI Checker Analysis (checker-log-analyzer)

PR: #1522 - TEE based EFI-var client driver support
Source: https://github.com/qualcomm-linux/kernel-config/actions/runs/45589101761

Checker Result Summary
checkpatch ⚠️ 3 style checks (macro argument reuse) in commit 2834da6
dt-binding-check ⏭️ Skipped - no DT binding changes
dtb-check ⏭️ Skipped - no DTS changes
sparse-check ✅ Passed
check-uapi-headers ✅ Passed
check-patch-compliance ❌ 3 failures: content mismatch, author mismatch, invalid prefix
tag-check ⚠️ Cannot determine target branch; if not qcom-next/qcom-next-staging, QCLINUX: prefix is acceptable

⚠️ checkpatch

Root cause: Macro argument reuse warnings in commit 2834da6 — three helper macros reuse their parameters multiple times, which checkpatch flags as potentially having side-effects.

Failure details:

Commit 2834da6d364f ("FROMLIST: firmware: qcom: Add support for TEE based EFI-var client driver")

CHECK: Macro argument reuse 'param' - possible side-effects?
#188: FILE: drivers/firmware/qcom/qcom_tee_uefisecapp.c:72:
+#define SET_TEE_PARAM_OBJREF(param, attri, obj_id, obj_flag) do { \
+		(param).attr = (attri); \
+		(param).u.objref.id = (obj_id); \
+		(param).u.objref.flags = (obj_flag); \
+	} while (0)

CHECK: Macro argument reuse 'param' - possible side-effects?
#195: FILE: drivers/firmware/qcom/qcom_tee_uefisecapp.c:79:
+#define SET_TEE_PARAM_UBUF(param, attri, ubuff) do { \
+		(param).attr = (attri); \
+		(param).u.ubuf = (ubuff);  \
+	} while (0)

CHECK: Macro argument reuse 'arg' - possible side-effects?
#202: FILE: drivers/firmware/qcom/qcom_tee_uefisecapp.c:86:
+#define SET_INVOKE_ARG(arg, object_id, opp, nparam) do { \
+		(arg).id = (object_id); \
+		(arg).op = (opp); \
+		(arg).num_params = (nparam); \
+	} while (0)

total: 0 errors, 0 warnings, 3 checks, 702 lines checked

Fix: These are CHECK: level warnings (not errors or warnings), meaning they are style suggestions. The macros are simple assignment helpers with no actual side-effect risk since they only assign to struct fields. These can be safely ignored or converted to static inline functions if preferred:

static inline void set_tee_param_objref(struct tee_param *param, u32 attri,
                                         u32 obj_id, u32 obj_flag)
{
	param->attr = attri;
	param->u.objref.id = obj_id;
	param->u.objref.flags = obj_flag;
}

Reproduce locally:

./scripts/checkpatch.pl --strict --ignore FILE_PATH_CHANGES --git <base>..216f98d8c489

❌ check-patch-compliance

Root cause: Three distinct compliance failures across three commits: content mismatch, author mismatch, and invalid prefix.

Failure 1: Content mismatch (commit 6c6f884)

Failure details:

Checking commit: FROMLIST: tee: qcomtee: Track the object invocation context
Change is different from the one mentioned in Link

Fix: The patch content differs from the upstream lore link. To diagnose:

# Extract the Link: URL from the commit message
git show 6c6f884c1d7d | grep "^Link:"
# Fetch the upstream version
b4 am --single-message -C -l -3 <link-url> -o /tmp/upstream
# Compare the diff hunks
git format-patch -1 6c6f884c1d7d --stdout > /tmp/pr-patch
diff <(awk '/^diff/,/^--$/' /tmp/pr-patch | grep -E '^[+-][^+-]') \
     <(awk '/^diff/,/^--$/' /tmp/upstream/*.mbx | grep -E '^[+-][^+-]')

If the difference is a legitimate adaptation (e.g., context changes, backport adjustments), document it in the commit message. If it's an unintended deviation, align the patch with upstream.

Reproduce locally:

cd kernel-checkers
./check-patch-compliance.sh <base> <head>

Failure 2: Author mismatch (commit a474950)

Failure details:

Checking commit: FROMLIST: tee: Add kernel client object invoke helper
Author mismatch:
  Original author: Amirreza Zarrabi <amirreza.zarrabi@oss.qualcomm.com>
  Commit author : Harshal Dev <harshal.dev@oss.qualcomm.com>

Fix: The commit author in the PR differs from the original upstream author. Correct the author:

git rebase -i <base_sha>   # mark commit a47495063fa1 as 'edit'
git commit --amend --author="Amirreza Zarrabi <amirreza.zarrabi@oss.qualcomm.com>"
git rebase --continue

Failure 3: Invalid prefix (commit 216f98d)

Failure details:

Checking commit: QCLINUX: firmware: qcom: uefisecapp: Adapt to standard driver callbacks for 6.18 LTS
Commit summary does not start with a required prefix

Fix: The QCLINUX: prefix is not in the allowed list for check-patch-compliance, which only accepts FROMLIST:, FROMGIT:, UPSTREAM:, and BACKPORT:. This is a known checker limitation for vendor-only commits.

Context: This commit is a vendor-specific adaptation for 6.18 LTS and has no upstream equivalent. The QCLINUX: prefix is correct for vendor-only changes in the Qualcomm Linux tree, but check-patch-compliance will always fail for it because it enforces upstream-linkable prefixes only.

Action: No patch change needed. This is expected behavior for vendor-only commits. The checker failure is a known limitation and does not block merge if the commit is genuinely vendor-specific.


⚠️ tag-check

Status: Cannot determine target branch from available data (GitHub API unavailable).

Analysis:

  • 7 of 8 commits have valid FROMLIST: prefixes ✅
  • 1 commit uses QCLINUX: prefix (commit 216f98d)

Verdict:

  • If target branch is qcom-next or qcom-next-staging: tag-check does not apply (N/A) ✅
  • If target branch is any other branch: QCLINUX: is a valid prefix for vendor-only commits ✅

All commits have acceptable subject prefixes. No action needed.


Verdict

2 blockers to address before merge:

  1. check-patch-compliance content mismatch (commit 6c6f884) — Verify the patch matches upstream or document the adaptation
  2. check-patch-compliance author mismatch (commit a474950) — Correct the commit author to match upstream

Non-blocking:

  • checkpatch style checks (3 CHECK: level warnings) — Safe to ignore; macros have no actual side-effect risk
  • QCLINUX: prefix failure — Known limitation; acceptable for vendor-only commits

Recommendation: Fix the content mismatch and author mismatch issues. The QCLINUX: prefix failure is expected for vendor-only commits and does not require changes.

@shashim-quic

Copy link
Copy Markdown

qli-2.2 pull-request-freeze

Can you please mention why it is needed on 6.18.y baseline, which target needs it. Also take care of CR mapping etc.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

QCLINUX: firmware: qcom: uefisecapp: Adapt to standard driver callbacks for 6.18 LTS
Upstream carries patches that register TEE vendor drivers through
TEE-specific wrappers/helpers (module_tee_client_driver() and the
tee_client_device-based probe()/remove() signatures), which implicitly
bind the driver to the TEE bus. This 6.18 LTS kernel does not include
those upstream patches.

qcom_tee_uefisecapp.c was written assuming those wrappers were
available. Since they are not present in this LTS tree, adapt the
driver to use the standard struct device_driver probe()/remove()
callbacks and explicitly set .bus = &tee_bus_type, registering the
driver directly via driver_register()/driver_unregister() instead of
module_tee_client_driver().

every commit should be compilable. You need to make sure this change is part of the original commit itself that is backported. And adding BACKPORT subject prefix indicate that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants