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: <20090414115805.GW3558@elte.hu>
Date:	Tue, 14 Apr 2009 13:58:05 +0200
From:	Ingo Molnar <mingo@...e.hu>
To:	Jaswinder Singh Rajput <jaswinder@...nel.org>
Cc:	mingo@...hat.com, hpa@...or.com, linux-kernel@...r.kernel.org,
	andreas.herrmann3@....com, akpm@...ux-foundation.org,
	mark.langsdorf@....com, tglx@...utronix.de,
	linux-tip-commits@...r.kernel.org
Subject: Re: [tip:x86/cpu] x86: cacheinfo: replace sysfs interface for
	cache_disable feature


* Jaswinder Singh Rajput <jaswinder@...nel.org> wrote:

> On Mon, 2009-04-13 at 10:22 +0530, Jaswinder Singh Rajput wrote:
> > Hello Mark,
> > 
> > On Fri, 2009-04-10 at 12:37 +0000, Mark Langsdorf wrote:
> > > Commit-ID:  f8b201fc7110c3673437254e8ba02451461ece0b
> > > Gitweb:     http://git.kernel.org/tip/f8b201fc7110c3673437254e8ba02451461ece0b
> > > Author:     Mark Langsdorf <mark.langsdorf@....com>
> > > AuthorDate: Thu, 9 Apr 2009 15:18:49 +0200
> > > Committer:  Ingo Molnar <mingo@...e.hu>
> > > CommitDate: Fri, 10 Apr 2009 14:21:53 +0200
> > > 
> > > x86: cacheinfo: replace sysfs interface for cache_disable feature
> > > 
> > > Impact: replace sysfs attribute
> > > 
> > > Current interface violates against "one-value-per-sysfs-attribute
> > > rule". This patch replaces current attribute with two attributes --
> > > one for each L3 Cache Index Disable register.
> > > 
> > > Signed-off-by: Mark Langsdorf <mark.langsdorf@....com>
> > > Signed-off-by: Andreas Herrmann <andreas.herrmann3@....com>
> > > Cc: Andrew Morton <akpm@...ux-foundation.org>
> > > LKML-Reference: <20090409131849.GJ31527@...erich.amd.com>
> > > Signed-off-by: Ingo Molnar <mingo@...e.hu>
> > > 
> > > 
> > > ---
> > >  arch/x86/kernel/cpu/intel_cacheinfo.c |   90 ++++++++++++++++----------------
> > >  1 files changed, 45 insertions(+), 45 deletions(-)
> > > 
> > > diff --git a/arch/x86/kernel/cpu/intel_cacheinfo.c b/arch/x86/kernel/cpu/intel_cacheinfo.c
> > > index 0cde071..fc28291 100644
> > > --- a/arch/x86/kernel/cpu/intel_cacheinfo.c
> > > +++ b/arch/x86/kernel/cpu/intel_cacheinfo.c
> > > @@ -697,73 +697,69 @@ static ssize_t show_type(struct _cpuid4_info *this_leaf, char *buf)
> > >  #define to_object(k)	container_of(k, struct _index_kobject, kobj)
> > >  #define to_attr(a)	container_of(a, struct _cache_attr, attr)
> > >  
> > > -static ssize_t show_cache_disable(struct _cpuid4_info *this_leaf, char *buf)
> > > +static ssize_t show_cache_disable(struct _cpuid4_info *this_leaf, char *buf,
> > > +				  unsigned int index)
> > >  {
> > > -	const struct cpumask *mask = to_cpumask(this_leaf->shared_cpu_map);
> > > -	int node = cpu_to_node(cpumask_first(mask));
> > > -	struct pci_dev *dev = NULL;
> > > -	ssize_t ret = 0;
> > > -	int i;
> > > +	int cpu = cpumask_first(to_cpumask(this_leaf->shared_cpu_map));
> > > +	int node = cpu_to_node(cpu);
> > > +	struct pci_dev *dev = node_to_k8_nb_misc(node);
> > > +	unsigned int reg = 0;
> > 
> > This leads to compilation warnings:
> >   CC      arch/x86/kernel/cpu/intel_cacheinfo.o
> > arch/x86/kernel/cpu/intel_cacheinfo.c: In function ‘show_cache_disable’:
> > arch/x86/kernel/cpu/intel_cacheinfo.c:712: warning: unused variable ‘node’
> > 
> > >  
> > > -static ssize_t
> > > -store_cache_disable(struct _cpuid4_info *this_leaf, const char *buf,
> > > -		    size_t count)
> > > +static ssize_t store_cache_disable(struct _cpuid4_info *this_leaf,
> > > +	const char *buf, size_t count, unsigned int index)
> > >  {
> > > -	const struct cpumask *mask = to_cpumask(this_leaf->shared_cpu_map);
> > > -	int node = cpu_to_node(cpumask_first(mask));
> > > -	struct pci_dev *dev = NULL;
> > > -	unsigned int ret, index, val;
> > > +	int cpu = cpumask_first(to_cpumask(this_leaf->shared_cpu_map));
> > > +	int node = cpu_to_node(cpu);
> > > +	struct pci_dev *dev = node_to_k8_nb_misc(node);
> > > +	unsigned long val = 0;
> > >  
> > 
> >   CC      arch/x86/kernel/cpu/intel_cacheinfo.o
> > arch/x86/kernel/cpu/intel_cacheinfo.c: In function ‘store_cache_disable’:
> > arch/x86/kernel/cpu/intel_cacheinfo.c:737: warning: unused variable ‘cpu’
> 
> Oops it is also pointing to node:
> 
> arch/x86/kernel/cpu/intel_cacheinfo.c: In function ‘store_cache_disable’:
> arch/x86/kernel/cpu/intel_cacheinfo.c:739: warning: unused variable ‘node’

Mind sending a fix? We really dont want warnings noise in the x86 
tree.

I was also thinking about adopting the Sparc trick: adding -Werror 
to arch/x86/ files only, fixing all the fallout and ensuring no new 
warnings from a flag day on. Anyone interested in doing that?

	Ingo
--
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