public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/5] perf, x86, uncore: Fix section mismatch in split uncore driver
@ 2014-09-04 23:08 Andi Kleen
  2014-09-04 23:08 ` [PATCH 2/5] perf, x86, uncore: Add Haswell-EP uncore support Andi Kleen
                   ` (4 more replies)
  0 siblings, 5 replies; 17+ messages in thread
From: Andi Kleen @ 2014-09-04 23:08 UTC (permalink / raw)
  To: peterz; +Cc: linux-kernel, mingo, eranian, tglx, Andi Kleen

From: Andi Kleen <ak@linux.intel.com>

The new split Intel uncore driver code that recently went
into tip added a section mismatch, which the build process
complains about.

uncore_pmu_register can be called from uncore_pci_probe,
which is not __init and can be called from pci driver ->probe.
I'm not fully sure if it's actually possible to call the probe
function later, but it seems safer to mark uncore_pmu_register
not __init.

This also fixes the warning.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
 arch/x86/kernel/cpu/perf_event_intel_uncore.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/cpu/perf_event_intel_uncore.c b/arch/x86/kernel/cpu/perf_event_intel_uncore.c
index 4785ee8..812ec5d 100644
--- a/arch/x86/kernel/cpu/perf_event_intel_uncore.c
+++ b/arch/x86/kernel/cpu/perf_event_intel_uncore.c
@@ -661,7 +661,7 @@ static struct attribute_group uncore_pmu_attr_group = {
 	.attrs = uncore_pmu_attrs,
 };
 
-static int __init uncore_pmu_register(struct intel_uncore_pmu *pmu)
+static int uncore_pmu_register(struct intel_uncore_pmu *pmu)
 {
 	int ret;
 
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 17+ messages in thread
* Re: [PATCH 2/5] perf, x86, uncore: Add Haswell-EP uncore support
@ 2014-10-27 20:13 Alexei Starovoitov
  2014-10-28 15:30 ` Andi Kleen
  0 siblings, 1 reply; 17+ messages in thread
From: Alexei Starovoitov @ 2014-10-27 20:13 UTC (permalink / raw)
  To: Andi Kleen
  Cc: Peter Zijlstra, linux-kernel@vger.kernel.org, Ingo Molnar,
	Stephane Eranian, Thomas Gleixner, Yan, Zheng

On Mon, Oct 27, 2014 at 4:57 AM, Andi Kleen <andi@firstfloor.org> wrote:
> Alexei Starovoitov <alexei.starovoitov@gmail.com> writes:
>> my E5-1630 v3 crashes hard during boot in
>> snbep_uncore_msr_init_box()+0x3c
>
>> I don't have a setup to capture the screen so early in the boot.
>> So this is just heads up.
>
> Is it a general general protection fault or a page fault?
>
> If it's a page fault please post the disassembled code:
>
> gdb vmlinux
> disassemble  snbep_uncore_msr_init_box
>

snbep_uncore_msr_init_box() is called with:
[    1.055678] msr 0
[    1.056027] msr 3584
[    1.056376] msr 3600
[    1.056725] msr 3616
[    1.057074] msr 3632
[    1.057424] msr 1824
[    1.057773] msr 1834
[    1.058123] msr 1844
[    1.058473] msr 1854
[    1.058822] msr 1808

since msr 3584 is HSWEP_C0_MSR_PMON_BOX_CTL
I've tried the following workaround which helped as well:
diff --git a/arch/x86/kernel/cpu/perf_event_intel_uncore_snbep.c
b/arch/x86/kernel/cpu/perf_event_intel_uncore_snbep.c
index adf138eac85c..1ca46523a541 100644
--- a/arch/x86/kernel/cpu/perf_event_intel_uncore_snbep.c
+++ b/arch/x86/kernel/cpu/perf_event_intel_uncore_snbep.c
@@ -368,7 +368,7 @@ static void snbep_uncore_msr_init_box(struct
intel_uncore_box *box)
 {
        unsigned msr = uncore_msr_box_ctl(box);

-       if (msr)
+       if (msr && msr >= 3584)
                wrmsrl(msr, SNBEP_PMON_BOX_CTL_INT);
 }

^ permalink raw reply related	[flat|nested] 17+ messages in thread
* Re: [PATCH 2/5] perf, x86, uncore: Add Haswell-EP uncore support
@ 2014-10-28 23:15 Alexei Starovoitov
  2014-10-29  3:11 ` Andi Kleen
  0 siblings, 1 reply; 17+ messages in thread
From: Alexei Starovoitov @ 2014-10-28 23:15 UTC (permalink / raw)
  To: Andi Kleen
  Cc: Peter Zijlstra, linux-kernel@vger.kernel.org, Ingo Molnar,
	Stephane Eranian, Thomas Gleixner, Yan, Zheng

On Tue, Oct 28, 2014 at 8:30 AM, Andi Kleen <andi@firstfloor.org> wrote:
>> snbep_uncore_msr_init_box() is called with:
>> [    1.055678] msr 0
>> [    1.056027] msr 3584
>> [    1.056376] msr 3600
>> [    1.056725] msr 3616
>> [    1.057074] msr 3632
>> [    1.057424] msr 1824
>
> So it would normally crash here, right? That's the SBOX.
>
> When you remove the sbox in hswep_msr_uncores the crash goes away,
> correct?

yes. removing line 'hswep_uncore_sbox' also worked as workaround.
You have an idea what's going on?
I suspect other folks will see the same crash when E5 v3
become more widespread.

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2014-10-29 15:06 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-04 23:08 [PATCH 1/5] perf, x86, uncore: Fix section mismatch in split uncore driver Andi Kleen
2014-09-04 23:08 ` [PATCH 2/5] perf, x86, uncore: Add Haswell-EP uncore support Andi Kleen
2014-09-24 15:00   ` [tip:perf/core] perf/x86/intel/uncore: " tip-bot for Yan, Zheng
2014-10-22 19:07   ` [PATCH 2/5] perf, x86, uncore: " Alexei Starovoitov
2014-10-27 11:57     ` Andi Kleen
2014-09-04 23:08 ` [PATCH 3/5] perf, x86, uncore: Register the PMU only if the uncore pci device exists Andi Kleen
2014-09-24 15:00   ` [tip:perf/core] perf/x86/intel/uncore: " tip-bot for Yan, Zheng
2014-09-04 23:08 ` [PATCH 4/5] perf, x86, uncore: Add missing cbox filter flags on IvyBridge-EP uncore driver Andi Kleen
2014-09-24 15:00   ` [tip:perf/core] perf/x86/intel/uncore: " tip-bot for Andi Kleen
2014-09-04 23:08 ` [PATCH 5/5] perf, x86, uncore: Fix PCU filter setup for Sandy/Ivy/Haswell EP Andi Kleen
2014-09-24 15:00   ` [tip:perf/core] perf/x86/intel/uncore: " tip-bot for Andi Kleen
2014-09-19  0:44 ` [PATCH 1/5] perf, x86, uncore: Fix section mismatch in split uncore driver Peter Zijlstra
  -- strict thread matches above, loose matches on Subject: below --
2014-10-27 20:13 [PATCH 2/5] perf, x86, uncore: Add Haswell-EP uncore support Alexei Starovoitov
2014-10-28 15:30 ` Andi Kleen
2014-10-28 23:15 Alexei Starovoitov
2014-10-29  3:11 ` Andi Kleen
2014-10-29 14:49   ` Patrick Lu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox