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] [day] [month] [year] [list]
Message-ID: <CAGsJ_4xpidX79zO2LRxtUu-jBpa3F1Wra-41ZoaczrTv-A1QDA@mail.gmail.com>
Date:   Thu, 12 Aug 2021 21:13:59 +1200
From:   Barry Song <21cnbao@...il.com>
To:     Greg KH <gregkh@...uxfoundation.org>
Cc:     LKML <linux-kernel@...r.kernel.org>, linuxarm@...wei.com,
        rafael@...nel.org, robin.murphy@....com,
        song.bao.hua@...ilicon.com, wangzhou1@...ilicon.com,
        will@...nel.org
Subject: Re: [PATCH] platform-msi: Add ABI to show msi_irqs of platform devices

On Thu, Aug 12, 2021 at 7:24 PM Greg KH <gregkh@...uxfoundation.org> wrote:
>
> On Thu, Aug 12, 2021 at 04:19:30PM +1200, Barry Song wrote:
> > > But why isn't this all handled by the MSI core code?  Why would each bus
> > > need to have this logic in it?
> >
> > i think i can extract some common code for sysfs populate/destroy to msi core from pci and platform.
> > but we still need some pci/platform specific code in pci-msi and platform-msi cores. for example,
> > pci-msi has specific data which will be accessed in its show() entry.
> >
> > struct msi_desc {
> >         ...
> >         union {
> >                 /* PCI MSI/X specific data */
> >                 struct {
> >                         u32 masked;
> >                         struct {
> >                                 u8      is_msix         : 1;
> >                                 u8      multiple        : 3;
> >                                 u8      multi_cap       : 3;
> >                                 u8      maskbit         : 1;
> >                                 u8      is_64           : 1;
> >                                 u8      is_virtual      : 1;
> >                                 u16     entry_nr;
> >                                 unsigned default_irq;
> >                         } msi_attrib;
> >                         union {
> >                                 u8      mask_pos;
> >                                 void __iomem *mask_base;
> >                         };
> >                 };
> >
> >                 ...
> >                 struct platform_msi_desc platform;
> >                 ...
> >         };
> > };
> >
> > in addition, they are quite different in initialization/release and also need different places to save sysfs groups.
> > so probably i can let msi cores provide msi_populate_sysfs() and msi_destroy_sysfs() APIs. And ask pci and platform
> > to call msi_populate_sysfs() in their init code and save the groups in their specific pointers,  and then they can
> > free sysfs in their release paths by calling msi_destroy_sysfs()
>
> Ok, if this isn't easy then I guess it's not a big deal, but you should
> go through the MSI developers first.
>
> Why does a platform device have MSI interrupts?  I thought they were
> only for PCI devices.

I really don't know the story of hardware, but as long as a device can
write some mmio address with some
messages (interrupt-describing data) to generate interrupts instead of
using a hardware interrupt line, MSI is
supported :-)

>
> thanks,
>
> greg k-h

Thanks
Barry

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