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: <4B296209.2010902@zytor.com>
Date:	Wed, 16 Dec 2009 14:41:13 -0800
From:	"H. Peter Anvin" <hpa@...or.com>
To:	Borislav Petkov <petkovbb@...glemail.com>,
	Randy Dunlap <randy.dunlap@...cle.com>,
	Borislav Petkov <borislav.petkov@....com>,
	Stephen Rothwell <sfr@...b.auug.org.au>,
	linux-next@...r.kernel.org, LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH -next] x86 msrs: alloc/free for CONFIG_SMP=n

On 12/16/2009 01:58 PM, Borislav Petkov wrote:
> 
>>
>> --- linux-next-20091216.orig/arch/x86/lib/Makefile
>> +++ linux-next-20091216/arch/x86/lib/Makefile
>> @@ -14,7 +14,7 @@ $(obj)/inat.o: $(obj)/inat-tables.c
>>  
>>  clean-files := inat-tables.c
>>  
>> -obj-$(CONFIG_SMP) := msr.o
>> +obj-$(CONFIG_X86_MSR) := msr.o
> 
> however, CONFIG_X86_MSR is the x86 MSR access module and the <lib/msr.c>
> is the library of MSR accessing functions which is always in. So this
> should be unconditional as in my version or Peter might have a better
> idea...?
> 

Both are wrong.

CONFIG_X86_MSR has nothing at all to do with this and is a complete red
herring.  Involving CONFIG_X86_MSR is just totally bogus.

Including msr.o unconditionally is also wrong, but for a more subtle
reason: msr.c is written to contain functions that apply to SMP only;
with UP replacement stubs written as inlines in
arch/x86/include/asm/msr.h.

Putting most of the file inside a big #ifdef of course works, but is a
pretty bad case of beating it with the ugly stick.  My preference would
be to move the SMP-specific functions to a new file, call it msr-smp.c,
and then leave only the functions that should be included
unconditionally in msr.c (I believe it is cleaner to do it that way than
the opposite.)

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