tee: optee: Fix FF-A offset handling on 64 KiB pages - #553
tee: optee: Fix FF-A offset handling on 64 KiB pages#553mahantesh-nvidia wants to merge 1 commit into
Conversation
|
This patch is needed for Bluefield-4 product/project. This fix is part of an effort to integrate OP-TEE OS as a Secure Partition running under Hafnium (SEL2). Link to Feature Request: (Redmine) https://redmine.mellanox.com/issues/4654738 Due to project deadlines and customer requests prioritizing the submission here and will soon submit the patch for upstream as well. |
BaseOS Kernel ReviewTip ✅ Review passedNo issues found across the reviewed commits. Findings: none 🔍 Review artifacts
📦 Kernel deb builds — 🟢 2/2 passed
Note Build reports and debs are retained for 10 days after the PR closes. Review metadata
This comment is maintained by BaseOS Reviewer and updated when the GitHub watcher publishes a newer review. |
PR Validation ReportPatchscan ✅ No Missing FixesAll cherry-picked commits checked — no missing upstream fixes found. PR Lint ❌ Errors foundDetailsChecking 1 commits...
Cherry-pick digest:
┌──────────────┬──────────────────────────────────────────────────────────────────┬────────────┬─────────┬───────────────────────────┐
│ Local │ Referenced upstream / Patch subject │ Patch-ID │ Subject │ SoB chain │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 5ee4a19150e2 │ [SAUCE] [26.04_linux-nvidia-bos] nvidia: vr: sauce: tee: optee: │ N/A │ N/A │ mahantes │
└──────────────┴──────────────────────────────────────────────────────────────────┴────────────┴─────────┴───────────────────────────┘
Lint results:
W: 5ee4a19150e2 ("[26.04_linux-nvidia-bos] NVIDIA: VR: SAUCE: tee: o"): subject 96 chars (>72)
E: 5ee4a19150e2 ("[26.04_linux-nvidia-bos] NVIDIA: VR: SAUCE: tee: o"): not SAUCE/UBUNTU/Revert but has no upstream reference trailer (cherry picked from commit ... or backported from ...)
PR metadata:
W: PR title missing [<branch>] prefix: "tee: optee: Fix FF-A offset handling on 64 KiB pages"
E: PR targets 26.04_linux-nvidia-bos but body has no https://bugs.launchpad.net/... link
|
|
My comments from here still apply to this PR: #552 (comment) |
Ack, I will submit this patch upstream and include the LKML link as recommended. |
|
like matt said the PR needs the tag: "NVIDIA: VR: SAUCE:" |
jamieNguyenNVIDIA
left a comment
There was a problem hiding this comment.
Two concerns with moving the page prefix into the normal FF-A offset fields.
Thanks for the review and observations. |
Ack, I will add them. Thanks |
b62fa27 to
50cb9b9
Compare
…et handling on 64 KiB pages OP-TEE FF-A memory objects use 4 KiB pages, while the kernel page size may be larger. Consequently, tee_shm::offset can be greater than or equal to FFA_PAGE_SIZE, but OP-TEE rejects such a value in internal_offs. Do not encode the excess page offset in offs_low/offs_high. Those fields describe the logical memref offset and are copied back into tee_param::shm_offs on return. Folding the page offset into them breaks parameter round trips when a memref is reused. They are also ignored by the OPTEE_RPC_CMD_SHM_ALLOC response path, which uses only global_id and internal_offs to construct the shared-memory mobj. Instead, start the FF-A descriptor at the 4 KiB page containing the shared buffer. Store the remaining in-page offset in internal_offs and preserve shm_offs in offs_low/offs_high. This keeps internal_offs within the FF-A page size, maps RPC allocations at the correct address, and preserves normal memref offsets across repeated invocations. Fixes: 4615e5a ("optee: add FF-A support") Signed-off-by: Mahantesh Salimath <[email protected]>
50cb9b9 to
5ee4a19
Compare
|
Hey @mahantesh-nvidia At the beginning of the title of the PR, can you add the: [26.04_linux-nvidia-bos] |
FF-A memory objects use 4 KiB pages, but the kernel page size may be larger. On systems with 64 KiB pages, offsets beyond the first 4 KiB must be encoded in offs_low and offs_high instead of internal_offs.
Fixes: 4615e5a ("optee: add FF-A support")