<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/arch/x86, branch v4.1.5</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>perf/x86/intel/cqm: Return cached counter value from IRQ context</title>
<updated>2015-08-10T19:21:58+00:00</updated>
<author>
<name>Matt Fleming</name>
<email>matt.fleming@intel.com</email>
</author>
<published>2015-07-21T14:55:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=f919f7a4d004513372807cedc14fac43f0652c4c'/>
<id>f919f7a4d004513372807cedc14fac43f0652c4c</id>
<content type='text'>
commit 2c534c0da0a68418693e10ce1c4146e085f39518 upstream.

Peter reported the following potential crash which I was able to
reproduce with his test program,

[  148.765788] ------------[ cut here ]------------
[  148.765796] WARNING: CPU: 34 PID: 2840 at kernel/smp.c:417 smp_call_function_many+0xb6/0x260()
[  148.765797] Modules linked in:
[  148.765800] CPU: 34 PID: 2840 Comm: perf Not tainted 4.2.0-rc1+ #4
[  148.765803]  ffffffff81cdc398 ffff88085f105950 ffffffff818bdfd5 0000000000000007
[  148.765805]  0000000000000000 ffff88085f105990 ffffffff810e413a 0000000000000000
[  148.765807]  ffffffff82301080 0000000000000022 ffffffff8107f640 ffffffff8107f640
[  148.765809] Call Trace:
[  148.765810]  &lt;NMI&gt;  [&lt;ffffffff818bdfd5&gt;] dump_stack+0x45/0x57
[  148.765818]  [&lt;ffffffff810e413a&gt;] warn_slowpath_common+0x8a/0xc0
[  148.765822]  [&lt;ffffffff8107f640&gt;] ? intel_cqm_stable+0x60/0x60
[  148.765824]  [&lt;ffffffff8107f640&gt;] ? intel_cqm_stable+0x60/0x60
[  148.765825]  [&lt;ffffffff810e422a&gt;] warn_slowpath_null+0x1a/0x20
[  148.765827]  [&lt;ffffffff811613f6&gt;] smp_call_function_many+0xb6/0x260
[  148.765829]  [&lt;ffffffff8107f640&gt;] ? intel_cqm_stable+0x60/0x60
[  148.765831]  [&lt;ffffffff81161748&gt;] on_each_cpu_mask+0x28/0x60
[  148.765832]  [&lt;ffffffff8107f6ef&gt;] intel_cqm_event_count+0x7f/0xe0
[  148.765836]  [&lt;ffffffff811cdd35&gt;] perf_output_read+0x2a5/0x400
[  148.765839]  [&lt;ffffffff811d2e5a&gt;] perf_output_sample+0x31a/0x590
[  148.765840]  [&lt;ffffffff811d333d&gt;] ? perf_prepare_sample+0x26d/0x380
[  148.765841]  [&lt;ffffffff811d3497&gt;] perf_event_output+0x47/0x60
[  148.765843]  [&lt;ffffffff811d36c5&gt;] __perf_event_overflow+0x215/0x240
[  148.765844]  [&lt;ffffffff811d4124&gt;] perf_event_overflow+0x14/0x20
[  148.765847]  [&lt;ffffffff8107e7f4&gt;] intel_pmu_handle_irq+0x1d4/0x440
[  148.765849]  [&lt;ffffffff811d07a6&gt;] ? __perf_event_task_sched_in+0x36/0xa0
[  148.765853]  [&lt;ffffffff81219bad&gt;] ? vunmap_page_range+0x19d/0x2f0
[  148.765854]  [&lt;ffffffff81219d11&gt;] ? unmap_kernel_range_noflush+0x11/0x20
[  148.765859]  [&lt;ffffffff814ce6fe&gt;] ? ghes_copy_tofrom_phys+0x11e/0x2a0
[  148.765863]  [&lt;ffffffff8109e5db&gt;] ? native_apic_msr_write+0x2b/0x30
[  148.765865]  [&lt;ffffffff8109e44d&gt;] ? x2apic_send_IPI_self+0x1d/0x20
[  148.765869]  [&lt;ffffffff81065135&gt;] ? arch_irq_work_raise+0x35/0x40
[  148.765872]  [&lt;ffffffff811c8d86&gt;] ? irq_work_queue+0x66/0x80
[  148.765875]  [&lt;ffffffff81075306&gt;] perf_event_nmi_handler+0x26/0x40
[  148.765877]  [&lt;ffffffff81063ed9&gt;] nmi_handle+0x79/0x100
[  148.765879]  [&lt;ffffffff81064422&gt;] default_do_nmi+0x42/0x100
[  148.765880]  [&lt;ffffffff81064563&gt;] do_nmi+0x83/0xb0
[  148.765884]  [&lt;ffffffff818c7c0f&gt;] end_repeat_nmi+0x1e/0x2e
[  148.765886]  [&lt;ffffffff811d07a6&gt;] ? __perf_event_task_sched_in+0x36/0xa0
[  148.765888]  [&lt;ffffffff811d07a6&gt;] ? __perf_event_task_sched_in+0x36/0xa0
[  148.765890]  [&lt;ffffffff811d07a6&gt;] ? __perf_event_task_sched_in+0x36/0xa0
[  148.765891]  &lt;&lt;EOE&gt;&gt;  [&lt;ffffffff8110ab66&gt;] finish_task_switch+0x156/0x210
[  148.765898]  [&lt;ffffffff818c1671&gt;] __schedule+0x341/0x920
[  148.765899]  [&lt;ffffffff818c1c87&gt;] schedule+0x37/0x80
[  148.765903]  [&lt;ffffffff810ae1af&gt;] ? do_page_fault+0x2f/0x80
[  148.765905]  [&lt;ffffffff818c1f4a&gt;] schedule_user+0x1a/0x50
[  148.765907]  [&lt;ffffffff818c666c&gt;] retint_careful+0x14/0x32
[  148.765908] ---[ end trace e33ff2be78e14901 ]---

