<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/arch/x86/kernel/alternative.c, branch linux-3.18.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.18.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.18.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2014-04-24T08:03:02Z</updated>
<entry>
<title>kprobes, x86: Allow kprobes on text_poke/hw_breakpoint</title>
<updated>2014-04-24T08:03:02Z</updated>
<author>
<name>Masami Hiramatsu</name>
</author>
<published>2014-04-17T08:18:07Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9c54b6164eeb292a0eac86c6913bd8daaff35e62'/>
<id>urn:sha1:9c54b6164eeb292a0eac86c6913bd8daaff35e62</id>
<content type='text'>
Allow kprobes on text_poke/hw_breakpoint because
those are not related to the critical int3-debug
recursive path of kprobes at this moment.

Signed-off-by: Masami Hiramatsu &lt;masami.hiramatsu.pt@hitachi.com&gt;
Reviewed-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: Borislav Petkov &lt;bp@suse.de&gt;
Cc: Fengguang Wu &lt;fengguang.wu@intel.com&gt;
Cc: Jiri Kosina &lt;jkosina@suse.cz&gt;
Cc: Oleg Nesterov &lt;oleg@redhat.com&gt;
Cc: Paul Gortmaker &lt;paul.gortmaker@windriver.com&gt;
Link: http://lkml.kernel.org/r/20140417081807.26341.73219.stgit@ltc230.yrl.intra.hitachi.co.jp
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</content>
</entry>
<entry>
<title>lockdep, x86/alternatives: Drop ancient lockdep fixup message</title>
<updated>2013-09-28T08:09:41Z</updated>
<author>
<name>Borislav Petkov</name>
</author>
<published>2013-09-27T14:34:42Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2a929242ee50db84c1a561c81897bb0551f2c32f'/>
<id>urn:sha1:2a929242ee50db84c1a561c81897bb0551f2c32f</id>
<content type='text'>
It messes up the output of the nodes/cores bootup table and it
is obsolete anyway, see

  17abecfe651c x86: fix up alternatives with lockdep enabled

