linux-hyperv.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Wei Liu <wei.liu@kernel.org>
Cc: Iouri Tarassov <iourit@linux.microsoft.com>,
	kys@microsoft.com, haiyangz@microsoft.com,
	sthemmin@microsoft.com, linux-hyperv@vger.kernel.org,
	linux-kernel@vger.kernel.org, spronovo@microsoft.com,
	spronovo@linux.microsoft.com
Subject: Re: [PATCH v3 02/30] drivers: hv: dxgkrnl: Driver initialization and loading
Date: Fri, 4 Mar 2022 18:55:19 +0100	[thread overview]
Message-ID: <YiJSh4WRmVdWvUc8@kroah.com> (raw)
In-Reply-To: <20220304160410.zbdbds6wh3omi5mk@liuwe-devbox-debian-v2>

On Fri, Mar 04, 2022 at 04:04:10PM +0000, Wei Liu wrote:
> > > A PCI device device is created for each virtual compute device.
> > > Therefore, there should be a global list of objects and a mutex to
> > > synchronize access to the list.
> > 
> > Woah, what?  You create a fake PCI device for each virtual device?  If
> > so, great, then you are now a PCI bus and create the PCI devices
> > properly so that the PCI core can handle and manage them and then
> > assign them to your driver.  You should NEVER have a global list of
> > these devices, as that is what the driver model should be managing.
> > Not you!
> > 
> 
> No, there is no fake PCI device. The device object is still coming from
> the PCI core driver. There is code to match against PCI vendor ID and
> device ID, and follow the usual way of managing PCI device.

So it is a real PCI device?  Why the confusion?

> Iouri understands device specific state should be encapsulated in the
> private data field in their respective device. And I believe the code
> can perhaps be rewritten to better conform to Linux kernel's model.

It has to follow the Linux kernel model, to think otherwise is quite
odd.

> > > IO space is shared by all compute devices, so its parameters should
> > > be global.
> > 
> > Huh?  If that's the case then you have bigger problems.  Use the aux
> > bus for devices that share io space.  That is what it was created for,
> > do not ignore the functionality that Linux already provides you by
> > trying to go around it and writing your own code.  Use the frameworks
> > we have already debugged and support.  This is why your Linux driver
> > should be at least 1/3 smaller than drivers for other operating
> > systems.
> > 
> 
> To be fair, auxiliary bus was only added in 5.11, while this series was
> written long before that. Unfortunately one only has so much time to
> follow Linux kernel development closely. I admit this is the first time
> I hear about it. :-)