The CQM task events are not safe to be called from within interrupt
context because they require performing an IPI to read the counter value
on all sockets. And performing IPIs from within IRQ context is a
"no-no".

Make do with the last read counter value currently event in
event-&gt;count when we're invoked in this context.

Reported-by: Peter Zijlstra &lt;peterz@infradead.org&gt;
Signed-off-by: Matt Fleming &lt;matt.fleming@intel.com&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Vikas Shivappa &lt;vikas.shivappa@intel.com&gt;
Cc: Kanaka Juvva &lt;kanaka.d.juvva@intel.com&gt;
Cc: Will Auld &lt;will.auld@intel.com&gt;
Link: http://lkml.kernel.org/r/1437490509-15373-1-git-send-email-matt@codeblueprint.co.uk
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 2c534c0da0a68418693e10ce1c4146e085f39518 upstream.

Peter reported the following potential crash which I was able to
reproduce with his test program,

[  148.765788] ------------[ cut here ]------------
[  148.765796] WARNING: CPU: 34 PID: 2840 at kernel/smp.c:417 smp_call_function_many+0xb6/0x260()
[  148.765797] Modules linked in:
[  148.765800] CPU: 34 PID: 2840 Comm: perf Not tainted 4.2.0-rc1+ #4
[  148.765803]  ffffffff81cdc398 ffff88085f105950 ffffffff818bdfd5 0000000000000007
[  148.765805]  0000000000000000 ffff88085f105990 ffffffff810e413a 0000000000000000
[  148.765807]  ffffffff82301080 0000000000000022 ffffffff8107f640 ffffffff8107f640
[  148.765809] Call Trace:
[  148.765810]  &lt;NMI&gt;  [&lt;ffffffff818bdfd5&gt;] dump_stack+0x45/0x57
[  148.765818]  [&lt;ffffffff810e413a&gt;] warn_slowpath_common+0x8a/0xc0
[  148.765822]  [&lt;ffffffff8107f640&gt;] ? intel_cqm_stable+0x60/0x60
[  148.765824]  [&lt;ffffffff8107f640&gt;] ? intel_cqm_stable+0x60/0x60
[  148.765825]  [&lt;ffffffff810e422a&gt;] warn_slowpath_null+0x1a/0x20
[  148.765827]  [&lt;ffffffff811613f6&gt;] smp_call_function_many+0xb6/0x260
[  148.765829]  [&lt;ffffffff8107f640&gt;] ? intel_cqm_stable+0x60/0x60
[  148.765831]  [&lt;ffffffff81161748&gt;] on_each_cpu_mask+0x28/0x60
[  148.765832]  [&lt;ffffffff8107f6ef&gt;] intel_cqm_event_count+0x7f/0xe0
[  148.765836]  [&lt;ffffffff811cdd35&gt;] perf_output_read+0x2a5/0x400
[  148.765839]  [&lt;ffffffff811d2e5a&gt;] perf_output_sample+0x31a/0x590
[  148.765840]  [&lt;ffffffff811d333d&gt;] ? perf_prepare_sample+0x26d/0x380
[  148.765841]  [&lt;ffffffff811d3497&gt;] perf_event_output+0x47/0x60
[  148.765843]  [&lt;ffffffff811d36c5&gt;] __perf_event_overflow+0x215/0x240
[  148.765844]  [&lt;ffffffff811d4124&gt;] perf_event_overflow+0x14/0x20
[  148.765847]  [&lt;ffffffff8107e7f4&gt;] intel_pmu_handle_irq+0x1d4/0x440
[  148.765849]  [&lt;ffffffff811d07a6&gt;] ? __perf_event_task_sched_in+0x36/0xa0
[  148.765853]  [&lt;ffffffff81219bad&gt;] ? vunmap_page_range+0x19d/0x2f0
[  148.765854]  [&lt;ffffffff81219d11&gt;] ? unmap_kernel_range_noflush+0x11/0x20
[  148.765859]  [&lt;ffffffff814ce6fe&gt;] ? ghes_copy_tofrom_phys+0x11e/0x2a0
[  148.765863]  [&lt;ffffffff8109e5db&gt;] ? native_apic_msr_write+0x2b/0x30
[  148.765865]  [&lt;ffffffff8109e44d&gt;] ? x2apic_send_IPI_self+0x1d/0x20
[  148.765869]  [&lt;ffffffff81065135&gt;] ? arch_irq_work_raise+0x35/0x40
[  148.765872]  [&lt;ffffffff811c8d86&gt;] ? irq_work_queue+0x66/0x80
[  148.765875]  [&lt;ffffffff81075306&gt;] perf_event_nmi_handler+0x26/0x40
[  148.765877]  [&lt;ffffffff81063ed9&gt;] nmi_handle+0x79/0x100
[  148.765879]  [&lt;ffffffff81064422&gt;] default_do_nmi+0x42/0x100
[  148.765880]  [&lt;ffffffff81064563&gt;] do_nmi+0x83/0xb0
[  148.765884]  [&lt;ffffffff818c7c0f&gt;] end_repeat_nmi+0x1e/0x2e
[  148.765886]  [&lt;ffffffff811d07a6&gt;] ? __perf_event_task_sched_in+0x36/0xa0
[  148.765888]  [&lt;ffffffff811d07a6&gt;] ? __perf_event_task_sched_in+0x36/0xa0
[  148.765890]  [&lt;ffffffff811d07a6&gt;] ? __perf_event_task_sched_in+0x36/0xa0
[  148.765891]  &lt;&lt;EOE&gt;&gt;  [&lt;ffffffff8110ab66&gt;] finish_task_switch+0x156/0x210
[  148.765898]  [&lt;ffffffff818c1671&gt;] __schedule+0x341/0x920
[  148.765899]  [&lt;ffffffff818c1c87&gt;] schedule+0x37/0x80
[  148.765903]  [&lt;ffffffff810ae1af&gt;] ? do_page_fault+0x2f/0x80
[  148.765905]  [&lt;ffffffff818c1f4a&gt;] schedule_user+0x1a/0x50
[  148.765907]  [&lt;ffffffff818c666c&gt;] retint_careful+0x14/0x32
[  148.765908] ---[ end trace e33ff2be78e14901 ]---

