All of lore.kernel.org
 help / color / mirror / Atom feed
From: Maximilian Luz <luzmaximilian@gmail.com>
To: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
	Rob Herring <robh@kernel.org>
Cc: Bjorn Andersson <andersson@kernel.org>,
	Andy Gross <agross@kernel.org>,
	Konrad Dybcio <konrad.dybcio@linaro.org>,
	Ard Biesheuvel <ardb@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Johan Hovold <johan@kernel.org>,
	Sudeep Holla <sudeep.holla@arm.com>,
	Ilias Apalodimas <ilias.apalodimas@linaro.org>,
	Srinivas Kandagatla <srinivas.kandagatla@linaro.org>,
	Sumit Garg <sumit.garg@linaro.org>,
	Steev Klimaszewski <steev@kali.org>,
	linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org,
	devicetree@vger.kernel.org
Subject: Re: [PATCH v3 3/4] dt-bindings: firmware: Add Qualcomm QSEECOM interface
Date: Thu, 9 Mar 2023 21:34:17 +0100	[thread overview]
Message-ID: <e20e489b-c033-7a38-9750-24b9abb22a0c@gmail.com> (raw)
In-Reply-To: <57b436d2-79f9-a7c1-ab97-0b555beb6468@linaro.org>

On 3/9/23 09:19, Dmitry Baryshkov wrote:
> On 09/03/2023 04:27, Maximilian Luz wrote:
>> On 3/9/23 02:33, Dmitry Baryshkov wrote:
>>> On 09/03/2023 00:44, Maximilian Luz wrote:
>>>> On 3/8/23 23:16, Rob Herring wrote:
>>>>> On Sun, Mar 05, 2023 at 03:21:18AM +0100, Maximilian Luz wrote:
>>>>>> Add bindings for the Qualcomm Secure Execution Environment interface
>>>>>> (QSEECOM).
>>>>>
>>>>> Pretty sure I already asked, but no answer in the commit message. Why do
>>>>> we need this? You've already declared the platform supports SCM calls
>>>>> with "qcom,scm". Why can't you probe whether you have QSEECOM or not? DT
>>>>> is for non-discoverable h/w we are stuck with.
>>>>
>>>> Yes, you've asked this before but I can only repeat what I've written in
>>>> my last response to your question: I am not aware of any way to properly
>>>> discover the interface at runtime from software.
>>>>
>>>> If it makes you happy, I can put this in the commit message as well...
>>>>
>>>>> Why is software made non-discoverable too?
>>>>
>>>> Please direct that question at the Qualcomm guys who actually designed
>>>> that interface. I can't give you an answer to that, and I'm not all that
>>>> happy about this either.
>>>>
>>>> To reiterate: I've reverse engineered this based on the Windows driver.
>>>> The Windows driver loads on an ACPI HID and it doesn't use any function
>>>> to check/verify whether the interface is actually present. Adding a DT
>>>> entry is the straight-forward adaption to having a HID in ACPI.
>>>>
>>>>> Nodes with only a compatible string are usually just an abuse of DT to
>>>>> instantiate some driver.
>>>>
>>>> If you or anyone here has any idea on how to discover the presence of
>>>> this, please feel free to let me know and I'd be happy to implement
>>>> that. Until then, I unfortunately don't see any other way of dealing
>>>> with this.
>>>
>>> You can probably try requesting QSEECOM version. According to msm-3.18:
>>>
>>>          uint32_t feature = 10;
>>>
>>>          rc = qseecom_scm_call(6, 3, &feature, sizeof(feature),
>>>                  &resp, sizeof(resp));
>>>          pr_info("qseecom.qsee_version = 0x%x\n", resp.result);
>>>          if (rc) {
>>>                  pr_err("Failed to get QSEE version info %d\n", rc);
>>>                  goto exit_del_cdev;
>>>          }
>>>
>>
>> Thanks! I'll give that a try.
>>
>> As I can't test this on a device that doesn't have qseecom, it would
>> probably be a good idea if someone could test this on a device that has
>> qcom_scm but no qseecom (if those even exist) to make sure this doesn't
>> misbehave.
> 
> I could not find a vendor dts which doesn't have the qseecom device (checked the source trees from 3.4 to the latest revisions).
> 

