Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp388457pxu; Thu, 3 Dec 2020 02:51:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJwPhQFuOb4P1ZL0iKCMZNxea/HNG5MepfFGoCEAm8wx3sHDizYHugOxSFCH5ucdZbIV1G+9 X-Received: by 2002:a17:906:6404:: with SMTP id d4mr1883673ejm.159.1606992719599; Thu, 03 Dec 2020 02:51:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606992719; cv=none; d=google.com; s=arc-20160816; b=Rvd9LxP3FibxQpRc2zaa/Vujf9S7WSkFTwHUwMiQMx2S5tnTxf1eyZuRb7KHLz4kYI P94xgRGPEgSyluZNDNf8liql7YM5XlPI+R2F2hiQPqjma8cEo97tMDjlkG7xhi0i1eQq OTjLQ5rbvDBBAW2Y6D6SgShtQF1FNHH1jdadOoobRdK7GWdJ4HddHZ/XW5SZD0ImVjYg 4STSj/5mvsGuMU1bFCnaz8z8Rhrl5t0p3J9v4DS9C8XVInJK0m1xRF/pnopRTeoI9yGU MDyQGFCaxMyr4O2+6/oDTwJZT1ZAvo6edVyBpFwGZmh1vJb09X03kazws9T6UEn3rHyq 8G6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=kkFYExdmMjiPNdwdyypney0AuNU74QN64tLYJDDZDV8=; b=f4s63lKc/8OaVqLDrtA2fNdbowKIBRAitw06jG+A+afzXwofK3zEdCbcYome+7AK/6 RfykwnfGDISS/EpQl+dSQjdYjtwUEieWuHp594gmsksSbl3krmkcfaFaPGEyyqo8T8my zopql2LSeKsVEYst3IpJ9GlLw62nsZJaCndyOmFVR+9ynXPYeT/HJpZreGRoiIzcmv6z MuFsj5/dNBzOfRYzHhGXFC0PQZTk1Ul/vSXGV6wTf0PVIyWSBGEmpx7lrmEMy2cFPmER nAd+eMsTLruFWnh52VVArdFTqdBwrVSEcO8qlAsytROtSqJqT7PwNEzfcCbepR4Pmyjl bXdw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id rn17si950247ejb.292.2020.12.03.02.51.36; Thu, 03 Dec 2020 02:51:59 -0800 (PST) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388756AbgLCKsG (ORCPT + 99 others); Thu, 3 Dec 2020 05:48:06 -0500 Received: from foss.arm.com ([217.140.110.172]:36812 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388715AbgLCKsG (ORCPT ); Thu, 3 Dec 2020 05:48:06 -0500 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 1C078113E; Thu, 3 Dec 2020 02:47:20 -0800 (PST) Received: from C02TD0UTHF1T.local (unknown [10.57.0.87]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E02FB3F66B; Thu, 3 Dec 2020 02:47:15 -0800 (PST) Date: Thu, 3 Dec 2020 10:47:12 +0000 From: Mark Rutland To: David Brazdil Cc: kvmarm@lists.cs.columbia.edu, Jonathan Corbet , Catalin Marinas , Will Deacon , Marc Zyngier , James Morse , Julien Thierry , Suzuki K Poulose , Dennis Zhou , Tejun Heo , Christoph Lameter , Lorenzo Pieralisi , Sudeep Holla , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel-team@android.com Subject: Re: [PATCH v4 06/26] psci: Add accessor for psci_0_1_function_ids Message-ID: <20201203104712.GC96754@C02TD0UTHF1T.local> References: <20201202184122.26046-1-dbrazdil@google.com> <20201202184122.26046-7-dbrazdil@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201202184122.26046-7-dbrazdil@google.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Dec 02, 2020 at 06:41:02PM +0000, David Brazdil wrote: > Make it possible to retrieve a copy of the psci_0_1_function_ids struct. > This is useful for KVM if it is configured to intercept host's PSCI SMCs. > > Signed-off-by: David Brazdil Acked-by: Mark Rutland ... just to check, does KVM snapshot which function IDs are valid, or do we want to add that state here too? That can be a follow-up if necessary. Thanks, Mark. > --- > drivers/firmware/psci/psci.c | 12 +++++------- > include/linux/psci.h | 9 +++++++++ > 2 files changed, 14 insertions(+), 7 deletions(-) > > diff --git a/drivers/firmware/psci/psci.c b/drivers/firmware/psci/psci.c > index 593fdd0e09a2..f5fc429cae3f 100644 > --- a/drivers/firmware/psci/psci.c > +++ b/drivers/firmware/psci/psci.c > @@ -58,15 +58,13 @@ typedef unsigned long (psci_fn)(unsigned long, unsigned long, > unsigned long, unsigned long); > static psci_fn *invoke_psci_fn; > > -struct psci_0_1_function_ids { > - u32 cpu_suspend; > - u32 cpu_on; > - u32 cpu_off; > - u32 migrate; > -}; > - > static struct psci_0_1_function_ids psci_0_1_function_ids; > > +struct psci_0_1_function_ids get_psci_0_1_function_ids(void) > +{ > + return psci_0_1_function_ids; > +} > + > #define PSCI_0_2_POWER_STATE_MASK \ > (PSCI_0_2_POWER_STATE_ID_MASK | \ > PSCI_0_2_POWER_STATE_TYPE_MASK | \ > diff --git a/include/linux/psci.h b/include/linux/psci.h > index 2a1bfb890e58..4ca0060a3fc4 100644 > --- a/include/linux/psci.h > +++ b/include/linux/psci.h > @@ -34,6 +34,15 @@ struct psci_operations { > > extern struct psci_operations psci_ops; > > +struct psci_0_1_function_ids { > + u32 cpu_suspend; > + u32 cpu_on; > + u32 cpu_off; > + u32 migrate; > +}; > + > +struct psci_0_1_function_ids get_psci_0_1_function_ids(void); > + > #if defined(CONFIG_ARM_PSCI_FW) > int __init psci_dt_init(void); > #else > -- > 2.29.2.454.gaff20da3a2-goog >