The CQM task events are not safe to be called from within interrupt
context because they require performing an IPI to read the counter value
on all sockets. And performing IPIs from within IRQ context is a
"no-no".

Make do with the last read counter value currently event in
event-&gt;count when we're invoked in this context.

Reported-by: Peter Zijlstra &lt;peterz@infradead.org&gt;
Signed-off-by: Matt Fleming &lt;matt.fleming@intel.com&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Vikas Shivappa &lt;vikas.shivappa@intel.com&gt;
Cc: Kanaka Juvva &lt;kanaka.d.juvva@intel.com&gt;
Cc: Will Auld &lt;will.auld@intel.com&gt;
Link: http://lkml.kernel.org/r/1437490509-15373-1-git-send-email-matt@codeblueprint.co.uk
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>x86/efi: Use all 64 bit of efi_memmap in setup_e820()</title>
<updated>2015-08-10T19:21:57+00:00</updated>
<author>
<name>Dmitry Skorodumov</name>
<email>sdmitry@parallels.com</email>
</author>
<published>2015-07-28T14:38:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=e8647ec68feb66acd35b0f7fa3177bb47cc6a94e'/>
<id>e8647ec68feb66acd35b0f7fa3177bb47cc6a94e</id>
<content type='text'>
commit 7cc03e48965453b5df1cce5062c826189b04b960 upstream.

The efi_info structure stores low 32 bits of memory map
in efi_memmap and high 32 bits in efi_memmap_hi.

While constructing pointer in the setup_e820(), need
to take into account all 64 bit of the pointer.

It is because on 64bit machine the function
efi_get_memory_map() may return full 64bit pointer and before
the patch that pointer was truncated.

The issue is triggered on Parallles virtual machine and
fixed with this patch.

Signed-off-by: Dmitry Skorodumov &lt;sdmitry@parallels.com&gt;
Cc: Denis V. Lunev &lt;den@openvz.org&gt;
Signed-off-by: Matt Fleming &lt;matt.fleming@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 7cc03e48965453b5df1cce5062c826189b04b960 upstream.

The efi_info structure stores low 32 bits of memory map
in efi_memmap and high 32 bits in efi_memmap_hi.

While constructing pointer in the setup_e820(), need
to take into account all 64 bit of the pointer.

It is because on 64bit machine the function
efi_get_memory_map() may return full 64bit pointer and before
the patch that pointer was truncated.

The issue is triggered on Parallles virtual machine and
fixed with this patch.

