<feed xmlns='http://www.w3.org/2005/Atom'>
<title>lwn.git/arch/x86/kernel/dumpstack.c, branch v4.18-rc5</title>
<subtitle>Linux kernel documentation tree maintained by Jonathan Corbet</subtitle>
<id>http://mirrors.hust.edu.cn/git/lwn.git/atom?h=v4.18-rc5</id>
<link rel='self' href='http://mirrors.hust.edu.cn/git/lwn.git/atom?h=v4.18-rc5'/>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/'/>
<updated>2018-04-26T14:15:28+00:00</updated>
<entry>
<title>x86/dumpstack: Explain the reasoning for the prologue and buffer size</title>
<updated>2018-04-26T14:15:28+00:00</updated>
<author>
<name>Borislav Petkov</name>
<email>bp@suse.de</email>
</author>
<published>2018-04-17T16:11:24+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=4dba072cd097f35fa8f77c49d909ada2b079a4c4'/>
<id>urn:sha1:4dba072cd097f35fa8f77c49d909ada2b079a4c4</id>
<content type='text'>
The whole reasoning behind the amount of opcode bytes dumped and prologue
length isn't very clear so write down some of the reasons for why it is
done the way it is.

Signed-off-by: Borislav Petkov &lt;bp@suse.de&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Josh Poimboeuf &lt;jpoimboe@redhat.com&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Andy Lutomirski &lt;luto@amacapital.net&gt;
Link: https://lkml.kernel.org/r/20180417161124.5294-10-bp@alien8.de

</content>
</entry>
<entry>
<title>x86/dumpstack: Save first regs set for the executive summary</title>
<updated>2018-04-26T14:15:28+00:00</updated>
<author>
<name>Borislav Petkov</name>
<email>bp@suse.de</email>
</author>
<published>2018-04-17T16:11:23+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=602bd705da334f214fc03db328dc37d2f1f33307'/>
<id>urn:sha1:602bd705da334f214fc03db328dc37d2f1f33307</id>
<content type='text'>
Save the regs set when __die() is onvoked for the first time and print it
in oops_end().

Signed-off-by: Borislav Petkov &lt;bp@suse.de&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Josh Poimboeuf &lt;jpoimboe@redhat.com&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Andy Lutomirski &lt;luto@amacapital.net&gt;
Link: https://lkml.kernel.org/r/20180417161124.5294-9-bp@alien8.de

</content>
</entry>
<entry>
<title>x86/dumpstack: Add a show_ip() function</title>
<updated>2018-04-26T14:15:27+00:00</updated>
<author>
<name>Borislav Petkov</name>
<email>bp@suse.de</email>
</author>
<published>2018-04-17T16:11:22+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=7cccf0725cf7402514e09c52b089430005798b7f'/>
<id>urn:sha1:7cccf0725cf7402514e09c52b089430005798b7f</id>
<content type='text'>
... which shows the Instruction Pointer along with the insn bytes around
it. Use it whenever rIP is printed. Drop the rIP &lt; PAGE_OFFSET check since
probe_kernel_read() can handle any address properly.

Signed-off-by: Borislav Petkov &lt;bp@suse.de&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Josh Poimboeuf &lt;jpoimboe@redhat.com&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Andy Lutomirski &lt;luto@amacapital.net&gt;
Link: https://lkml.kernel.org/r/20180417161124.5294-8-bp@alien8.de

</content>
</entry>
<entry>
<title>x86/dumpstack: Add loglevel argument to show_opcodes()</title>
<updated>2018-04-26T14:15:26+00:00</updated>
<author>
<name>Borislav Petkov</name>
<email>bp@suse.de</email>
</author>
<published>2018-04-17T16:11:20+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=e8b6f984516b1fcb0ccf4469ca42777c9c2dc76d'/>
<id>urn:sha1:e8b6f984516b1fcb0ccf4469ca42777c9c2dc76d</id>
<content type='text'>
Will be used in the next patch.

Signed-off-by: Borislav Petkov &lt;bp@suse.de&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Josh Poimboeuf &lt;jpoimboe@redhat.com&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Andy Lutomirski &lt;luto@amacapital.net&gt;
Link: https://lkml.kernel.org/r/20180417161124.5294-6-bp@alien8.de

</content>
</entry>
<entry>
<title>x86/dumpstack: Improve opcodes dumping in the code section</title>
<updated>2018-04-26T14:15:26+00:00</updated>
<author>
<name>Borislav Petkov</name>
<email>bp@suse.de</email>
</author>
<published>2018-04-17T16:11:19+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=9e4a90fd34445df64a13d136676a31a4dd22aea3'/>
<id>urn:sha1:9e4a90fd34445df64a13d136676a31a4dd22aea3</id>
<content type='text'>
The code used to iterate byte-by-byte over the bytes around RIP and that
is expensive: disabling pagefaults around it, copy_from_user, etc...

Make it read the whole buffer of OPCODE_BUFSIZE size in one go. Use a
statically allocated 64 bytes buffer so that concurrent show_opcodes()
do not interleave in the output even though in the majority of the cases
it's serialized via die_lock. Except the #PF path which doesn't...

Also, do the PAGE_OFFSET check outside of the function because latter
will be reused in other context.

Signed-off-by: Borislav Petkov &lt;bp@suse.de&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Josh Poimboeuf &lt;jpoimboe@redhat.com&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Andy Lutomirski &lt;luto@amacapital.net&gt;
Link: https://lkml.kernel.org/r/20180417161124.5294-5-bp@alien8.de

