From patchwork Thu Nov 26 15:53:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Brazdil X-Patchwork-Id: 11934277 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=-16.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham 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 D47EDC63697 for ; Thu, 26 Nov 2020 15:56:02 +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 7914F21D40 for ; Thu, 26 Nov 2020 15:56:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="MOBhOzHb"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=google.com header.i=@google.com header.b="q0DXHENI" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7914F21D40 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com 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-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=J0WAyU7AMdn3hJ18/SM9hxznKMXPg7MAiDmX9lO1x7M=; b=MOBhOzHb4oKMSmrm5/J570b2g ulLXino2k6DUBGwfSYM4BHhE8uY8DN7NuZHKZTNJgttu2MeiyX91J0D7oaKvk54Ydjv8uRk21rFV2 UnCm1OzJTU9tpMpwbHA6lbka6BA2xoJxIYH4/j32vcUWd7cSZHkHn8lnkCk1AT7LQ2qmNIrIRJDLB JnhM7KsS9Rd1OZ2aIahopsKo6CF9OmNFjfAZzGyJJi2Zv3nDz0K8OSqOwfiJP0Er4FjvY408kmry6 NZaMOjtZ9rKsXI3035ZPU+DCRuulohtcXBIa79oqi2W1IhxnlmjtduXxjwjvjkFMXwO0WfBBrfc4m fNa7Et9hA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kiJbP-0007fb-Bm; Thu, 26 Nov 2020 15:54:35 +0000 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kiJbJ-0007dt-SA for linux-arm-kernel@lists.infradead.org; Thu, 26 Nov 2020 15:54:31 +0000 Received: by mail-wr1-x444.google.com with SMTP id u12so2662865wrt.0 for ; Thu, 26 Nov 2020 07:54:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=9eBkN6lmfdOZ6y3T4AeVQ2xEMCxfbxxoIUc76Qx59Gw=; b=q0DXHENIOaqhJFnVso9J1kN3Eb61iVK8nd3AricHajirGlfnSXv+NmgwWHCMVIELoM /xkucGICwySq83LXla7dhpUSyhhrYAX2WyLB2M0GSO+2LUD2XI2l+m2AypGqvHH1oZWj ar44f6d4mUGekt4sM2d7YlccV/6w5dO+75q5vS8ABmkgJxt4nsK1E5YYxMSRXHZwtqRw CgRzDUSpetP2+yE0F4UC58Vh56PRAdl/j8zQgvJ3gdi0B97IexPJS8ZDk2Z0gcqlwvRq +6NN5jRL2/yL9KuYo3aGBfcKHp1j9xVMqkzoFKdL7JrD/vM8UlDrwr99kKCpPxKPalu6 8LXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=9eBkN6lmfdOZ6y3T4AeVQ2xEMCxfbxxoIUc76Qx59Gw=; b=T6q+3eUgNmZ03nEwwQ03QOcbCH4i8VHDHVVc2WxuqasBLssqb5loXranFmJW3J26vE l2/QTVKGCfMcWOcxbjaa30nzH9CYvZ92DgDCcEVfWjVaSZnacmVhESArikUOLZnQvTwE R4MXh6z4jkK61ocwLzXi1n/RyK5SyWbBkZ70yKd3qwG72wJ2nAnEXtvEKsUuSn6m4tHn r2nxHuwm7JogXXssMJiJ26H3vABy4yIWRCWEYSkCnGwTXRkPNXzEvW/6ZqThQN1Uij6+ 09D/UGOxgMjdudDviAcvP03v52LwDZbSrvwfltoqZOpxL3suSnfaNNS9cGCIb0avZKtU 7eEA== X-Gm-Message-State: AOAM5339iendNa+7IkuLhgi2qiw0LMcH+ihDBYW+ks2qIjOUHsWXOYr0 hoo/LkHG1Ih5EDEfIL279tM3YQ== X-Google-Smtp-Source: ABdhPJw/lRW3PEMxi02nhLES66F/ltyrof/LoT+FjVRp6ybB+E4igrjSX8c/nxUUNknF9HL5GfidZA== X-Received: by 2002:a5d:5482:: with SMTP id h2mr4667449wrv.18.1606406068612; Thu, 26 Nov 2020 07:54:28 -0800 (PST) Received: from localhost ([2a01:4b00:8523:2d03:f008:704d:8d4b:9951]) by smtp.gmail.com with ESMTPSA id v7sm2637615wma.26.2020.11.26.07.54.27 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 26 Nov 2020 07:54:27 -0800 (PST) From: David Brazdil To: kvmarm@lists.cs.columbia.edu Subject: [PATCH v3 01/23] psci: Support psci_ops.get_version for v0.1 Date: Thu, 26 Nov 2020 15:53:59 +0000 Message-Id: <20201126155421.14901-2-dbrazdil@google.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201126155421.14901-1-dbrazdil@google.com> References: <20201126155421.14901-1-dbrazdil@google.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201126_105429_973221_282AAB6D X-CRM114-Status: GOOD ( 15.53 ) 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, Jonathan Corbet , Catalin Marinas , Suzuki K Poulose , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Sudeep Holla , James Morse , linux-arm-kernel@lists.infradead.org, Marc Zyngier , Tejun Heo , Dennis Zhou , Christoph Lameter , David Brazdil , Will Deacon , Julien Thierry Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 Acked-by: Mark Rutland --- 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); +} + 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;