* [PATCH] perf/x86/uncore: fix missing end markers for SNB/IVB/HSW IMC PMU
@ 2014-03-13 12:04 Stephane Eranian
2014-03-13 17:17 ` Andi Kleen
2014-03-14 8:39 ` [tip:perf/core] perf/x86/uncore: Fix missing end markers for SNB/ IVB/HSW " tip-bot for Stephane Eranian
0 siblings, 2 replies; 4+ messages in thread
From: Stephane Eranian @ 2014-03-13 12:04 UTC (permalink / raw)
To: linux-kernel; +Cc: peterz, mingo, zheng.z.yan, bp, ak
This patch fixes a bug with the SNB/IVB/HSW uncore
mmeory controller support.
The PCI Ids tables for the memory controller were missing end markers.
That could cause random crashes on boot during or after PCI device
registration.
Signed-off-by: Stephane Erainan <eranian@google.com>
--
diff --git a/arch/x86/kernel/cpu/perf_event_intel_uncore.c b/arch/x86/kernel/cpu/perf_event_intel_uncore.c
index f509ab1..bd2253d 100644
--- a/arch/x86/kernel/cpu/perf_event_intel_uncore.c
+++ b/arch/x86/kernel/cpu/perf_event_intel_uncore.c
@@ -1989,6 +1989,7 @@ static DEFINE_PCI_DEVICE_TABLE(snb_uncore_pci_ids) = {
PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_SNB_IMC),
.driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0),
},
+ { /* end: all zeroes */ },
};
static DEFINE_PCI_DEVICE_TABLE(ivb_uncore_pci_ids) = {
@@ -1996,6 +1997,7 @@ static DEFINE_PCI_DEVICE_TABLE(ivb_uncore_pci_ids) = {
PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_IVB_IMC),
.driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0),
},
+ { /* end: all zeroes */ },
};
static DEFINE_PCI_DEVICE_TABLE(hsw_uncore_pci_ids) = {
@@ -2003,6 +2005,7 @@ static DEFINE_PCI_DEVICE_TABLE(hsw_uncore_pci_ids) = {
PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HSW_IMC),
.driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0),
},
+ { /* end: all zeroes */ },
};
static struct pci_driver snb_uncore_pci_driver = {
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] perf/x86/uncore: fix missing end markers for SNB/IVB/HSW IMC PMU
2014-03-13 12:04 [PATCH] perf/x86/uncore: fix missing end markers for SNB/IVB/HSW IMC PMU Stephane Eranian
@ 2014-03-13 17:17 ` Andi Kleen
2014-03-13 19:35 ` Stephane Eranian
2014-03-14 8:39 ` [tip:perf/core] perf/x86/uncore: Fix missing end markers for SNB/ IVB/HSW " tip-bot for Stephane Eranian
1 sibling, 1 reply; 4+ messages in thread
From: Andi Kleen @ 2014-03-13 17:17 UTC (permalink / raw)
To: Stephane Eranian; +Cc: linux-kernel, peterz, mingo, zheng.z.yan, bp
Stephane Eranian <eranian@google.com> writes:
> This patch fixes a bug with the SNB/IVB/HSW uncore
> mmeory controller support.
>
> The PCI Ids tables for the memory controller were missing end markers.
> That could cause random crashes on boot during or after PCI device
> registration.
I wonder if there's a way to check this in checkpatch.pl ?
Or maybe a sparse check could be added, with a new type attribute
that says "needs to be 0 terminate"
-Andi
--
ak@linux.intel.com -- Speaking for myself only
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] perf/x86/uncore: fix missing end markers for SNB/IVB/HSW IMC PMU
2014-03-13 17:17 ` Andi Kleen
@ 2014-03-13 19:35 ` Stephane Eranian
0 siblings, 0 replies; 4+ messages in thread
From: Stephane Eranian @ 2014-03-13 19:35 UTC (permalink / raw)
To: Andi Kleen
Cc: LKML, Peter Zijlstra, mingo@elte.hu, Yan, Zheng, Borislav Petkov
On Thu, Mar 13, 2014 at 6:17 PM, Andi Kleen <andi@firstfloor.org> wrote:
> Stephane Eranian <eranian@google.com> writes:
>
>> This patch fixes a bug with the SNB/IVB/HSW uncore
>> mmeory controller support.
>>
>> The PCI Ids tables for the memory controller were missing end markers.
>> That could cause random crashes on boot during or after PCI device
>> registration.
>
> I wonder if there's a way to check this in checkpatch.pl ?
>
> Or maybe a sparse check could be added, with a new type attribute
> that says "needs to be 0 terminate"
>
Not that easy , because in some cases, the size may be passed as a parameter
to the call or maybe embedded into a struct passed to the call.
But if you target this specific macro, you should be able to find the issues.
> -Andi
>
> --
> ak@linux.intel.com -- Speaking for myself only
^ permalink raw reply [flat|nested] 4+ messages in thread
* [tip:perf/core] perf/x86/uncore: Fix missing end markers for SNB/ IVB/HSW IMC PMU
2014-03-13 12:04 [PATCH] perf/x86/uncore: fix missing end markers for SNB/IVB/HSW IMC PMU Stephane Eranian
2014-03-13 17:17 ` Andi Kleen
@ 2014-03-14 8:39 ` tip-bot for Stephane Eranian
1 sibling, 0 replies; 4+ messages in thread
From: tip-bot for Stephane Eranian @ 2014-03-14 8:39 UTC (permalink / raw)
To: linux-tip-commits; +Cc: linux-kernel, eranian, hpa, mingo, tglx
Commit-ID: 81827ed8d85e892311965dc9ec4120b2b2e745bd
Gitweb: http://git.kernel.org/tip/81827ed8d85e892311965dc9ec4120b2b2e745bd
Author: Stephane Eranian <eranian@google.com>
AuthorDate: Thu, 13 Mar 2014 13:04:36 +0100
Committer: Ingo Molnar <mingo@kernel.org>
CommitDate: Fri, 14 Mar 2014 09:25:25 +0100
perf/x86/uncore: Fix missing end markers for SNB/IVB/HSW IMC PMU
This patch fixes a bug with the SNB/IVB/HSW uncore
mmeory controller support.
The PCI Ids tables for the memory controller were missing end
markers. That could cause random crashes on boot during or after
PCI device registration.
Signed-off-by: Stephane Erainan <eranian@google.com>
Cc: peterz@infradead.org
Cc: zheng.z.yan@intel.com
Cc: bp@alien8.de
Cc: ak@linux.intel.com
Link: http://lkml.kernel.org/r/20140313120436.GA14236@quad
Signed-off-by: Ingo Molnar <mingo@kernel.org>
--
---
arch/x86/kernel/cpu/perf_event_intel_uncore.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/x86/kernel/cpu/perf_event_intel_uncore.c b/arch/x86/kernel/cpu/perf_event_intel_uncore.c
index dfd50ea..618d502 100644
--- a/arch/x86/kernel/cpu/perf_event_intel_uncore.c
+++ b/arch/x86/kernel/cpu/perf_event_intel_uncore.c
@@ -1989,6 +1989,7 @@ static DEFINE_PCI_DEVICE_TABLE(snb_uncore_pci_ids) = {
PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_SNB_IMC),
.driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0),
},
+ { /* end: all zeroes */ },
};
static DEFINE_PCI_DEVICE_TABLE(ivb_uncore_pci_ids) = {
@@ -1996,6 +1997,7 @@ static DEFINE_PCI_DEVICE_TABLE(ivb_uncore_pci_ids) = {
PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_IVB_IMC),
.driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0),
},
+ { /* end: all zeroes */ },
};
static DEFINE_PCI_DEVICE_TABLE(hsw_uncore_pci_ids) = {
@@ -2003,6 +2005,7 @@ static DEFINE_PCI_DEVICE_TABLE(hsw_uncore_pci_ids) = {
PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HSW_IMC),
.driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0),
},
+ { /* end: all zeroes */ },
};
static struct pci_driver snb_uncore_pci_driver = {
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-03-14 8:41 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-13 12:04 [PATCH] perf/x86/uncore: fix missing end markers for SNB/IVB/HSW IMC PMU Stephane Eranian
2014-03-13 17:17 ` Andi Kleen
2014-03-13 19:35 ` Stephane Eranian
2014-03-14 8:39 ` [tip:perf/core] perf/x86/uncore: Fix missing end markers for SNB/ IVB/HSW " tip-bot for Stephane Eranian
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).