Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp997310pxf; Wed, 7 Apr 2021 17:13:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw3qK/ntUWEuRTRhOGFHP8q92r1AYl+AbwnqwF/E3N5WbXoZV3rKv2ACvnOhlxX8GQqMRVF X-Received: by 2002:a17:90b:388d:: with SMTP id mu13mr5725829pjb.34.1617840813607; Wed, 07 Apr 2021 17:13:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617840813; cv=none; d=google.com; s=arc-20160816; b=swqY2tqWNOMaYZnWEL9ux0uYqpXeqYq4/S3divXNZHeo2grPHdyp48f6DgX0eSVeaD lfZHJ098zrZjXpuHV/lhbbiGVY960mb/5vXvmcGdx81peq/BQU0dwMH3dXXlZa9ZYoB6 R4Q2Otr7HWu5Ur/x2BQUev0FhEaeQiApJFuOp2rwqb4j8fJRuNFYX+fE4KEeOwiSXcxI nqxqbIhySJlgakKiZ36ghv5lOx+w7H0k9+KJK2BfQJyzjKxIs9AkkOolhHE5qhhDS9e3 pJKFNyM86uUDpqraCEx9hPbjsGS2kQC5mkL8sraRyqsWTApDgUVBgf8GouhG1vClNNyk nkLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:message-id:date:to:cc:from:subject :references:in-reply-to:content-transfer-encoding:mime-version :dkim-signature; bh=8D8XPaeKV95AOIsyqrG+mdWfzRj4cAHDWOaASJt1zGs=; b=CAmDt888Vj1PZXvwZFPfwQqe+sXYFBAkPjpb7KwZYPa7XkYIJCwzFmBDvOCBhajfgY 9AWwSHIlxSBESCnEw7wINF/s6jXTTleC0MNRI0BBjANuISzcQGl97e2fEQKYoXjrmgbb SHUMJFZ/BaE0eC/7Sa9jhtsJj3Tl2iFQSnNHMZaXGmvkGbvNDXnB2k71xsDNWIa5RC52 GHBy3oOcUr1cTDLs4J6umDIRSKW/dH1IAT3lk8//KkpiT2hnD//hlWUPG8JJmUw8BuW5 BzeWMlxkvvXid9DDdSx5Yg89Dsz3a8yDN8TfknGuqGEI0PdTFngK53tYbBBT+m1heDqz FpGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=j8MKc3Ye; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y15si25818160pfo.77.2021.04.07.17.13.07; Wed, 07 Apr 2021 17:13:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=j8MKc3Ye; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229484AbhDHAMV (ORCPT + 99 others); Wed, 7 Apr 2021 20:12:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34842 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229480AbhDHAMU (ORCPT ); Wed, 7 Apr 2021 20:12:20 -0400 Received: from mail-pg1-x534.google.com (mail-pg1-x534.google.com [IPv6:2607:f8b0:4864:20::534]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CFB85C061760 for ; Wed, 7 Apr 2021 17:12:09 -0700 (PDT) Received: by mail-pg1-x534.google.com with SMTP id b17so76850pgh.7 for ; Wed, 07 Apr 2021 17:12:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:content-transfer-encoding:in-reply-to:references :subject:from:cc:to:date:message-id:user-agent; bh=8D8XPaeKV95AOIsyqrG+mdWfzRj4cAHDWOaASJt1zGs=; b=j8MKc3Ye8ykdNgICWke14Eow75lnPz8CIGBLwfuCCDNAPOo3QXW6qXxQWDIej5zrxj O5IhvceaIVGevBUYFe2XxJSC+PAjLnuLgayHghAo/eHwgh17HNXB1PnM+1fdHj/K/U/B eFLO+CcFZ/nQrB/Y4z8GJ6bwsgpiYLpDVgIDg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:content-transfer-encoding :in-reply-to:references:subject:from:cc:to:date:message-id :user-agent; bh=8D8XPaeKV95AOIsyqrG+mdWfzRj4cAHDWOaASJt1zGs=; b=OObFn/n6UC6IE1oLBZmpERmDw+3Bh4Sjvjy+3rN0b/HKcbRMl8HTzo9msHUxMu/p7A 75PeWE6glwIbq6cjOMMlCHwv4hbH3s+09dE5AI4Iybk/ryduPIuOO1YMxmp3IRXPa0Xp WHtSYnDd+fLxKrRi52q0w7UJmBY4VV+Qwt2pHJlcTtepqJzIFexkyrmnxTOJbbBhjqNs Z32nKD/xNIb5H9WvVAONrAf1HLEHUAUBsHhmXDWkP0B+SMtQ7Ca4Tj7qKIkLuDe2UfXw sNxwrWIBQdR+bF2E5DNr8tmDdAUpftw80OAPaIhqmYUF2EU+aBrCu5DwuVtx4Ro8WaX5 mrBg== X-Gm-Message-State: AOAM531myL1S9rMW6c51c3n6uWhY9Egn0MsROQ/Cuy6bKraNBUOKj9wJ SzEjYq24sn9JdgjPacAySie4LWwwhVVriA== X-Received: by 2002:a65:5b06:: with SMTP id y6mr5542633pgq.58.1617840729223; Wed, 07 Apr 2021 17:12:09 -0700 (PDT) Received: from chromium.org ([2620:15c:202:201:e193:83c5:6e95:43de]) by smtp.gmail.com with ESMTPSA id n7sm6283577pjk.23.2021.04.07.17.12.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Apr 2021 17:12:08 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: References: <20210323224336.1311783-1-swboyd@chromium.org> <6ec0ca8d-85c7-53d6-acf2-22c4ac13e805@codeaurora.org> <161734672825.2260335.8472441215895199196@swboyd.mtv.corp.google.com> <161738411853.2260335.5107124874054215375@swboyd.mtv.corp.google.com> Subject: Re: [PATCH v2] firmware: qcom_scm: Only compile legacy calls on ARM From: Stephen Boyd Cc: Andy Gross , Bjorn Andersson , Elliot Berman , linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Brian Masney , Jeffrey Hugo , Douglas Anderson To: Stephan Gerhold Date: Wed, 07 Apr 2021 17:12:06 -0700 Message-ID: <161784072681.3790633.7665111601750934002@swboyd.mtv.corp.google.com> User-Agent: alot/0.9.1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Stephan Gerhold (2021-04-05 05:50:26) > On Fri, Apr 02, 2021 at 10:21:58AM -0700, Stephen Boyd wrote: > >=20 > > Ah right, the whole secure world running in 32-bit mode thing. Is > > msm8916 the only SoC that's using that? Or are there more? If only > > msm8916 is affected then we could use a combination of CONFIG_ARM64 and > > the compatible string to differentiate and then if more SoCs use 32-bit > > secure world then we could have a new compatible string like qcom,scm-32 > > that tells us this fact. Maybe this was all discussed before and I > > missed it. Either way, I'm trying to get rid of this boot call so that > > we don't have to bounce to the firmware an extra time to figure out > > something we can figure out from the kernel arch and scm compatible > > string. >=20 > At least MSM8994 also uses SMC32 from what I heard. Overall it's > probably quite hard to get that right now since all boards were tested > with the dynamic detection so far. I suppose you could do the opposite, > add an optional qcom,scm-64 to skip the detection step and force SMC64. Isn't SMC64 going to be the overall majority going forward? Legacy convention is for sure limited to CONFIG_ARM so I'll send another follow-up patch to add a warning if we find legacy on CONFIG_ARM64. SMC32 is hopefully no longer being produced given that it was introduced at the time that the bootloader team wasn't supporting PSCI and didn't want to support it. So we're making all new boards/SoCs/firmwares do this calling convention probing to figure out something they already know? Maybe we should probe the calling convention on msm8994/msm8916 and otherwise assume SMC64 on CONFIG_ARM64 kernels. I'd expect the exception list to be smaller that way. >=20 > Also note that this could even be firmware-specific, not necessarily > SoC-specific. There are some ancient MSM8916 firmwares that have legacy > instead of SMC32. I could also imagine that there is also some SoC where > there are different firmware versions with SMC32 or SMC64. Sure but in theory the firmware would update the DT to indicate what sort of firmware is there. >=20 > Plus, IMO the overhead for this detection is negligible. At least it > ensures that we always use the right calling convention. The PSCI code > probably does much more firmware calls to figure out all supported > features. >=20 Heh, it tried to ensure we use the right calling convention but broke things in the process, because the way of detecting the convention isn't always there. I wouldn't be surprised if this comes up again for other boards that use TF-A.