Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp4651886rdb; Fri, 15 Sep 2023 08:24:05 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHwQO/OWgpjLCNy2LJE5huPqRXZ7IRpxCXaYMFRcyUKCU6wIQVf8RW0MYV+9bwookI50sdC X-Received: by 2002:a17:90a:6d63:b0:273:4944:2eba with SMTP id z90-20020a17090a6d6300b0027349442ebamr1660712pjj.40.1694791445476; Fri, 15 Sep 2023 08:24:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694791445; cv=none; d=google.com; s=arc-20160816; b=Zvu1QoNllCQ1szdcGIElM6mSZdmgtUuY7t4j656RXb2mOVhVJnvm64dEmX8kxNOScA hG2PSdV9GJ5SLvwzP2JUSSzvphMDKaNbtkKWV5+10hJrfaPDGbIFhWQBnwsT/hwogzT2 NxR4SmRyXCUvmXTOuV0qR7OEV10gYxc2iOtD87exAyvp93dnMrgmiT0Iz0z/wMuUmICv cBbtsO/xj9ie5LhXfhjtWDRx+ilxKFb6+rJHHL/QmJIKc8eEbSUP61kcH2cmfbec663k 5loACFUCTUnKeXZmji+IGjd34pMYy7h+gWxr2H+WXdzy3IIPAdzX4sFePzAOkvl6wf2g /pSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=l8NEeXciC77W6E8I6Tu/1JxeayKsmRaRFNGgzoOh6io=; fh=GeN6pSgbG1fkkzs2TKouK58XnKZCjywhn/bvRYIyuJE=; b=bn6PHiTsnZtpHnUBs2GRmwHMa/eMsyPyDWbPKz5UCqK1wiIJ/kcn3/uTfzqNg2mMHm avaVolBL3DgONcToVqjVl2ir16+5msr+hEhDfmdUdHwf4QQ+Jie6ZHGogp036ZvC3o7I uZrCa2+5Dmt3Kj2+Ham1zAAl5VQpr1KkVh410DfKv8iEWAA+8tIlxMXQhGTZDTqfl3IQ D3JoD4WXMp3TAeO9BPH9mLbCxvfqY7s6tiSZlxG6SIumpsmuSheYbqnVpc+vrfJcY+/h Z1irhHRIlvrlADn5uEx/s7CiNoxhvjG4TSMfn6aJQloDU/y4kvHE1V3YbzIb3Z7C/epF aPdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VS53YwKy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id m70-20020a633f49000000b005783367f97fsi586047pga.342.2023.09.15.08.24.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Sep 2023 08:24:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VS53YwKy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 47F8880698ED; Fri, 15 Sep 2023 08:18:12 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236020AbjIOPR7 (ORCPT + 99 others); Fri, 15 Sep 2023 11:17:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45558 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235992AbjIOPRf (ORCPT ); Fri, 15 Sep 2023 11:17:35 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CBE77E6A; Fri, 15 Sep 2023 08:17:29 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C2D5BC433C7; Fri, 15 Sep 2023 15:17:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1694791049; bh=TPHKnv6db0a6xw1+xArvSG1rxIzxtQZwKrUHA2vOqak=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=VS53YwKyC45jVv8cxTqITtzN4aMPex3Kowb0nPZL/iwXu56eSPi1Qzy7l7DDrzSFV PU2eInHPR2bn/M4W/7BitgLePLEt/5CvQEphwFBBuk4eQV4ndh1PjCxPIz159DIM0h Y5K1/SPWImejGYZIPV7fFgr+Qf1pxHHlcGKsw8idOvWKR+Ecr70s+QcCLnF4MJ44Te XaXh4dQ7y/Ln2W7q+YKKVjogAEq551SfM9l87fPZVBfzEgmho8hbEN2FDAl+m/c1rL KN+tMXo0YPNFhe4XtDi9iasDqiWWI4E1bKTnUphiqtayzsmEHuJBw85iP24yoOWyFB YSSK6n1SAOlHg== Date: Fri, 15 Sep 2023 08:21:43 -0700 From: Bjorn Andersson To: Kathiravan T , Elliot Berman Cc: Andy Gross , Konrad Dybcio , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, quic_eberman@quicinc.com, stable@vger.kernel.org Subject: Re: [PATCH V2] firmware: qcom_scm: use the SCM_CONVENTION based on ARM / ARM64 Message-ID: References: <20230607045345.25049-1-quic_kathirav@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230607045345.25049-1-quic_kathirav@quicinc.com> X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Fri, 15 Sep 2023 08:18:12 -0700 (PDT) On Wed, Jun 07, 2023 at 10:23:45AM +0530, 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. > My memory of this is cloudy, but I feel the logic is complicated because early 64-bit boards all used 32-bit TZ. So, I really would like Elliot's input before picking this change. Regards, Bjorn > 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); > -- > 2.17.1 >