Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3564506pxb; Mon, 16 Nov 2020 19:23:49 -0800 (PST) X-Google-Smtp-Source: ABdhPJynFswhM+PHK3qAl9HXlGxRPfMqF/Z2otSqEAQjSghDcuxh3OweetnAhXlrRZuoltxW1ALa X-Received: by 2002:a17:906:7e55:: with SMTP id z21mr17138819ejr.154.1605583429294; Mon, 16 Nov 2020 19:23:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605583429; cv=none; d=google.com; s=arc-20160816; b=DBLElz0CKtRfiuQ58KZF12+dq7YP50WY/Lu9RkkomrC3L62bRyRauB7TZsL9fN2vLt m3pi1PFYKu2GbdJ6lTj8wupaBQ/MTQh3jVrkU5WcBUqEpiZ0hFKxKHQWDV7aUmAcqhyx cJXQUaEshczvnWmhu00+2AooZVA7N60JP68gLumpP7By7n491Q0EBVgG1mGr7U8kFX4x 9ouBuPs5tflfAq71/zKaNcw+Ca30VQxMIDzYOa1Y33+I5NlCiYU3uUXQRq+hVGTw5bay 0z+aGoMoahMROvfHDjMTSnt1u8G0ngLRBSgIfUEEEU1qqMLGLlYIlEpNkbmCkAU0/s8o sfRg== 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=zcAUCdpGWiuobZn7klovZm7k+zA43w4wed6QHZHKZWs=; b=fl+a3RZC9akFqrj+dhHDq4hM2njHXq6lyw5be19eyrHxH90do4E6BP5cvuV8i1nWZv NV9jXomytgpxUaDhkKeqs3Dy1hmRh0qskb7BcRXv42Kf4qSXeJ1EJXdaJFs5cJCnlb4J hcMm2J3K2oct2J41B7giltnv6AdYf20zuFexaK8ZsJL2b7YPb9wcr18lvQAACJOfOy5e NTFUxzry30zJLjJdVJxv37jvM/t3U2kMETuVTopEKzRJDQWI77yHjr/uDvZSZedbP0my 19y7yTFPKIQPqhHHjAzOuwNmRbd6zVuI2HCJK8yTt1Lnz/toBXer4okmkvWvVJp2E7h/ DNmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="t+iNX/pa"; 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 f18si212855eds.8.2020.11.16.19.23.26; Mon, 16 Nov 2020 19:23:49 -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="t+iNX/pa"; 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 S1733064AbgKPUn1 (ORCPT + 99 others); Mon, 16 Nov 2020 15:43:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46796 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726200AbgKPUn0 (ORCPT ); Mon, 16 Nov 2020 15:43:26 -0500 Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 84FCDC0613CF for ; Mon, 16 Nov 2020 12:43:26 -0800 (PST) Received: by mail-wm1-x341.google.com with SMTP id h21so582799wmb.2 for ; Mon, 16 Nov 2020 12:43:26 -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=zcAUCdpGWiuobZn7klovZm7k+zA43w4wed6QHZHKZWs=; b=t+iNX/paL9tpslCZ4CFA0oCR9xlgnZt6fxJdREt7U7vuSjqq/X58AyBogeLhmb/FgA seqQtQzK3lsKx2bZbh9uTqgCQ8BiJKQM1Kkc2l5gBGbgIEIK4ZvLY57zj9qQ575CVNiG 32YGidIbqGAxwSRCkoTBCJTX6Ck5M4kMXTeTIydXYbK7dk4aWmkCMhjTFoM2M1q438vQ eZPIRHbbCtKMUQOnso8i7X8CQ1A5SRPmJh6MDrhmCxrglK8LbcDnHBisKHia+Y65TAWA aK5vNo0NXNX1qC+rBXjlsbA88aDmZKhEObSRb3tTXOeFer1H+YDQ8lWIe+INsuGEW9RO E6ng== 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=zcAUCdpGWiuobZn7klovZm7k+zA43w4wed6QHZHKZWs=; b=I5Apn68M7V9WCuEmWL/7FMn3cQxvoQifa58PX3o9YoPgeZhm1LHnBwtDUi6ZLq/ede 4oltfQfyHhRVY3cbqj9FHTosOIeOOK48upWd7QMVVT1eEH378Cm+x5oEqdm+h8OGJEq1 F6jn+LNwROaPggyy9wERxYYlDvZgmalLbW8BOUwZGLvKXYQMIGxTqxE/C7kmGCvViloL O9urK5gKLWM5a2+OixFgNwsstEq3xQJjBHYr1+DYG1VTnq6WcOVNqJsviJUXN74JnMRn Hmn3fyfrIAbwu58w1o0U2xAkiHaKyd0/TtsZLuzAO1bWyO8yAI0bx1m8Xz7GO6q5JmRw gU+w== X-Gm-Message-State: AOAM5316WDyOfHA4E2W7JLGV7zfEZHi80iWHco4h2fd5H6IhnvRgX0KY NZUjKUAznYw7rie71I9Ji8jLbA== X-Received: by 2002:a1c:4485:: with SMTP id r127mr684535wma.177.1605559405139; Mon, 16 Nov 2020 12:43:25 -0800 (PST) Received: from localhost ([2a01:4b00:8523:2d03:bc40:bd71:373a:1b33]) by smtp.gmail.com with ESMTPSA id p4sm623902wmc.46.2020.11.16.12.43.23 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 16 Nov 2020 12:43:24 -0800 (PST) From: David Brazdil To: kvmarm@lists.cs.columbia.edu Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Marc Zyngier , James Morse , Julien Thierry , Suzuki K Poulose , Catalin Marinas , Will Deacon , Dennis Zhou , Tejun Heo , Christoph Lameter , Mark Rutland , Lorenzo Pieralisi , Quentin Perret , Andrew Scull , Andrew Walbran , kernel-team@android.com, David Brazdil Subject: [PATCH v2 01/24] psci: Support psci_ops.get_version for v0.1 Date: Mon, 16 Nov 2020 20:42:55 +0000 Message-Id: <20201116204318.63987-2-dbrazdil@google.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201116204318.63987-1-dbrazdil@google.com> References: <20201116204318.63987-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.299.gdc1121823c-goog