Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp1748295rdh; Tue, 26 Sep 2023 02:15:12 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGKWnBZnwlbl4MvEyz9cc5vYHxtaqXWl10/CfvBXIGEVoSHwOgHPOGAydTlWjCsfhqLoIKi X-Received: by 2002:a05:6a00:1401:b0:691:fd26:f54a with SMTP id l1-20020a056a00140100b00691fd26f54amr11106433pfu.20.1695719712025; Tue, 26 Sep 2023 02:15:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695719712; cv=none; d=google.com; s=arc-20160816; b=UO2AbKnanQx9oTTCTEEPji80FV0qkczsSuUtXafYE2roOchaiC67tk8IFF+q7rhM/v 99sLF3xGyPq1/24RCSzelD8hSmftn71tXchFffY5x2DIyfWMO5f0gO1lslQC2OxRH3+D 9ux3DwhgL0pnt4T5Bf0uSxtlJj48RNvTXpYD5+sVPVH0JPSZrDEil2SDabOSQRHqToVB dJU/iYpgXzOnlIWdWVDEKDSEjJQtjYYXEF2/l+1TcUI1rUH/Q6y5a+XqAX7usy4CBlYQ Wgu5s3aAd933ziOERrrGTEfzsKhH67J5Li4jKTjwYGfevmIuxn1iGfY/fD3jt3tgqtRq 8LZw== 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=zF57oW9dvv/fJD5h/f8Q1JSDPMQnlxvhM+jKOYPRpV4=; fh=IoyuW1MdpAH/ckqYJDA59MiNzAXOSnj+fQjbVLQI568=; b=0UWI8mBD1IkPIi3vxm++vLXcYRv/vjsaLCXcmYnz1mqMeH2zqpT9PSPmgajapO3WOl TLMq1rnpaM8zXTjcOjHLkfgADhzsapmH3rMIOGEZjjEkMPQNYdGi3MzCM5LiNZgFQOlN HblwsPphfJtqQB6NxPv0fOeBK4TuovS0zCzrw+iIRD27BmjFQ6cnhBPgQiXRUYc18ws7 ygOUh0NdBfZo0JhpuGzn90MphZc19Ia5cPFBDd8MeOScLXuSRCSp1cRpuKRa0eeeecGx k+bfrSMyZYAChFpN/omaKDrKgRHgby2iu6In2s65rVpSQjPxmJMpmr9YTkmLpu4DpaMO c2yQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=DbXbni+l; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id d7-20020a056a0024c700b0068ffd96e1d4si12696415pfv.165.2023.09.26.02.15.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Sep 2023 02:15:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=DbXbni+l; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 6E42382B2EAC; Tue, 26 Sep 2023 01:03:42 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233714AbjIZIDo (ORCPT + 99 others); Tue, 26 Sep 2023 04:03:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47092 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229556AbjIZIDm (ORCPT ); Tue, 26 Sep 2023 04:03:42 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 38D55C0; Tue, 26 Sep 2023 01:03:36 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2DC72C433C8; Tue, 26 Sep 2023 08:03:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1695715415; bh=HB5KB8HsIMAvF0aDCyMdk9BLWivG2eE+dsYkN33J79Y=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=DbXbni+lGMF3g1j2jwtHFtZHs33LvSNNcfraLYV7pJN3g0snV3SPMQQyEgJLIQWdo MH+AmCK1gv4G0VfF6EZkH9ncvTNc9NANSgjkY17oaUzw6lJyuDrqk7K0kI+aAdKWjH NUlTbld9+L9fhwTiFRt6jZ+pKeNlvZCqzX9nlAOM= Date: Tue, 26 Sep 2023 10:03:31 +0200 From: Greg KH To: Wei Liu Cc: Nuno Das Neves , linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org, x86@kernel.org, linux-arm-kernel@lists.infradead.org, linux-arch@vger.kernel.org, patches@lists.linux.dev, mikelley@microsoft.com, kys@microsoft.com, haiyangz@microsoft.com, decui@microsoft.com, apais@linux.microsoft.com, Tianyu.Lan@microsoft.com, ssengar@linux.microsoft.com, mukeshrathor@microsoft.com, stanislav.kinsburskiy@gmail.com, jinankjain@linux.microsoft.com, vkuznets@redhat.com, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, hpa@zytor.com, will@kernel.org, catalin.marinas@arm.com Subject: Re: [PATCH v3 15/15] Drivers: hv: Add modules to expose /dev/mshv to VMMs running on Hyper-V Message-ID: <2023092646-version-series-a7b5@gregkh> References: <1695407915-12216-1-git-send-email-nunodasneves@linux.microsoft.com> <1695407915-12216-16-git-send-email-nunodasneves@linux.microsoft.com> <2023092342-staunch-chafe-1598@gregkh> <2023092630-masculine-clinic-19b6@gregkh> <2023092614-tummy-dwelling-7063@gregkh> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Tue, 26 Sep 2023 01:03:42 -0700 (PDT) On Tue, Sep 26, 2023 at 07:00:51AM +0000, Wei Liu wrote: > On Tue, Sep 26, 2023 at 08:31:03AM +0200, Greg KH wrote: > > On Tue, Sep 26, 2023 at 05:54:34AM +0000, Wei Liu wrote: > > > On Tue, Sep 26, 2023 at 06:52:46AM +0200, Greg KH wrote: > > > > On Mon, Sep 25, 2023 at 05:07:24PM -0700, Nuno Das Neves wrote: > > > > > On 9/23/2023 12:58 AM, Greg KH wrote: > > > > > > Also, drivers should never call pr_*() calls, always use the proper > > > > > > dev_*() calls instead. > > > > > > > > > > > > > > > > We only use struct device in one place in this driver, I think that is the > > > > > only place it makes sense to use dev_*() over pr_*() calls. > > > > > > > > Then the driver needs to be fixed to use struct device properly so that > > > > you do have access to it when you want to print messages. That's a > > > > valid reason to pass around your device structure when needed. > > > > > > Greg, ACRN and Nitro drivers do not pass around the device structure. > > > Instead, they rely on a global struct device. We can follow the same. > > > > A single global struct device is wrong, please don't do that. > > > > Don't copy bad design patterns from other drivers, be better :) > > > > If we're working with real devices like network cards or graphics cards > I would agree -- it is easy to imagine that we have several cards of the > same model in the system -- but in real world there won't be two > hypervisor instances running on the same hardware. > > We can stash the struct device inside some private data fields, but that > doesn't change the fact that we're still having one instance of the > structure. Is this what you want? Or do you have something else in mind? You have a real device, it's how userspace interacts with your subsystem. Please use that, it is dynamically created and handled and is the correct representation here. thanks, greg k-h