Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp1269998rwb; Sat, 5 Aug 2023 10:43:45 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFdOrHMi8wwAH/WQ5TppsFk4P3lBdALkI+ew6dRjRVZ1EO9+fpycUo6jJRly22I+Zgdorwy X-Received: by 2002:aa7:88c2:0:b0:687:535f:6710 with SMTP id k2-20020aa788c2000000b00687535f6710mr4335045pff.7.1691257425522; Sat, 05 Aug 2023 10:43:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691257425; cv=none; d=google.com; s=arc-20160816; b=DE5cJBH2y8MTXky1HEt6ZnRsQkvxbyOTvQT3CXPyHitGwoY8u9RQZB2SRUcaHvuKS/ XylxrEgr4oPUdH6fJ6D7AFPd1712YnCXipm10GMhofbnyhAqB92cObH0ap4hIMvtOtmr e7P37UjXjfAwgbfkt7Sb+lNCT0YQkEgITNN2sQNB+YfFA7olRn+Xh8Hq98NEvG6Mfihi HCPseHZUjPcCXomaT8Wxuhukh6/JO+AFCx6PR4pmTwqrN1U4ydj9IdE/dfpl1MT90TjC Cm+5pXw7G1tDAyGQIAU9q6BOlVAA5gDFfmU2tWnLvcdIreYaU7/mj2RqHKrbOHelK7uO WCJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=IB8VU4hlyDXjazxEsTRhCMKIGLOHTye/bUyUdl8iipo=; fh=uywyjt+gw8fLTiunmaEr5i65nvc3SPl0liRDSY5qP9c=; b=BMgwqlKejixZeVvs/VYwZAftr0zJjwnwlYIrMI+2msc9g5awuaIP/Q+HKh/1F6RH/+ tQbD7Vh9v4ak5Qhm019NwJDE0f+fY2UqMl5liTEVxJ8e/ZJgL9uQ58YehbemnJo/jH/E anWw+/uAz1wF+KgO/+Ocshjj1ZfDjaYe98tlaPNm3IMuiQZTAYsjJi17iTNMJdoQ291T DEsnpcSCPuHo2v0j3L+14QxyjtfR7XvtvUge6vs+Zvr3aMpG839EnJ+LQp5K4YUDXvd3 MPNqLrCSz7mo3ehWYYWGJqaOnaqXfG3DZZ76PywSrYcl4zBYTty9hzrSPnNu/5ORVdaQ nUEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=IFjuy7s9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cm21-20020a056a00339500b00675f3892a4dsi3328396pfb.304.2023.08.05.10.43.34; Sat, 05 Aug 2023 10:43:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=IFjuy7s9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229549AbjHERYA (ORCPT + 99 others); Sat, 5 Aug 2023 13:24:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53954 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229450AbjHERX7 (ORCPT ); Sat, 5 Aug 2023 13:23:59 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 04976E7; Sat, 5 Aug 2023 10:23:57 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 8470760CA0; Sat, 5 Aug 2023 17:23:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2E0A5C433C8; Sat, 5 Aug 2023 17:23:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1691256236; bh=BbzHGpUBsuGfV7pkOJsxZ3KB9uZF7Ih5TgB7xbv8WZQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=IFjuy7s9HlNqCdhSjHhUckxj+uPZnXdNmhOLnvG2I89/HiINMBV2Ig8gPmcbkKWv3 04tPMZmbW7o2q9m6shfDcZ+AOkjeTF1rNFkUfv9cjSEkMEuUfwo5aftlmjp3++Bizz hpA5pEuBv3zACD0r54fuPcs+e2F4pH0h/j03pPnFkuDpKyCDKWobXfPhQou9Sw57m2 Em194qqIZ/BAZmU7AbPA9FwL1h2fjMUTQdE3FhiqHNWqNLRLU6pVlKzS/CWmM0p/ld Le/E392k48Cz9Kzl/HMlRcsDygeOuu8iT5MNta4quGFERp7kpM7pO1DgRzhpiGrRXg inWtrFWP/KO+w== Date: Sat, 5 Aug 2023 10:26:54 -0700 From: Bjorn Andersson To: Elliot Berman Cc: Alex Elder , Srinivas Kandagatla , Jonathan Corbet , Prakruthi Deepak Heragu , Murali Nalajala , Trilok Soni , Srivatsa Vaddagiri , Carl van Schaik , Dmitry Baryshkov , Konrad Dybcio , Arnd Bergmann , Greg Kroah-Hartman , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bagas Sanjaya , Will Deacon , Andy Gross , Catalin Marinas , Jassi Brar , 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 Subject: Re: [PATCH v14 09/25] gunyah: vm_mgr: Introduce basic VM Manager Message-ID: References: <20230613172054.3959700-1-quic_eberman@quicinc.com> <20230613172054.3959700-10-quic_eberman@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230613172054.3959700-10-quic_eberman@quicinc.com> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 13, 2023 at 10:20:37AM -0700, Elliot Berman wrote: > diff --git a/drivers/virt/gunyah/rsc_mgr.c b/drivers/virt/gunyah/rsc_mgr.c > index 04c8e131d259f..a0faf126ee56e 100644 > --- a/drivers/virt/gunyah/rsc_mgr.c > +++ b/drivers/virt/gunyah/rsc_mgr.c > @@ -15,8 +15,10 @@ > #include > #include > #include > +#include 'm' < 'p' > > #include "rsc_mgr.h" > +#include "vm_mgr.h" > > #define RM_RPC_API_VERSION_MASK GENMASK(3, 0) > #define RM_RPC_HEADER_WORDS_MASK GENMASK(7, 4) > @@ -130,6 +132,7 @@ struct gh_rm_connection { > * @cache: cache for allocating Tx messages > * @send_lock: synchronization to allow only one request to be sent at a time > * @nh: notifier chain for clients interested in RM notification messages > + * @miscdev: /dev/gunyah > */ > struct gh_rm { > struct device *dev; > @@ -146,6 +149,8 @@ struct gh_rm { > struct kmem_cache *cache; > struct mutex send_lock; > struct blocking_notifier_head nh; > + > + struct miscdevice miscdev; > }; > > /** > @@ -580,6 +585,33 @@ int gh_rm_notifier_unregister(struct gh_rm *rm, struct notifier_block *nb) > } > EXPORT_SYMBOL_GPL(gh_rm_notifier_unregister); > > +struct device *gh_rm_get(struct gh_rm *rm) > +{ > + return get_device(rm->miscdev.this_device); Please add a comment to why the VM is parented off the miscdevice and not the RM itself, when the function name indicates that you're acquiring a reference to the rm... > +} > +EXPORT_SYMBOL_GPL(gh_rm_get); > + [..] > diff --git a/drivers/virt/gunyah/vm_mgr.c b/drivers/virt/gunyah/vm_mgr.c > new file mode 100644 > index 0000000000000..a43401cb34f7d > --- /dev/null > +++ b/drivers/virt/gunyah/vm_mgr.c > @@ -0,0 +1,93 @@ > +// SPDX-License-Identifier: GPL-2.0-only > +/* > + * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved. > + */ > + > +#define pr_fmt(fmt) "gh_vm_mgr: " fmt Unused? Regards, Bjorn