public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@zytor.com>
To: Borislav Petkov <petkovbb@googlemail.com>,
	Randy Dunlap <randy.dunlap@oracle.com>,
	Borislav Petkov <borislav.petkov@amd.com>,
	Stephen Rothwell <sfr@canb.auug.org.au>,
	linux-next@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH -next] x86 msrs: alloc/free for CONFIG_SMP=n
Date: Wed, 16 Dec 2009 14:41:13 -0800	[thread overview]
Message-ID: <4B296209.2010902@zytor.com> (raw)
In-Reply-To: <20091216215808.GB27228@liondog.tnic>

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

  parent reply	other threads:[~2009-12-16 22:41 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-16  7:32 linux-next: Tree for December 16 Stephen Rothwell
2009-12-16 17:24 ` linux-next: Tree for December 16 (amd64_edac) Randy Dunlap
2009-12-16 17:32   ` H. Peter Anvin
2009-12-16 17:45     ` Borislav Petkov
2009-12-16 18:36       ` H. Peter Anvin
2009-12-16 21:51         ` [PATCH -next] x86 msrs: alloc/free for CONFIG_SMP=n Randy Dunlap
2009-12-16 21:58           ` Borislav Petkov
2009-12-16 22:02             ` Randy Dunlap
2009-12-16 22:41             ` H. Peter Anvin [this message]
2009-12-16 23:16               ` Borislav Petkov
2009-12-17  1:00                 ` [tip:x86/urgent] x86, msr: msrs_alloc/free " tip-bot for Borislav Petkov
2009-12-16 21:54         ` linux-next: Tree for December 16 (amd64_edac) Borislav Petkov
2009-12-16 22:26 ` [PATCH -next] power: fix printk formats Randy Dunlap
2009-12-16 22:35   ` Rafael J. Wysocki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4B296209.2010902@zytor.com \
    --to=hpa@zytor.com \
    --cc=borislav.petkov@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=petkovbb@googlemail.com \
    --cc=randy.dunlap@oracle.com \
    --cc=sfr@canb.auug.org.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox