<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/arch/x86/kernel/traps.c, branch linux-2.6.37.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-2.6.37.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-2.6.37.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2010-10-23T15:25:36Z</updated>
<entry>
<title>Merge branches 'softirq-for-linus', 'x86-debug-for-linus', 'x86-numa-for-linus', 'x86-quirks-for-linus', 'x86-setup-for-linus', 'x86-uv-for-linus' and 'x86-vm86-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip</title>
<updated>2010-10-23T15:25:36Z</updated>
<author>
<name>Linus Torvalds</name>
</author>
<published>2010-10-23T15:25:36Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=02f36038c568111ad4fc433f6fa760ff5e38fab4'/>
<id>urn:sha1:02f36038c568111ad4fc433f6fa760ff5e38fab4</id>
<content type='text'>
* 'softirq-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  softirqs: Make wakeup_softirqd static

* 'x86-debug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  x86, asm: Restore parentheses around one pushl_cfi argument
  x86, asm: Fix ancient-GAS workaround
  x86, asm: Fix CFI macro invocations to deal with shortcomings in gas

* 'x86-numa-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  x86, numa: Assign CPUs to nodes in round-robin manner on fake NUMA

* 'x86-quirks-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  x86: HPET force enable for CX700 / VIA Epia LT

* 'x86-setup-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  x86, setup: Use string copy operation to optimze copy in kernel compression

* 'x86-uv-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  x86, UV: Use allocated buffer in tlb_uv.c:tunables_read()

* 'x86-vm86-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  x86, vm86: Fix preemption bug for int1 debug and int3 breakpoint handlers.
</content>
</entry>
<entry>
<title>x86, vm86: Fix preemption bug for int1 debug and int3 breakpoint handlers.</title>
<updated>2010-09-23T18:07:49Z</updated>
<author>
<name>Bart Oldeman</name>
</author>
<published>2010-09-23T17:16:58Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6554287b1de0448f1e02e200d02b43914e997d15'/>
<id>urn:sha1:6554287b1de0448f1e02e200d02b43914e997d15</id>
<content type='text'>
Impact: fix kernel bug such as:
BUG: scheduling while atomic: dosemu.bin/19680/0x00000004
See also Ubuntu bug 455067 at
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/455067

Commits 4915a35e35a037254550a2ba9f367a812bc37d40
("Use preempt_conditional_sti/cli in do_int3, like on x86_64.")
and 3d2a71a596bd9c761c8487a2178e95f8a61da083
("x86, traps: converge do_debug handlers")
started disabling preemption in int1 and int3 handlers on i386.
The problem with vm86 is that the call to handle_vm86_trap() may jump
straight to entry_32.S and never returns so preempt is never enabled
again, and there is an imbalance in the preempt count.

