public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Borislav Petkov <borislav.petkov@amd.com>
To: "H. Peter Anvin" <hpa@zytor.com>
Cc: x86@kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] [x86, msr]: execute on the correct CPU subset (was: Re: [PATCH] [x86, msr]: remove code duplication)
Date: Thu, 16 Jul 2009 18:51:36 +0200	[thread overview]
Message-ID: <20090716165136.GA31204@aftab> (raw)
In-Reply-To: <20090708111911.GC19315@aftab>

Hi,

On Wed, Jul 08, 2009 at 01:19:11PM +0200, Borislav Petkov wrote:
> On Tue, Jul 07, 2009 at 08:56:00AM -0700, H. Peter Anvin wrote:
> > Borislav Petkov wrote:
> > > 
> > > Actually, the more important question is why am I executing anything on
> > > my own CPU without first checking if it is in the cpumask _at_ _all_?!
> > > /me ducks behind the sofa.
> > > 
> > > The right thing to do should be something like the following:
> > > 
> > > preempt_disable();
> > > this_cpu = raw_smp_processor_id();
> > > 
> > > if (cpumask_test_cpu(this_cpu, mask)) {
> > > 	local_irq_disable();
> > > 	msr_func(&rv);
> > > 	local_irq_enable();
> > > }
> > > 
> > > smp_call_function_many(mask, msr_func, &rv, 1);
> > > preempt_enable();
> > > 
> > 
> > I don't see why you're disabling local IRQs.
> 
> I guess I was trying to be overly careful but can't seem to think of a
> case when this would be appropriate. Hmm...
> 
> --
> From: Borislav Petkov <borislav.petkov@amd.com>
> Date: Mon, 6 Jul 2009 16:08:34 +0200
> Subject: [PATCH] [x86, msr]: execute on the correct CPU subset
> 
> rdmsr_on_cpus/wrmsr_on_cpus were erroneously executing on the current
> CPU even in the case where it wasn't in the supplied bitmask. Add a
> check for that and handle accordingly.
> 
> While at it, since rdmsr_on_cpus and wrmsr_on_cpus are almost identical,
> fold them into a common __rwmsr_on_cpus helper passing a function
> pointer arg to the actual MSR operation.
> 
> Signed-off-by: Borislav Petkov <borislav.petkov@amd.com>
> ---
>  arch/x86/lib/msr.c |   53 +++++++++++++++++++--------------------------------
>  1 files changed, 20 insertions(+), 33 deletions(-)

any comments on that one, NAK/AK? Since it is a fix and not changing the
interface to external users, it might be a good idea to include it in
2.6.31, IMHO, no?

-- 
Regards/Gruss,
Boris.

Operating | Advanced Micro Devices GmbH
  System  | Karl-Hammerschmidt-Str. 34, 85609 Dornach b. München, Germany
 Research | Geschäftsführer: Thomas M. McCoy, Giuliano Meroni
  Center  | Sitz: Dornach, Gemeinde Aschheim, Landkreis München
  (OSRC)  | Registergericht München, HRB Nr. 43632


  reply	other threads:[~2009-07-16 16:52 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-06 14:29 [PATCH] [x86, msr]: remove code duplication Borislav Petkov
2009-07-06 21:31 ` H. Peter Anvin
2009-07-07 10:37   ` Borislav Petkov
2009-07-07 15:56     ` H. Peter Anvin
2009-07-08 11:19       ` [PATCH] [x86, msr]: execute on the correct CPU subset (was: Re: [PATCH] [x86, msr]: remove code duplication) Borislav Petkov
2009-07-16 16:51         ` Borislav Petkov [this message]
2009-07-16 17:24           ` [PATCH] [x86, msr]: execute on the correct CPU subset H. Peter Anvin
2009-07-27 20:46         ` H. Peter Anvin
2009-07-28 10:29           ` Borislav Petkov
2009-07-29 16:49           ` Borislav Petkov
2009-07-29 17:30             ` H. Peter Anvin
2009-07-29 18:02               ` Borislav Petkov
2009-07-29 18:05                 ` H. Peter Anvin
2009-07-29 18:46                   ` Borislav Petkov
2009-07-29 18:50                     ` H. Peter Anvin
2009-07-30  9:10                       ` [PATCH] x86, msr: " Borislav Petkov
2009-07-30  9:10                       ` [PATCH] x86, msr: unify rdmsr_on_cpus/wrmsr_on_cpus Borislav Petkov
2009-09-14 12:55                         ` Borislav Petkov

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=20090716165136.GA31204@aftab \
    --to=borislav.petkov@amd.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=x86@kernel.org \
    /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