</content>
</entry>
<entry>
<title>x86/dumpstack: Carve out code-dumping into a function</title>
<updated>2018-04-26T14:15:26+00:00</updated>
<author>
<name>Borislav Petkov</name>
<email>bp@suse.de</email>
</author>
<published>2018-04-17T16:11:18+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=f0a1d7c11c3ebe2f601b448d13e7fbc3a0364a03'/>
<id>urn:sha1:f0a1d7c11c3ebe2f601b448d13e7fbc3a0364a03</id>
<content type='text'>
No functionality change, carve it out into a separate function for later
changes.

Signed-off-by: Borislav Petkov &lt;bp@suse.de&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Josh Poimboeuf &lt;jpoimboe@redhat.com&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Andy Lutomirski &lt;luto@amacapital.net&gt;
Link: https://lkml.kernel.org/r/20180417161124.5294-4-bp@alien8.de

</content>
</entry>
<entry>
<title>x86/dumpstack: Unexport oops_begin()</title>
<updated>2018-04-26T14:15:26+00:00</updated>
<author>
<name>Borislav Petkov</name>
<email>bp@suse.de</email>
</author>
<published>2018-04-17T16:11:17+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=5df61707f0bdf8dce714a14806740e6abf2114c7'/>
<id>urn:sha1:5df61707f0bdf8dce714a14806740e6abf2114c7</id>
<content type='text'>
The only user outside of arch/ is not a module since

  86cd47334b00 ("ACPI, APEI, GHES, Prevent GHES to be built as module")

No functional changes.

Signed-off-by: Borislav Petkov &lt;bp@suse.de&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Josh Poimboeuf &lt;jpoimboe@redhat.com&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Andy Lutomirski &lt;luto@amacapital.net&gt;
Link: https://lkml.kernel.org/r/20180417161124.5294-3-bp@alien8.de

</content>
</entry>
<entry>
<title>x86/dumpstack: Remove code_bytes</title>
<updated>2018-04-26T14:15:25+00:00</updated>
<author>
<name>Borislav Petkov</name>
<email>bp@suse.de</email>
</author>
<published>2018-04-17T16:11:16+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=5d12f0424edf01ccd8abbcba1c7d45fe0b23c779'/>
<id>urn:sha1:5d12f0424edf01ccd8abbcba1c7d45fe0b23c779</id>
<content type='text'>
This was added by

  86c418374223 ("[PATCH] i386: add option to show more code in oops reports")

long time ago but experience shows that 64 instruction bytes are plenty
when deciphering an oops. So get rid of it.

Removing it will simplify further enhancements to the opcodes dumping
machinery coming in the following patches.

Signed-off-by: Borislav Petkov &lt;bp@suse.de&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Josh Poimboeuf &lt;jpoimboe@redhat.com&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Andy Lutomirski &lt;luto@amacapital.net&gt;
Link: https://lkml.kernel.org/r/20180417161124.5294-2-bp@alien8.de

</content>
</entry>
<entry>
<title>x86/dumpstack: Unify show_regs()</title>
<updated>2018-03-08T11:04:59+00:00</updated>
<author>
<name>Borislav Petkov</name>
<email>bp@suse.de</email>
</author>
<published>2018-03-06T09:49:14+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=16d1cb0bc43642a4d934631a73c5210ad2499e2f'/>
<id>urn:sha1:16d1cb0bc43642a4d934631a73c5210ad2499e2f</id>
<content type='text'>
The 32-bit version uses KERN_EMERG and commit

  b0f4c4b32c8e ("bugs, x86: Fix printk levels for panic, softlockups and stack dumps")

changed the 64-bit version to KERN_DEFAULT. The same justification in
that commit that those messages do not belong in the terminal, holds
true for 32-bit also, so make it so.

Make code_bytes static, while at it.

Signed-off-by: Borislav Petkov &lt;bp@suse.de&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Josh Poimboeuf &lt;jpoimboe@redhat.com&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Andy Lutomirski &lt;luto@amacapital.net&gt;
Link: https://lkml.kernel.org/r/20180306094920.16917-4-bp@alien8.de

</content>
</entry>
<entry>
<title>x86/dumpstack: Avoid uninitlized variable</title>
<updated>2018-02-02T22:33:50+00:00</updated>
<author>
<name>Arnd Bergmann</name>
<email>arnd@arndb.de</email>
</author>
<published>2018-02-02T14:56:17+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=ebfc15019cfa72496c674ffcb0b8ef10790dcddc'/>
<id>urn:sha1:ebfc15019cfa72496c674ffcb0b8ef10790dcddc</id>
<content type='text'>
In some configurations, 'partial' does not get initialized, as shown by
this gcc-8 warning:

arch/x86/kernel/dumpstack.c: In function 'show_trace_log_lvl':
arch/x86/kernel/dumpstack.c:156:4: error: 'partial' may be used uninitialized in this function [-Werror=maybe-uninitialized]
    show_regs_if_on_stack(&amp;stack_info, regs, partial);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This initializes it to false, to get the previous behavior in this case.

Fixes: a9cdbe72c4e8 ("x86/dumpstack: Fix partial register dumps")
Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Andi Kleen &lt;ak@linux.intel.com&gt;
Cc: Nicolas Pitre &lt;nico@linaro.org&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Dave Hansen &lt;dave.hansen@linux.intel.com&gt;
Cc: Andy Lutomirski &lt;luto@kernel.org&gt;
Cc: Josh Poimboeuf &lt;jpoimboe@redhat.com&gt;
Cc: Borislav Petkov &lt;bpetkov@suse.de&gt;
Cc: Vlastimil Babka &lt;vbabka@suse.cz&gt;
Link: https://lkml.kernel.org/r/20180202145634.200291-1-arnd@arndb.de

</content>
</entry>
</feed>
