[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <99084f51-f156-664b-cd69-51bf224674ac@quicinc.com>
Date: Fri, 14 Jul 2023 19:28:24 +0530
From: Kathiravan T <quic_kathirav@...cinc.com>
To: Andy Gross <agross@...nel.org>,
Bjorn Andersson <andersson@...nel.org>,
Konrad Dybcio <konrad.dybcio@...aro.org>,
Elliot Berman <eberman@...eaurora.org>,
<linux-arm-msm@...r.kernel.org>, <linux-kernel@...r.kernel.org>
CC: <quic_eberman@...cinc.com>, <stable@...r.kernel.org>
Subject: Re: [PATCH V2] firmware: qcom_scm: use the SCM_CONVENTION based on
ARM / ARM64
On 6/20/2023 11:43 AM, Kathiravan T wrote:
>
> On 6/7/2023 10:23 AM, Kathiravan T wrote:
>> During SCM probe, to identify the SCM convention, scm call is made with
>> SMC_CONVENTION_ARM_64 followed by SMC_CONVENTION_ARM_32. Based on the
>> result what convention to be used is decided.
>>
>> IPQ chipsets starting from IPQ807x, supports both 32bit and 64bit kernel
>> variants, however TZ firmware runs in 64bit mode. When running on 32bit
>> kernel, scm call is made with SMC_CONVENTION_ARM_64 is causing the
>> system crash, due to the difference in the register sets between ARM and
>> AARCH64, which is accessed by the TZ.
>>
>> To avoid this, use SMC_CONVENTION_ARM_64 only on ARM64 builds.
>
>
> Gentle Reminder...
Bjorn,
Can you share your thoughts on this patch?
Thanks, Kathiravan T.
>
>
>>
>> Cc: stable@...r.kernel.org
>> Fixes: 9a434cee773a ("firmware: qcom_scm: Dynamically support SMCCC
>> and legacy conventions")
>> Signed-off-by: Kathiravan T <quic_kathirav@...cinc.com>
>> ---
>> Changes in V2:
>> - Added the Fixes tag and cc'd stable mailing list
>>
>> drivers/firmware/qcom_scm.c | 2 ++
>> 1 file changed, 2 insertions(+)
>>
>> diff --git a/drivers/firmware/qcom_scm.c b/drivers/firmware/qcom_scm.c
>> index fde33acd46b7..db6754db48a0 100644
>> --- a/drivers/firmware/qcom_scm.c
>> +++ b/drivers/firmware/qcom_scm.c
>> @@ -171,6 +171,7 @@ static enum qcom_scm_convention
>> __get_convention(void)
>> if (likely(qcom_scm_convention != SMC_CONVENTION_UNKNOWN))
>> return qcom_scm_convention;
>> +#if IS_ENABLED(CONFIG_ARM64)
>> /*
>> * Device isn't required as there is only one argument - no device
>> * needed to dma_map_single to secure world
>> @@ -191,6 +192,7 @@ static enum qcom_scm_convention
>> __get_convention(void)
>> forced = true;
>> goto found;
>> }
>> +#endif
>> probed_convention = SMC_CONVENTION_ARM_32;
>> ret = __scm_smc_call(NULL, &desc, probed_convention, &res, true);
Powered by blists - more mailing lists