Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp701308pxu; Thu, 26 Nov 2020 09:25:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJwfldpt5nGiK+Obm6NssSyU3vvvnJ0PnZmr0ybaahz9UaVeHFjViRY+liVFprYHPgC3pYM/ X-Received: by 2002:aa7:d891:: with SMTP id u17mr3663625edq.0.1606411531228; Thu, 26 Nov 2020 09:25:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606411531; cv=none; d=google.com; s=arc-20160816; b=aGTkxKE9Ntf8MwINTtGajeLrHgvFvQV62jOwmlORdPpGxC72ZGraVJmvjooU/IN8Uk lLpFqlRxBM9Ki4/YjHUpEgoXj2UokpMuVegx/X7KER4/fvW6ftp9/Rz727Wv9y4VrGGV nQDeSiZE+Kq8Jb+ljmmsWQoP9t0Bh9HTRSnWubICcYIaG0hDsmRuzdByT8wzMWgI1rUP eDVDt/nKU9KhuIX+qSCWW+tEqn+iBiqrLQY/Rjm3bkFlkL2pk/fwALKobeWK4syW1VHJ McUoK1fyYhyyW58LjmJwhVov5gQw3sqsDCJS3s1lZco3/kGph2hqBVY8wNT0MZVPVKtM SBaQ== 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=jnEeTLsO6sFTJCwDtAbxAuzxv7BphIxVLSnwfU+0TU4=; b=rR0ATEiQiRdSMD5dMIeKECoVhmWva6j69O/A0j1hmcaDbEwDvuquRKrTW+zLhLpKhC zZMJluWW4LOH4MVM3wCUhl/p6syiWo57bVtytVHR/SuftaMUpMDSsRF/n2a88XYj8rmp s4jUwZIXNKAnYK8Lb40geI+IXJ2UjHZLuHKmhgp3PFPW5mWth/dY2zycJ7BlWdZSl0o7 q6c2EZkRckJQJV+fXIWt58xrYEBF0J0NLxLOy8EMvkoMkIX5+/otzqwomkM27fVw1X1s r12J+EU+0Qns3srdbqRvQNdjYmD6FSsMBgGCG/M/8NyM7xhKl0aqTax+MLcoQwOLnsJZ 6nDQ== 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 l20si3300692ejn.671.2020.11.26.09.25.04; Thu, 26 Nov 2020 09:25:31 -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 S2404169AbgKZRV3 (ORCPT + 99 others); Thu, 26 Nov 2020 12:21:29 -0500 Received: from foss.arm.com ([217.140.110.172]:41088 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726677AbgKZRV3 (ORCPT ); Thu, 26 Nov 2020 12:21:29 -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 4DACB31B; Thu, 26 Nov 2020 09:21:28 -0800 (PST) Received: from C02TD0UTHF1T.local (unknown [10.57.30.234]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 353A53F23F; Thu, 26 Nov 2020 09:21:24 -0800 (PST) Date: Thu, 26 Nov 2020 17:21:21 +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 v3 01/23] psci: Support psci_ops.get_version for v0.1 Message-ID: <20201126172121.GB38486@C02TD0UTHF1T.local> References: <20201126155421.14901-1-dbrazdil@google.com> <20201126155421.14901-2-dbrazdil@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201126155421.14901-2-dbrazdil@google.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 26, 2020 at 03:53:59PM +0000, David Brazdil wrote: > KVM's host PSCI SMC filter needs to be aware of the PSCI version of the > system but currently it is impossible to distinguish between v0.1 and > PSCI disabled because both have get_version == NULL. > > Populate get_version for v0.1 with a function that returns a constant. > > psci_opt.get_version is currently unused so this has no effect on > existing functionality. > > Signed-off-by: David Brazdil > --- > drivers/firmware/psci/psci.c | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/drivers/firmware/psci/psci.c b/drivers/firmware/psci/psci.c > index 00af99b6f97c..213c68418a65 100644 > --- a/drivers/firmware/psci/psci.c > +++ b/drivers/firmware/psci/psci.c > @@ -146,6 +146,11 @@ static int psci_to_linux_errno(int errno) > return -EINVAL; > } > > +static u32 psci_get_version_0_1(void) > +{ > + return PSCI_VERSION(0, 1); > +} Elsewhere in this file we've used a psci_${MAJOR}_${MINOR}_* naming scheme. To match that, I'd prefer we call this psci_0_1_get_version(), and rename psci_get_version() to psci_0_2_get_version(). With that: Acked-by: Mark Rutland Thanks, Mark. > + > static u32 psci_get_version(void) > { > return invoke_psci_fn(PSCI_0_2_FN_PSCI_VERSION, 0, 0, 0); > @@ -514,6 +519,8 @@ static int __init psci_0_1_init(struct device_node *np) > > pr_info("Using PSCI v0.1 Function IDs from DT\n"); > > + psci_ops.get_version = psci_get_version_0_1; > + > if (!of_property_read_u32(np, "cpu_suspend", &id)) { > psci_function_id[PSCI_FN_CPU_SUSPEND] = id; > psci_ops.cpu_suspend = psci_cpu_suspend; > -- > 2.29.2.454.gaff20da3a2-goog >