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:	Sun, 02 Sep 2007 10:15:17 -0700
From:	Randy Dunlap <randy.dunlap@...cle.com>
To:	Jeff Garzik <jeff@...zik.org>
CC:	Andi Kleen <ak@...e.de>, LKML <linux-kernel@...r.kernel.org>,
	Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH] x86/x86-64 PCI domain support

Jeff Garzik wrote:
> Randy Dunlap wrote:
>> On Sat, 01 Sep 2007 18:40:27 -0400 Jeff Garzik wrote:
>>
>>> Andi Kleen wrote:
>>>>>> The second function is redundant? 
>>>>> No, it's a hook we must implement, when CONFIG_PCI_DOMAINS is enabled.
>>>> Then the other function is redundant.
>>> No, both functions are required by the interface.
>>
>> by what interface?  and why, please?  (instead of just stating 
>> "required")
> 
> grep for CONFIG_PCI_DOMAINS in arch code and include/linux/pci.h.

Thanks, I get it.

> This is normal "arch" interface:  you enable a define, and a group of 
> functions is assumed to be present.  Otherwise (!defined), a set of stub 
> no-ops is activated for your arch.
> 
> I have implemented the [small] group of functions the code assumes to be 
> present, when CONFIG_PCI_DOMAINS is enabled, like all the other arches 
> that implement PCI domain support.


+#ifdef CONFIG_PCI_DOMAINS
+static inline int pci_domain_nr(struct pci_bus *bus)
+{
+	struct pci_sysdata *sd = bus->sysdata;
+	return sd->domain;
+}
+
+static inline int pci_proc_domain(struct pci_bus *bus)
+{
+	return pci_domain_nr(bus);
+}
+#endif /* CONFIG_PCI_DOMAINS */

So if CONFIG_PCI_DOMAINS=y, proc_proc_domain() decides to print the domain nr
in /proc iff the domain nr != 0 ?  so that the /proc file format is
different depending on the domain nr (0 vs. !0) ?

I suppose that is similar to what arch/powerpc/kernel/pci_64.c does
with hose->buid.  I think that I had rather see the domain nr printed
whenever CONFIG_PCI_DOMAINS=y... oh well.


-- 
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***
-
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