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]
Date:	Wed, 22 Jul 2015 18:42:11 +0100
From:	Marc Zyngier <marc.zyngier@....com>
To:	Bjorn Helgaas <bhelgaas@...gle.com>
CC:	Thomas Gleixner <tglx@...utronix.de>,
	Jiang Liu <jiang.liu@...ux.intel.com>,
	Jason Cooper <jason@...edaemon.net>,
	"linux-arm-kernel@...ts.infradead.org" 
	<linux-arm-kernel@...ts.infradead.org>,
	"linux-pci@...r.kernel.org" <linux-pci@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Yijing Wang <wangyijing@...wei.com>,
	Ma Jun <majun258@...wei.com>,
	Lorenzo Pieralisi <Lorenzo.Pieralisi@....com>,
	Duc Dang <dhdang@....com>
Subject: Re: [PATCH v4 04/19] PCI/MSI: Add hooks to populate the msi_domain
 field

On 22/07/15 17:53, Bjorn Helgaas wrote:
> On Wed, Jul 22, 2015 at 03:54:14PM +0100, Marc Zyngier wrote:
>> On 22/07/15 15:48, Bjorn Helgaas wrote:
>>> On Wed, Jul 22, 2015 at 9:42 AM, Marc Zyngier <marc.zyngier@....com> wrote:
>>>> Hi Bjorn,
>>>>
>>>> On 21/07/15 22:26, Bjorn Helgaas wrote:
>>>>> On Wed, Jul 15, 2015 at 01:16:38PM +0100, Marc Zyngier wrote:
>>>>>> In order to be able to populate the device msi_domain field,
>>>>>> add the necesary hooks to propagate the host bridge msi_domain
>>>>>> across secondary busses to devices.
>>>>>>
>>>>>> So far, nobody populates the initial msi_domain.
>>>>>>
>>>>>> Signed-off-by: Marc Zyngier <marc.zyngier@....com>
>>>>>> ---
>>>>>>  drivers/pci/probe.c | 30 ++++++++++++++++++++++++++++++
>>>>>>  include/linux/pci.h |  1 +
>>>>>>  2 files changed, 31 insertions(+)
>>>>>>
>>>>>> diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
>>>>>> index cefd636..376f6fa 100644
>>>>>> --- a/drivers/pci/probe.c
>>>>>> +++ b/drivers/pci/probe.c
>>>>>> @@ -661,6 +661,20 @@ static void pci_set_bus_speed(struct pci_bus *bus)
>>>>>>      }
>>>>>>  }
>>>>>>
>>>>>> +void __weak pcibios_set_host_bridge_msi_domain(struct pci_bus *bus)
>>>>>> +{
>>>>>> +}
>>>>>
>>>>> I don't think there's anything in this series that requires this to be a
>>>>> weak function, is there?  This is the only definition I see.
>>>>
>>>> It looks like all the pcibios_* functions so far have a weak attribute,
>>>> and I've added it as a matter of consistency.
>>>
>>> We've used pcibios_* names where we might need an arch-specific
>>> implementation.  I'm not sure that's the case here -- do you envision
>>> an implementation under arch/* someday?  If not, maybe it should just
>>> be a pci_* function instead of pcibios_*.
>>
>> I could definitely see non-OF driven architectures wanting to override this.
>>
>> Or maybe we should turn it the other way around and make it call the
>> various firmware interfaces (OF, ACPI...) until one of them succeeds. In
>> which case your suggestion of making it a pci_* function makes a lot of
>> sense.
> 
> Here's my advice, FWIW:
> 
>   - remove __weak
> 
>   - rename pcibios_set_host_bridge_msi_domain() to
>     pci_host_bridge_msi_domain() and have it return a struct irq_domain *
> 
>   - pci_host_bridge_msi_domain() can call whatever firmware- or
>     arch-specific code you need to look up the irq_domain
> 
>   - move the dev_set_msi_domain() call from pci_set_phb_of_msi_domain() to
>     pci_set_bus_msi_domain()
> 

Yes, seems to make sense. I end-up with something that looks much more
readable (pci_set_bus_msi_domain looks fairly neat now).

I'll post a new version shortly.

Thanks,

	M.
-- 
Jazz is not dead. It just smells funny...
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