5.11 was over a year ago.  We do not take "old" drivers into the kernel
tree, and if this series has not been touched for over a year, um, you
all have bigger problems here and are just wasting our time :(

> > Then fix this.  Make your compute devices store the needed information
> > when they are created.  Again, we have loads of examples in the kernel,
> > this is nothing new.
> > 
> 
> At this point, I think Iouri and I have settled on more encapsulation is
> needed. Yet there is something I don't know how to square yet. That is,
> devices (either from vmbus or pci) don't form a clear hierarchy.

That is because devices don't care where they are in the larger kernel
tree of devices, they are independant.  To try to claim there is a
needed hierarchy is quite odd and will cause lots of problems when that
heirachy changes by the underlying system.

> If
> there isn't a linked list or some sort to organize them it would be
> difficult to cross-reference.

You should never be touching another device from another one.  There are
a few rare exceptions but they are rare and you should not use them at
all.  And if you do have to do so, you better get the reference counting
logic correct.

good luck!

greg k-h

  reply	other threads:[~2022-03-04 17:55 UTC|newest]

Thread overview: 72+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-01 19:45 [PATCH v3 00/30] Driver for Hyper-v virtual compute device Iouri Tarassov
2022-03-01 19:45 ` [PATCH v3 01/30] drivers: hv: dxgkrnl: Add virtual compute device VM bus channel guids Iouri Tarassov
2022-03-01 19:45   ` [PATCH v3 02/30] drivers: hv: dxgkrnl: Driver initialization and loading Iouri Tarassov
2022-03-01 20:45     ` Greg KH
2022-03-01 22:23       ` Wei Liu
2022-03-01 22:47         ` Iouri Tarassov
2022-03-02  7:54           ` Greg KH
2022-03-02  7:53         ` Greg KH
2022-03-02 11:53           ` Wei Liu
2022-03-02 18:49             ` Iouri Tarassov
2022-03-02 20:20               ` Greg KH
2022-03-02 22:27                 ` Iouri Tarassov
2022-03-03 13:16                   ` Greg KH
2022-03-09 23:14                     ` Steve Pronovost
2022-03-10 10:13                       ` Greg KH
2022-03-10 18:31                         ` Steve Pronovost
2022-03-02 20:34               ` Wei Liu
2022-03-03  1:09           ` Iouri Tarassov
2022-03-03 13:22             ` Greg KH
2022-03-04 16:04               ` Wei Liu
2022-03-04 17:55                 ` Greg KH [this message]
2022-03-02 22:59       ` Iouri Tarassov
2022-03-03 13:29         ` Greg KH
2022-03-02 23:27       ` Iouri Tarassov
2022-03-03 13:10         ` Greg KH
2022-03-01 22:06     ` Wei Liu
2022-03-03  2:01       ` Iouri Tarassov
2022-03-01 19:45   ` [PATCH v3 03/30] drivers: hv: dxgkrnl: Add VM bus message support, initialize VM bus channels Iouri Tarassov
2022-03-01 22:57     ` Wei Liu
2022-03-01 19:45   ` [PATCH v3 04/30] drivers: hv: dxgkrnl: Creation of dxgadapter object Iouri Tarassov
2022-03-01 23:25     ` Wei Liu
2022-03-01 19:45   ` [PATCH v3 05/30] drivers: hv: dxgkrnl: Opening of /dev/dxg device and dxgprocess creation Iouri Tarassov
2022-03-01 20:46     ` Greg KH
2022-03-01 20:46     ` Greg KH
2022-03-01 23:47     ` Wei Liu
2022-03-01 19:45   ` [PATCH v3 06/30] drivers: hv: dxgkrnl: Enumerate and open dxgadapter objects Iouri Tarassov
2022-03-02 12:43     ` Wei Liu
2022-03-01 19:45   ` [PATCH v3 07/30] drivers: hv: dxgkrnl: Creation of dxgdevice objects Iouri Tarassov
2022-03-01 19:45   ` [PATCH v3 08/30] drivers: hv: dxgkrnl: Creation of dxgcontext objects Iouri Tarassov
2022-03-02 12:59     ` Wei Liu
2022-03-01 19:45   ` [PATCH v3 09/30] drivers: hv: dxgkrnl: Creation of compute device allocations and resources Iouri Tarassov
2022-03-01 19:45   ` [PATCH v3 10/30] drivers: hv: dxgkrnl: Creation of compute device sync objects Iouri Tarassov
2022-03-02 13:25     ` Wei Liu
2022-03-01 19:45   ` [PATCH v3 11/30] drivers: hv: dxgkrnl: Operations using " Iouri Tarassov
2022-03-01 19:45   ` [PATCH v3 12/30] drivers: hv: dxgkrnl: Sharing of dxgresource objects Iouri Tarassov
2022-03-02 14:13     ` Wei Liu
2022-03-02 14:15     ` Wei Liu
2022-03-01 19:46   ` [PATCH v3 13/30] drivers: hv: dxgkrnl: Sharing of sync objects Iouri Tarassov
2022-03-01 19:46   ` [PATCH v3 14/30] drivers: hv: dxgkrnl: Creation of hardware queues. Sync object operations to hw queue Iouri Tarassov
2022-03-01 19:46   ` [PATCH v3 15/30] drivers: hv: dxgkrnl: Creation of paging queue objects Iouri Tarassov
2022-03-01 19:46   ` [PATCH v3 16/30] drivers: hv: dxgkrnl: Submit execution commands to the compute device Iouri Tarassov
2022-03-01 19:46   ` [PATCH v3 17/30] drivers: hv: dxgkrnl: Share objects with the host Iouri Tarassov
2022-03-01 19:46   ` [PATCH v3 18/30] drivers: hv: dxgkrnl: Query the dxgdevice state Iouri Tarassov
2022-03-01 19:46   ` [PATCH v3 19/30] drivers: hv: dxgkrnl: Map(unmap) CPU address to device allocation Iouri Tarassov
2022-03-01 19:46   ` [PATCH v3 20/30] drivers: hv: dxgkrnl: Manage device allocation properties Iouri Tarassov
2022-03-01 19:46   ` [PATCH v3 21/30] drivers: hv: dxgkrnl: Flush heap transitions Iouri Tarassov
2022-03-01 19:46   ` [PATCH v3 22/30] drivers: hv: dxgkrnl: Query video memory information Iouri Tarassov
2022-03-01 19:46   ` [PATCH v3 23/30] drivers: hv: dxgkrnl: The escape ioctl Iouri Tarassov
2022-03-01 19:46   ` [PATCH v3 24/30] drivers: hv: dxgkrnl: Ioctl to put device to error state Iouri Tarassov
2022-03-01 19:46   ` [PATCH v3 25/30] drivers: hv: dxgkrnl: Ioctls to query statistics and clock calibration Iouri Tarassov
2022-03-01 19:46   ` [PATCH v3 26/30] drivers: hv: dxgkrnl: Offer and reclaim allocations Iouri Tarassov
2022-03-02 14:25     ` Wei Liu
2022-03-02 18:13       ` Iouri Tarassov
2022-03-02 18:23         ` Wei Liu
2022-03-01 19:46   ` [PATCH v3 27/30] drivers: hv: dxgkrnl: Ioctls to manage scheduling priority Iouri Tarassov
2022-03-01 19:46   ` [PATCH v3 28/30] drivers: hv: dxgkrnl: Manage residency of allocations Iouri Tarassov
2022-03-01 19:46   ` [PATCH v3 29/30] drivers: hv: dxgkrnl: Manage compute device virtual addresses Iouri Tarassov
2022-03-01 19:46   ` [PATCH v3 30/30] drivers: hv: dxgkrnl: Add support to map guest pages by host Iouri Tarassov
2022-03-02 14:29     ` Wei Liu
2022-03-01 21:37   ` [PATCH v3 01/30] drivers: hv: dxgkrnl: Add virtual compute device VM bus channel guids Wei Liu
2022-03-02  8:51 ` [PATCH v3 00/30] Driver for Hyper-v virtual compute device Christoph Hellwig
2022-03-02 14:53 ` Wei Liu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YiJSh4WRmVdWvUc8@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=haiyangz@microsoft.com \
    --cc=iourit@linux.microsoft.com \
    --cc=kys@microsoft.com \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=spronovo@linux.microsoft.com \
    --cc=spronovo@microsoft.com \
    --cc=sthemmin@microsoft.com \
    --cc=wei.liu@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).