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=-19.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1, 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 2D2ABC48BC2 for ; Wed, 23 Jun 2021 22:05:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0D7DE613B2 for ; Wed, 23 Jun 2021 22:05:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229812AbhFWWHu (ORCPT ); Wed, 23 Jun 2021 18:07:50 -0400 Received: from linux.microsoft.com ([13.77.154.182]:59450 "EHLO linux.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229853AbhFWWHr (ORCPT ); Wed, 23 Jun 2021 18:07:47 -0400 Received: from [10.0.0.178] (c-67-168-106-253.hsd1.wa.comcast.net [67.168.106.253]) by linux.microsoft.com (Postfix) with ESMTPSA id EE18B20B7188; Wed, 23 Jun 2021 15:05:28 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com EE18B20B7188 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1624485929; bh=0S1B3tajSDS4jZ66fuyQAE4asiaTTZT2KKBCT5RZ+Tg=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=dvmAR0/Ir1JwoS4pQw0LRF8HnuEJjCmvcHosMXmVGSiyVlVp3CgaglO+GIS1CbcRB ihIT/j0yy+Ws3DhSVymjaqW61bLl2aRoyQ6fIe5Nkcbl781IofmTyGb2RfvHlcB5Ma KDXqsl58OskEywKmdb4BIx8pCSABfSiP/iFiED2k= Subject: Re: [PATCH 03/19] drivers/hv: minimal mshv module (/dev/mshv/) To: Sunil Muthuswamy , "linux-hyperv@vger.kernel.org" , "linux-kernel@vger.kernel.org" Cc: "virtualization@lists.linux-foundation.org" , Michael Kelley , "viremana@linux.microsoft.com" , "wei.liu@kernel.org" , vkuznets , Lillian Grassin-Drake , KY Srinivasan References: <1622241819-21155-1-git-send-email-nunodasneves@linux.microsoft.com> <1622241819-21155-4-git-send-email-nunodasneves@linux.microsoft.com> From: Nuno Das Neves Message-ID: <323bb12e-82db-d54c-1014-7f0b431ebdd7@linux.microsoft.com> Date: Wed, 23 Jun 2021 15:05:28 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-hyperv@vger.kernel.org On 6/2/2021 6:28 PM, Sunil Muthuswamy wrote: >> diff --git a/drivers/hv/Kconfig b/drivers/hv/Kconfig >> index 66c794d92391..d618b1fab2bb 100644 >> --- a/drivers/hv/Kconfig >> +++ b/drivers/hv/Kconfig >> @@ -27,4 +27,22 @@ config HYPERV_BALLOON >> help >> Select this option to enable Hyper-V Balloon driver. >> >> +config HYPERV_ROOT_API > > A more suitable place to put this would be under the "VIRTUALIZATION" > config menu option, where we have the "KVM" option today. > Is Xen also under "VIRTUALIZATION"? >> + tristate "Microsoft Hypervisor root partition interfaces: /dev/mshv" >> + depends on HYPERV >> + help >> + Provides access to interfaces for managing guest virtual machines >> + running under the Microsoft Hypervisor. > > These are technically not "root" interfaces. As you say it too, these are > interfaces to manage guest VMs. Calling it "HYPERV_ROOT_API" would > be confusing. Something along the lines of "HYPERV_VMM_API" or > "HYPERV_VM_API" seems more appropriate to me. > Good point - HYPERV_VMM_API might be better. >> new file mode 100644 >> index 000000000000..c68cc84fb983 >> --- /dev/null >> +++ b/drivers/hv/mshv_main.c > Why not in /virt/hv or something under /virt? > We decided that all the non arch-specific hyperv code should live in drivers/hv. >> +static int mshv_dev_open(struct inode *inode, struct file *filp); >> +static int mshv_dev_release(struct inode *inode, struct file *filp); >> +static long mshv_dev_ioctl(struct file *filp, unsigned int ioctl, unsigned long arg); > > Do we need to have both 'mshv' & 'dev' in the name? How about just > calling these 'mshv_xyz'? Like you have for init/exit. > I wanted a distinction between mshv_* the module, and mshv_dev_* the root device of the module, but I guess it's effectively the same thing. >> + >> +static struct miscdevice mshv_dev = { >> + .minor = MISC_DYNAMIC_MINOR, >> + .name = "mshv", >> + .fops = &mshv_dev_fops, >> + .mode = 600, >> +}; > For the default mode, I think we want to keep it the same as that for 'kvm'. > KVM doesn't specify a mode here. Not sure how it gets set. > - Sunil >