Signed-off-by: Dmitry Skorodumov &lt;sdmitry@parallels.com&gt;
Cc: Denis V. Lunev &lt;den@openvz.org&gt;
Signed-off-by: Matt Fleming &lt;matt.fleming@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>efi: Check for NULL efi kernel parameters</title>
<updated>2015-08-10T19:21:57+00:00</updated>
<author>
<name>Ricardo Neri</name>
<email>ricardo.neri-calderon@linux.intel.com</email>
</author>
<published>2015-07-16T02:36:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=c54f557fa580989c304cc5c83528efa5a1819a85'/>
<id>c54f557fa580989c304cc5c83528efa5a1819a85</id>
<content type='text'>
commit 9115c7589b11349a1c3099758b4bded579ff69e0 upstream.

Even though it is documented how to specifiy efi parameters, it is
possible to cause a kernel panic due to a dereference of a NULL pointer when
parsing such parameters if "efi" alone is given:

PANIC: early exception 0e rip 10:ffffffff812fb361 error 0 cr2 0
[ 0.000000] CPU: 0 PID: 0 Comm: swapper Not tainted 4.2.0-rc1+ #450
[ 0.000000]  ffffffff81fe20a9 ffffffff81e03d50 ffffffff8184bb0f 00000000000003f8
[ 0.000000]  0000000000000000 ffffffff81e03e08 ffffffff81f371a1 64656c62616e6520
[ 0.000000]  0000000000000069 000000000000005f 0000000000000000 0000000000000000
[ 0.000000] Call Trace:
[ 0.000000]  [&lt;ffffffff8184bb0f&gt;] dump_stack+0x45/0x57
[ 0.000000]  [&lt;ffffffff81f371a1&gt;] early_idt_handler_common+0x81/0xae
[ 0.000000]  [&lt;ffffffff812fb361&gt;] ? parse_option_str+0x11/0x90
[ 0.000000]  [&lt;ffffffff81f4dd69&gt;] arch_parse_efi_cmdline+0x15/0x42
[ 0.000000]  [&lt;ffffffff81f376e1&gt;] do_early_param+0x50/0x8a
[ 0.000000]  [&lt;ffffffff8106b1b3&gt;] parse_args+0x1e3/0x400
[ 0.000000]  [&lt;ffffffff81f37a43&gt;] parse_early_options+0x24/0x28
[ 0.000000]  [&lt;ffffffff81f37691&gt;] ? loglevel+0x31/0x31
[ 0.000000]  [&lt;ffffffff81f37a78&gt;] parse_early_param+0x31/0x3d
[ 0.000000]  [&lt;ffffffff81f3ae98&gt;] setup_arch+0x2de/0xc08
[ 0.000000]  [&lt;ffffffff8109629a&gt;] ? vprintk_default+0x1a/0x20
[ 0.000000]  [&lt;ffffffff81f37b20&gt;] start_kernel+0x90/0x423
[ 0.000000]  [&lt;ffffffff81f37495&gt;] x86_64_start_reservations+0x2a/0x2c
[ 0.000000]  [&lt;ffffffff81f37582&gt;] x86_64_start_kernel+0xeb/0xef
[ 0.000000] RIP 0xffffffff81ba2efc

This panic is not reproducible with "efi=" as this will result in a non-NULL
zero-length string.

Thus, verify that the pointer to the parameter string is not NULL. This is
consistent with other parameter-parsing functions which check for NULL pointers.

Signed-off-by: Ricardo Neri &lt;ricardo.neri-calderon@linux.intel.com&gt;
Cc: Dave Young &lt;dyoung@redhat.com&gt;
Signed-off-by: Matt Fleming &lt;matt.fleming@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 9115c7589b11349a1c3099758b4bded579ff69e0 upstream.

Even though it is documented how to specifiy efi parameters, it is
possible to cause a kernel panic due to a dereference of a NULL pointer when
parsing such parameters if "efi" alone is given:

PANIC: early exception 0e rip 10:ffffffff812fb361 error 0 cr2 0
[ 0.000000] CPU: 0 PID: 0 Comm: swapper Not tainted 4.2.0-rc1+ #450
[ 0.000000]  ffffffff81fe20a9 ffffffff81e03d50 ffffffff8184bb0f 00000000000003f8
[ 0.000000]  0000000000000000 ffffffff81e03e08 ffffffff81f371a1 64656c62616e6520
[ 0.000000]  0000000000000069 000000000000005f 0000000000000000 0000000000000000
[ 0.000000] Call Trace:
[ 0.000000]  [&lt;ffffffff8184bb0f&gt;] dump_stack+0x45/0x57
[ 0.000000]  [&lt;ffffffff81f371a1&gt;] early_idt_handler_common+0x81/0xae
[ 0.000000]  [&lt;ffffffff812fb361&gt;] ? parse_option_str+0x11/0x90
[ 0.000000]  [&lt;ffffffff81f4dd69&gt;] arch_parse_efi_cmdline+0x15/0x42
[ 0.000000]  [&lt;ffffffff81f376e1&gt;] do_early_param+0x50/0x8a
[ 0.000000]  [&lt;ffffffff8106b1b3&gt;] parse_args+0x1e3/0x400
[ 0.000000]  [&lt;ffffffff81f37a43&gt;] parse_early_options+0x24/0x28
[ 0.000000]  [&lt;ffffffff81f37691&gt;] ? loglevel+0x31/0x31
[ 0.000000]  [&lt;ffffffff81f37a78&gt;] parse_early_param+0x31/0x3d
[ 0.000000]  [&lt;ffffffff81f3ae98&gt;] setup_arch+0x2de/0xc08
[ 0.000000]  [&lt;ffffffff8109629a&gt;] ? vprintk_default+0x1a/0x20
[ 0.000000]  [&lt;ffffffff81f37b20&gt;] start_kernel+0x90/0x423
[ 0.000000]  [&lt;ffffffff81f37495&gt;] x86_64_start_reservations+0x2a/0x2c
[ 0.000000]  [&lt;ffffffff81f37582&gt;] x86_64_start_kernel+0xeb/0xef
[ 0.000000] RIP 0xffffffff81ba2efc

