diff options
author | Tudor Florea <tudor.florea@enea.com> | 2014-10-10 03:19:54 +0200 |
---|---|---|
committer | Tudor Florea <tudor.florea@enea.com> | 2014-10-10 03:19:54 +0200 |
commit | c158582c0fc7f4bd73980fe9adad446855f4d61b (patch) | |
tree | 31b701a2367cb983e76e76cd7c2ba176ad33e5ac /recipes-kernel | |
download | meta-vt-daisy-140929.tar.gz |
initial commit for Enea Linux 4.0-140929daisy-140929
Migrated from the internal git server on the daisy-enea-point-release branch
Signed-off-by: Tudor Florea <tudor.florea@enea.com>
Diffstat (limited to 'recipes-kernel')
8 files changed, 173 insertions, 0 deletions
diff --git a/recipes-kernel/linux/files/perf-x86-fix-RAPL-rdmsrl_safe-usage.patch b/recipes-kernel/linux/files/perf-x86-fix-RAPL-rdmsrl_safe-usage.patch new file mode 100644 index 0000000..058e676 --- /dev/null +++ b/recipes-kernel/linux/files/perf-x86-fix-RAPL-rdmsrl_safe-usage.patch | |||
@@ -0,0 +1,29 @@ | |||
1 | From: Stephane Eranian | ||
2 | Date: Wed Apr 23 2014 - 13:04:31 EST | ||
3 | This patch fixes a bug introduced by commit 24223657. | ||
4 | |||
5 | perf/x86: fix RAPL rdmsrl_safe() usage | ||
6 | |||
7 | The rdmsrl_safe() function returns 0 on success. | ||
8 | The current code was failing to detect the RAPL PMU | ||
9 | on real hardware (missing /sys/devices/power) because | ||
10 | the return value of rdmsrl_safe() was misinterpreted. | ||
11 | |||
12 | Signed-off-by: Stephane Eranian <eranian@xxxxxxxxxx> | ||
13 | Upstream-Status: Backport [http://lkml.iu.edu/hypermail/linux/kernel/1404.2/05008.html] | ||
14 | |||
15 | diff --git a/arch/x86/kernel/cpu/perf_event_intel_rapl.c b/arch/x86/kernel/cpu/perf_event_intel_rapl.c | ||
16 | index 7c87424..619f769 100644 | ||
17 | --- a/arch/x86/kernel/cpu/perf_event_intel_rapl.c | ||
18 | +++ b/arch/x86/kernel/cpu/perf_event_intel_rapl.c | ||
19 | @@ -543,7 +543,8 @@ static int rapl_cpu_prepare(int cpu) | ||
20 | if (phys_id < 0) | ||
21 | return -1; | ||
22 | |||
23 | - if (!rdmsrl_safe(MSR_RAPL_POWER_UNIT, &msr_rapl_power_unit_bits)) | ||
24 | + /* protect rdmsrl() to handle virtualization */ | ||
25 | + if (rdmsrl_safe(MSR_RAPL_POWER_UNIT, &msr_rapl_power_unit_bits)) | ||
26 | return -1; | ||
27 | |||
28 | pmu = kzalloc_node(sizeof(*pmu), GFP_KERNEL, cpu_to_node(cpu)); | ||
29 | -- | ||
diff --git a/recipes-kernel/linux/files/perf-x86-intel-Use-rdmsrl_safe-when-initializing-RAP.patch b/recipes-kernel/linux/files/perf-x86-intel-Use-rdmsrl_safe-when-initializing-RAP.patch new file mode 100644 index 0000000..6b29970 --- /dev/null +++ b/recipes-kernel/linux/files/perf-x86-intel-Use-rdmsrl_safe-when-initializing-RAP.patch | |||
@@ -0,0 +1,80 @@ | |||
1 | From 24223657806a0ebd0ae5c9caaf7b021091889cf2 Mon Sep 17 00:00:00 2001 | ||
2 | From: Venkatesh Srinivas <venkateshs@google.com> | ||
3 | Date: Thu, 13 Mar 2014 12:36:26 -0700 | ||
4 | Subject: [PATCH] perf/x86/intel: Use rdmsrl_safe() when initializing RAPL PMU | ||
5 | |||
6 | CPUs which should support the RAPL counters according to | ||
7 | Family/Model/Stepping may still issue #GP when attempting to access | ||
8 | the RAPL MSRs. This may happen when Linux is running under KVM and | ||
9 | we are passing-through host F/M/S data, for example. Use rdmsrl_safe | ||
10 | to first access the RAPL_POWER_UNIT MSR; if this fails, do not | ||
11 | attempt to use this PMU. | ||
12 | |||
13 | Signed-off-by: Venkatesh Srinivas <venkateshs@google.com> | ||
14 | Signed-off-by: Peter Zijlstra <peterz@infradead.org> | ||
15 | Link: http://lkml.kernel.org/r/1394739386-22260-1-git-send-email-venkateshs@google.com | ||
16 | Cc: zheng.z.yan@intel.com | ||
17 | Cc: eranian@google.com | ||
18 | Cc: ak@linux.intel.com | ||
19 | Cc: linux-kernel@vger.kernel.org | ||
20 | [ The patch also silently fixes another bug: rapl_pmu_init() didn't handle the memory alloc failure case previously. ] | ||
21 | Signed-off-by: Ingo Molnar <mingo@kernel.org> | ||
22 | Upstream-Status: Backport | ||
23 | --- | ||
24 | arch/x86/kernel/cpu/perf_event_intel_rapl.c | 12 +++++++++--- | ||
25 | 1 file changed, 9 insertions(+), 3 deletions(-) | ||
26 | |||
27 | diff --git a/arch/x86/kernel/cpu/perf_event_intel_rapl.c b/arch/x86/kernel/cpu/perf_event_intel_rapl.c | ||
28 | index 4b9a9e9..7c87424 100644 | ||
29 | --- a/arch/x86/kernel/cpu/perf_event_intel_rapl.c | ||
30 | +++ b/arch/x86/kernel/cpu/perf_event_intel_rapl.c | ||
31 | @@ -535,6 +535,7 @@ static int rapl_cpu_prepare(int cpu) | ||
32 | struct rapl_pmu *pmu = per_cpu(rapl_pmu, cpu); | ||
33 | int phys_id = topology_physical_package_id(cpu); | ||
34 | u64 ms; | ||
35 | + u64 msr_rapl_power_unit_bits; | ||
36 | |||
37 | if (pmu) | ||
38 | return 0; | ||
39 | @@ -542,6 +543,9 @@ static int rapl_cpu_prepare(int cpu) | ||
40 | if (phys_id < 0) | ||
41 | return -1; | ||
42 | |||
43 | + if (!rdmsrl_safe(MSR_RAPL_POWER_UNIT, &msr_rapl_power_unit_bits)) | ||
44 | + return -1; | ||
45 | + | ||
46 | pmu = kzalloc_node(sizeof(*pmu), GFP_KERNEL, cpu_to_node(cpu)); | ||
47 | if (!pmu) | ||
48 | return -1; | ||
49 | @@ -555,8 +559,7 @@ static int rapl_cpu_prepare(int cpu) | ||
50 | * | ||
51 | * we cache in local PMU instance | ||
52 | */ | ||
53 | - rdmsrl(MSR_RAPL_POWER_UNIT, pmu->hw_unit); | ||
54 | - pmu->hw_unit = (pmu->hw_unit >> 8) & 0x1FULL; | ||
55 | + pmu->hw_unit = (msr_rapl_power_unit_bits >> 8) & 0x1FULL; | ||
56 | pmu->pmu = &rapl_pmu_class; | ||
57 | |||
58 | /* | ||
59 | @@ -677,7 +680,9 @@ static int __init rapl_pmu_init(void) | ||
60 | cpu_notifier_register_begin(); | ||
61 | |||
62 | for_each_online_cpu(cpu) { | ||
63 | - rapl_cpu_prepare(cpu); | ||
64 | + ret = rapl_cpu_prepare(cpu); | ||
65 | + if (ret) | ||
66 | + goto out; | ||
67 | rapl_cpu_init(cpu); | ||
68 | } | ||
69 | |||
70 | @@ -700,6 +705,7 @@ static int __init rapl_pmu_init(void) | ||
71 | hweight32(rapl_cntr_mask), | ||
72 | ktime_to_ms(pmu->timer_interval)); | ||
73 | |||
74 | +out: | ||
75 | put_online_cpus(); | ||
76 | |||
77 | return 0; | ||
78 | -- | ||
79 | 1.9.0 | ||
80 | |||
diff --git a/recipes-kernel/linux/linux-boundary_3.10.17.bbappend b/recipes-kernel/linux/linux-boundary_3.10.17.bbappend new file mode 100644 index 0000000..ab4f6e5 --- /dev/null +++ b/recipes-kernel/linux/linux-boundary_3.10.17.bbappend | |||
@@ -0,0 +1,6 @@ | |||
1 | SRC_URI_append = " \ | ||
2 | file://cfg/00023-ikconfig.cfg \ | ||
3 | file://cfg/00029-devtmpfs.cfg \ | ||
4 | file://cfg/00043-containers.cfg \ | ||
5 | file://cfg/00047-bridge.cfg \ | ||
6 | " | ||
diff --git a/recipes-kernel/linux/linux-keystone_3.10.bbappend b/recipes-kernel/linux/linux-keystone_3.10.bbappend new file mode 100644 index 0000000..7914b77 --- /dev/null +++ b/recipes-kernel/linux/linux-keystone_3.10.bbappend | |||
@@ -0,0 +1,13 @@ | |||
1 | SRC_URI += " \ | ||
2 | file://cfg/00040-9p.cfg \ | ||
3 | file://cfg/00041-virtio.cfg \ | ||
4 | file://cfg/00042-vhost.cfg \ | ||
5 | file://cfg/00043-containers.cfg \ | ||
6 | " | ||
7 | |||
8 | KERNEL_FEATURES_append = "\ | ||
9 | cfg/00040-9p \ | ||
10 | cfg/00041-virtio \ | ||
11 | cfg/00042-vhost \ | ||
12 | cfg/00043-containers \ | ||
13 | " | ||
diff --git a/recipes-kernel/linux/linux-qoriq-sdk.bbappend b/recipes-kernel/linux/linux-qoriq-sdk.bbappend new file mode 100644 index 0000000..4e73fd5 --- /dev/null +++ b/recipes-kernel/linux/linux-qoriq-sdk.bbappend | |||
@@ -0,0 +1,24 @@ | |||
1 | SRC_URI =+ "\ | ||
2 | file://cfg/00035-netfilter.cfg \ | ||
3 | file://cfg/00036-ppc_virt.cfg \ | ||
4 | file://cfg/00037-ppc_lxc.cfg \ | ||
5 | file://cfg/00040-9p.cfg \ | ||
6 | file://cfg/00041-virtio.cfg \ | ||
7 | file://cfg/00042-vhost.cfg \ | ||
8 | file://cfg/00043-containers.cfg \ | ||
9 | " | ||
10 | |||
11 | VIRT_FEATURES = "\ | ||
12 | cfg/00035-netfilter \ | ||
13 | cfg/00036-ppc_virt \ | ||
14 | cfg/00037-ppc_lxc \ | ||
15 | cfg/00040-9p \ | ||
16 | cfg/00041-virtio \ | ||
17 | cfg/00042-vhost \ | ||
18 | cfg/00043-containers \ | ||
19 | " | ||
20 | |||
21 | KERNEL_FEATURES_append_e500v2 = " ${VIRT_FEATURES}" | ||
22 | KERNEL_FEATURES_remove_e500v2 = "cfg/00036-ppc_virt" | ||
23 | KERNEL_FEATURES_append_e500mc = " ${VIRT_FEATURES}" | ||
24 | KERNEL_FEATURES_append_b4860qds-64b = " ${VIRT_FEATURES}" | ||
diff --git a/recipes-kernel/linux/linux-xlnx_3.8.bbappend b/recipes-kernel/linux/linux-xlnx_3.8.bbappend new file mode 100644 index 0000000..e4cd65c --- /dev/null +++ b/recipes-kernel/linux/linux-xlnx_3.8.bbappend | |||
@@ -0,0 +1,7 @@ | |||
1 | SRC_URI_append = " \ | ||
2 | file://cfg/00035-netfilter.cfg \ | ||
3 | file://cfg/00040-9p.cfg \ | ||
4 | file://cfg/00041-virtio.cfg \ | ||
5 | file://cfg/00042-vhost.cfg \ | ||
6 | file://cfg/00043-containers.cfg \ | ||
7 | " | ||
diff --git a/recipes-kernel/linux/linux-yocto_3.10.bbappend b/recipes-kernel/linux/linux-yocto_3.10.bbappend new file mode 100644 index 0000000..7791d06 --- /dev/null +++ b/recipes-kernel/linux/linux-yocto_3.10.bbappend | |||
@@ -0,0 +1,6 @@ | |||
1 | SRC_URI += " \ | ||
2 | file://cfg/00040-9p.cfg \ | ||
3 | file://cfg/00041-virtio.cfg \ | ||
4 | file://cfg/00042-vhost.cfg \ | ||
5 | file://cfg/00043-containers.cfg \ | ||
6 | " | ||
diff --git a/recipes-kernel/linux/linux-yocto_3.14.bbappend b/recipes-kernel/linux/linux-yocto_3.14.bbappend new file mode 100644 index 0000000..a9cfb3c --- /dev/null +++ b/recipes-kernel/linux/linux-yocto_3.14.bbappend | |||
@@ -0,0 +1,8 @@ | |||
1 | FILESEXTRAPATHS_prepend := "${THISDIR}/files:" | ||
2 | SRC_URI += "file://perf-x86-intel-Use-rdmsrl_safe-when-initializing-RAP.patch \ | ||
3 | file://perf-x86-fix-RAPL-rdmsrl_safe-usage.patch \ | ||
4 | file://cfg/00040-9p.cfg \ | ||
5 | file://cfg/00041-virtio.cfg \ | ||
6 | file://cfg/00042-vhost.cfg \ | ||
7 | file://cfg/00043-containers.cfg \ | ||
8 | " | ||