lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5e157ea4.1c69fb81.8361e.6698@mx.google.com>
Date:   Tue, 07 Jan 2020 23:02:59 -0800
From:   Stephen Boyd <swboyd@...omium.org>
To:     Bjorn Andersson <bjorn.andersson@...aro.org>,
        Elliot Berman <eberman@...eaurora.org>,
        Stephan Gerhold <stephan@...hold.net>, agross@...nel.org
Cc:     Elliot Berman <eberman@...eaurora.org>,
        saiprakash.ranjan@...eaurora.org, tsoni@...eaurora.org,
        sidgup@...eaurora.org, psodagud@...eaurora.org,
        Brian Masney <masneyb@...tation.org>,
        linux-arm-msm@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v5 17/17] firmware: qcom_scm: Dynamically support SMCCC and legacy conventions

(Nitpick trivia late at night)

Quoting Elliot Berman (2020-01-07 13:04:26)
> diff --git a/drivers/firmware/qcom_scm.c b/drivers/firmware/qcom_scm.c
> index 895f148..059bb0f 100644
> --- a/drivers/firmware/qcom_scm.c
> +++ b/drivers/firmware/qcom_scm.c
> @@ -72,6 +72,13 @@ static struct qcom_scm_wb_entry qcom_scm_wb[] = {
>         { .flag = QCOM_SCM_FLAG_WARMBOOT_CPU3 },
>  };
>  
> +static const char *qcom_scm_convention_names[] = {

Can this be const char * const ?

> +       [SMC_CONVENTION_UNKNOWN] = "unknown",
> +       [SMC_CONVENTION_ARM_32] = "smc arm 32",
> +       [SMC_CONVENTION_ARM_64] = "smc arm 64",
> +       [SMC_CONVENTION_LEGACY] = "smc legacy",
> +};
> +
>  static struct qcom_scm *__scm;
>  
>  static int qcom_scm_clk_enable(void)
> @@ -107,6 +114,143 @@ static void qcom_scm_clk_disable(void)
>         clk_disable_unprepare(__scm->bus_clk);
>  }
>  
> +static int __qcom_scm_is_call_available(struct device *dev, u32 svc_id,
> +                                       u32 cmd_id);
> +
> +enum qcom_scm_convention qcom_scm_convention;
> +static bool has_queried __read_mostly;
> +static DEFINE_SPINLOCK(query_lock);
> +
> +static void __query_convention(void)
> +{
> +       unsigned long flags;
> +       struct qcom_scm_desc desc = {
> +               .svc = QCOM_SCM_SVC_INFO,
> +               .cmd = QCOM_SCM_INFO_IS_CALL_AVAIL,
> +               .args[0] = SCM_SMC_FNID(QCOM_SCM_SVC_INFO,
> +                                          QCOM_SCM_INFO_IS_CALL_AVAIL) |
> +                          (ARM_SMCCC_OWNER_SIP << ARM_SMCCC_OWNER_SHIFT),
> +               .arginfo = QCOM_SCM_ARGS(1),
> +               .owner = ARM_SMCCC_OWNER_SIP,
> +       };
> +       struct qcom_scm_res res;
> +       int ret;
> +
> +       spin_lock_irqsave(&query_lock, flags);
> +       if (has_queried)
> +               goto out;
> +
> +       qcom_scm_convention = SMC_CONVENTION_ARM_64;
> +       // Device isn't required as there is only one argument - no device
> +       // needed to dma_map_single to secure world

This isn't kernel style for multiline comments. Please use /* and */.

> +       ret = scm_smc_call(NULL, &desc, &res, true);
> +       if (!ret && res.result[0] == 1)
> +               goto out;
> +

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