This panic is not reproducible with "efi=" as this will result in a non-NULL
zero-length string.

Thus, verify that the pointer to the parameter string is not NULL. This is
consistent with other parameter-parsing functions which check for NULL pointers.

Signed-off-by: Ricardo Neri &lt;ricardo.neri-calderon@linux.intel.com&gt;
Cc: Dave Young &lt;dyoung@redhat.com&gt;
Signed-off-by: Matt Fleming &lt;matt.fleming@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>x86/mm: Add parenthesis for TLB tracepoint size calculation</title>
<updated>2015-08-10T19:21:57+00:00</updated>
<author>
<name>Dave Hansen</name>
<email>dave.hansen@linux.intel.com</email>
</author>
<published>2015-07-20T23:01:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=5728ec989adce2f303000b84469750579f162c2d'/>
<id>5728ec989adce2f303000b84469750579f162c2d</id>
<content type='text'>
commit bbc03778b9954a2ec93baed63718e4df0192f130 upstream.

flush_tlb_info-&gt;flush_start/end are both normal virtual
addresses.  When calculating 'nr_pages' (only used for the
tracepoint), I neglected to put parenthesis in.

Thanks to David Koufaty for pointing this out.

Signed-off-by: Dave Hansen &lt;dave.hansen@linux.intel.com&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: dave@sr71.net
Link: http://lkml.kernel.org/r/20150720230153.9E834081@viggo.jf.intel.com
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit bbc03778b9954a2ec93baed63718e4df0192f130 upstream.

flush_tlb_info-&gt;flush_start/end are both normal virtual
addresses.  When calculating 'nr_pages' (only used for the
tracepoint), I neglected to put parenthesis in.

Thanks to David Koufaty for pointing this out.

Signed-off-by: Dave Hansen &lt;dave.hansen@linux.intel.com&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: dave@sr71.net
Link: http://lkml.kernel.org/r/20150720230153.9E834081@viggo.jf.intel.com
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>x86, perf: Fix static_key bug in load_mm_cr4()</title>
<updated>2015-08-10T19:21:54+00:00</updated>
<author>
<name>Peter Zijlstra</name>
<email>peterz@infradead.org</email>
</author>
<published>2015-07-09T17:23:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=68b9e67311ca10a0bdce6ab2939ca0ff3ebac91b'/>
<id>68b9e67311ca10a0bdce6ab2939ca0ff3ebac91b</id>
<content type='text'>
commit a833581e372a4adae2319d8dc379493edbc444e9 upstream.

Mikulas reported his K6-3 not booting. This is because the
static_key API confusion struck and bit Andy, this wants to be
static_key_false().

Reported-by: Mikulas Patocka &lt;mpatocka@redhat.com&gt;
Tested-by: Mikulas Patocka &lt;mpatocka@redhat.com&gt;
Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Cc: Andrea Arcangeli &lt;aarcange@redhat.com&gt;
Cc: Andy Lutomirski &lt;luto@amacapital.net&gt;
Cc: Arnaldo Carvalho de Melo &lt;acme@kernel.org&gt;
Cc: Borislav Petkov &lt;bp@alien8.de&gt;
Cc: Brian Gerst &lt;brgerst@gmail.com&gt;
Cc: Denys Vlasenko &lt;dvlasenk@redhat.com&gt;
Cc: H. Peter Anvin &lt;hpa@zytor.com&gt;
Cc: Kees Cook &lt;keescook@chromium.org&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Paul Mackerras &lt;paulus@samba.org&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Valdis Kletnieks &lt;Valdis.Kletnieks@vt.edu&gt;
Cc: Vince Weaver &lt;vince@deater.net&gt;
Cc: hillf.zj &lt;hillf.zj@alibaba-inc.com&gt;
Fixes: a66734297f78 ("perf/x86: Add /sys/devices/cpu/rdpmc=2 to allow rdpmc for all tasks")
Link: http://lkml.kernel.org/r/20150709172338.GC19282@twins.programming.kicks-ass.net
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit a833581e372a4adae2319d8dc379493edbc444e9 upstream.