Thanks for checking!

So that only leaves one potential issue: The re-entrant/blocking calls
not being handled at the moment. If we detect qseecom based on the
version and then try to query the app ID, we could get some devices that
use those.

I'm not sure what the consequences there are, i.e. if we're potentially
blocking something else if one of those calls blocks on such devices. Is
there any way we can detect this beforehand?

The current proposal isn't very good at handling that either as it
assumes that this depends on the SoC generation (which it probably
doesn't). So I guess one possibility is to make the list of app-names to
be checked SoC specific as well. That at least limits the scope
somewhat. Maybe you have some other ideas?

Regards,
Max

  reply	other threads:[~2023-03-09 20:34 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-05  2:21 [PATCH v3 0/4] firmware: Add support for Qualcomm UEFI Secure Application Maximilian Luz
2023-03-05  2:21 ` [PATCH v3 1/4] firmware: qcom_scm: Export SCM call functions Maximilian Luz
2023-03-07 15:23   ` Dmitry Baryshkov
2023-03-08 12:53     ` Srinivas Kandagatla
2023-03-08 13:48       ` Maximilian Luz
2023-03-08 14:20         ` Srinivas Kandagatla
2023-03-08 15:09           ` Maximilian Luz
2023-03-08 13:29     ` Maximilian Luz
2023-03-05  2:21 ` [PATCH v3 2/4] firmware: Add support for Qualcomm Secure Execution Environment SCM interface Maximilian Luz
2023-03-07 15:32   ` Dmitry Baryshkov
2023-03-08 13:59     ` Maximilian Luz
2023-03-09  8:45       ` Dmitry Baryshkov
2023-03-09 20:54         ` Maximilian Luz
2023-03-07 15:36   ` Dmitry Baryshkov
2023-03-08 14:06     ` Maximilian Luz
2023-03-09  8:07       ` Dmitry Baryshkov
2023-03-05  2:21 ` [PATCH v3 3/4] dt-bindings: firmware: Add Qualcomm QSEECOM interface Maximilian Luz
2023-03-08 22:16   ` Rob Herring
2023-03-08 22:44     ` Maximilian Luz
2023-03-09  1:33       ` Dmitry Baryshkov
2023-03-09  2:27         ` Maximilian Luz
2023-03-09  8:19           ` Dmitry Baryshkov
2023-03-09 20:34             ` Maximilian Luz [this message]
2023-03-09 20:43               ` Dmitry Baryshkov
2023-05-02  8:38           ` Sudeep Holla
2023-05-02 10:52             ` Maximilian Luz
2023-05-02  8:31       ` Krzysztof Kozlowski
2023-05-02 10:57         ` Maximilian Luz
2023-03-05  2:21 ` [PATCH v3 4/4] firmware: Add support for Qualcomm UEFI Secure Application Maximilian Luz
2023-03-07 15:51   ` Dmitry Baryshkov
2023-03-08 15:02     ` Maximilian Luz
2023-03-09  8:36       ` Dmitry Baryshkov
2023-03-09 20:44         ` Maximilian Luz
2023-06-29 12:26     ` Johan Hovold

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=e20e489b-c033-7a38-9750-24b9abb22a0c@gmail.com \
    --to=luzmaximilian@gmail.com \
    --cc=agross@kernel.org \
    --cc=andersson@kernel.org \
    --cc=ardb@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.baryshkov@linaro.org \
    --cc=ilias.apalodimas@linaro.org \
    --cc=johan@kernel.org \
    --cc=konrad.dybcio@linaro.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=srinivas.kandagatla@linaro.org \
    --cc=steev@kali.org \
    --cc=sudeep.holla@arm.com \
    --cc=sumit.garg@linaro.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.