Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp2052093rwo; Thu, 3 Aug 2023 04:07:51 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFtatU0Fef0bCv55xVjo7zUeF9GMjhm3o0etP6CUap+usFwYHZI4rwMz2r3kNCSSUsUr0e2 X-Received: by 2002:a50:ed93:0:b0:523:e2b:3245 with SMTP id h19-20020a50ed93000000b005230e2b3245mr1097614edr.21.1691060871369; Thu, 03 Aug 2023 04:07:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691060871; cv=none; d=google.com; s=arc-20160816; b=Nc25AA1OVo5dIbOak6UjHpG7LBvr70Pdi4IjK3dZRIKUCcx1zKAv+NUw51a9gLhJ2Y aDoQpP27/SzWVfJY2Szlxm+nZ7vk2fjtsV6a49dkkYdVnhPnRlUWbTC8nDOuT6aChGX8 lHq1VuVNsKGj7/CfOzJaocEPgLE1ZXZ83NC8olS0csqXDxcl/rVfg+LVVEgaB2SoCg5K ybDImUkTBL6cqYhid/NgxLsiMhXo2v92rTn00vKgkL22D7V8xFh+cDGzluLQgPIcvcB5 xSyc7XqPP7DNPRYPw/4IUVA9B5ZK5btlSYpoFJ9g/v8MsxcUN7eOF8dR3r0ww2OC3e1d icow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :content-language:references:cc:to:from:subject:user-agent :mime-version:date:message-id:dkim-signature; bh=AfmvGrFBo+mjbonztvfWYLDiQ0svI+wbYuTjfBmylIU=; fh=XdYK1pYltwLJxkaVfZ54HFn8qWy8+wDvx2qKvMoIsG0=; b=emCvMvPTPuhUWzs3PGKsDMbhiRtN87nQvzSMdaACnwsYEOE/Aehe/CjtcmuBYM1En0 idJHLZioDdh1j/mdzByNy6/OAzvybBjvb+nsj9VRLsvj22Dwe5yccAWDxTq+Z8p9hOeI bYQ/WTA/iDz4aB20N+zy1RQfz0pvTxMoFJIC0hKUhxh9X2Z2/Lhv7Rm1bKJNADqOHMd0 HqlC+UXpQ/duC+EJuaKdZRrr/c2EHAqhZy9fomLYMh5/TmDFBVxmVYaMrDmG+g5hR1Eo +BxGhH4MO+FQVLkEBz1UujteejsNF/bzItc34gPA7liIVtlsp5xIIle4piwc+DevWz5r HBDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=HlLvaeFF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b17-20020aa7c911000000b0052279fdc5e0si8029499edt.522.2023.08.03.04.07.27; Thu, 03 Aug 2023 04:07:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=HlLvaeFF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234681AbjHCJQy (ORCPT + 99 others); Thu, 3 Aug 2023 05:16:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53174 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234133AbjHCJQo (ORCPT ); Thu, 3 Aug 2023 05:16:44 -0400 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DDB43AC; Thu, 3 Aug 2023 02:16:42 -0700 (PDT) Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 373984vI026848; Thu, 3 Aug 2023 09:16:07 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=message-id : date : mime-version : subject : from : to : cc : references : in-reply-to : content-type : content-transfer-encoding; s=qcppdkim1; bh=AfmvGrFBo+mjbonztvfWYLDiQ0svI+wbYuTjfBmylIU=; b=HlLvaeFFlCsh6j8oHtIgalex0APZ0PaX7smmmU3dJpVPQHcljM2HnbL9SIkjgv/7uhUg fnzdgkvnUiBNQk7ORIwAhuKERb+ZETn2boaHqbldWNNR31j8yidAfxZK9Z7h3BtjabIT wu1f1hDLogzZNvflLaI4ZC8EI/VabVUzcabIEULZU5YFExbG2rde4knIM8iW/L3I06yb q9tiUr41tyQkuubQ7ofF/mWGzfUiVEKUhC2pwyyuh4VyQmd2EF/wY8AEn6TeOCDeH4+9 zdfffie7Tja1/HM7NsXqtsPYemg7VAkmluT2sIw+3pGFpmBRbGNhdzqSufPeLTa5Y28J eg== Received: from nasanppmta02.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3s7upp1gc3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 03 Aug 2023 09:16:07 +0000 Received: from nasanex01a.na.qualcomm.com (nasanex01a.na.qualcomm.com [10.52.223.231]) by NASANPPMTA02.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 3739G6pD011728 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 3 Aug 2023 09:16:06 GMT Received: from [10.201.2.96] (10.80.80.8) by nasanex01a.na.qualcomm.com (10.52.223.231) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.30; Thu, 3 Aug 2023 02:16:03 -0700 Message-ID: <45649e51-7c89-24ea-cd99-4cc0e3dad71f@quicinc.com> Date: Thu, 3 Aug 2023 14:46:00 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.7.0 Subject: Re: [PATCH V2] firmware: qcom_scm: use the SCM_CONVENTION based on ARM / ARM64 From: Kathiravan T To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Elliot Berman , , CC: , References: <20230607045345.25049-1-quic_kathirav@quicinc.com> <2f915104-952f-3e3d-b3d5-4c0400b4f331@quicinc.com> <99084f51-f156-664b-cd69-51bf224674ac@quicinc.com> Content-Language: en-US In-Reply-To: <99084f51-f156-664b-cd69-51bf224674ac@quicinc.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nasanex01a.na.qualcomm.com (10.52.223.231) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: Ue6prKWo0KgweRDRDHDs3iD_x_sXmSn2 X-Proofpoint-ORIG-GUID: Ue6prKWo0KgweRDRDHDs3iD_x_sXmSn2 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-08-03_06,2023-08-01_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 clxscore=1011 malwarescore=0 spamscore=0 lowpriorityscore=0 mlxlogscore=999 bulkscore=0 impostorscore=0 priorityscore=1501 adultscore=0 mlxscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2306200000 definitions=main-2308030081 X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/14/2023 7:28 PM, Kathiravan T wrote: > > 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. Gentle Reminder... > > >> >> >>> >>> Cc: stable@vger.kernel.org >>> Fixes: 9a434cee773a ("firmware: qcom_scm: Dynamically support SMCCC >>> and legacy conventions") >>> Signed-off-by: Kathiravan T >>> --- >>> 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);