From: Robert Richter <robert.richter@amd.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"oprofile-list@lists.sourceforge.net"
<oprofile-list@lists.sourceforge.net>,
"Peter Zijlstra" <a.p.zijlstra@chello.nl>,
"Frédéric Weisbecker" <fweisbec@gmail.com>,
"atswartz@gmail.com" <atswartz@gmail.com>,
"Rafael J. Wysocki" <rjw@sisk.pl>,
"Dan Carpenter" <error27@gmail.com>,
"Andrew Morton" <akpm@linux-foundation.org>,
"stable@kernel.org" <stable@kernel.org>
Subject: Re: [PATCH] arch/x86/oprofile/op_model_amd.c: perform initialisation on a single CPU
Date: Mon, 3 Jan 2011 15:44:20 +0100 [thread overview]
Message-ID: <20110103144420.GN4739@erda.amd.com> (raw)
In-Reply-To: <20110103120310.GA23927@elte.hu>
Ingo,
I tested your patch and it fixes the bug too.
On 03.01.11 07:03:10, Ingo Molnar wrote:
>
> * Robert Richter <robert.richter@amd.com> wrote:
>
> > static void init_ibs(void)
> > {
> > ibs_caps = get_ibs_caps();
>
> this get_ibs_caps() call is percpu too - still it now runs with preempt off.
get_ibs_caps() uses the cpuid instruction and this is percpu. But
mixed silicon support does not allow the use of different cpus with
different cpuid features in one system, so it should be save to use it
with preemption enabled.
Also, since the check uses a combination of boot_cpu_has() and
cpuid_eax(), disabling preemption would not help here. We would have
to pin the init code to the boot cpu then. Suppose a boot cpu with ibs
enabled and a secondary (init) cpu with ibs disabled. This will crash
the system when accessing ibs msrs.
Anyway, I am fine with your change.
>
> > + printk(KERN_INFO "oprofile: AMD IBS detected (0x%08x)\n",
> > + (unsigned)ibs_caps);
>
> that cast looks ugly and unnecessary.
Yes, this cast is unnecessary.
>
> I fixed both in the commit below. (not tested yet)
Thanks for looking at this,
-Robert
--
Advanced Micro Devices, Inc.
Operating System Research Center
prev parent reply other threads:[~2011-01-03 14:44 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-29 14:47 [GIT PULL] oprofile fixes for v2.6.37 Robert Richter
2010-12-29 16:37 ` Ingo Molnar
2010-12-30 13:08 ` Robert Richter
2010-12-30 17:38 ` Ingo Molnar
2011-01-03 11:15 ` [PATCH] arch/x86/oprofile/op_model_amd.c: perform initialisation on a single CPU Robert Richter
2011-01-03 12:03 ` Ingo Molnar
2011-01-03 14:44 ` Robert Richter [this message]
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=20110103144420.GN4739@erda.amd.com \
--to=robert.richter@amd.com \
--cc=a.p.zijlstra@chello.nl \
--cc=akpm@linux-foundation.org \
--cc=atswartz@gmail.com \
--cc=error27@gmail.com \
--cc=fweisbec@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=oprofile-list@lists.sourceforge.net \
--cc=rjw@sisk.pl \
--cc=stable@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