Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp6604982ybi; Wed, 5 Jun 2019 03:40:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqzKcxgNbGfd7YBRWDp1Z8D0JfPoIFnVpM516py5FrpG3g3V6zp16schREUMKD4orhcmpsZv X-Received: by 2002:a17:90a:36a9:: with SMTP id t38mr779541pjb.19.1559731221090; Wed, 05 Jun 2019 03:40:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559731221; cv=none; d=google.com; s=arc-20160816; b=jB3J9NRfS/jjuEaIIxe2pl6QayB7ByZFq6DmlOqwmGBG99qlQbUF4+MIk/hWOd4Mew PharmDQThdJYGhiylrNH0GBrKa/aAYjWvXX3e1b7V6FB6kl21fIR0YjXHAGhEWGx5HCr AzVWuhzK9FMNc0nwxAauZPMAaVaUFas45MXNWQYbnbmV+/hE9hyowEl5m7u455Ol6H3J E3uCPUkwkZZFaxdOHNJ7lXLU8uOcHLulEnZ3t9kobqllpjBk79oAeB9o6A+raNO8puMt NwJYJ5raLr32m6qoR/wBEmD+ylsU87EUKJPt0rUUQ41Y0GyLEWjUSf4+nIRRQH+nVPcb 3qAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=NQbZMT7os7/AwVowPVMUHG1rkETXW2u9cItrL37Ygvk=; b=qTfpKcYO+DDIy4u9aolXolW3LfTLkTh2xvImJ6BFtVSfnxs/gvseH6jD5V67y2pbrk gmEwWYyxuC50cfwVFNkGv+ikivsUy+XB0RB5oHepCAsPt0sifaaswRzUDb7yqmx661nF K27pY53AgX0BvpAmpaqaIzwKDhuuG3AeVxSnKAj3NjxVSuCsIyn77sYSJKs4jtUeUeF9 P1LrktDY6MoqIyI2mQGCiSByAVmV9NHXaVOHh26Y2kcbOEhoUlDwY15xiLJ137MneBll qL9wNp9Mhf5VQmRASGLrMhgOYwbRbXG2NBxCrT18czKpDEfnDhHn597pfPvVnSm7a7b8 fXaw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i5si26308827pgs.4.2019.06.05.03.39.57; Wed, 05 Jun 2019 03:40:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727148AbfFEKjP (ORCPT + 99 others); Wed, 5 Jun 2019 06:39:15 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:57200 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727083AbfFEKjP (ORCPT ); Wed, 5 Jun 2019 06:39:15 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 42558374; Wed, 5 Jun 2019 03:39:15 -0700 (PDT) Received: from lakrids.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id D56273F690; Wed, 5 Jun 2019 03:39:12 -0700 (PDT) Date: Wed, 5 Jun 2019 11:38:40 +0100 From: Mark Rutland To: Sudeep Holla Cc: Ali Saidi , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-crypto@vger.kernel.org, Benjamin Herrenschmidt , Herbert Xu , Arnd Bergmann , Catalin Marinas , Matt Mackall , Will Deacon , Ron Rindjunsky , David Woodhouse , Greg Kroah-Hartman Subject: Re: [PATCH 2/3] arm64: export acpi_psci_use_hvc Message-ID: <20190605103840.GA30925@lakrids.cambridge.arm.com> References: <20190604203100.15050-1-alisaidi@amazon.com> <20190604203100.15050-3-alisaidi@amazon.com> <20190605094031.GB28613@e107155-lin> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190605094031.GB28613@e107155-lin> User-Agent: Mutt/1.11.1+11 (2f07cb52) (2018-12-01) Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Wed, Jun 05, 2019 at 10:40:31AM +0100, Sudeep Holla wrote: > On Tue, Jun 04, 2019 at 08:30:59PM +0000, Ali Saidi wrote: > > Allow a module that wants to make SMC calls to detect if it should be > > using smc or hvc. > > > > Signed-off-by: Ali Saidi > > --- > > arch/arm64/kernel/acpi.c | 1 + > > 1 file changed, 1 insertion(+) > > > > diff --git a/arch/arm64/kernel/acpi.c b/arch/arm64/kernel/acpi.c > > index 803f0494dd3e..ea41c6541d3c 100644 > > --- a/arch/arm64/kernel/acpi.c > > +++ b/arch/arm64/kernel/acpi.c > > @@ -119,6 +119,7 @@ bool acpi_psci_use_hvc(void) > > { > > return acpi_gbl_FADT.arm_boot_flags & ACPI_FADT_PSCI_USE_HVC; > > } > > +EXPORT_SYMBOL_GPL(acpi_psci_use_hvc); > > > > I would rather have this in drivers/firmware/psci/psci.c checking the > value of psci_ops.conduit so that it's not just ACPI specific and can > be used on DT platforms too if required. I'd also like this to not hook into PSCI internals. This code cares about SMCCC, not PSCI. We also really shouldn't need to spread the conduit management everywhere, too. We should be abel to have probe code do: if (!is_smccc_1_1_available()) goto fail_probe; ... and runtime code do: res = arm_smccc_1_1_call(...); ... which is much clearner. I'd started cleaning that up [1], but I haven't had the chance to rebase and repost it. Ali, I assume your firmware has SMCCCv1.1+. Is that the case? Thanks, Mark. [1] https://git.kernel.org/pub/scm/linux/kernel/git/mark/linux.git/log/?h=arm64/smccc-cleanup