From: Andrew Morton <akpm@linux-foundation.org>
To: Artem Fetishev <artem_fetishev@epam.com>
Cc: <eranian@google.com>, <linux-kernel@vger.kernel.org>,
Ingo Molnar <mingo@elte.hu>,
Peter Zijlstra <a.p.zijlstra@chello.nl>
Subject: Re: [PATCH] x86: Fix boot on uniprocessor systems
Date: Wed, 26 Mar 2014 13:31:48 -0700 [thread overview]
Message-ID: <20140326133148.4a347bf956b1c5fd2ae40335@linux-foundation.org> (raw)
In-Reply-To: <20140324225910.GB4937@owamsq.epam.com>
On Tue, 25 Mar 2014 01:59:10 +0300 Artem Fetishev <artem_fetishev@epam.com> wrote:
> On x86 uniprocessor systems topology_physical_package_id() returns -1 which
> causes rapl_cpu_prepare() to leave rapl_pmu variable uninitialized which leads
> to GPF in rapl_pmu_init(). See arch/x86/kernel/cpu/perf_event_intel_rapl.c.
>
> It turns out that physical_package_id and core_id can actually be retreived for
> uniprocessor systems too. Enabling them also fixes rapl_pmu code.
>
> Signed-off-by: Artem Fetishev <artem_fetishev@epam.com>
> ---
> diff --git a/arch/x86/include/asm/topology.h b/arch/x86/include/asm/topology.h
> index d35f24e..1306d11 100644
> --- a/arch/x86/include/asm/topology.h
> +++ b/arch/x86/include/asm/topology.h
> @@ -119,9 +119,10 @@ static inline void setup_node_to_cpumask_map(void) { }
>
> extern const struct cpumask *cpu_coregroup_mask(int cpu);
>
> -#ifdef ENABLE_TOPO_DEFINES
> #define topology_physical_package_id(cpu) (cpu_data(cpu).phys_proc_id)
> #define topology_core_id(cpu) (cpu_data(cpu).cpu_core_id)
> +
> +#ifdef ENABLE_TOPO_DEFINES
> #define topology_core_cpumask(cpu) (per_cpu(cpu_core_map, cpu))
> #define topology_thread_cpumask(cpu) (per_cpu(cpu_sibling_map, cpu))
> #endif
The patch applies to 3.13 and perhaps earlier kernels. Is it needed in
those kernel versions?
next prev parent reply other threads:[~2014-03-26 20:31 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-24 22:59 Artem Fetishev
2014-03-26 20:31 ` Andrew Morton [this message]
2014-03-26 22:01 ` Stephane Eranian
2014-03-26 22:10 ` Andrew Morton
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=20140326133148.4a347bf956b1c5fd2ae40335@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=a.p.zijlstra@chello.nl \
--cc=artem_fetishev@epam.com \
--cc=eranian@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
/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
all inboxes | Powered by JetHome®