devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johan Hovold <johan@kernel.org>
To: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Cc: Bjorn Andersson <andersson@kernel.org>,
	Maximilian Luz <luzmaximilian@gmail.com>,
	Konrad Dybcio <konradybcio@kernel.org>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Ard Biesheuvel <ardb@kernel.org>,
	Steev Klimaszewski <steev@kali.org>,
	linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org,
	devicetree@vger.kernel.org, linux-efi@vger.kernel.org,
	Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
	Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Subject: Re: [PATCH v4 7/8] firmware: qcom: scm: rework QSEECOM allowlist
Date: Thu, 26 Jun 2025 11:56:01 +0200	[thread overview]
Message-ID: <aF0ZMcVcgHpqsKoG@hovoldconsulting.com> (raw)
In-Reply-To: <20250625-more-qseecom-v4-7-aacca9306cee@oss.qualcomm.com>

On Wed, Jun 25, 2025 at 01:53:26AM +0300, Dmitry Baryshkov wrote:
> From: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> 
> Listing individual machines in qcom_scm_qseecom_allowlist doesn't scale.
> Allow it to function as allow and disallow list at the same time by the
> means of the match->data and list the SoC families instead of devices.
> 
> In case a particular device has buggy or incompatible firmware user
> still can disable QSEECOM by specifying qcom_scm.qseecom=off kernel
> param and (in the longer term) adding machine-specific entry to the
> qcom_scm_qseecom_allowlist table.
> 
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>

>  /*
>   * We do not yet support re-entrant calls via the qseecom interface. To prevent
> - * any potential issues with this, only allow validated machines for now. Users
> + * any potential issues with this, only allow validated platforms for now. Users
>   * still can manually enable or disable it via the qcom_scm.qseecom modparam.
> + *
> + * To disable QSEECOM for a particular machine, add compatible entry and set
> + * data to &qcom_qseecom_disable.
>   */
>  static const struct of_device_id qcom_scm_qseecom_allowlist[] __maybe_unused = {
> -	{ .compatible = "asus,vivobook-s15" },
> -	{ .compatible = "asus,zenbook-a14-ux3407qa" },
> -	{ .compatible = "asus,zenbook-a14-ux3407ra" },
> -	{ .compatible = "dell,xps13-9345" },
> -	{ .compatible = "hp,elitebook-ultra-g1q" },
> -	{ .compatible = "hp,omnibook-x14" },
> -	{ .compatible = "huawei,gaokun3" },
> -	{ .compatible = "lenovo,flex-5g" },
> -	{ .compatible = "lenovo,thinkpad-t14s" },
> -	{ .compatible = "lenovo,thinkpad-x13s", },
>  	{ .compatible = "lenovo,yoga-c630", .data = &qcom_qseecom_ro_uefi, },
> -	{ .compatible = "lenovo,yoga-slim7x" },
> -	{ .compatible = "microsoft,arcata", },
> -	{ .compatible = "microsoft,blackrock" },
> -	{ .compatible = "microsoft,romulus13", },
> -	{ .compatible = "microsoft,romulus15", },
> -	{ .compatible = "qcom,sc8180x-primus" },
> +	{ .compatible = "qcom,sc8180x", },
> +	{ .compatible = "qcom,sc8280xp", },
>  	{ .compatible = "qcom,sc8280xp-crd", .data = &qcom_qseecom_ro_uefi, },

You need to have the machine specific entries before the SoC fallbacks
for this to work.

Perhaps this should be made more clear in the table by adding a
separator comment before the SoC entries or similar.

> -	{ .compatible = "qcom,x1e001de-devkit" },
> -	{ .compatible = "qcom,x1e80100-crd" },
> -	{ .compatible = "qcom,x1e80100-qcp" },
> -	{ .compatible = "qcom,x1p42100-crd" },
> +	{ .compatible = "qcom,sdm845", .data = &qcom_qseecom_disable, },
> +	{ .compatible = "qcom,x1e80100", },
> +	{ .compatible = "qcom,x1p42100", },
>  	{ }
>  };
>  
> @@ -2046,12 +2035,22 @@ static bool qcom_scm_qseecom_machine_is_allowed(struct device *scm_dev,
>  	match = of_match_node(qcom_scm_qseecom_allowlist, np);
>  	of_node_put(np);
>  
> -	if (match && match->data)
> +	if (!match) {
> +		dev_info(scm_dev, "qseecom: untested machine, skipping\n");
> +		return false;
> +	}
> +
> +	if (match->data)
>  		*quirks = *(unsigned long *)(match->data);
>  	else
>  		*quirks = 0;
>  
> -	return match;
> +	if (*quirks & QCOM_QSEECOM_QUIRK_DISABLE) {
> +		dev_info(scm_dev, "qseecom: disabled by the quirk\n");

Not sure this is needed since it presumably has been disabled because it
has been tested and found not to work. No need to spam the logs with
that on every boot.

In any case I don't think you should be referring to "the quirk" which
makes little sense without looking at the implementation.

> +		return false;
> +	}
> +
> +	return true;
>  }