Mikulas reported his K6-3 not booting. This is because the
static_key API confusion struck and bit Andy, this wants to be
static_key_false().

Reported-by: Mikulas Patocka &lt;mpatocka@redhat.com&gt;
Tested-by: Mikulas Patocka &lt;mpatocka@redhat.com&gt;
Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Cc: Andrea Arcangeli &lt;aarcange@redhat.com&gt;
Cc: Andy Lutomirski &lt;luto@amacapital.net&gt;
Cc: Arnaldo Carvalho de Melo &lt;acme@kernel.org&gt;
Cc: Borislav Petkov &lt;bp@alien8.de&gt;
Cc: Brian Gerst &lt;brgerst@gmail.com&gt;
Cc: Denys Vlasenko &lt;dvlasenk@redhat.com&gt;
Cc: H. Peter Anvin &lt;hpa@zytor.com&gt;
Cc: Kees Cook &lt;keescook@chromium.org&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Paul Mackerras &lt;paulus@samba.org&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Valdis Kletnieks &lt;Valdis.Kletnieks@vt.edu&gt;
Cc: Vince Weaver &lt;vince@deater.net&gt;
Cc: hillf.zj &lt;hillf.zj@alibaba-inc.com&gt;
Fixes: a66734297f78 ("perf/x86: Add /sys/devices/cpu/rdpmc=2 to allow rdpmc for all tasks")
Link: http://lkml.kernel.org/r/20150709172338.GC19282@twins.programming.kicks-ass.net
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>x86/kasan: Fix boot crash on AMD processors</title>
<updated>2015-08-10T19:21:52+00:00</updated>
<author>
<name>Andrey Ryabinin</name>
<email>a.ryabinin@samsung.com</email>
</author>
<published>2015-07-02T09:09:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=6b12a75d0777a320a691a5f7a38aab2f4e80a733'/>
<id>6b12a75d0777a320a691a5f7a38aab2f4e80a733</id>
<content type='text'>
commit d4f86beacc21d538dc41e1fc75a22e084f547edf upstream.

While populating zero shadow wrong bits in upper level page
tables used. __PAGE_KERNEL_RO that was used for pgd/pud/pmd has
_PAGE_BIT_GLOBAL set. Global bit is present only in the lowest
level of the page translation hierarchy (ptes), and it should be
zero in upper levels.

This bug seems doesn't cause any troubles on Intel cpus, while
on AMDs it cause kernel crash on boot.

Use _KERNPG_TABLE bits for pgds/puds/pmds to fix this.

Reported-by: Borislav Petkov &lt;bp@alien8.de&gt;
Signed-off-by: Andrey Ryabinin &lt;a.ryabinin@samsung.com&gt;
Cc: Alexander Popov &lt;alpopov@ptsecurity.com&gt;
Cc: Alexander Potapenko &lt;glider@google.com&gt;
Cc: Andrey Konovalov &lt;adech.fo@gmail.com&gt;
Cc: Dmitry Vyukov &lt;dvyukov@google.com&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Link: http://lkml.kernel.org/r/1435828178-10975-5-git-send-email-a.ryabinin@samsung.com
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit d4f86beacc21d538dc41e1fc75a22e084f547edf upstream.

While populating zero shadow wrong bits in upper level page
tables used. __PAGE_KERNEL_RO that was used for pgd/pud/pmd has
_PAGE_BIT_GLOBAL set. Global bit is present only in the lowest
level of the page translation hierarchy (ptes), and it should be
zero in upper levels.

This bug seems doesn't cause any troubles on Intel cpus, while
on AMDs it cause kernel crash on boot.

Use _KERNPG_TABLE bits for pgds/puds/pmds to fix this.

Reported-by: Borislav Petkov &lt;bp@alien8.de&gt;
Signed-off-by: Andrey Ryabinin &lt;a.ryabinin@samsung.com&gt;
Cc: Alexander Popov &lt;alpopov@ptsecurity.com&gt;
Cc: Alexander Potapenko &lt;glider@google.com&gt;
Cc: Andrey Konovalov &lt;adech.fo@gmail.com&gt;
Cc: Dmitry Vyukov &lt;dvyukov@google.com&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Link: http://lkml.kernel.org/r/1435828178-10975-5-git-send-email-a.ryabinin@samsung.com
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>x86/kasan: Flush TLBs after switching CR3</title>
<updated>2015-08-10T19:21:52+00:00</updated>
<author>
<name>Andrey Ryabinin</name>
<email>a.ryabinin@samsung.com</email>
</author>
<published>2015-07-02T09:09:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=bcb87bb5a5c1f990e584c6003e50869087bc2646'/>
<id>bcb87bb5a5c1f990e584c6003e50869087bc2646</id>
<content type='text'>
commit 241d2c54c62fa0939fc9a9512b48ac3434e90a89 upstream.

load_cr3() doesn't cause tlb_flush if PGE enabled.

This may cause tons of false positive reports spamming the
kernel to death.

To fix this __flush_tlb_all() should be called explicitly
after CR3 changed.

Signed-off-by: Andrey Ryabinin &lt;a.ryabinin@samsung.com&gt;
Cc: Alexander Popov &lt;alpopov@ptsecurity.com&gt;
Cc: Alexander Potapenko &lt;glider@google.com&gt;
Cc: Andrey Konovalov &lt;adech.fo@gmail.com&gt;
Cc: Borislav Petkov &lt;bp@alien8.de&gt;
Cc: Dmitry Vyukov &lt;dvyukov@google.com&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Link: http://lkml.kernel.org/r/1435828178-10975-4-git-send-email-a.ryabinin@samsung.com
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 241d2c54c62fa0939fc9a9512b48ac3434e90a89 upstream.

load_cr3() doesn't cause tlb_flush if PGE enabled.

This may cause tons of false positive reports spamming the
kernel to death.

To fix this __flush_tlb_all() should be called explicitly
after CR3 changed.

Signed-off-by: Andrey Ryabinin &lt;a.ryabinin@samsung.com&gt;
Cc: Alexander Popov &lt;alpopov@ptsecurity.com&gt;
Cc: Alexander Potapenko &lt;glider@google.com&gt;
Cc: Andrey Konovalov &lt;adech.fo@gmail.com&gt;
Cc: Borislav Petkov &lt;bp@alien8.de&gt;
Cc: Dmitry Vyukov &lt;dvyukov@google.com&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Link: http://lkml.kernel.org/r/1435828178-10975-4-git-send-email-a.ryabinin@samsung.com
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>x86/kasan: Fix KASAN shadow region page tables</title>
<updated>2015-08-10T19:21:52+00:00</updated>
<author>
<name>Alexander Popov</name>
<email>alpopov@ptsecurity.com</email>
</author>
<published>2015-07-02T09:09:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=2fe36f4f2f2ae489cb7ab431b9a35947d426bbbb'/>
<id>2fe36f4f2f2ae489cb7ab431b9a35947d426bbbb</id>
<content type='text'>
commit 5d5aa3cfca5cf74cd928daf3674642e6004328d1 upstream.

Currently KASAN shadow region page tables created without
respect of physical offset (phys_base). This causes kernel halt
when phys_base is not zero.

So let's initialize KASAN shadow region page tables in
kasan_early_init() using __pa_nodebug() which considers
phys_base.

This patch also separates x86_64_start_kernel() from KASAN low
level details by moving kasan_map_early_shadow(init_level4_pgt)
into kasan_early_init().

Remove the comment before clear_bss() which stopped bringing
much profit to the code readability. Otherwise describing all
the new order dependencies would be too verbose.

Signed-off-by: Alexander Popov &lt;alpopov@ptsecurity.com&gt;
Signed-off-by: Andrey Ryabinin &lt;a.ryabinin@samsung.com&gt;
Cc: Alexander Potapenko &lt;glider@google.com&gt;
Cc: Andrey Konovalov &lt;adech.fo@gmail.com&gt;
Cc: Borislav Petkov &lt;bp@alien8.de&gt;
Cc: Dmitry Vyukov &lt;dvyukov@google.com&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Link: http://lkml.kernel.org/r/1435828178-10975-3-git-send-email-a.ryabinin@samsung.com
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 5d5aa3cfca5cf74cd928daf3674642e6004328d1 upstream.

Currently KASAN shadow region page tables created without
respect of physical offset (phys_base). This causes kernel halt
when phys_base is not zero.

So let's initialize KASAN shadow region page tables in
kasan_early_init() using __pa_nodebug() which considers
phys_base.

This patch also separates x86_64_start_kernel() from KASAN low
level details by moving kasan_map_early_shadow(init_level4_pgt)
into kasan_early_init().

Remove the comment before clear_bss() which stopped bringing
much profit to the code readability. Otherwise describing all
the new order dependencies would be too verbose.

Signed-off-by: Alexander Popov &lt;alpopov@ptsecurity.com&gt;
Signed-off-by: Andrey Ryabinin &lt;a.ryabinin@samsung.com&gt;
Cc: Alexander Potapenko &lt;glider@google.com&gt;
Cc: Andrey Konovalov &lt;adech.fo@gmail.com&gt;
Cc: Borislav Petkov &lt;bp@alien8.de&gt;
Cc: Dmitry Vyukov &lt;dvyukov@google.com&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Link: http://lkml.kernel.org/r/1435828178-10975-3-git-send-email-a.ryabinin@samsung.com
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>x86/init: Clear 'init_level4_pgt' earlier</title>
<updated>2015-08-10T19:21:52+00:00</updated>
<author>
<name>Andrey Ryabinin</name>
<email>a.ryabinin@samsung.com</email>
</author>
<published>2015-07-02T09:09:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=16e28fc11cd6a2d04a488486cb7c945168dc2a8d'/>
<id>16e28fc11cd6a2d04a488486cb7c945168dc2a8d</id>
<content type='text'>
commit d0f77d4d04b222a817925d33ba3589b190bfa863 upstream.

