From mboxrd@z Thu Jan 1 00:00:00 1970 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=-20.4 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT,USER_IN_DEF_DKIM_WL 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 36145C55179 for ; Wed, 4 Nov 2020 18:36:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C557B2151B for ; Wed, 4 Nov 2020 18:36:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="GjufsStQ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732436AbgKDSgr (ORCPT ); Wed, 4 Nov 2020 13:36:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56424 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732412AbgKDSgo (ORCPT ); Wed, 4 Nov 2020 13:36:44 -0500 Received: from mail-wm1-x343.google.com (mail-wm1-x343.google.com [IPv6:2a00:1450:4864:20::343]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B4E5AC0613D3 for ; Wed, 4 Nov 2020 10:36:43 -0800 (PST) Received: by mail-wm1-x343.google.com with SMTP id p19so2459597wmg.0 for ; Wed, 04 Nov 2020 10:36:43 -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=KMYzxJDYxfHlXJHNbiZJ0RtJwPETqciyv+NsXmdBd5Y=; b=GjufsStQ+HyoPB83S7Ba9wxZeSrIRXkcXxAxPID7JhjR+e70vcnGKegRMVIYfysv7o Aqy9GF51B2tXn8u3oe9zVHDNUbK2UjEYfUl0ImJtzs/qCnSFhbV8uAm01P1AEnwJSTKY 886tVk2x+NqZ5mbipyudrXGoKPfd75Ue1T3DpW0nxqJunhv6vnfS3Iwujj+lpucAL2j2 j0mudlvRcrcyi0KAqUQGnQDvtN05+8dSDdGl/vWDpoo8shIIkYtCVWQ7JrYQpG8Ud1tT DFeM3GX/XIeyX0MPssEYN6d5bp19EuNjOd7hRYPB3gs5DyH308XmOGyqTzEtvSLxC8S/ jr5A== 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=KMYzxJDYxfHlXJHNbiZJ0RtJwPETqciyv+NsXmdBd5Y=; b=ktj5hDScBuUldv2b41fhgk385ehTBwHRy99aZeNi8ylO/5KVfle4iXQIR1HPZiffC0 8GpENez+/FkkAvGRk0/tJTHYON2k7TjgOQsysyvdwJR0A/X52CgUaOoIi84WGKRPXfkj Pc+EjwxRYXxvuBVHXDkENrDEXy+GEXBSeA5GGEHyvggxQ3HWzjSiwIrrhXBz6qJ67cL8 4FPXXfIQX5x0NuOijpL+OTnNyCXyguXpv9V+SpOnsmnevfDFTzSKUNaQTPp9+wBXAs0P N6bTsmXKaE8nl4/y+bIn1Jcm7AONliyf+q2lT0+EcWpW/fpjwt346ILSI4oXePhypU26 Iq5A== X-Gm-Message-State: AOAM533T99NHVfAK373TEg1fL5Xg7qXrMirgX7u6gsf1D5yHQlrD3m9O MdsqxJqKewyhpaY0yHJ5xrbxQw== X-Google-Smtp-Source: ABdhPJxe5MqDZ8brVsIs/z3j+gd8UQSoF3AlIuXpflyiQYSloiegdjfrS3Wak4Mz8sQzKefo8pVKsw== X-Received: by 2002:a7b:c748:: with SMTP id w8mr6054631wmk.32.1604515002281; Wed, 04 Nov 2020 10:36:42 -0800 (PST) Received: from localhost ([2a01:4b00:8523:2d03:c8d2:30f2:53c6:bc2]) by smtp.gmail.com with ESMTPSA id u10sm4014080wrw.36.2020.11.04.10.36.40 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 04 Nov 2020 10:36:41 -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 , kernel-team@android.com, David Brazdil Subject: [RFC PATCH 02/26] psci: Export configured PSCI function IDs Date: Wed, 4 Nov 2020 18:36:06 +0000 Message-Id: <20201104183630.27513-3-dbrazdil@google.com> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201104183630.27513-1-dbrazdil@google.com> References: <20201104183630.27513-1-dbrazdil@google.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Function IDs used by PSCI are configurable for v0.1 via DT/APCI. If the host is using PSCI v0.1, KVM's PSCI proxy needs to use the same IDs. Expose the array holding the information. Signed-off-by: David Brazdil --- drivers/firmware/psci/psci.c | 10 +--------- include/linux/psci.h | 10 ++++++++++ 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/drivers/firmware/psci/psci.c b/drivers/firmware/psci/psci.c index ff523bdbfe3f..ffcb88f60e21 100644 --- a/drivers/firmware/psci/psci.c +++ b/drivers/firmware/psci/psci.c @@ -60,15 +60,7 @@ typedef unsigned long (psci_fn)(unsigned long, unsigned long, unsigned long, unsigned long); static psci_fn *invoke_psci_fn; -enum psci_function { - PSCI_FN_CPU_SUSPEND, - PSCI_FN_CPU_ON, - PSCI_FN_CPU_OFF, - PSCI_FN_MIGRATE, - PSCI_FN_MAX, -}; - -static u32 psci_function_id[PSCI_FN_MAX]; +u32 psci_function_id[PSCI_FN_MAX]; #define PSCI_0_2_POWER_STATE_MASK \ (PSCI_0_2_POWER_STATE_ID_MASK | \ diff --git a/include/linux/psci.h b/include/linux/psci.h index cb35b90d1746..877d844ee6d9 100644 --- a/include/linux/psci.h +++ b/include/linux/psci.h @@ -29,6 +29,16 @@ bool psci_has_osi_support(void); */ extern int psci_driver_version; +enum psci_function { + PSCI_FN_CPU_SUSPEND, + PSCI_FN_CPU_ON, + PSCI_FN_CPU_OFF, + PSCI_FN_MIGRATE, + PSCI_FN_MAX, +}; + +extern u32 psci_function_id[PSCI_FN_MAX]; + struct psci_operations { u32 (*get_version)(void); int (*cpu_suspend)(u32 state, unsigned long entry_point); -- 2.29.1.341.ge80a0c044ae-goog