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: <CAFpQJXUaVS7tBqjQ4Dh201yrOWFxa3Bk2q-ZCFtK4mk-te=Q7w@mail.gmail.com>
Date:	Sat, 9 Jan 2016 11:35:17 +0530
From:	Ganapatrao Kulkarni <gpkulkarni@...il.com>
To:	Will Deacon <will.deacon@....com>
Cc:	Bjorn Helgaas <helgaas@...nel.org>,
	Ganapatrao Kulkarni <gkulkarni@...iumnetworks.com>,
	"linux-arm-kernel@...ts.infradead.org" 
	<linux-arm-kernel@...ts.infradead.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	linux-pci@...r.kernel.org,
	Catalin Marinas <catalin.marinas@....com>,
	Bjorn Helgaas <bhelgaas@...gle.com>,
	Hanjun Guo <hanjun.guo@...aro.org>,
	Robert Richter <rrichter@...ium.com>,
	Prasun Kapoor <Prasun.Kapoor@...iumnetworks.com>
Subject: Re: [PATCH] arm64, pci, numa: Adding helper functions as required by pci

On Fri, Jan 8, 2016 at 11:36 PM, Will Deacon <will.deacon@....com> wrote:
> On Fri, Jan 08, 2016 at 12:01:31PM -0600, Bjorn Helgaas wrote:
>> On Tue, Dec 22, 2015 at 04:08:50PM +0530, Ganapatrao Kulkarni wrote:
>> > Adding helper functions and necessary code to make
>> > pci driver(pci-host-generic) numa aware.
>> >
>> > This patch is on top of arm64-numa v7.
>> > http://www.spinics.net/lists/arm-kernel/msg460813.html
>> >
>> > Signed-off-by: Ganapatrao Kulkarni <gkulkarni@...iumnetworks.com>
>> > ---
>> >  arch/arm64/include/asm/numa.h       | 8 +++++---
>> >  arch/arm64/kernel/pci.c             | 8 ++++++++
>> >  drivers/pci/host/pci-host-generic.c | 1 +
>> >  3 files changed, 14 insertions(+), 3 deletions(-)
>> >
>> > diff --git a/arch/arm64/include/asm/numa.h b/arch/arm64/include/asm/numa.h
>> > index b8c2a3f..1eca4db 100644
>> > --- a/arch/arm64/include/asm/numa.h
>> > +++ b/arch/arm64/include/asm/numa.h
>> > @@ -15,9 +15,11 @@
>> >  extern int __node_distance(int from, int to);
>> >  #define node_distance(a, b) __node_distance(a, b)
>> >
>> > -/* dummy definitions for pci functions */
>> > -#define pcibus_to_node(node)       0
>> > -#define cpumask_of_pcibus(bus)     0
>> > +struct pci_bus;
>> > +extern int pcibus_to_node(struct pci_bus *bus);
>> > +#define cpumask_of_pcibus(bus)     (pcibus_to_node(bus) == -1 ?            \
>> > +                            cpu_all_mask :                         \
>> > +                            cpumask_of_node(pcibus_to_node(bus)))
>>
>> All the arch definitions of cpumask_of_pcibus() are pretty similar;
>> could they be made more generic?  At the very least, can you drop the
>> definition here and use the one in include/asm-generic/topology.h,
>> which is identical to what you're defining here?
macro cpumask_of_pcibus is defined under #ifndef CONFIG_NUMA in
include/asm-generic/topology.h
and this macro is defined again for NUMA in respective arch header files.
i think moving this macro from ifndef will allow us to use without redefinition.

--- a/include/asm-generic/topology.h
+++ b/include/asm-generic/topology.h
@@ -54,14 +54,14 @@
 #define pcibus_to_node(bus)    ((void)(bus), -1)
 #endif

+#endif /* CONFIG_NUMA */
+
 #ifndef cpumask_of_pcibus
 #define cpumask_of_pcibus(bus) (pcibus_to_node(bus) == -1 ?            \
                                 cpu_all_mask :                         \
                                 cpumask_of_node(pcibus_to_node(bus)))
 #endif

-#endif /* CONFIG_NUMA */
-
 #if !defined(CONFIG_NUMA) || !defined(CONFIG_HAVE_MEMORYLESS_NODES)

 #ifndef set_numa_mem

i have got below compilation error withour macro defined in arch code.

drivers/pci/pci-sysfs.c: In function ‘cpuaffinity_show’:
drivers/pci/pci-sysfs.c:114:15: error: implicit declaration of
function ‘cpumask_of_pcibus’ [-Werror=implicit-function-declaration]
drivers/pci/pci-sysfs.c:114:34: warning: initialization makes pointer
from integer without a cast [enabled by default]
drivers/pci/pci-sysfs.c: In function ‘cpulistaffinity_show’:
drivers/pci/pci-sysfs.c:123:34: warning: initialization makes pointer
from integer without a cast [enabled by default]
cc1: some warnings being treated as errors


i can send this as separate patch( as a  fix patch).

>
> +1 on that. I asked for exactly the same thing in my review of v7:
>
>   http://www.spinics.net/lists/arm-kernel/msg469592.html
>
> but it looks like I was just ignored.
>
> Will
thanks
ganapat

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