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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7E003C4332F for ; Tue, 13 Dec 2022 06:26:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=L8yZ56ujbVgZ7Ricq1ajz4Yb6U7P30kAReWV3Xe7EwE=; b=PHMmXoj4rwpGFf BXr6OOY9j9lA0h09itYYk8hmsbyET8RQNqyF6hi5tCVhI/5UP0Vh1b5unZmRMxwxsuK1uNjtQW0gT kZpxkNc6Joh0xOBpfqLse+uBFsDAkx5h2da10aZP8Y2Qa+SYogsphJC7hYqqIsa1j5yYAGN0Ujj8Y 4EGkCOjOGfdzS7df4w5xUuev2yJL9vmW/XwjjLBDvILN/gJUXe/11t9va+SQWxjrWMaUClrzLzzWJ uL7EiLNhp7BebTHUGvk0XL9cbxEEKqw+qgYe0xN+HjeG+mNYumhqybz1LLRKL08FqvoD6t3PxTGMT D3WC6LG7xOBhq/TTWbxg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p4yjg-00BRlL-ER; Tue, 13 Dec 2022 06:25:52 +0000 Received: from ams.source.kernel.org ([2604:1380:4601:e00::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p4yjb-00BRds-SK for linux-arm-kernel@lists.infradead.org; Tue, 13 Dec 2022 06:25:50 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 0C9BFB810B5; Tue, 13 Dec 2022 06:25:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 27D46C433EF; Tue, 13 Dec 2022 06:25:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1670912744; bh=eMWjSga3C3hMbGjnvBP989uWEXS7JkaxC+FmhAkhfPI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=xSicbsLVQ4BhWrnWzKoQCDZrmwsGXB9uhhfHqLsox4Od+SI6WsiJFNiIxYhTCvaNW 7qqxRtiBJgA9N96ZexXmwtyuOOyHAKr0Ynzcyxo5WI10sFx2x8jG5PrLKh4NzQ5aQg SGmKnb6d1qDe6AZV1d8NBnQcDi1I7DGidI4nz8Hs= Date: Tue, 13 Dec 2022 07:25:41 +0100 From: Greg Kroah-Hartman To: Elliot Berman Cc: Bjorn Andersson , Murali Nalajala , Trilok Soni , Srivatsa Vaddagiri , Carl van Schaik , Prakruthi Deepak Heragu , Arnd Bergmann , Rob Herring , Krzysztof Kozlowski , Jonathan Corbet , Catalin Marinas , Will Deacon , Jassi Brar , Sudeep Holla , Mark Rutland , Lorenzo Pieralisi , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-acpi@vger.kernel.org Subject: Re: [PATCH v7 10/20] gunyah: rsc_mgr: Add resource manager RPC core Message-ID: References: <20221121140009.2353512-1-quic_eberman@quicinc.com> <20221121140009.2353512-11-quic_eberman@quicinc.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221212_222548_443517_FFC0B938 X-CRM114-Status: GOOD ( 39.33 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 On Mon, Dec 12, 2022 at 03:46:58PM -0800, Elliot Berman wrote: > > > On 11/21/2022 7:23 AM, Greg Kroah-Hartman wrote: > > On Mon, Nov 21, 2022 at 05:59:59AM -0800, Elliot Berman wrote: > > > The resource manager is a special virtual machine which is always > > > running on a Gunyah system. It provides APIs for creating and destroying > > > VMs, secure memory management, sharing/lending of memory between VMs, > > > and setup of inter-VM communication. Calls to the resource manager are > > > made via message queues. > > > > > > This patch implements the basic probing and RPC mechanism to make those > > > API calls. Request/response calls can be made with gh_rm_call. > > > Drivers can also register to notifications pushed by RM via > > > gh_rm_register_notifier > > > > > > Specific API calls that resource manager supports will be implemented in > > > subsequent patches. > > > > > > Signed-off-by: Elliot Berman > > > --- > > > MAINTAINERS | 2 +- > > > drivers/virt/gunyah/Kconfig | 7 + > > > drivers/virt/gunyah/Makefile | 2 + > > > drivers/virt/gunyah/gunyah_rm_rpc.c | 570 +++++++++++++++++++++++++++ > > > drivers/virt/gunyah/gunyah_rsc_mgr.c | 50 +++ > > > drivers/virt/gunyah/rsc_mgr.h | 37 ++ > > > include/linux/gunyah_rsc_mgr.h | 18 + > > > 7 files changed, 685 insertions(+), 1 deletion(-) > > > create mode 100644 drivers/virt/gunyah/gunyah_rm_rpc.c > > > create mode 100644 drivers/virt/gunyah/gunyah_rsc_mgr.c > > > create mode 100644 drivers/virt/gunyah/rsc_mgr.h > > > create mode 100644 include/linux/gunyah_rsc_mgr.h > > > > > > diff --git a/MAINTAINERS b/MAINTAINERS > > > index 502798197b80..b65f7ff444e5 100644 > > > --- a/MAINTAINERS > > > +++ b/MAINTAINERS > > > @@ -8948,7 +8948,7 @@ F: Documentation/virt/gunyah/ > > > F: arch/arm64/gunyah/ > > > F: drivers/mailbox/gunyah-msgq.c > > > F: drivers/virt/gunyah/ > > > -F: include/linux/gunyah.h > > > +F: include/linux/gunyah*.h > > > HABANALABS PCI DRIVER > > > M: Oded Gabbay > > > diff --git a/drivers/virt/gunyah/Kconfig b/drivers/virt/gunyah/Kconfig > > > index 127156a678a6..0bb497372d4e 100644 > > > --- a/drivers/virt/gunyah/Kconfig > > > +++ b/drivers/virt/gunyah/Kconfig > > > @@ -10,3 +10,10 @@ config GUNYAH > > > Say Y/M here to enable the drivers needed to interact in a Gunyah > > > virtual environment. > > > + > > > +if GUNYAH > > > +config GUNYAH_RESOURCE_MANAGER > > > + tristate > > > + depends on MAILBOX > > > + select GUNYAH_MESSAGE_QUEUES > > > +endif > > > diff --git a/drivers/virt/gunyah/Makefile b/drivers/virt/gunyah/Makefile > > > index 2ac4ee64b89d..b62ac4045621 100644 > > > --- a/drivers/virt/gunyah/Makefile > > > +++ b/drivers/virt/gunyah/Makefile > > > @@ -1 +1,3 @@ > > > obj-$(CONFIG_GUNYAH) += gunyah.o > > > + > > > +obj-$(CONFIG_GUNYAH_RESOURCE_MANAGER) += gunyah_rsc_mgr.o gunyah_rm_rpc.o > > > diff --git a/drivers/virt/gunyah/gunyah_rm_rpc.c b/drivers/virt/gunyah/gunyah_rm_rpc.c > > > new file mode 100644 > > > index 000000000000..45b1a8691982 > > > --- /dev/null > > > +++ b/drivers/virt/gunyah/gunyah_rm_rpc.c > > > @@ -0,0 +1,570 @@ > > > +// SPDX-License-Identifier: GPL-2.0-only > > > +/* > > > + * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. > > > + */ > > > + > > > +#include > > > +#include > > > +#include > > > +#include > > > +#include > > > +#include > > > +#include > > > +#include > > > +#include > > > +#include > > > +#include > > > +#include > > > +#include > > > > This should not have anything to do with a platform device, please see > > below. > > > > > +#include > > > +#include > > > + > > > +#include "rsc_mgr.h" > > > + > > > +static int gh_rm_drv_probe(struct platform_device *pdev) > > > > Why is this tied to a platformm device? > > > > I don't understand the relationship here, sorry. > > >> +{ > > > + struct gh_rm_rpc *rsc_mgr; > > > + > > > + rsc_mgr = gh_rm_rpc_init(pdev); > > > > Shouldn't this be creating a new one that is just a child passed in? > > Shouldn't this call just take a 'struct device *'? > > > > I'm following the suggestion from Arnd to have small core module that calls > into initialization routines for the other parts of the driver, rather than > creating bus for a few (2) devices. > > https://lore.kernel.org/all/a3754259-9989-495e-a6bd-5501daff06a2@app.fastmail.com/ 2 devices is still a bus. Please don't mess with the driver model in ways it is not ment to be messed with if at all possible. And again, don't abuse platform devices for dynamically discovered devices like this. thanks, greg k-h _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel