From: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
To: Haozhen Li <dezige131@foxmail.com>,
Bjorn Andersson <andersson@kernel.org>,
Konrad Dybcio <konradybcio@kernel.org>
Cc: "Abel Vesa" <abelvesa@kernel.org>,
"Dawid Wróbel" <me@dawidwrobel.com>,
linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org,
"Amirreza Zarrabi" <amirreza.zarrabi@oss.qualcomm.com>,
"Kuldeep Singh" <kuldeep.singh@oss.qualcomm.com>,
"Harshal Dev" <harshal.dev@oss.qualcomm.com>,
"Sumit Garg" <sumit.garg@oss.qualcomm.com>,
"Jorge Ramirez-Ortiz" <jorge.ramirez@oss.qualcomm.com>,
"Dmitry Baryshkov" <dmitry.baryshkov@oss.qualcomm.com>
Subject: Re: [RFC PATCH 1/2] firmware: qcom: scm: Add QSEECOM app loading and shutdown
Date: Mon, 2 Nov 2026 13:26:43 +0100 [thread overview]
Message-ID: <60afa31c-0c68-4e77-81b7-ef78f987f429@oss.qualcomm.com> (raw)
In-Reply-To: <tencent_1E7A74EBC425C78E07DED39F31807B7E1D0A@qq.com>
On 11/1/26 5:01 PM, Haozhen Li wrote:
> QSEECOM clients in the kernel can currently only talk to trusted
> applications that some earlier boot stage happened to load:
> qcom_scm_qseecom_app_get_id() looks an app up and
> qcom_scm_qseecom_app_send() talks to it, but nothing lets Linux start
> one itself.
Adding some relevant folks to Cc for awareness
[...]
> + * The image buffer must lie entirely below the 4 GiB physical mark: QTEE
> + * reads the image address as a 32-bit value even under the 64-bit SMC
> + * calling convention, so a buffer above it would be truncated into a wrong
> + * address. Such buffers are rejected here rather than passed on.
I think that only holds for certain versions
> + *
> + * Return: Zero on success, nonzero on failure.
> + */
> +int qcom_scm_qseecom_app_load(void *img, size_t mdt_len, size_t img_len,
> + u32 *app_id)
> +{
> + phys_addr_t img_phys;
> + struct qcom_scm_qseecom_resp res = {};
> + struct qcom_scm_desc desc = {};
> + int status;
nit: please use reverse-Christmas-tree sorting
[...]
> + /* See the comment on the 4 GiB limit in the function doc above. */
> + if (upper_32_bits(img_phys) || (u64)img_phys + img_len > SZ_4G) {
This can overflow on 32b archs, do `|| img_len > SZ_4G - img_phys` instead
(also below)
Konrad
next prev parent reply other threads:[~2026-11-02 12:26 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20261101160110.3622-1-dezige131@foxmail.com>
2026-11-01 16:01 ` Haozhen Li
2026-11-02 12:26 ` Konrad Dybcio [this message]
2026-11-02 16:27 ` Haozhen Li
2026-11-01 16:01 ` [RFC PATCH 2/2] firmware: qcom: scm: Handle QSEECOM listener callbacks Haozhen Li
2026-11-02 12:28 ` Konrad Dybcio
2026-11-02 16:27 ` Haozhen Li
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=60afa31c-0c68-4e77-81b7-ef78f987f429@oss.qualcomm.com \
--to=konrad.dybcio@oss.qualcomm.com \
--cc=abelvesa@kernel.org \
--cc=amirreza.zarrabi@oss.qualcomm.com \
--cc=andersson@kernel.org \
--cc=dezige131@foxmail.com \
--cc=dmitry.baryshkov@oss.qualcomm.com \
--cc=harshal.dev@oss.qualcomm.com \
--cc=jorge.ramirez@oss.qualcomm.com \
--cc=konradybcio@kernel.org \
--cc=kuldeep.singh@oss.qualcomm.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=me@dawidwrobel.com \
--cc=sumit.garg@oss.qualcomm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®