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=-26.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT,USER_IN_DEF_DKIM_WL autolearn=unavailable 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 9CBB0C8301A for ; Wed, 2 Dec 2020 18:43:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 54C25206D5 for ; Wed, 2 Dec 2020 18:43:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387870AbgLBSnA (ORCPT ); Wed, 2 Dec 2020 13:43:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53972 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730984AbgLBSm7 (ORCPT ); Wed, 2 Dec 2020 13:42:59 -0500 Received: from mail-wr1-x444.google.com (mail-wr1-x444.google.com [IPv6:2a00:1450:4864:20::444]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 15194C061A4E for ; Wed, 2 Dec 2020 10:41:42 -0800 (PST) Received: by mail-wr1-x444.google.com with SMTP id u12so5193492wrt.0 for ; Wed, 02 Dec 2020 10:41:42 -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=qXwVi8GgD0h+y0Z1L4Qz/RxstC0DDwAUVzhRN0FU904=; b=i+G98kVudQR6uGePmNxw8xCv7SMJAja1ZSWowPxR1m3WcQORTplZuJmLizNsMjEhCh wEKbRahBqXc7XUcmyktVRkyyRuiuvzzaXLq/c+bjP3tKDlOtoQz2LX6scrNS6qFBjsDZ jJFI5aZZ9jlIWXo5dAO5x0M14XqlhIjLXybyL7t9tmYSDxxm8vj02XMeVsJGeAbRe3Ec bHjOvS6lH4XPiSfInJTeRmGrp8KEenXa0rxR8rBCPjCgXRbh7UKOJ0EfJ0JxTI2zZtoa SeNlCdJAZECI2DajIMd/1/nTwrPVyOC5AzMf8GimCHFwpoSij5LlSefToJPi7j30LqQ8 It/A== 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=qXwVi8GgD0h+y0Z1L4Qz/RxstC0DDwAUVzhRN0FU904=; b=L+5+0RGLjqBvBuMEV4KDvfSHnE64pN0YMRyktYfHwrvDsBgJZm5/qKf5jFRZU2bqrO tHhZUEh1XK+5K09Dt6UTJtsgl8qmdBPdthTr7eu8XpznWrQ8TnV+pFPL4GvNZSRe7rbS GZA8zqmPNpvY9HPCNGNGmvkj6c9YC3SnK+ccvmMX/ncTM2EAeplhJHwlftCjWJtgSHZq VGo9M12KHSEiYA5pXA/LeW4TcQolJuP9MBch0Obtd4XCQv2tnHAbOeT3Of7VlzkxHeyc cmzHqVCyRSl8rUo4xXsZfTGwEtfcwyewBBjyux0cNBawKHuSmXn4FYfelXCJpjsFY7Lw UIXw== X-Gm-Message-State: AOAM533vo7WTrc2aoN/4Zh6rnW8xrJ94/q4CFFM8kVuq9dcZdhdFQNIW +xvMHlHDDVEKJa1BPJYnw/NPTw== X-Google-Smtp-Source: ABdhPJzo+3XrHLu5MZisvjC9Vlqkp9p6BFe0uyPEE/+3sbo7phn6YCf8SNKtKbXnK5PdAZQg2KF0+w== X-Received: by 2002:a5d:4f0e:: with SMTP id c14mr4996465wru.422.1606934500673; Wed, 02 Dec 2020 10:41:40 -0800 (PST) Received: from localhost ([2a01:4b00:8523:2d03:5ddd:b7c5:e3c9:e87a]) by smtp.gmail.com with ESMTPSA id p11sm3257202wrj.14.2020.12.02.10.41.39 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 02 Dec 2020 10:41:39 -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 v4 06/26] psci: Add accessor for psci_0_1_function_ids Date: Wed, 2 Dec 2020 18:41:02 +0000 Message-Id: <20201202184122.26046-7-dbrazdil@google.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201202184122.26046-1-dbrazdil@google.com> References: <20201202184122.26046-1-dbrazdil@google.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Make it possible to retrieve a copy of the psci_0_1_function_ids struct. This is useful for KVM if it is configured to intercept host's PSCI SMCs. Signed-off-by: David Brazdil --- drivers/firmware/psci/psci.c | 12 +++++------- include/linux/psci.h | 9 +++++++++ 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/drivers/firmware/psci/psci.c b/drivers/firmware/psci/psci.c index 593fdd0e09a2..f5fc429cae3f 100644 --- a/drivers/firmware/psci/psci.c +++ b/drivers/firmware/psci/psci.c @@ -58,15 +58,13 @@ typedef unsigned long (psci_fn)(unsigned long, unsigned long, unsigned long, unsigned long); static psci_fn *invoke_psci_fn; -struct psci_0_1_function_ids { - u32 cpu_suspend; - u32 cpu_on; - u32 cpu_off; - u32 migrate; -}; - static struct psci_0_1_function_ids psci_0_1_function_ids; +struct psci_0_1_function_ids get_psci_0_1_function_ids(void) +{ + return psci_0_1_function_ids; +} + #define PSCI_0_2_POWER_STATE_MASK \ (PSCI_0_2_POWER_STATE_ID_MASK | \ PSCI_0_2_POWER_STATE_TYPE_MASK | \ diff --git a/include/linux/psci.h b/include/linux/psci.h index 2a1bfb890e58..4ca0060a3fc4 100644 --- a/include/linux/psci.h +++ b/include/linux/psci.h @@ -34,6 +34,15 @@ struct psci_operations { extern struct psci_operations psci_ops; +struct psci_0_1_function_ids { + u32 cpu_suspend; + u32 cpu_on; + u32 cpu_off; + u32 migrate; +}; + +struct psci_0_1_function_ids get_psci_0_1_function_ids(void); + #if defined(CONFIG_ARM_PSCI_FW) int __init psci_dt_init(void); #else -- 2.29.2.454.gaff20da3a2-goog 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=-16.5 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_INVALID,DKIM_SIGNED,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 5850DC71155 for ; Wed, 2 Dec 2020 18:41:47 +0000 (UTC) Received: from mm01.cs.columbia.edu (mm01.cs.columbia.edu [128.59.11.253]) by mail.kernel.org (Postfix) with ESMTP id A0050221FA for ; Wed, 2 Dec 2020 18:41:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A0050221FA Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvmarm-bounces@lists.cs.columbia.edu Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 257AF4B415; Wed, 2 Dec 2020 13:41:46 -0500 (EST) X-Virus-Scanned: at lists.cs.columbia.edu Authentication-Results: mm01.cs.columbia.edu (amavisd-new); dkim=softfail (fail, message has been altered) header.i=@google.com Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id guds5KhovMz4; Wed, 2 Dec 2020 13:41:45 -0500 (EST) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 24B154B41C; Wed, 2 Dec 2020 13:41:45 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id E622B4B40C for ; Wed, 2 Dec 2020 13:41:43 -0500 (EST) X-Virus-Scanned: at lists.cs.columbia.edu Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id jt5xxDNJBB+U for ; Wed, 2 Dec 2020 13:41:43 -0500 (EST) Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by mm01.cs.columbia.edu (Postfix) with ESMTPS id F0F744B414 for ; Wed, 2 Dec 2020 13:41:41 -0500 (EST) Received: by mail-wr1-f65.google.com with SMTP id z7so5174271wrn.3 for ; Wed, 02 Dec 2020 10:41:41 -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=qXwVi8GgD0h+y0Z1L4Qz/RxstC0DDwAUVzhRN0FU904=; b=i+G98kVudQR6uGePmNxw8xCv7SMJAja1ZSWowPxR1m3WcQORTplZuJmLizNsMjEhCh wEKbRahBqXc7XUcmyktVRkyyRuiuvzzaXLq/c+bjP3tKDlOtoQz2LX6scrNS6qFBjsDZ jJFI5aZZ9jlIWXo5dAO5x0M14XqlhIjLXybyL7t9tmYSDxxm8vj02XMeVsJGeAbRe3Ec bHjOvS6lH4XPiSfInJTeRmGrp8KEenXa0rxR8rBCPjCgXRbh7UKOJ0EfJ0JxTI2zZtoa SeNlCdJAZECI2DajIMd/1/nTwrPVyOC5AzMf8GimCHFwpoSij5LlSefToJPi7j30LqQ8 It/A== 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=qXwVi8GgD0h+y0Z1L4Qz/RxstC0DDwAUVzhRN0FU904=; b=coHxHzXCvFkeB54CuPtKY7FXcZtRlYwuS7wcZ90SgU0I6OvhzST38H70pScHCbg2JT NUFgFjSBZe+5Y0hXy2D1mHJ9nvdWSFTthU4yELxp1zBCdKmIjgR9yPdfVAcgWVP9WoKu eAvdYKr2woUI1UrxpT5laJt3AMPNGohCGI88/JdlXrG4e6Q0CBYRXTyx8LoLmydLYPZ5 AX+VNQRYwLkimeZcHfKfudzytVPEhlLfQD2oIl7Ite2PxzCFOcFgskCDFfaDLBqO8ALi sEU6tlwdgbh0g2yHKMQ5Cu++CnMEjiUklJ+h7GEEgeG4uTUXOIPJopvYAEyyICECRzQh V1VQ== X-Gm-Message-State: AOAM5310S8AFMNSQFMSPoKHXM/NZmsfgRjRFxyLPbiBGmjUc5hun7Uu4 wbC7XBLYrG5S3xpMjCUtjslhWZqJJp5aMg== X-Google-Smtp-Source: ABdhPJzo+3XrHLu5MZisvjC9Vlqkp9p6BFe0uyPEE/+3sbo7phn6YCf8SNKtKbXnK5PdAZQg2KF0+w== X-Received: by 2002:a5d:4f0e:: with SMTP id c14mr4996465wru.422.1606934500673; Wed, 02 Dec 2020 10:41:40 -0800 (PST) Received: from localhost ([2a01:4b00:8523:2d03:5ddd:b7c5:e3c9:e87a]) by smtp.gmail.com with ESMTPSA id p11sm3257202wrj.14.2020.12.02.10.41.39 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 02 Dec 2020 10:41:39 -0800 (PST) From: David Brazdil To: kvmarm@lists.cs.columbia.edu Subject: [PATCH v4 06/26] psci: Add accessor for psci_0_1_function_ids Date: Wed, 2 Dec 2020 18:41:02 +0000 Message-Id: <20201202184122.26046-7-dbrazdil@google.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201202184122.26046-1-dbrazdil@google.com> References: <20201202184122.26046-1-dbrazdil@google.com> MIME-Version: 1.0 Cc: Lorenzo Pieralisi , kernel-team@android.com, Jonathan Corbet , Catalin Marinas , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Sudeep Holla , linux-arm-kernel@lists.infradead.org, Marc Zyngier , Tejun Heo , Dennis Zhou , Christoph Lameter , Will Deacon X-BeenThere: kvmarm@lists.cs.columbia.edu X-Mailman-Version: 2.1.14 Precedence: list List-Id: Where KVM/ARM decisions are made List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kvmarm-bounces@lists.cs.columbia.edu Sender: kvmarm-bounces@lists.cs.columbia.edu Make it possible to retrieve a copy of the psci_0_1_function_ids struct. This is useful for KVM if it is configured to intercept host's PSCI SMCs. Signed-off-by: David Brazdil --- drivers/firmware/psci/psci.c | 12 +++++------- include/linux/psci.h | 9 +++++++++ 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/drivers/firmware/psci/psci.c b/drivers/firmware/psci/psci.c index 593fdd0e09a2..f5fc429cae3f 100644 --- a/drivers/firmware/psci/psci.c +++ b/drivers/firmware/psci/psci.c @@ -58,15 +58,13 @@ typedef unsigned long (psci_fn)(unsigned long, unsigned long, unsigned long, unsigned long); static psci_fn *invoke_psci_fn; -struct psci_0_1_function_ids { - u32 cpu_suspend; - u32 cpu_on; - u32 cpu_off; - u32 migrate; -}; - static struct psci_0_1_function_ids psci_0_1_function_ids; +struct psci_0_1_function_ids get_psci_0_1_function_ids(void) +{ + return psci_0_1_function_ids; +} + #define PSCI_0_2_POWER_STATE_MASK \ (PSCI_0_2_POWER_STATE_ID_MASK | \ PSCI_0_2_POWER_STATE_TYPE_MASK | \ diff --git a/include/linux/psci.h b/include/linux/psci.h index 2a1bfb890e58..4ca0060a3fc4 100644 --- a/include/linux/psci.h +++ b/include/linux/psci.h @@ -34,6 +34,15 @@ struct psci_operations { extern struct psci_operations psci_ops; +struct psci_0_1_function_ids { + u32 cpu_suspend; + u32 cpu_on; + u32 cpu_off; + u32 migrate; +}; + +struct psci_0_1_function_ids get_psci_0_1_function_ids(void); + #if defined(CONFIG_ARM_PSCI_FW) int __init psci_dt_init(void); #else -- 2.29.2.454.gaff20da3a2-goog _______________________________________________ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm 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=-18.2 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 14B05C83018 for ; Wed, 2 Dec 2020 18:43:24 +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 A6701206D5 for ; Wed, 2 Dec 2020 18:43:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A6701206D5 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=Q2gJnPOkSRRCbysWPm6fI+TpT/jSMXIKPrO2Hh6ClP0=; b=U0WeAHBKfEypVmnsf47NvdNr1 Xjzm31EN3DiT0veQBMrqjgjLkYC3KyHbGOOuuEPe6/pB4kzt8UoVfvGHjDF4aSqzUJaBQZSZSCFbU mdeAuXx0mahG9RMltZKJ+tmRnCsaHik+FfivSKuSWDZA0VgwkzltYrOXHhnpU8slUxCY7pRlC3OXj LpphkRyIjerFjaza/y2/4piATf9GKvuC6sZFngd5nopeIXdsdMtJTX/eflJYqL8cc1URMYDyFo863 NGnuUcVJojmPRxJ4veVBPZka2K4uH7yyqY9WKt4/Ly2VnzSu+uAa/ehlI0S40WkBX7BT1XBXDKBvk cPFqM+d9A==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kkX4X-0008FF-HG; Wed, 02 Dec 2020 18:41:49 +0000 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kkX4P-0008Ci-SV for linux-arm-kernel@lists.infradead.org; Wed, 02 Dec 2020 18:41:42 +0000 Received: by mail-wr1-x441.google.com with SMTP id i2so5162861wrs.4 for ; Wed, 02 Dec 2020 10:41:41 -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=qXwVi8GgD0h+y0Z1L4Qz/RxstC0DDwAUVzhRN0FU904=; b=i+G98kVudQR6uGePmNxw8xCv7SMJAja1ZSWowPxR1m3WcQORTplZuJmLizNsMjEhCh wEKbRahBqXc7XUcmyktVRkyyRuiuvzzaXLq/c+bjP3tKDlOtoQz2LX6scrNS6qFBjsDZ jJFI5aZZ9jlIWXo5dAO5x0M14XqlhIjLXybyL7t9tmYSDxxm8vj02XMeVsJGeAbRe3Ec bHjOvS6lH4XPiSfInJTeRmGrp8KEenXa0rxR8rBCPjCgXRbh7UKOJ0EfJ0JxTI2zZtoa SeNlCdJAZECI2DajIMd/1/nTwrPVyOC5AzMf8GimCHFwpoSij5LlSefToJPi7j30LqQ8 It/A== 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=qXwVi8GgD0h+y0Z1L4Qz/RxstC0DDwAUVzhRN0FU904=; b=ByMz/6NlqtBvRzVrQy0u/hm305Hv2yyf4s7HfCeapnuTIwfBaocW1YlwEZ/AUNi+pQ nMOtwG3QaZ0C6/syuVHHRPx1eMHTJ0QiCoNmTPPacCAZNCU6YcAEQO7N0nSYsc5L6mkk uOXHPqDCEH49sLR1ZhXsYeP57BWrAxT+/rKfJKZeZrW2Ky6HZ6IA0rkvcILifIB+cEV6 F/YIAUiE4KtO2/SlJifzQqTtvvChGlB+QKGwO1eLH/4qTW0/Tw+0P2NPzBnh1B2c9YJV dZ11eT8ciB1UrH026To0b5TsEWHlUlqJr3xhloLq8uSvLujxaT6m6IxS6RZiPYELUB6x BMEg== X-Gm-Message-State: AOAM5317KVU+M/OrVuElq1LVx7F19gToymkSDzsFl31YFHZ/KWGkEkac rWJV50eZpK5jTmykPsWdiKdq2w== X-Google-Smtp-Source: ABdhPJzo+3XrHLu5MZisvjC9Vlqkp9p6BFe0uyPEE/+3sbo7phn6YCf8SNKtKbXnK5PdAZQg2KF0+w== X-Received: by 2002:a5d:4f0e:: with SMTP id c14mr4996465wru.422.1606934500673; Wed, 02 Dec 2020 10:41:40 -0800 (PST) Received: from localhost ([2a01:4b00:8523:2d03:5ddd:b7c5:e3c9:e87a]) by smtp.gmail.com with ESMTPSA id p11sm3257202wrj.14.2020.12.02.10.41.39 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 02 Dec 2020 10:41:39 -0800 (PST) From: David Brazdil To: kvmarm@lists.cs.columbia.edu Subject: [PATCH v4 06/26] psci: Add accessor for psci_0_1_function_ids Date: Wed, 2 Dec 2020 18:41:02 +0000 Message-Id: <20201202184122.26046-7-dbrazdil@google.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201202184122.26046-1-dbrazdil@google.com> References: <20201202184122.26046-1-dbrazdil@google.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201202_134142_058575_5BB7DF03 X-CRM114-Status: GOOD ( 16.29 ) 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Make it possible to retrieve a copy of the psci_0_1_function_ids struct. This is useful for KVM if it is configured to intercept host's PSCI SMCs. Signed-off-by: David Brazdil --- drivers/firmware/psci/psci.c | 12 +++++------- include/linux/psci.h | 9 +++++++++ 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/drivers/firmware/psci/psci.c b/drivers/firmware/psci/psci.c index 593fdd0e09a2..f5fc429cae3f 100644 --- a/drivers/firmware/psci/psci.c +++ b/drivers/firmware/psci/psci.c @@ -58,15 +58,13 @@ typedef unsigned long (psci_fn)(unsigned long, unsigned long, unsigned long, unsigned long); static psci_fn *invoke_psci_fn; -struct psci_0_1_function_ids { - u32 cpu_suspend; - u32 cpu_on; - u32 cpu_off; - u32 migrate; -}; - static struct psci_0_1_function_ids psci_0_1_function_ids; +struct psci_0_1_function_ids get_psci_0_1_function_ids(void) +{ + return psci_0_1_function_ids; +} + #define PSCI_0_2_POWER_STATE_MASK \ (PSCI_0_2_POWER_STATE_ID_MASK | \ PSCI_0_2_POWER_STATE_TYPE_MASK | \ diff --git a/include/linux/psci.h b/include/linux/psci.h index 2a1bfb890e58..4ca0060a3fc4 100644 --- a/include/linux/psci.h +++ b/include/linux/psci.h @@ -34,6 +34,15 @@ struct psci_operations { extern struct psci_operations psci_ops; +struct psci_0_1_function_ids { + u32 cpu_suspend; + u32 cpu_on; + u32 cpu_off; + u32 migrate; +}; + +struct psci_0_1_function_ids get_psci_0_1_function_ids(void); + #if defined(CONFIG_ARM_PSCI_FW) int __init psci_dt_init(void); #else -- 2.29.2.454.gaff20da3a2-goog _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel