07 Jan, 2011

4 commits

  • Just re-arrange the code a bit to make it easier to follow what is
    going on. Basically un-negating the if-statement and swapping the code
    inside the if-statement with code outside.

    No functional changes.

    Originally-by: Huang Ying
    Signed-off-by: Don Zickus
    Signed-off-by: Peter Zijlstra
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Don Zickus
     
  • In original NMI handler, NMI reason io port (0x61) is only processed
    on BSP. This makes it impossible to hot-remove BSP. To solve the
    issue, a raw spinlock is used to allow the port to be processed on any
    CPU.

    Originally-by: Huang Ying
    Signed-off-by: Don Zickus
    Signed-off-by: Peter Zijlstra
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Don Zickus
     
  • With priorities in place and no one really understanding the difference between
    DIE_NMI and DIE_NMI_IPI, just remove DIE_NMI_IPI and convert everyone to DIE_NMI.

    This also simplifies default_do_nmi() a little bit. Instead of calling the
    die_notifier in both the if and else part, just pull it out and call it before
    the if-statement. This has the side benefit of avoiding a call to the ioport
    to see if there is an external NMI sitting around until after the (more frequent)
    internal NMIs are dealt with.

    Patch-Inspired-by: Huang Ying
    Signed-off-by: Don Zickus
    Signed-off-by: Peter Zijlstra
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Don Zickus
     
  • Replace the NMI related magic numbers with symbol constants.

    Memory parity error is only valid for IBM PC-AT, newer machine use
    bit 7 (0x80) of 0x61 port for PCI SERR. While memory error is usually
    reported via MCE. So corresponding function name and kernel log string
    is changed.

    But on some machines, PCI SERR line is still used to report memory
    errors. This is used by EDAC, so corresponding EDAC call is reserved.

    Signed-off-by: Huang Ying
    Signed-off-by: Don Zickus
    Signed-off-by: Peter Zijlstra
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Huang Ying
     

05 Jan, 2011

1 commit


10 Dec, 2010

1 commit

  • Originally adapted from Huang Ying's patch which moved the
    unknown_nmi_panic to the traps.c file. Because the old nmi
    watchdog was deleted before this change happened, the
    unknown_nmi_panic sysctl was lost. This re-adds it.

    Also, the nmi_watchdog sysctl was re-implemented and its
    documentation updated accordingly.

    Patch-inspired-by: Huang Ying
    Signed-off-by: Don Zickus
    Reviewed-by: Cyrill Gorcunov
    Acked-by: Yinghai Lu
    Cc: fweisbec@gmail.com
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Don Zickus
     

18 Nov, 2010

2 commits

  • Now that the bulk of the old nmi_watchdog is gone, remove all
    the stub variables and hooks associated with it.

    This touches lots of files mainly because of how the io_apic
    nmi_watchdog was implemented. Now that the io_apic nmi_watchdog
    is forever gone, remove all its fingers.

    Most of this code was not being exercised by virtue of
    nmi_watchdog != NMI_IO_APIC, so there shouldn't be anything to
    risky here.

    Signed-off-by: Don Zickus
    Cc: fweisbec@gmail.com
    Cc: gorcunov@openvz.org
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Don Zickus
     
  • Now that we have a new nmi_watchdog that is more generic and
    sits on top of the perf subsystem, we really do not need the old
    nmi_watchdog any more.

    In addition, the old nmi_watchdog doesn't really work if you are
    using the default clocksource, hpet. The old nmi_watchdog code
    relied on local apic interrupts to determine if the cpu is still
    alive. With hpet as the clocksource, these interrupts don't
    increment any more and the old nmi_watchdog triggers false
    postives.

    This piece removes the old nmi_watchdog code and stubs out any
    variables and functions calls. The stubs are the same ones used
    by the new nmi_watchdog code, so it should be well tested.

    Signed-off-by: Don Zickus
    Cc: fweisbec@gmail.com
    Cc: gorcunov@openvz.org
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Don Zickus
     

23 Oct, 2010

1 commit

  • … '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

    * '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.

    Linus Torvalds
     

24 Sep, 2010

1 commit

  • 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
    LKML-Reference:
    Cc: Frederic Weisbecker
    Cc: K.Prasad
    Cc: Alan Stern
    Cc: Alexander van Heukelum
    Cc:
    Signed-off-by: H. Peter Anvin

    Bart Oldeman
     

10 Sep, 2010

2 commits


05 Aug, 2010

1 commit


30 Jun, 2010

1 commit

  • 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
    Signed-off-by: Frederic Weisbecker
    Cc: Ingo Molnar
    Cc: H. Peter Anvin
    Cc: Thomas Gleixner
    Cc: Prasad
    Cc: 2.6.33.x 2.6.34.x

    Frederic Weisbecker
     

