From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 15A9FC00A89 for ; Thu, 5 Nov 2020 09:53:39 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 70F7C21556 for ; Thu, 5 Nov 2020 09:53:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ktwxF/nI"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="CrU9BPZM" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 70F7C21556 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Type: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Message-ID:References:In-Reply-To:Subject:To:From: Date:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=0gFATN4gfY5/Hv5H66h12v4k5Geokzx719u6lePJg1Q=; b=ktwxF/nIohu/Ue5hIJBFjWDus R3e9TONz7caB62hJNH2WIWBKk8YT07MUMpd0s9v2+CNPYlmjASV7hsiweLlr3ucUdtidw6vzPEnXX LEsVb7D0tWcPf/hGipUIV6JO0a88nq6nqqL/XEv1UQES5GPwwtOmQwYgDQcXxBMT7/ME1iO56fA27 nan+w5+acp6C1bAZxcLWiiaNGeFIP7OSbHC4Q0D9rmRLwaZZwvX6S96rjaNJq15C8AsuuTNtNMJoz bY3RACH8Ruq2She3OVvndHSwoDEZPaWKY80PzyFuJxgpMTatTir4OdSSX/5LQF+TYyjRmNovM6By4 XVND15Amg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kabxC-0006b6-NE; Thu, 05 Nov 2020 09:53:14 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kabxA-0006aT-FA for linux-arm-kernel@lists.infradead.org; Thu, 05 Nov 2020 09:53:13 +0000 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5CF892151B; Thu, 5 Nov 2020 09:53:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604569989; bh=05ML26Jp9zU6GACtn9aCiyu+oy90xRHx7TvqsEetQSw=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=CrU9BPZMhjG6XBnFZj7rwMjBVY+aLHNqx0Nlb1mA9Fiij/8DL/eyOM0r9e8D7jhlp SpmPMVZC5KABurCvlqM34aJ3EEWWHuslRh8ARBAAoztEjDKBnd09P29s5J8TcPG1i/ lT5ExIn9lIegbNHrSwGiL+7NorLstJSACtsZuQGc= Received: from disco-boy.misterjones.org ([51.254.78.96] helo=www.loen.fr) by disco-boy.misterjones.org with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94) (envelope-from ) id 1kabx5-007nE3-6I; Thu, 05 Nov 2020 09:53:07 +0000 MIME-Version: 1.0 Date: Thu, 05 Nov 2020 09:53:07 +0000 From: Marc Zyngier To: David Brazdil Subject: Re: [RFC PATCH 02/26] psci: Export configured PSCI function IDs In-Reply-To: <20201104183630.27513-3-dbrazdil@google.com> References: <20201104183630.27513-1-dbrazdil@google.com> <20201104183630.27513-3-dbrazdil@google.com> User-Agent: Roundcube Webmail/1.4.9 Message-ID: <61384a4031c6a3419c55a8cdb8f9f0ab@kernel.org> X-Sender: maz@kernel.org X-SA-Exim-Connect-IP: 51.254.78.96 X-SA-Exim-Rcpt-To: dbrazdil@google.com, kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, james.morse@arm.com, julien.thierry.kdev@gmail.com, suzuki.poulose@arm.com, catalin.marinas@arm.com, will@kernel.org, dennis@kernel.org, tj@kernel.org, cl@linux.com, mark.rutland@arm.com, lorenzo.pieralisi@arm.com, qperret@google.com, ascull@google.com, kernel-team@android.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201105_045312_684700_68185F24 X-CRM114-Status: GOOD ( 17.98 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Lorenzo Pieralisi , kernel-team@android.com, Suzuki K Poulose , Catalin Marinas , Quentin Perret , linux-kernel@vger.kernel.org, James Morse , linux-arm-kernel@lists.infradead.org, Tejun Heo , Dennis Zhou , Christoph Lameter , Will Deacon , kvmarm@lists.cs.columbia.edu, Julien Thierry , Andrew Scull Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 2020-11-04 18:36, David Brazdil wrote: > Function IDs used by PSCI are configurable for v0.1 via DT/APCI. If the > host is using PSCI v0.1, KVM's PSCI proxy needs to use the same IDs. > Expose the array holding the information. > > Signed-off-by: David Brazdil > --- > drivers/firmware/psci/psci.c | 10 +--------- > include/linux/psci.h | 10 ++++++++++ > 2 files changed, 11 insertions(+), 9 deletions(-) > > diff --git a/drivers/firmware/psci/psci.c > b/drivers/firmware/psci/psci.c > index ff523bdbfe3f..ffcb88f60e21 100644 > --- a/drivers/firmware/psci/psci.c > +++ b/drivers/firmware/psci/psci.c > @@ -60,15 +60,7 @@ typedef unsigned long (psci_fn)(unsigned long, > unsigned long, > unsigned long, unsigned long); > static psci_fn *invoke_psci_fn; > > -enum psci_function { > - PSCI_FN_CPU_SUSPEND, > - PSCI_FN_CPU_ON, > - PSCI_FN_CPU_OFF, > - PSCI_FN_MIGRATE, > - PSCI_FN_MAX, > -}; > - > -static u32 psci_function_id[PSCI_FN_MAX]; > +u32 psci_function_id[PSCI_FN_MAX]; > > #define PSCI_0_2_POWER_STATE_MASK \ > (PSCI_0_2_POWER_STATE_ID_MASK | \ > diff --git a/include/linux/psci.h b/include/linux/psci.h > index cb35b90d1746..877d844ee6d9 100644 > --- a/include/linux/psci.h > +++ b/include/linux/psci.h > @@ -29,6 +29,16 @@ bool psci_has_osi_support(void); > */ > extern int psci_driver_version; > > +enum psci_function { > + PSCI_FN_CPU_SUSPEND, > + PSCI_FN_CPU_ON, > + PSCI_FN_CPU_OFF, > + PSCI_FN_MIGRATE, > + PSCI_FN_MAX, > +}; > + > +extern u32 psci_function_id[PSCI_FN_MAX]; I am very reluctant to expose this array to the rest of the kernel. The temptation becomes huge for people to start writing to it from random drivers in order to route PSCI calls somewhere else. Consider exporting an accessor instead. Same thing for the following patch (there already are a couple of accessors for psci_cpu_suspend_feature, which you could make visible). Thanks, M. -- Jazz is not dead. It just smells funny... _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel