[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87v9hufln7.fsf@nanos.tec.linutronix.de>
Date: Fri, 07 Aug 2020 18:47:40 +0200
From: Thomas Gleixner <tglx@...utronix.de>
To: Jason Gunthorpe <jgg@...dia.com>,
"gregkh\@linuxfoundation.org" <gregkh@...uxfoundation.org>
Cc: "Dey\, Megha" <megha.dey@...el.com>, Marc Zyngier <maz@...nel.org>,
"Jiang\, Dave" <dave.jiang@...el.com>,
"vkoul\@kernel.org" <vkoul@...nel.org>,
"bhelgaas\@google.com" <bhelgaas@...gle.com>,
"rafael\@kernel.org" <rafael@...nel.org>,
"hpa\@zytor.com" <hpa@...or.com>,
"alex.williamson\@redhat.com" <alex.williamson@...hat.com>,
"Pan\, Jacob jun" <jacob.jun.pan@...el.com>,
"Raj\, Ashok" <ashok.raj@...el.com>,
"Liu\, Yi L" <yi.l.liu@...el.com>,
"Lu\, Baolu" <baolu.lu@...el.com>,
"Tian\, Kevin" <kevin.tian@...el.com>,
"Kumar\, Sanjay K" <sanjay.k.kumar@...el.com>,
"Luck\, Tony" <tony.luck@...el.com>,
"Lin\, Jing" <jing.lin@...el.com>,
"Williams\, Dan J" <dan.j.williams@...el.com>,
"kwankhede\@nvidia.com" <kwankhede@...dia.com>,
"eric.auger\@redhat.com" <eric.auger@...hat.com>,
"parav\@mellanox.com" <parav@...lanox.com>,
"Hansen\, Dave" <dave.hansen@...el.com>,
"netanelg\@mellanox.com" <netanelg@...lanox.com>,
"shahafs\@mellanox.com" <shahafs@...lanox.com>,
"yan.y.zhao\@linux.intel.com" <yan.y.zhao@...ux.intel.com>,
"pbonzini\@redhat.com" <pbonzini@...hat.com>,
"Ortiz\, Samuel" <samuel.ortiz@...el.com>,
"Hossain\, Mona" <mona.hossain@...el.com>,
"dmaengine\@vger.kernel.org" <dmaengine@...r.kernel.org>,
"linux-kernel\@vger.kernel.org" <linux-kernel@...r.kernel.org>,
"x86\@kernel.org" <x86@...nel.org>,
"linux-pci\@vger.kernel.org" <linux-pci@...r.kernel.org>,
"kvm\@vger.kernel.org" <kvm@...r.kernel.org>
Subject: Re: [PATCH RFC v2 02/18] irq/dev-msi: Add support for a new DEV_MSI irq domain
Jason Gunthorpe <jgg@...dia.com> writes:
> Though it is more of a rational and a cookbook on how to combine
> existing technology pieces. (eg PASID, platform_msi, etc)
>
> The basic approach of SIOV's IMS is that there is no longer a generic
> interrupt indirection from numbers to addr/data pairs like
> IOAPIC/MSI/MSI-X owned by the common OS code.
>
> Instead the driver itself is responsible to set the addr/data pair
> into the device in a device specific way, deal with masking, etc.
>
> This lets the device use an implementation that is not limited by the
> harsh MSI-X semantics.
>
> In Linux we already have 'IMS' it is called platform_msi and a few
> embedded drivers already work like this. The idea here is to bring it
> to PCI.
platform_msi as it exists today is a crutch and in hindsight I should
have payed more attention back then and shoot it down before it got
merged.
IMS can be somehow mapped to platform MSI but the proposed approach to
extend platform MSI with the extra bolts for IMS (valid for one
particular incarnation) is just going into the wrong direction.
We've been there and the main reason why hierarchical irq domains exist
is that we needed to make a clear cut between the involved hardware
pieces and their drivers. The pre hierarchy model was a maze of stuff
calling back and forth between layers with lots of duct tape added to
make it "work". This finally fell apart when Intel tried to support
I/O-APIC hotplug. The ARM people had similar issues with all the special
irq related SoC specific IP blocks which are placed between the CPU
level interrupt controller and the device.
The hierarchy strictly seperates the per layer resource management and
each layer can work mostly independent of the actual available parent
layer.
Now looking at IMS. It's a subsystem inside a physical device. It has
slot management (where to place the Message) and mask/unmask. Resource
management at that level is what irq domains are for and mask/unmask is
what a irq chip handles.
So the right thing to do is to create shared infrastructure which is
utilized by the device drivers by providing a few bog standard data
structures and the handful of device specific domain and irq functions.
That keeps the functionality common, but avoids that we end up with
- msi_desc becoming a dump ground for random driver data
- a zoo of platform callbacks
- glued on driver specific resource management
and all the great hacks which it requires to work on hundreds of
different devices which all implement IMS differently.
I'm all for sharing code and making the life of driver writers simple
because that makes my life simple as well, but not by creating a layer
at the wrong level and then hacking it into submission until it finally
collapses.
Designing the infrastructure following the clear layering rules of
hierarchical domains so it works for IMS and also replaces the platform
MSI hack is the only sane way to go forward, not the other way round.
Thanks,
tglx
Powered by blists - more mailing lists