21 May, 2010

2 commits

  • Allow the x86 arch to have early exception processing for the purpose
    of debugging via the kgdb.

    Signed-off-by: Jan Kiszka
    Signed-off-by: Jason Wessel

    Jan Kiszka
     
  • 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
    CC: Thomas Gleixner
    CC: H. Peter Anvin
    CC: x86@kernel.org
    Signed-off-by: Jason Wessel

    Jason Wessel
     

18 May, 2010

1 commit

  • * '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

    Linus Torvalds
     

13 May, 2010

1 commit

  • 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
    Cc: Ingo Molnar
    Cc: Peter Zijlstra
    Cc: Cyrill Gorcunov
    Cc: Eric Paris
    Cc: Randy Dunlap
    LKML-Reference:
    Signed-off-by: Frederic Weisbecker

    Don Zickus
     

04 May, 2010

4 commits


26 Mar, 2010

2 commits

  • Implement ptrace-block-step using TIF_BLOCKSTEP which will set
    DEBUGCTLMSR_BTF when set for a task while preserving any other
    DEBUGCTLMSR bits.

    Signed-off-by: Peter Zijlstra
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     
  • Support for the PMU's BTS features has been upstreamed in
    v2.6.32, but we still have the old and disabled ptrace-BTS,
    as Linus noticed it not so long ago.

    It's buggy: TIF_DEBUGCTLMSR is trampling all over that MSR without
    regard for other uses (perf) and doesn't provide the flexibility
    needed for perf either.

    Its users are ptrace-block-step and ptrace-bts, since ptrace-bts
    was never used and ptrace-block-step can be implemented using a
    much simpler approach.

    So axe all 3000 lines of it. That includes the *locked_memory*()
    APIs in mm/mlock.c as well.

    Reported-by: Linus Torvalds
    Signed-off-by: Peter Zijlstra
    Cc: Roland McGrath
    Cc: Oleg Nesterov
    Cc: Markus Metzger
    Cc: Steven Rostedt
    Cc: Andrew Morton
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     

25 Feb, 2010

1 commit

  • Mostly copy/paste whitespace damage with a couple of nitpicks by
    the checkpatch script. Fix the struct definition as requested by Ingo too.

    Signed-off-by: Don Zickus
    Cc: peterz@infradead.org
    Cc: gorcunov@gmail.com
    Cc: aris@redhat.com
    LKML-Reference:
    Signed-off-by: Ingo Molnar
    --
    arch/x86/kernel/apic/hw_nmi.c | 14 +++++------
    arch/x86/kernel/traps.c | 6 ++--
    include/linux/nmi.h | 2 -
    kernel/nmi_watchdog.c | 51 ++++++++++++++++++++----------------------
    4 files changed, 36 insertions(+), 37 deletions(-)

    Don Zickus
     

08 Feb, 2010

2 commits

  • These are the bits that enable the new nmi_watchdog and safely
    isolate the old nmi_watchdog. Only one or the other can run,
    not both at the same time.

    Signed-off-by: Don Zickus
    Cc: Linus Torvalds
    Cc: Andrew Morton
    Cc: gorcunov@gmail.com
    Cc: aris@redhat.com
    Cc: peterz@infradead.org
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Don Zickus
     
  • In order to handle a new nmi_watchdog approach, I need to move
    the notify_die() routine out of nmi_watchdog_tick() and into
    default_do_nmi(). This lets me easily swap out the old
    nmi_watchdog with the new one with just a config change.

    The change probably makes sense from a high level perspective
    because the nmi_watchdog shouldn't be handling notify_die
    routines anyway. However, this move does change the semantics a
    little bit. Instead of checking on every nmi interrupt if the
    cpus are stuck, only check them on the nmi_watchdog interrupts.

    v2: Move notify_die call into #idef block

    Signed-off-by: Don Zickus
    Cc: Linus Torvalds
    Cc: Andrew Morton
    Cc: gorcunov@gmail.com
    Cc: aris@redhat.com
    Cc: peterz@infradead.org
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Don Zickus
     

29 Jan, 2010

1 commit

  • Clear the reserved bits from the stored copy of debug status
    register (DR6).
    This will help easy bitwise operations such as quick testing
    of a debug event origin.

    Signed-off-by: K.Prasad
    Cc: Roland McGrath
    Cc: Jan Kiszka
    Cc: Alan Stern
    Cc: Ingo Molnar
    LKML-Reference:
    Signed-off-by: Frederic Weisbecker

    K.Prasad
     

18 Oct, 2009

1 commit