Signed-off-by: Borislav Petkov &lt;bp@suse.de&gt;
Cc: huawei.libin@huawei.com
Cc: wangyijing@huawei.com
Cc: fenghua.yu@intel.com
Cc: guohanjun@huawei.com
Cc: paul.gortmaker@windriver.com
Link: http://lkml.kernel.org/r/20130927143442.GE4422@pd.tnic
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</content>
</entry>
<entry>
<title>kprobes/x86: Call out into INT3 handler directly instead of using notifier</title>
<updated>2013-07-23T08:12:57Z</updated>
<author>
<name>Jiri Kosina</name>
</author>
<published>2013-07-23T08:09:28Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=17f41571bb2c4a398785452ac2718a6c5d77180e'/>
<id>urn:sha1:17f41571bb2c4a398785452ac2718a6c5d77180e</id>
<content type='text'>
In fd4363fff3d96 ("x86: Introduce int3 (breakpoint)-based
instruction patching"), the mechanism that was introduced for
notifying alternatives code from int3 exception handler that and
exception occured was die_notifier.

This is however problematic, as early code might be using jump
labels even before the notifier registration has been performed,
which will then lead to an oops due to unhandled exception. One
of such occurences has been encountered by Fengguang:

 int3: 0000 [#1] PREEMPT SMP DEBUG_PAGEALLOC
 Modules linked in:
 CPU: 1 PID: 0 Comm: swapper/1 Not tainted 3.11.0-rc1-01429-g04bf576 #8
 task: ffff88000da1b040 ti: ffff88000da1c000 task.ti: ffff88000da1c000
 RIP: 0010:[&lt;ffffffff811098cc&gt;]  [&lt;ffffffff811098cc&gt;] ttwu_do_wakeup+0x28/0x225
 RSP: 0000:ffff88000dd03f10  EFLAGS: 00000006
 RAX: 0000000000000000 RBX: ffff88000dd12940 RCX: ffffffff81769c40
 RDX: 0000000000000002 RSI: 0000000000000000 RDI: 0000000000000001
 RBP: ffff88000dd03f28 R08: ffffffff8176a8c0 R09: 0000000000000002
 R10: ffffffff810ff484 R11: ffff88000dd129e8 R12: ffff88000dbc90c0
 R13: ffff88000dbc90c0 R14: ffff88000da1dfd8 R15: ffff88000da1dfd8
 FS:  0000000000000000(0000) GS:ffff88000dd00000(0000) knlGS:0000000000000000
 CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
 CR2: 00000000ffffffff CR3: 0000000001c88000 CR4: 00000000000006e0
 Stack:
  ffff88000dd12940 ffff88000dbc90c0 ffff88000da1dfd8 ffff88000dd03f48
  ffffffff81109e2b ffff88000dd12940 0000000000000000 ffff88000dd03f68
  ffffffff81109e9e 0000000000000000 0000000000012940 ffff88000dd03f98
 Call Trace:
  &lt;IRQ&gt;
  [&lt;ffffffff81109e2b&gt;] ttwu_do_activate.constprop.56+0x6d/0x79
  [&lt;ffffffff81109e9e&gt;] sched_ttwu_pending+0x67/0x84
  [&lt;ffffffff8110c845&gt;] scheduler_ipi+0x15a/0x2b0
  [&lt;ffffffff8104dfb4&gt;] smp_reschedule_interrupt+0x38/0x41
  [&lt;ffffffff8173bf5d&gt;] reschedule_interrupt+0x6d/0x80
  &lt;EOI&gt;
  [&lt;ffffffff810ff484&gt;] ? __atomic_notifier_call_chain+0x5/0xc1
  [&lt;ffffffff8105cc30&gt;] ? native_safe_halt+0xd/0x16
  [&lt;ffffffff81015f10&gt;] default_idle+0x147/0x282
  [&lt;ffffffff81017026&gt;] arch_cpu_idle+0x3d/0x5d
  [&lt;ffffffff81127d6a&gt;] cpu_idle_loop+0x46d/0x5db
  [&lt;ffffffff81127f5c&gt;] cpu_startup_entry+0x84/0x84
  [&lt;ffffffff8104f4f8&gt;] start_secondary+0x3c8/0x3d5
  [...]

Fix this by directly calling poke_int3_handler() from the int3
exception handler (analogically to what ftrace has been doing
already), instead of relying on notifier, registration of which
might not have yet been finalized by the time of the first trap.

Reported-and-tested-by: Fengguang Wu &lt;fengguang.wu@intel.com&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
Acked-by: Masami Hiramatsu &lt;masami.hiramatsu.pt@hitachi.com&gt;
Cc: H. Peter Anvin &lt;hpa@linux.intel.com&gt;
Cc: Fengguang Wu &lt;fengguang.wu@intel.com&gt;
Cc: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Link: http://lkml.kernel.org/r/alpine.LNX.2.00.1307231007490.14024@pobox.suse.cz
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</content>
</entry>
<entry>
<title>kprobes/x86: Remove unused text_poke_smp() and text_poke_smp_batch() functions</title>
<updated>2013-07-19T07:57:04Z</updated>
<author>
<name>Masami Hiramatsu</name>
</author>
<published>2013-07-18T11:47:53Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ea8596bb2d8d37957f3e92db9511c50801689180'/>
<id>urn:sha1:ea8596bb2d8d37957f3e92db9511c50801689180</id>
<content type='text'>
Since introducing the text_poke_bp() for all text_poke_smp*()
callers, text_poke_smp*() are now unused. This patch basically
reverts:

  3d55cc8a058e ("x86: Add text_poke_smp for SMP cross modifying code")
  7deb18dcf047 ("x86: Introduce text_poke_smp_batch() for batch-code modifying")

and related commits.

This patch also fixes a Kconfig dependency issue on STOP_MACHINE
in the case of CONFIG_SMP &amp;&amp; !CONFIG_MODULE_UNLOAD.

Signed-off-by: Masami Hiramatsu &lt;masami.hiramatsu.pt@hitachi.com&gt;
Reviewed-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
Cc: H. Peter Anvin &lt;hpa@linux.intel.com&gt;
Cc: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Cc: Jason Baron &lt;jbaron@akamai.com&gt;
Cc: yrl.pp-manager.tt@hitachi.com
Cc: Borislav Petkov &lt;bpetkov@suse.de&gt;
Link: http://lkml.kernel.org/r/20130718114753.26675.18714.stgit@mhiramat-M0-7522
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</content>
</entry>
<entry>
<title>x86: Introduce int3 (breakpoint)-based instruction patching</title>
<updated>2013-07-17T00:55:29Z</updated>
<author>
<name>Jiri Kosina</name>
</author>
<published>2013-07-12T09:21:48Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=fd4363fff3d96795d3feb1b3fb48ce590f186bdd'/>
<id>urn:sha1:fd4363fff3d96795d3feb1b3fb48ce590f186bdd</id>
<content type='text'>
Introduce a method for run-time instruction patching on a live SMP kernel
based on int3 breakpoint, completely avoiding the need for stop_machine().

The way this is achieved:

	- add a int3 trap to the address that will be patched
	- sync cores
	- update all but the first byte of the patched range
	- sync cores
	- replace the first byte (int3) by the first byte of
	  replacing opcode
	- sync cores

According to

	http://lkml.indiana.edu/hypermail/linux/kernel/1001.1/01530.html

synchronization after replacing "all but first" instructions should not
be necessary (on Intel hardware), as the syncing after the subsequent
patching of the first byte provides enough safety.
But there's not only Intel HW out there, and we'd rather be on a safe
side.

If any CPU instruction execution would collide with the patching,
it'd be trapped by the int3 breakpoint and redirected to the provided
"handler" (which would typically mean just skipping over the patched
region, acting as "nop" has been there, in case we are doing nop -&gt; jump
and jump -&gt; nop transitions).

Ftrace has been using this very technique since 08d636b ("ftrace/x86:
Have arch x86_64 use breakpoints instead of stop machine") for ages
already, and jump labels are another obvious potential user of this.

Based on activities of Masami Hiramatsu &lt;masami.hiramatsu.pt@hitachi.com&gt;
a few years ago.

Reviewed-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Reviewed-by: Masami Hiramatsu &lt;masami.hiramatsu.pt@hitachi.com&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
Link: http://lkml.kernel.org/r/alpine.LNX.2.00.1307121102440.29788@pobox.suse.cz
Signed-off-by: H. Peter Anvin &lt;hpa@linux.intel.com&gt;
</content>
</entry>
<entry>
<title>x86, cpu: Expand cpufeature facility to include cpu bugs</title>
<updated>2013-04-02T17:12:52Z</updated>
<author>
<name>Borislav Petkov</name>
</author>
<published>2013-03-20T14:07:23Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=65fc985b37dc241c4db7cd32adcbc989193fe3c8'/>
<id>urn:sha1:65fc985b37dc241c4db7cd32adcbc989193fe3c8</id>
<content type='text'>
We add another 32-bit vector at the end of the -&gt;x86_capability
bitvector which collects bugs present in CPUs. After all, a CPU bug is a
kind of a capability, albeit a strange one.

Signed-off-by: Borislav Petkov &lt;bp@suse.de&gt;
Link: http://lkml.kernel.org/r/1363788448-31325-2-git-send-email-bp@alien8.de
Signed-off-by: H. Peter Anvin &lt;hpa@zytor.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'x86-cleanups-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip</title>
<updated>2012-10-01T17:47:45Z</updated>
<author>
<name>Linus Torvalds</name>
</author>
<published>2012-10-01T17:47:45Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=08815bc267291ea0a4f7f348290efc555444d7a8'/>
<id>urn:sha1:08815bc267291ea0a4f7f348290efc555444d7a8</id>
<content type='text'>
Pull x86/cleanups from Ingo Molnar:
 "Smaller cleanups"

* 'x86-cleanups-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  arch/x86: Remove unecessary semicolons
  x86, boot: Remove obsolete and unused constant RAMDISK
</content>
</entry>
<entry>
<title>Merge branch 'x86-asm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip</title>
<updated>2012-10-01T17:46:27Z</updated>
<author>
<name>Linus Torvalds</name>
</author>
<published>2012-10-01T17:46:27Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=da8347969f324db5f572581397d9b3a8e108cda4'/>
<id>urn:sha1:da8347969f324db5f572581397d9b3a8e108cda4</id>
<content type='text'>
Pull x86/asm changes from Ingo Molnar:
 "The one change that stands out is the alternatives patching change
  that prevents us from ever patching back instructions from SMP to UP:
  this simplifies things and speeds up CPU hotplug.

  Other than that it's smaller fixes, cleanups and improvements."

* 'x86-asm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86: Unspaghettize do_trap()
  x86_64: Work around old GAS bug
  x86: Use REP BSF unconditionally
  x86: Prefer TZCNT over BFS
  x86/64: Adjust types of temporaries used by ffs()/fls()/fls64()
  x86: Drop unnecessary kernel_eflags variable on 64-bit
  x86/smp: Don't ever patch back to UP if we unplug cpus
</content>
</entry>
<entry>
<title>arch/x86: Remove unecessary semicolons</title>
<updated>2012-09-19T15:32:48Z</updated>
<author>
<name>Peter Senna Tschudin</name>
</author>
<published>2012-09-18T16:36:14Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4b8073e467e6a66b6a5a8e799d28bc3b243c0d78'/>
<id>urn:sha1:4b8073e467e6a66b6a5a8e799d28bc3b243c0d78</id>
<content type='text'>
Found by http://coccinelle.lip6.fr/

Signed-off-by: Peter Senna Tschudin &lt;peter.senna@gmail.com&gt;
Cc: avi@redhat.com
Cc: mtosatti@redhat.com
Cc: a.p.zijlstra@chello.nl
Cc: rusty@rustcorp.com.au
Cc: masami.hiramatsu.pt@hitachi.com
Cc: suresh.b.siddha@intel.com
Cc: joerg.roedel@amd.com
Cc: agordeev@redhat.com
Cc: yinghai@kernel.org
Cc: bhelgaas@google.com
Cc: liuj97@gmail.com
Link: http://lkml.kernel.org/r/1347986174-30287-7-git-send-email-peter.senna@gmail.com
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</content>
</entry>
<entry>
<title>x86/smp: Don't ever patch back to UP if we unplug cpus</title>
<updated>2012-08-23T08:45:13Z</updated>
<author>
<name>Rusty Russell</name>
</author>
<published>2012-08-06T07:59:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=816afe4ff98ee10b1d30fd66361be132a0a5cee6'/>
<id>urn:sha1:816afe4ff98ee10b1d30fd66361be132a0a5cee6</id>
<content type='text'>
We still patch SMP instructions to UP variants if we boot with a
single CPU, but not at any other time.  In particular, not if we
unplug CPUs to return to a single cpu.

Paul McKenney points out:

 mean offline overhead is 6251/48=130.2 milliseconds.

 If I remove the alternatives_smp_switch() from the offline
 path [...] the mean offline overhead is 550/42=13.1 milliseconds

Basically, we're never going to get those 120ms back, and the
code is pretty messy.

We get rid of:

 1) The "smp-alt-once" boot option. It's actually "smp-alt-boot", the
    documentation is wrong. It's now the default.

 2) The skip_smp_alternatives flag used by suspend.

 3) arch_disable_nonboot_cpus_begin() and arch_disable_nonboot_cpus_end()
    which were only used to set this one flag.

Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
Cc: Paul McKenney &lt;paul.mckenney@us.ibm.com&gt;
Cc: Suresh Siddha &lt;suresh.b.siddha@intel.com&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Link: http://lkml.kernel.org/r/87vcgwwive.fsf@rustcorp.com.au
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</content>
</entry>
</feed>