Currently x86_64_start_kernel() has two KASAN related
function calls. The first call maps shadow to early_level4_pgt,
the second maps shadow to init_level4_pgt.

If we move clear_page(init_level4_pgt) earlier, we could hide
KASAN low level detail from generic x86_64 initialization code.
The next patch will do it.

Signed-off-by: Andrey Ryabinin &lt;a.ryabinin@samsung.com&gt;
Cc: Alexander Popov &lt;alpopov@ptsecurity.com&gt;
Cc: Alexander Potapenko &lt;glider@google.com&gt;
Cc: Andrey Konovalov &lt;adech.fo@gmail.com&gt;
Cc: Borislav Petkov &lt;bp@alien8.de&gt;
Cc: Dmitry Vyukov &lt;dvyukov@google.com&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Link: http://lkml.kernel.org/r/1435828178-10975-2-git-send-email-a.ryabinin@samsung.com
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit d0f77d4d04b222a817925d33ba3589b190bfa863 upstream.

Currently x86_64_start_kernel() has two KASAN related
function calls. The first call maps shadow to early_level4_pgt,
the second maps shadow to init_level4_pgt.

If we move clear_page(init_level4_pgt) earlier, we could hide
KASAN low level detail from generic x86_64 initialization code.
The next patch will do it.

Signed-off-by: Andrey Ryabinin &lt;a.ryabinin@samsung.com&gt;
Cc: Alexander Popov &lt;alpopov@ptsecurity.com&gt;
Cc: Alexander Potapenko &lt;glider@google.com&gt;
Cc: Andrey Konovalov &lt;adech.fo@gmail.com&gt;
Cc: Borislav Petkov &lt;bp@alien8.de&gt;
Cc: Dmitry Vyukov &lt;dvyukov@google.com&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Link: http://lkml.kernel.org/r/1435828178-10975-2-git-send-email-a.ryabinin@samsung.com
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>x86/mpx: Do not set -&gt;vm_ops on MPX VMAs</title>
<updated>2015-08-03T16:29:19+00:00</updated>
<author>
<name>Kirill A. Shutemov</name>
<email>kirill.shutemov@linux.intel.com</email>
</author>
<published>2015-07-20T21:29:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=eee18465135ca687330666ce1886603c3c265ae5'/>
<id>eee18465135ca687330666ce1886603c3c265ae5</id>
<content type='text'>
commit a89652769470d12cd484ee3d3f7bde0742be8d96 upstream.

MPX setups private anonymous mapping, but uses vma-&gt;vm_ops too.
This can confuse core VM, as it relies on vm-&gt;vm_ops to
distinguish file VMAs from anonymous.

As result we will get SIGBUS, because handle_pte_fault() thinks
it's file VMA without vm_ops-&gt;fault and it doesn't know how to
handle the situation properly.

Let's fix that by not setting -&gt;vm_ops.

We don't really need -&gt;vm_ops here: MPX VMA can be detected with
VM_MPX flag. And vma_merge() will not merge MPX VMA with non-MPX
VMA, because -&gt;vm_flags won't match.

The only thing left is name of VMA. I'm not sure if it's part of
ABI, or we can just drop it. The patch keep it by providing
arch_vma_name() on x86.

Signed-off-by: Kirill A. Shutemov &lt;kirill.shutemov@linux.intel.com&gt;
Signed-off-by: Dave Hansen &lt;dave.hansen@linux.intel.com&gt;
Cc: Andy Lutomirski &lt;luto@amacapital.net&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: dave@sr71.net
Link: http://lkml.kernel.org/r/20150720212958.305CC3E9@viggo.jf.intel.com
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;


</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit a89652769470d12cd484ee3d3f7bde0742be8d96 upstream.

MPX setups private anonymous mapping, but uses vma-&gt;vm_ops too.
This can confuse core VM, as it relies on vm-&gt;vm_ops to
distinguish file VMAs from anonymous.

As result we will get SIGBUS, because handle_pte_fault() thinks
it's file VMA without vm_ops-&gt;fault and it doesn't know how to
handle the situation properly.

Let's fix that by not setting -&gt;vm_ops.

We don't really need -&gt;vm_ops here: MPX VMA can be detected with
VM_MPX flag. And vma_merge() will not merge MPX VMA with non-MPX
VMA, because -&gt;vm_flags won't match.

The only thing left is name of VMA. I'm not sure if it's part of
ABI, or we can just drop it. The patch keep it by providing
arch_vma_name() on x86.

Signed-off-by: Kirill A. Shutemov &lt;kirill.shutemov@linux.intel.com&gt;
Signed-off-by: Dave Hansen &lt;dave.hansen@linux.intel.com&gt;
Cc: Andy Lutomirski &lt;luto@amacapital.net&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: dave@sr71.net
Link: http://lkml.kernel.org/r/20150720212958.305CC3E9@viggo.jf.intel.com
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;


</pre>
</div>
</content>
</entry>
</feed>
