Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp642747pxu; Thu, 26 Nov 2020 07:57:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJwhOwdRAxBsCsIjP87clQRItzt3U87JkXNvxIeC5EFNDA+zKoXYTM3Aqy8D24A9WVv4wpMM X-Received: by 2002:a05:6402:17ac:: with SMTP id j12mr3120858edy.31.1606406234612; Thu, 26 Nov 2020 07:57:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606406234; cv=none; d=google.com; s=arc-20160816; b=t6uCGK8VoQmKzcA2IeMCi+HxWBC1J0T5xuW9Yp3rgyVE7s2I4UxHAlC8qrVhaFRwqV 5YxKcHDiGjnXYilq9vgHc5qU171LQyaZGmcEAKPogJSKGtkHh8BUDec4L1ks0Khp7sCk UaGqEzN0kAOdGKInlHdIpnRL675khycq9xASc9VRRAy4jzqIZhixcUtHjCbjLZvp2J22 n7jnMnWs0vULfT1ecdIBlSdeiUowNHj7p5duuwG3g4GjuWdKfDuLnTYdJ0iMVM9i2XZ4 EBkTXDQ6Vu1NjqmkCS9z8npjaC0t01RYeHh/Q19WeCyuozMHormmHjgX4KACPR7S/s5N mHaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=9eBkN6lmfdOZ6y3T4AeVQ2xEMCxfbxxoIUc76Qx59Gw=; b=z7Q9mNY0UJTTgXtHANkeXXL1/CSUN8Slda4PSrwTIy1hCx8IkfHcpH/Fi0Etv7mkEk J0tZLzoLoawHhb3LoH7WyUPHCfxPSW4jnhdG5k6UFXzQLL1NT3VCaBW89lIQyH5Bz+Y4 aqSmISrbtNmtDOou7Cqv7V6T0o6zboFwFWKy1f5fd8VKnZt527OSi9On6iC6b0JJUeJ0 UImjJoZ22O1bLE3LhhziSsVKIO9aOWHsxSAJaPmweHIZRPFgRhECVjV2scf6BTKSiB37 U12tt9hxxp8Cnf6YmCvJmDo/X0ZZZWachPTqHs7IDDQQQC5HyLCVd4eJQFFhOllk6sYs qlWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=q0DXHENI; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cw17si3320192edb.538.2020.11.26.07.56.51; Thu, 26 Nov 2020 07:57:14 -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; dkim=pass header.i=@google.com header.s=20161025 header.b=q0DXHENI; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391338AbgKZPyb (ORCPT + 99 others); Thu, 26 Nov 2020 10:54:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51078 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391331AbgKZPya (ORCPT ); Thu, 26 Nov 2020 10:54:30 -0500 Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F108CC0613D4 for ; Thu, 26 Nov 2020 07:54:29 -0800 (PST) Received: by mail-wr1-x442.google.com with SMTP id r3so2656320wrt.2 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=Apzh2aRx+h6SqWGEVPfSr6455xBY0Q7BJ36UWqdm6auHEuRf7MOT7+PppJfRknYtpT rfBwcTPIT3NtQeiPvUUlTtRUqDJV2rTzhStnyrYEJfjMOA5/Kd8GakKBKR9Tu9d2AUKR 4PIbpKJtB3MRqAatiQNVADkYFHvTBRsMrCJOxZ8g8WififeoSuyh/V5QtomcYKhaEUbC VQy3jPswrpxTW1gNhOZCKDiqxVEhflw6Hzij0XNEnaZR8VVGEpDurpq6qI1fnLkms5mN 4mChsP97uh3PU59X42Sx+XbY5fJSXu+VUSBmb7dY9E6eEhUTpr3upRmHdx5HYrDD3MzK yhpw== X-Gm-Message-State: AOAM530fUI35BAmMNh5UZ4Qfmfn5ODVYlikbKjjh2GYewy6YZdRjgPaE 92E0fISt/noiqGEaOlBsz8Mo2A== 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 Cc: Jonathan Corbet , Catalin Marinas , Will Deacon , Marc Zyngier , James Morse , Julien Thierry , Suzuki K Poulose , Dennis Zhou , Tejun Heo , Christoph Lameter , Mark Rutland , Lorenzo Pieralisi , Sudeep Holla , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel-team@android.com, David Brazdil 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 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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 --- 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; -- 2.29.2.454.gaff20da3a2-goog