lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z096wCMFmR7AyfWn@lizhi-Precision-Tower-5810>
Date: Tue, 3 Dec 2024 16:40:16 -0500
From: Frank Li <Frank.li@....com>
To: Thomas Gleixner <tglx@...utronix.de>
Cc: Manivannan Sadhasivam <manivannan.sadhasivam@...aro.org>,
	Krzysztof WilczyƄski <kw@...ux.com>,
	Kishon Vijay Abraham I <kishon@...nel.org>,
	Bjorn Helgaas <bhelgaas@...gle.com>, Arnd Bergmann <arnd@...db.de>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	"Rafael J. Wysocki" <rafael@...nel.org>,
	Anup Patel <apatel@...tanamicro.com>, linux-kernel@...r.kernel.org,
	linux-pci@...r.kernel.org, imx@...ts.linux.dev,
	Niklas Cassel <cassel@...nel.org>, dlemoal@...nel.org,
	maz@...nel.org, jdmason@...zu.us, stable@...nel.org
Subject: Re: [PATCH v9 1/6] platform-msi: Add msi_remove_device_irq_domain()
 in platform_device_msi_free_irqs_all()

On Tue, Dec 03, 2024 at 10:12:36PM +0100, Thomas Gleixner wrote:
> On Tue, Dec 03 2024 at 15:36, Frank Li wrote:
> > The follow steps trigger kernel dump warning and
> > platform_device_msi_init_and_alloc_irqs() return false.
> >
> > 1: platform_device_msi_init_and_alloc_irqs();
> > 2: platform_device_msi_free_irqs_all();
> > 3: platform_device_msi_init_and_alloc_irqs();
> >
> > Do below two things in platform_device_msi_init_and_alloc_irqs().
> > - msi_create_device_irq_domain()
> > - msi_domain_alloc_irqs_range()
> >
> > But only call msi_domain_free_irqs_all() in
> > platform_device_msi_free_irqs_all(), which missed call
> > msi_remove_device_irq_domain().
>
> It's not a missed call. It's intentional as all existing users remove
> the device afterwards.
>
> > This cause above kernel dump when call
> > platform_device_msi_init_and_alloc_irqs() again.
>
> Sure, but that's not a fix and not required for stable because no
> existing driver is affected by this unless I'm missing something.
>
> What's the actual use case for this? You describe in great length what
> fails, which is nice, but I'm missing the larger picture here.

PCI host send a door bell to PCI endpoint, which use platform msi to
trigger a IRQ.

PCI Host side				PCI endpoint side

Send "enable"  command      ->         call platform_device_msi_init_and_alloc_irqs()
Get doorbell address        <-         send back MSI address by shared memory
Write data to doorbell      -> 	       MSI irq handler triggered.
Send "Disable"  command     ->	       call platform_device_msi_free_irqs_all()


At endpoint side, need dymatic response "enable/disable" commands. Of
course, I can call msi_remove_device_irq_domain() in my disable function.
But I think it should be symetic in alloc/free pair functions.

Previous version, alloc/free in bind/unbind function. I missed to do
unbind/bind test. the principle should be the same.

Frank

>
> Thanks,
>
>         tglx

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