27 Sep, 2009

1 commit

  • …git/tip/linux-2.6-tip

    * 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    x86: Remove redundant non-NUMA topology functions
    x86: early_printk: Protect against using the same device twice
    x86: Reduce verbosity of "PAT enabled" kernel message
    x86: Reduce verbosity of "TSC is reliable" message
    x86: mce: Use safer ways to access MCE registers
    x86: mce, inject: Use real inject-msg in raise_local
    x86: mce: Fix thermal throttling message storm
    x86: mce: Clean up thermal throttling state tracking code
    x86: split NX setup into separate file to limit unstack-protected code
    xen: check EFER for NX before setting up GDT mapping
    x86: Cleanup linker script using new linker script macros.
    x86: Use section .data.page_aligned for the idt_table.
    x86: convert to use __HEAD and HEAD_TEXT macros.
    x86: convert compressed loader to use __HEAD and HEAD_TEXT macros.
    x86: fix fragile computation of vsyscall address

    Linus Torvalds
     

25 Sep, 2009

1 commit


24 Sep, 2009

1 commit

  • * remove asm/atomic.h inclusion from linux/utsname.h --
    not needed after kref conversion
    * remove linux/utsname.h inclusion from files which do not need it

    NOTE: it looks like fs/binfmt_elf.c do not need utsname.h, however
    due to some personality stuff it _is_ needed -- cowardly leave ELF-related
    headers and files alone.

    Signed-off-by: Alexey Dobriyan
    Signed-off-by: Linus Torvalds

    Alexey Dobriyan
     

20 Sep, 2009

1 commit


19 Sep, 2009

2 commits

  • …el/git/tip/linux-2.6-tip

    * 'x86-platform-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (38 commits)
    x86: Move get/set_wallclock to x86_platform_ops
    x86: platform: Fix section annotations
    x86: apic namespace cleanup
    x86: Distangle ioapic and i8259
    x86: Add Moorestown early detection
    x86: Add hardware_subarch ID for Moorestown
    x86: Add early platform detection
    x86: Move tsc_init to late_time_init
    x86: Move tsc_calibration to x86_init_ops
    x86: Replace the now identical time_32/64.c by time.c
    x86: time_32/64.c unify profile_pc
    x86: Move calibrate_cpu to tsc.c
    x86: Make timer setup and global variables the same in time_32/64.c
    x86: Remove mca bus ifdef from timer interrupt
    x86: Simplify timer_ack magic in time_32.c
    x86: Prepare unification of time_32/64.c
    x86: Remove do_timer hook
    x86: Add timer_init to x86_init_ops
    x86: Move percpu clockevents setup to x86_init_ops
    x86: Move xen_post_allocator_init into xen_pagetable_setup_done
    ...

    Fix up conflicts in arch/x86/include/asm/io_apic.h

    Linus Torvalds
     
  • The .data.idt section is just squashed into the .data.page_aligned
    output section by the linker script anyway, so it might as well be in
    the .data.page_aligned section.

    This eliminates all references to .data.idt on x86.

    Signed-off-by: Tim Abbott
    Cc: Ingo Molnar
    Signed-off-by: H. Peter Anvin

    Tim Abbott
     

15 Sep, 2009

1 commit


14 Sep, 2009

2 commits

  • * 'x86-fpu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    x86-64: move clts into batch cpu state updates when preloading fpu
    x86-64: move unlazy_fpu() into lazy cpu state part of context switch
    x86-32: make sure clts is batched during context switch
    x86: split out core __math_state_restore

    Linus Torvalds
     
  • …el/git/tip/linux-2.6-tip

    * 'x86-cleanups-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    x86: Make memtype_seq_ops const
    x86: uv: Clean up uv_ptc_init(), use proc_create()
    x86: Use printk_once()
    x86/cpu: Clean up various files a bit
    x86: Remove duplicated #include
    x86, ipi: Clean up safe_smp_processor_id() by using the cpu_has_apic() macro helper
    x86: Clean up idt_descr and idt_tableby using NR_VECTORS instead of hardcoded number
    x86: Further clean up of mtrr/generic.c
    x86: Clean up mtrr/main.c
    x86: Clean up mtrr/state.c
    x86: Clean up mtrr/mtrr.h
    x86: Clean up mtrr/if.c
    x86: Clean up mtrr/generic.c
    x86: Clean up mtrr/cyrix.c
    x86: Clean up mtrr/cleanup.c
    x86: Clean up mtrr/centaur.c
    x86: Clean up mtrr/amd.c:
    x86: ds.c fix invalid assignment

    Linus Torvalds
     

07 Sep, 2009

1 commit


31 Aug, 2009

1 commit