Commit be716615fe596ee117292dc615e95f707fb67fd1 ("x86, vm86:
fix preemption bug"), which was later (accidentally?) reverted by commit
08d68323d1f0c34452e614263b212ca556dae47f ("hw-breakpoints: modifying
generic debug exception to use thread-specific debug registers")
fixed the problem for debug exceptions but not for breakpoints.

There are three solutions to this problem.

1. Reenable preemption before calling handle_vm86_trap(). This
was the approach that was later reverted.

2. Do not disable preemption for i386 in breakpoint and debug handlers.
This was the situation before October 2008. As far as I understand
preemption only needs to be disabled on x86_64 because a seperate stack is
used, but it's nice to have things work the same way on
i386 and x86_64.

3. Let handle_vm86_trap() return instead of jumping to assembly code.
By setting a flag in _TIF_WORK_MASK, either TIF_IRET or TIF_NOTIFY_RESUME,
the code in entry_32.S is instructed to return to 32 bit mode from
V86 mode. The logic in entry_32.S was already present to handle signals.
(I chose TIF_IRET because it's slightly more efficient in
do_notify_resume() in signal.c, but in fact TIF_IRET can probably be
replaced by TIF_NOTIFY_RESUME everywhere.)

I'm submitting approach 3, because I believe it is the most elegant
and prevents future confusion. Still, an obvious
preempt_conditional_cli(regs); is necessary in traps.c to correct the
bug.

[ hpa: This is technically a regression, but because:
  1. the regression is so old,
  2. the patch seems relatively high risk, justifying more testing, and
  3. we're late in the 2.6.36-rc cycle,

  I'm queuing it up for the 2.6.37 merge window.  It might, however,
  justify as a -stable backport at a latter time, hence Cc: stable. ]

Signed-off-by: Bart Oldeman &lt;bartoldeman@users.sourceforge.net&gt;
LKML-Reference: &lt;alpine.DEB.2.00.1009231312330.4732@localhost.localdomain&gt;
Cc: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Cc: K.Prasad &lt;prasad@linux.vnet.ibm.com&gt;
Cc: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Cc: Alexander van Heukelum &lt;heukelum@fastmail.fm&gt;
Cc: &lt;stable@kernel.org&gt;
Signed-off-by: H. Peter Anvin &lt;hpa@linux.intel.com&gt;
</content>
</entry>
<entry>
<title>x86-32, fpu: Remove math_emulate stub</title>
<updated>2010-09-09T21:17:11Z</updated>
<author>
<name>Brian Gerst</name>
</author>
<published>2010-09-04T01:17:15Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a334fe43d85f570ae907acf988a053c5eff78d6e'/>
<id>urn:sha1:a334fe43d85f570ae907acf988a053c5eff78d6e</id>
<content type='text'>
check_fpu() in bugs.c halts boot if no FPU is found and math emulation
isn't enabled.  Therefore this stub will never be used.

Signed-off-by: Brian Gerst &lt;brgerst@gmail.com&gt;
Acked-by: Pekka Enberg &lt;penberg@kernel.org&gt;
Cc: Suresh Siddha &lt;suresh.b.siddha@intel.com&gt;
LKML-Reference: &lt;1283563039-3466-9-git-send-email-brgerst@gmail.com&gt;
Signed-off-by: H. Peter Anvin &lt;hpa@linux.intel.com&gt;
</content>
</entry>
<entry>
<title>x86, fpu: Merge fpu_init()</title>
<updated>2010-09-09T21:16:20Z</updated>
<author>
<name>Brian Gerst</name>
</author>
<published>2010-09-04T01:17:09Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6ac8bac2684235f4caf22a410549c582aa7327d6'/>
<id>urn:sha1:6ac8bac2684235f4caf22a410549c582aa7327d6</id>
<content type='text'>
Make fpu_init() handle 32-bit setup.

Signed-off-by: Brian Gerst &lt;brgerst@gmail.com&gt;
Acked-by: Pekka Enberg &lt;penberg@kernel.org&gt;
Cc: Suresh Siddha &lt;suresh.b.siddha@intel.com&gt;
LKML-Reference: &lt;1283563039-3466-3-git-send-email-brgerst@gmail.com&gt;
Signed-off-by: H. Peter Anvin &lt;hpa@linux.intel.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'perf/nmi' into perf/core</title>
<updated>2010-08-05T06:45:05Z</updated>
<author>
<name>Ingo Molnar</name>
</author>
<published>2010-08-05T06:45:05Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=61be7fdec2f51b99570cd5dcc30c7848c8e56513'/>
<id>urn:sha1:61be7fdec2f51b99570cd5dcc30c7848c8e56513</id>
<content type='text'>
Conflicts:
	kernel/Makefile

Merge reason: Add the now complete topic, fix the conflict.

Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>x86: Send a SIGTRAP for user icebp traps</title>
<updated>2010-06-30T14:16:20Z</updated>
<author>
<name>Frederic Weisbecker</name>
</author>
<published>2010-06-30T13:09:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a1e80fafc9f0742a1776a0490258cb64912411b0'/>
<id>urn:sha1:a1e80fafc9f0742a1776a0490258cb64912411b0</id>
<content type='text'>
Before we had a generic breakpoint layer, x86 used to send a
sigtrap for any debug event that happened in userspace,
except if it was caused by lazy dr7 switches.

Currently we only send such signal for single step or breakpoint
events.

However, there are three other kind of debug exceptions:

- debug register access detected: trigger an exception if the
  next instruction touches the debug registers. We don't use
  it.
- task switch, but we don't use tss.
- icebp/int01 trap. This instruction (0xf1) is undocumented and
  generates an int 1 exception. Unlike single step through TF
  flag, it doesn't set the single step origin of the exception
  in dr6.

icebp then used to be reported in userspace using trap signals
but this have been incidentally broken with the new breakpoint
code. Reenable this. Since this is the only debug event that
doesn't set anything in dr6, this is all we have to check.

This fixes a regression in Wine where World Of Warcraft got broken
as it uses this for software protection checks purposes. And
probably other apps do.

Reported-and-tested-by: Alexandre Julliard &lt;julliard@winehq.org&gt;
Signed-off-by: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Cc: Ingo Molnar &lt;mingo@elte.hu&gt;
Cc: H. Peter Anvin &lt;hpa@zytor.com&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Prasad &lt;prasad@linux.vnet.ibm.com&gt;
Cc: 2.6.33.x 2.6.34.x &lt;stable@kernel.org&gt;
</content>
</entry>
<entry>
<title>x86, kgdb: early trap init for early debug</title>
<updated>2010-05-21T02:04:29Z</updated>
<author>
<name>Jan Kiszka</name>
</author>
<published>2010-05-21T02:04:29Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=29c843912a0baa7fa63033fe28e1ca7e796686a5'/>
<id>urn:sha1:29c843912a0baa7fa63033fe28e1ca7e796686a5</id>
<content type='text'>
Allow the x86 arch to have early exception processing for the purpose
of debugging via the kgdb.

Signed-off-by: Jan Kiszka &lt;jan.kiszka@web.de&gt;
Signed-off-by: Jason Wessel &lt;jason.wessel@windriver.com&gt;
</content>
</entry>
<entry>
<title>x86,kgdb: Add low level debug hook</title>
<updated>2010-05-21T02:04:25Z</updated>
<author>
<name>Jason Wessel</name>
</author>
<published>2010-05-21T02:04:25Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f503b5ae53cb557ac351a668fcac1baab1cef0db'/>
<id>urn:sha1:f503b5ae53cb557ac351a668fcac1baab1cef0db</id>
<content type='text'>
The only way the debugger can handle a trap in inside rcu_lock,
notify_die, or atomic_notifier_call_chain without a triple fault is
to have a low level "first opportunity handler" in the int3 exception
handler.

Generally this will be something the vast majority of folks will not
need, but for those who need it, it is added as a kernel .config
option called KGDB_LOW_LEVEL_TRAP.

CC: Ingo Molnar &lt;mingo@elte.hu&gt;
CC: Thomas Gleixner &lt;tglx@linutronix.de&gt;
CC: H. Peter Anvin &lt;hpa@zytor.com&gt;
CC: x86@kernel.org
Signed-off-by: Jason Wessel &lt;jason.wessel@windriver.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'x86-fpu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip</title>
<updated>2010-05-18T15:58:16Z</updated>
<author>
<name>Linus Torvalds</name>
</author>
<published>2010-05-18T15:58:16Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=41d59102e146a4423a490b8eca68a5860af4fe1c'/>
<id>urn:sha1:41d59102e146a4423a490b8eca68a5860af4fe1c</id>
<content type='text'>
* 'x86-fpu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  x86, fpu: Use static_cpu_has() to implement use_xsave()
  x86: Add new static_cpu_has() function using alternatives
  x86, fpu: Use the proper asm constraint in use_xsave()
  x86, fpu: Unbreak FPU emulation
  x86: Introduce 'struct fpu' and related API
  x86: Eliminate TS_XSAVE
  x86-32: Don't set ignore_fpu_irq in simd exception
  x86: Merge kernel_math_error() into math_error()
  x86: Merge simd_math_error() into math_error()
  x86-32: Rework cache flush denied handler

Fix trivial conflict in arch/x86/kernel/process.c
</content>
</entry>
<entry>
<title>lockup_detector: Combine nmi_watchdog and softlockup detector</title>
<updated>2010-05-12T21:55:33Z</updated>
<author>
<name>Don Zickus</name>
</author>
<published>2010-05-07T21:11:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=58687acba59266735adb8ccd9b5b9aa2c7cd205b'/>
<id>urn:sha1:58687acba59266735adb8ccd9b5b9aa2c7cd205b</id>
<content type='text'>
The new nmi_watchdog (which uses the perf event subsystem) is very
similar in structure to the softlockup detector.  Using Ingo's
suggestion, I combined the two functionalities into one file:
kernel/watchdog.c.

Now both the nmi_watchdog (or hardlockup detector) and softlockup
detector sit on top of the perf event subsystem, which is run every
60 seconds or so to see if there are any lockups.

To detect hardlockups, cpus not responding to interrupts, I
implemented an hrtimer that runs 5 times for every perf event
overflow event.  If that stops counting on a cpu, then the cpu is
most likely in trouble.

To detect softlockups, tasks not yielding to the scheduler, I used the
previous kthread idea that now gets kicked every time the hrtimer fires.
If the kthread isn't being scheduled neither is anyone else and the
warning is printed to the console.

I tested this on x86_64 and both the softlockup and hardlockup paths
work.

V2:
- cleaned up the Kconfig and softlockup combination
- surrounded hardlockup cases with #ifdef CONFIG_PERF_EVENTS_NMI
- seperated out the softlockup case from perf event subsystem
- re-arranged the enabling/disabling nmi watchdog from proc space
- added cpumasks for hardlockup failure cases
- removed fallback to soft events if no PMU exists for hard events

V3:
- comment cleanups
- drop support for older softlockup code
- per_cpu cleanups
- completely remove software clock base hardlockup detector
- use per_cpu masking on hard/soft lockup detection
- #ifdef cleanups
- rename config option NMI_WATCHDOG to LOCKUP_DETECTOR
- documentation additions

V4:
- documentation fixes
- convert per_cpu to __get_cpu_var
- powerpc compile fixes

V5:
- split apart warn flags for hard and soft lockups

TODO:
- figure out how to make an arch-agnostic clock2cycles call
  (if possible) to feed into perf events as a sample period

[fweisbec: merged conflict patch]

Signed-off-by: Don Zickus &lt;dzickus@redhat.com&gt;
Cc: Ingo Molnar &lt;mingo@elte.hu&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Cyrill Gorcunov &lt;gorcunov@gmail.com&gt;
Cc: Eric Paris &lt;eparis@redhat.com&gt;
Cc: Randy Dunlap &lt;randy.dunlap@oracle.com&gt;
LKML-Reference: &lt;1273266711-18706-2-git-send-email-dzickus@redhat.com&gt;
Signed-off-by: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
</content>
</entry>
</feed>
