Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp1944938ybn; Thu, 26 Sep 2019 04:44:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqxYL3NyilF8IxME9QPBgT0Gh8wPxd83NLJARVq2cdW/FzmcCRfwhrBQwShefAEAdFrwHhDv X-Received: by 2002:a17:907:41db:: with SMTP id og19mr2620697ejb.307.1569498288601; Thu, 26 Sep 2019 04:44:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569498288; cv=none; d=google.com; s=arc-20160816; b=ckuCFabGqLrnCgwRdH9rbrRdMLsmtBu0R7GQ2zlBtV+u3afURbsA8HUHYjMP4E9DFQ feEM+uldngH8xfBIdW7i28QqM2h5mxWDRujjvWxjf414YWlxhXtRVpZtanCgMDsqn2BR UB8iKuLAoWaEzKl7h1emXODC0Mlr7Sft7dZ9g2umZbCEuHdRAVegx3ACrZk0qkuyJa0f QoIjoi7b8HJBYmmZO7RcTX1X08YI7675l08X7WnNcwGezfSzpL2iRuZiCuvsoR3bN0J6 H+zgc+Tpb+0kEHCTbF0dIuPkZdI6gQYhdxMNc72ltgjSHTq2j7JsKFcE8vC2C3bemU+n mnQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=vxENupIo2+xc2vF/CdjHuje7PIW/V1IaluBmMDIel2I=; b=BJR+vcuzXlSBUrYKLWECxaXq0lpMTWS8uSjHv/2bW8WJt6LWrxArBQ+CSYFUScFn3g btFmkmZ2Zrz1/nZxPMAJ9pMlSVkJC7aFddcb1aEMk4Hfv9hv3S1dDfZ/mLGlZg0K5eqM /vWPz7SK9jjBUUHZ6n5VTbGgp+eJaPz2KiGvKqJYInMtNklC7Mc+8DjDI3zIR2rRfN4u MddQqmcd4xvf/zC163B7YdOSkUSWxemQmrZGm3trm+sDpUEbbhbXJURiXn1NCa5KfrTJ B81xwgXS0TlXtn7Ccd2AMii2LTzMUKmP3FfXtjoZb9QrkYRSQSVIDhVTLexyGLziPdJz wWkQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 l12si1304855edk.444.2019.09.26.04.44.25; Thu, 26 Sep 2019 04:44:48 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726452AbfIZLm3 (ORCPT + 99 others); Thu, 26 Sep 2019 07:42:29 -0400 Received: from foss.arm.com ([217.140.110.172]:47060 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726376AbfIZLm3 (ORCPT ); Thu, 26 Sep 2019 07:42:29 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 8FBDD1570; Thu, 26 Sep 2019 04:42:28 -0700 (PDT) Received: from entos-d05.shanghai.arm.com (entos-d05.shanghai.arm.com [10.169.40.35]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 06BB93F67D; Thu, 26 Sep 2019 04:42:23 -0700 (PDT) From: Jianyong Wu To: netdev@vger.kernel.org, yangbo.lu@nxp.com, john.stultz@linaro.org, tglx@linutronix.de, pbonzini@redhat.com, sean.j.christopherson@intel.com, maz@kernel.org, richardcochran@gmail.com, Mark.Rutland@arm.com, Will.Deacon@arm.com, suzuki.poulose@arm.com Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, Steve.Capper@arm.com, Kaly.Xin@arm.com, justin.he@arm.com, jianyong.wu@arm.com, nd@arm.com Subject: [RFC PATCH v4 1/5] psci: Export psci_ops.conduit symbol as modules will use it. Date: Thu, 26 Sep 2019 19:42:08 +0800 Message-Id: <20190926114212.5322-2-jianyong.wu@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190926114212.5322-1-jianyong.wu@arm.com> References: <20190926114212.5322-1-jianyong.wu@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If arm_smccc_1_1_invoke used in modules, psci_ops.conduit should be export. Signed-off-by: Jianyong Wu --- drivers/firmware/psci/psci.c | 6 ++++++ include/linux/arm-smccc.h | 2 +- include/linux/psci.h | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/firmware/psci/psci.c b/drivers/firmware/psci/psci.c index f82ccd39a913..35c4eaab1451 100644 --- a/drivers/firmware/psci/psci.c +++ b/drivers/firmware/psci/psci.c @@ -212,6 +212,12 @@ static unsigned long psci_migrate_info_up_cpu(void) 0, 0, 0); } +enum psci_conduit psci_get_conduit(void) +{ + return psci_ops.conduit; +} +EXPORT_SYMBOL(psci_get_conduit); + static void set_conduit(enum psci_conduit conduit) { switch (conduit) { diff --git a/include/linux/arm-smccc.h b/include/linux/arm-smccc.h index 552cbd49abe8..a6e4d3e3d10a 100644 --- a/include/linux/arm-smccc.h +++ b/include/linux/arm-smccc.h @@ -357,7 +357,7 @@ asmlinkage void __arm_smccc_hvc(unsigned long a0, unsigned long a1, * The return value also provides the conduit that was used. */ #define arm_smccc_1_1_invoke(...) ({ \ - int method = psci_ops.conduit; \ + int method = psci_get_conduit(); \ switch (method) { \ case PSCI_CONDUIT_HVC: \ arm_smccc_1_1_hvc(__VA_ARGS__); \ diff --git a/include/linux/psci.h b/include/linux/psci.h index a8a15613c157..e5cedc986049 100644 --- a/include/linux/psci.h +++ b/include/linux/psci.h @@ -42,6 +42,7 @@ struct psci_operations { enum smccc_version smccc_version; }; +extern enum psci_conduit psci_get_conduit(void); extern struct psci_operations psci_ops; #if defined(CONFIG_ARM_PSCI_FW) -- 2.17.1