From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751714AbeA2KIh (ORCPT ); Mon, 29 Jan 2018 05:08:37 -0500 Received: from foss.arm.com ([217.140.101.70]:38126 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751204AbeA2KIf (ORCPT ); Mon, 29 Jan 2018 05:08:35 -0500 Subject: Re: [PATCH 12/14] firmware/psci: Expose PSCI conduit To: Ard Biesheuvel Cc: Linux Kernel Mailing List , linux-arm-kernel , kvmarm , Mark Rutland , Peter Maydell , Lorenzo Pieralisi , Catalin Marinas , Will Deacon , Jon Masters , Christoffer Dall References: <20180126142847.31240-1-marc.zyngier@arm.com> <20180126142847.31240-13-marc.zyngier@arm.com> From: Marc Zyngier Organization: ARM Ltd Message-ID: <26bcd8c6-c834-3d3a-426a-98fca3dfbbbf@arm.com> Date: Mon, 29 Jan 2018 10:08:30 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 29/01/18 10:04, Ard Biesheuvel wrote: > On 26 January 2018 at 14:28, Marc Zyngier wrote: >> In order to call into the firmware to apply workarounds, it is >> useful to find out whether we're using HVC or SMC. Let's expose >> this through the psci_ops. >> >> Signed-off-by: Marc Zyngier >> --- >> drivers/firmware/psci.c | 26 +++++++++++++++++++++----- >> include/linux/psci.h | 7 +++++++ >> 2 files changed, 28 insertions(+), 5 deletions(-) >> >> diff --git a/drivers/firmware/psci.c b/drivers/firmware/psci.c >> index 8b25d31e8401..570187e5d084 100644 >> --- a/drivers/firmware/psci.c >> +++ b/drivers/firmware/psci.c >> @@ -59,7 +59,9 @@ bool psci_tos_resident_on(int cpu) >> return cpu == resident_cpu; >> } >> >> -struct psci_operations psci_ops; >> +struct psci_operations psci_ops = { >> + .conduit = PSCI_CONDUIT_NONE, >> +}; >> >> typedef unsigned long (psci_fn)(unsigned long, unsigned long, >> unsigned long, unsigned long); >> @@ -210,6 +212,20 @@ static unsigned long psci_migrate_info_up_cpu(void) >> 0, 0, 0); >> } >> >> +static void set_conduit(enum psci_conduit conduit) >> +{ >> + switch (conduit) { >> + case PSCI_CONDUIT_HVC: >> + invoke_psci_fn = __invoke_psci_fn_hvc; >> + break; >> + case PSCI_CONDUIT_SMC: >> + invoke_psci_fn = __invoke_psci_fn_smc; >> + break; > > I get a GCC warning here about PSCI_CONDUIT_NONE not being handled. Yup, I fixed it already. Thanks, M. -- Jazz is not dead. It just smells funny...