Johan

  reply	other threads:[~2025-06-26  9:56 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-24 22:53 [PATCH v4 0/8] firmware: qcom: enable UEFI variables on Lenovo Yoga C630 Dmitry Baryshkov
2025-06-24 22:53 ` [PATCH v4 1/8] efi: efivars: don't crash in efivar_set_variable{,_locked} in r/o case Dmitry Baryshkov
2025-06-26 10:04   ` Johan Hovold
2025-06-26 11:03     ` Dmitry Baryshkov
2025-06-26 12:51       ` Johan Hovold
2025-06-26 12:54         ` Dmitry Baryshkov
2025-06-27 12:27           ` Johan Hovold
2025-06-28 15:05             ` Dmitry Baryshkov
2025-06-30 12:15               ` Johan Hovold
2025-06-24 22:53 ` [PATCH v4 2/8] firmware: qcom: scm: allow specifying quirks for QSEECOM implementations Dmitry Baryshkov
2025-06-24 22:53 ` [PATCH v4 3/8] firmware: qcom: uefisecapp: add support for R/O UEFI vars Dmitry Baryshkov
2025-07-16 19:13   ` Bjorn Andersson
2025-07-16 21:07     ` Dmitry Baryshkov
2025-06-24 22:53 ` [PATCH v4 4/8] firmware: qcom: enable QSEECOM on Lenovo Yoga C630 Dmitry Baryshkov
2025-06-24 22:53 ` [PATCH v4 5/8] firmware; qcom: scm: enable QSEECOM on SC8280XP CRD Dmitry Baryshkov
2025-06-26 23:34   ` Konrad Dybcio
2025-06-26 23:48     ` Dmitry Baryshkov
2025-06-26 23:54     ` Konrad Dybcio
2025-06-27 12:23       ` Johan Hovold
2025-06-27 12:26         ` Konrad Dybcio
2025-06-27 12:50           ` Johan Hovold
2025-06-28 14:50             ` Dmitry Baryshkov
2025-06-30 12:16               ` Johan Hovold
2025-07-16 19:02                 ` Bjorn Andersson
2025-06-24 22:53 ` [PATCH v4 6/8] firmware: qcom: scm: add modparam to control QSEECOM enablement Dmitry Baryshkov
2025-06-26 10:11   ` Johan Hovold
2025-06-26 11:08     ` Dmitry Baryshkov
2025-06-26 12:58       ` Johan Hovold
2025-06-26 23:33         ` Dmitry Baryshkov
2025-06-27 12:46           ` Johan Hovold
2025-06-28 15:03             ` Dmitry Baryshkov
2025-06-30 12:42               ` Johan Hovold
2025-07-01 11:10                 ` Dmitry Baryshkov
2025-07-10  9:40                   ` Johan Hovold
2025-06-24 22:53 ` [PATCH v4 7/8] firmware: qcom: scm: rework QSEECOM allowlist Dmitry Baryshkov
2025-06-26  9:56   ` Johan Hovold [this message]
2025-06-26 11:09     ` Dmitry Baryshkov
2025-06-26 13:02       ` Johan Hovold
2025-06-24 22:53 ` [PATCH v4 8/8] arm64: dts: qcom: sdm850-lenovo-yoga-c630: fix RTC offset info Dmitry Baryshkov
2025-06-26 10:16   ` Johan Hovold
2025-06-26 11:10     ` Dmitry Baryshkov

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=aF0ZMcVcgHpqsKoG@hovoldconsulting.com \
    --to=johan@kernel.org \
    --cc=andersson@kernel.org \
    --cc=ardb@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.baryshkov@linaro.org \
    --cc=dmitry.baryshkov@oss.qualcomm.com \
    --cc=konrad.dybcio@oss.qualcomm.com \
    --cc=konradybcio@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-efi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luzmaximilian@gmail.com \
    --cc=robh@kernel.org \
    --cc=steev@kali.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).