16 Jan, 2012

1 commit

  • * 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (39 commits)
    perf tools: Fix compile error on x86_64 Ubuntu
    perf report: Fix --stdio output alignment when --showcpuutilization used
    perf annotate: Get rid of field_sep check
    perf annotate: Fix usage string
    perf kmem: Fix a memory leak
    perf kmem: Add missing closedir() calls
    perf top: Add error message for EMFILE
    perf test: Change type of '-v' option to INCR
    perf script: Add missing closedir() calls
    tracing: Fix compile error when static ftrace is enabled
    recordmcount: Fix handling of elf64 big-endian objects.
    perf tools: Add const.h to MANIFEST to make perf-tar-src-pkg work again
    perf tools: Add support for guest/host-only profiling
    perf kvm: Do guest-only counting by default
    perf top: Don't update total_period on process_sample
    perf hists: Stop using 'self' for struct hist_entry
    perf hists: Rename total_session to total_period
    x86: Add counter when debug stack is used with interrupts enabled
    x86: Allow NMIs to hit breakpoints in i386
    x86: Keep current stack in NMI breakpoints
    ...

    Linus Torvalds
     

22 Dec, 2011

2 commits

  • Mathieu Desnoyers pointed out a case that can cause issues with
    NMIs running on the debug stack:

    int3 -> interrupt -> NMI -> int3

    Because the interrupt changes the stack, the NMI will not see that
    it preempted the debug stack. Looking deeper at this case,
    interrupts only happen when the int3 is from userspace or in
    an a location in the exception table (fixup).

    userspace -> int3 -> interurpt -> NMI -> int3

    All other int3s that happen in the kernel should be processed
    without ever enabling interrupts, as the do_trap() call will
    panic the kernel if it is called to process any other location
    within the kernel.

    Adding a counter around the sections that enable interrupts while
    using the debug stack allows the NMI to also check that case.
    If the NMI sees that it either interrupted a task using the debug
    stack or the debug counter is non-zero, then it will have to
    change the IDT table to make the int3 not change stacks (which will
    corrupt the stack if it does).

    Note, I had to move the debug_usage functions out of processor.h
    and into debugreg.h because of the static inlined functions to
    inc and dec the debug_usage counter. __get_cpu_var() requires
    smp.h which includes processor.h, and would fail to build.

    Link: http://lkml.kernel.org/r/1323976535.23971.112.camel@gandalf.stny.rr.com

    Reported-by: Mathieu Desnoyers
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: H. Peter Anvin
    Cc: Thomas Gleixner
    Cc: Paul Turner
    Cc: Frederic Weisbecker
    Signed-off-by: Steven Rostedt

    Steven Rostedt
     
  • We want to allow NMI handlers to have breakpoints to be able to
    remove stop_machine from ftrace, kprobes and jump_labels. But if
    an NMI interrupts a current breakpoint, and then it triggers a
    breakpoint itself, it will switch to the breakpoint stack and
    corrupt the data on it for the breakpoint processing that it
    interrupted.

    Instead, have the NMI check if it interrupted breakpoint processing
    by checking if the stack that is currently used is a breakpoint
    stack. If it is, then load a special IDT that changes the IST
    for the debug exception to keep the same stack in kernel context.
    When the NMI is done, it puts it back.

    This way, if the NMI does trigger a breakpoint, it will keep
    using the same stack and not stomp on the breakpoint data for
    the breakpoint it interrupted.

    Suggested-by: Peter Zijlstra
    Signed-off-by: Steven Rostedt

    Steven Rostedt
     

21 Dec, 2011

1 commit

  • Several fields in struct cpuinfo_x86 were not defined for the
    !SMP case, likely to save space. However, those fields still
    have some meaning for UP, and keeping them allows some #ifdef
    removal from other files. The additional size of the UP kernel
    from this change is not significant enough to worry about
    keeping up the distinction:

    text data bss dec hex filename
    4737168 506459 972040 6215667 5ed7f3 vmlinux.o.before
    4737444 506459 972040 6215943 5ed907 vmlinux.o.after

    for a difference of 276 bytes for an example UP config.

    If someone wants those 276 bytes back badly then it should
    be implemented in a cleaner way.

    Signed-off-by: Kevin Winchester
    Cc: Steffen Persvold
    Link: http://lkml.kernel.org/r/1324428742-12498-1-git-send-email-kjwinchester@gmail.com
    Signed-off-by: Ingo Molnar

    Kevin Winchester
     

06 Dec, 2011

2 commits

  • I used "ifdef CONFIG_NUMA" simply because it doesn't make
    sense in a non-numa configuration even with SMP enabled.

    Besides, the only place where it is called right now is
    in kernel/cpu/amd.c:srat_detect_node() within the
    "CONFIG_NUMA" protected part.

    Signed-off-by: Steffen Persvold
    Cc: Daniel J Blueman
    Cc: Jesse Barnes
    Link: http://lkml.kernel.org/r/1323073238-32686-2-git-send-email-daniel@numascale-asia.com
    Signed-off-by: Ingo Molnar

    Steffen Persvold
     
  • Add an x86_init vector for handling inconsistent core numbering.
    This is useful for multi-fabric platforms, such as Numascale
    NumaConnect.

    v2:
    - use struct x86_cpuinit_ops
    - provide default fall-back function to warn

    Signed-off-by: Daniel J Blueman
    Cc: Steffen Persvold
    Cc: Jesse Barnes
    Link: http://lkml.kernel.org/r/1323073238-32686-2-git-send-email-daniel@numascale-asia.com
    Signed-off-by: Ingo Molnar

    Daniel J Blueman
     

28 Oct, 2011

2 commits

  • * 'x86-rdrand-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    x86, random: Verify RDRAND functionality and allow it to be disabled
    x86, random: Architectural inlines to get random integers with RDRAND
    random: Add support for architectural random hooks

    Fix up trivial conflicts in drivers/char/random.c: the architectural
    random hooks touched "get_random_int()" that was simplified to use MD5
    and not do the keyptr thing any more (see commit 6e5714eaf77d: "net:
    Compute protocol sequence numbers and fragment IDs using MD5").

    Linus Torvalds
     
  • * 'x86-cpu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    x86, amd: Include linux/elf.h since we use stuff from asm/elf.h
    x86: cache_info: Update calculation of AMD L3 cache indices
    x86: cache_info: Kill the atomic allocation in amd_init_l3_cache()
    x86: cache_info: Kill the moronic shadow struct
    x86: cache_info: Remove bogus free of amd_l3_cache data
    x86, amd: Include elf.h explicitly, prepare the code for the module.h split
    x86-32, amd: Move va_align definition to unbreak 32-bit build
    x86, amd: Move BSP code to cpu_dev helper
    x86: Add a BSP cpu_dev helper
    x86, amd: Avoid cache aliasing penalties on AMD family 15h

    Linus Torvalds
     

06 Aug, 2011

1 commit

  • Add a function ptr to struct cpu_dev which is destined to be run only
    once on the BSP during boot.

    Signed-off-by: Borislav Petkov
    Link: http://lkml.kernel.org/r/20110805180116.GB26217@aftab
    Signed-off-by: H. Peter Anvin

    Borislav Petkov
     

01 Aug, 2011

1 commit

  • If the CPU declares that RDRAND is available, go through a guranteed
    reseed sequence, and make sure that it is actually working (producing
    data.) If it does not, disable the CPU feature flag.

    Allow RDRAND to be disabled on the command line (as opposed to at
    compile time) for a user who has special requirements with regards to
    random numbers.

    Signed-off-by: H. Peter Anvin
    Cc: Matt Mackall
    Cc: Herbert Xu
    Cc: "Theodore Ts'o"

    H. Peter Anvin
     

27 Jul, 2011

1 commit

  • This allows us to move duplicated code in
    (atomic_inc_not_zero() for now) to

    Signed-off-by: Arun Sharma
    Reviewed-by: Eric Dumazet
    Cc: Ingo Molnar
    Cc: David Miller
    Cc: Eric Dumazet
    Acked-by: Mike Frysinger
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Arun Sharma
     

30 May, 2011

1 commit

  • * 'idle-release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-idle-2.6:
    x86 idle: deprecate mwait_idle() and "idle=mwait" cmdline param
    x86 idle: deprecate "no-hlt" cmdline param
    x86 idle APM: deprecate CONFIG_APM_CPU_IDLE
    x86 idle floppy: deprecate disable_hlt()
    x86 idle: EXPORT_SYMBOL(default_idle, pm_idle) only when APM demands it
    x86 idle: clarify AMD erratum 400 workaround
    idle governor: Avoid lock acquisition to read pm_qos before entering idle
    cpuidle: menu: fixed wrapping timers at 4.294 seconds

    Linus Torvalds
     

29 May, 2011

1 commit

  • The workaround for AMD erratum 400 uses the term "c1e" falsely suggesting:
    1. Intel C1E is somehow involved
    2. All AMD processors with C1E are involved

    Use the string "amd_c1e" instead of simply "c1e" to clarify that
    this workaround is specific to AMD's version of C1E.
    Use the string "e400" to clarify that the workaround is specific
    to AMD processors with Erratum 400.

    This patch is text-substitution only, with no functional change.

    cc: x86@kernel.org
    Acked-by: Borislav Petkov
    Signed-off-by: Len Brown

    Len Brown
     

26 May, 2011

1 commit

  • This patch removes a check that causes incorrect scheduler
    domain setup (SMP instead of SMT) and bootlog warning messages
    when cpuid extensions for topology enumeration are not supported
    and the number of processors reported to the OS is smaller than
    smp_num_siblings.

    Acked-by: Suresh Siddha
    Signed-off-by: Nikhil P Rao
    Link: http://lkml.kernel.org/r/1306343921.19325.1.camel@fedora13
    Signed-off-by: Ingo Molnar

    Nikhil P Rao
     

23 May, 2011

1 commit

  • The setup_smep function gets calle at resume time too, and is thus not a
    pure __init function. When marked as __init, it gets thrown out after
    the kernel has initialized, and when the kernel is suspended and
    resumed, the code will no longer be around, and we'll get a nice "kernel
    tried to execute NX-protected page" oops because the page is no longer
    marked executable.

    Reported-and-tested-by: Parag Warudkar
    Cc: Fenghua Yu
    Cc: "H. Peter Anvin"
    Cc: Ingo Molnar
    Signed-off-by: Linus Torvalds

    Linus Torvalds
     

18 May, 2011

2 commits

  • Enable/disable newly documented SMEP (Supervisor Mode Execution Protection) CPU
    feature in kernel. CR4.SMEP (bit 20) is 0 at power-on. If the feature is
    supported by CPU (X86_FEATURE_SMEP), enable SMEP by setting CR4.SMEP. New kernel
    option nosmep disables the feature even if the feature is supported by CPU.

    [ hpa: moved the call to setup_smep() until after the vendor-specific
    initialization; that ensures that CPUID features are unmasked. We
    will still run it before we have userspace (never mind uncontrolled
    userspace). ]

    Signed-off-by: Fenghua Yu
    LKML-Reference:
    Signed-off-by: H. Peter Anvin

    Fenghua Yu
     
  • CPUID leaf 7, subleaf 0 returns the maximum subleaf in EAX, not the
    number of subleaves. Since so far only subleaf 0 is defined (and only
    the EBX bitfield) we do not need to qualify the test.

    Signed-off-by: Fenghua Yu
    Link: http://lkml.kernel.org/r/1305660806-17519-1-git-send-email-fenghua.yu@intel.com
    Signed-off-by: H. Peter Anvin
    Cc: 2.6.36..39

    Fenghua Yu
     

16 Mar, 2011

1 commit

  • * 'x86-mm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (93 commits)
    x86, tlb, UV: Do small micro-optimization for native_flush_tlb_others()
    x86-64, NUMA: Don't call numa_set_distanc() for all possible node combinations during emulation
    x86-64, NUMA: Don't assume phys node 0 is always online in numa_emulation()
    x86-64, NUMA: Clean up initmem_init()
    x86-64, NUMA: Fix numa_emulation code with node0 without RAM
    x86-64, NUMA: Revert NUMA affine page table allocation
    x86: Work around old gas bug
    x86-64, NUMA: Better explain numa_distance handling
    x86-64, NUMA: Fix distance table handling
    mm: Move early_node_map[] reverse scan helpers under HAVE_MEMBLOCK
    x86-64, NUMA: Fix size of numa_distance array
    x86: Rename e820_table_* to pgt_buf_*
    bootmem: Move __alloc_memory_core_early() to nobootmem.c
    bootmem: Move contig_page_data definition to bootmem.c/nobootmem.c
    bootmem: Separate out CONFIG_NO_BOOTMEM code into nobootmem.c
    x86-64, NUMA: Seperate out numa_alloc_distance() from numa_set_distance()
    x86-64, NUMA: Add proper function comments to global functions
    x86-64, NUMA: Move NUMA emulation into numa_emulation.c
    x86-64, NUMA: Prepare numa_emulation() for moving NUMA emulation into a separate file
    x86-64, NUMA: Do not scan two times for setup_node_bootmem()
    ...

    Fix up conflicts in arch/x86/kernel/smpboot.c

    Linus Torvalds
     

05 Mar, 2011

1 commit


28 Jan, 2011

1 commit

  • x86_32 has been managing node_to_cpumask_map explicitly from
    map_cpu_to_node() and friends in a rather ugly way. With
    previous changes, it's now possible to share the code with
    64bit.

    * When CONFIG_NUMA_EMU is disabled, numa_add/remove_cpu() are
    implemented in numa.c and shared by 32 and 64bit. CONFIG_NUMA_EMU
    versions still live in numa_64.c.

    NUMA_EMU's dependency on 64bit is planned to be removed and the
    above should go away together.

    * identify_cpu() now calls numa_add_cpu() for 32bit too. This
    makes the explicit mask management from map_cpu_to_node() unnecessary.

    * The whole x86_32 specific map_cpu_to_node() chunk is no longer
    necessary. Dropped.

    Signed-off-by: Tejun Heo
    Reviewed-by: Pekka Enberg
    Cc: eric.dumazet@gmail.com
    Cc: yinghai@kernel.org
    Cc: brgerst@gmail.com
    Cc: gorcunov@gmail.com
    Cc: shaohui.zheng@intel.com
    Cc: rientjes@google.com
    LKML-Reference:
    Signed-off-by: Ingo Molnar
    Cc: David Rientjes
    Cc: Shaohui Zheng

    Tejun Heo
     

26 Nov, 2010

1 commit

  • The perf hardware pmu got initialized at various points in the boot,
    some before early_initcall() some after (notably arch_initcall).

    The problem is that the NMI lockup detector is ran from early_initcall()
    and expects the hardware pmu to be present.

    Sanitize this by moving all architecture hardware pmu implementations to
    initialize at early_initcall() and move the lockup detector to an explicit
    initcall right after that.

    Cc: paulus
    Cc: davem
    Cc: Michael Cree
    Cc: Deng-Cheng Zhu
    Acked-by: Paul Mundt
    Acked-by: Will Deacon
    Signed-off-by: Peter Zijlstra
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     

22 Oct, 2010

3 commits


05 Oct, 2010

1 commit

  • ba0593bf553c450a03dbc5f8c1f0ff58b778a0c8 cleared the aforementioned
    cpuid bit only on 32-bit due to various problems with Virtual PC. This
    somehow got lost during the 32- + 64-bit merge so restore the feature
    bit on 64-bit. For that, set it explicitly for non-constant arguments of
    cpu_has(). Update comment for future reference.

    Signed-off-by: Borislav Petkov
    LKML-Reference:
    Cc: Ryan O'Neill
    Cc: Linus Torvalds
    Signed-off-by: H. Peter Anvin

    Borislav Petkov
     

29 Sep, 2010

1 commit


21 Sep, 2010

1 commit


10 Sep, 2010

1 commit


13 Aug, 2010

1 commit

  • boot_cpu_id is there for historical reasons and was renamed to
    boot_cpu_physical_apicid in patch:

    c70dcb7 x86: change boot_cpu_id to boot_cpu_physical_apicid

    However, there are some remaining occurrences of boot_cpu_id that are
    never touched in the kernel and thus its value is always 0.

    This patch removes boot_cpu_id completely.

    Signed-off-by: Robert Richter
    LKML-Reference:
    Signed-off-by: H. Peter Anvin

    Robert Richter
     

07 Aug, 2010

2 commits

  • …git/tip/linux-2.6-tip

    * 'x86-xsave-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    x86, xsave: Make xstate_enable_boot_cpu() __init, protect on CPU 0
    x86, xsave: Add __init attribute to setup_xstate_features()
    x86, xsave: Make init_xstate_buf static
    x86, xsave: Check cpuid level for XSTATE_CPUID (0x0d)
    x86, xsave: Introduce xstate enable functions
    x86, xsave: Separate fpu and xsave initialization
    x86, xsave: Move boot cpu initialization to xsave_init()
    x86, xsave: 32/64 bit boot cpu check unification in initialization
    x86, xsave: Do not include asm/i387.h in asm/xsave.h
    x86, xsave: Use xsaveopt in context-switch path when supported
    x86, xsave: Sync xsave memory layout with its header for user handling
    x86, xsave: Track the offset, size of state in the xsave layout

    Linus Torvalds
     
  • * 'x86-mrst-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    x86, mrst: make mrst_timer_options an enum
    x86, mrst: make mrst_identify_cpu() an inline returning enum
    x86, mrst: add more timer config options
    x86, mrst: add cpu type detection
    x86: detect scattered cpuid features earlier

    Linus Torvalds
     

22 Jul, 2010

1 commit

  • As xsave also supports other than fpu features, it should be
    initialized independently of the fpu. This patch moves this out of fpu
    initialization.

    There is also a lot of cross referencing between fpu and xsave
    code. This patch reduces this by making xsave_cntxt_init() and
    init_thread_xstate() static functions.

    The patch moves the cpu_has_xsave check at the beginning of
    xsave_init(). All other checks may removed then.

    Signed-off-by: Robert Richter
    LKML-Reference:
    Acked-by: Suresh Siddha
    Signed-off-by: H. Peter Anvin

    Robert Richter
     

21 Jul, 2010

2 commits


20 Jul, 2010

1 commit

  • xsaveopt is a more optimized form of xsave specifically designed
    for the context switch usage. xsaveopt doesn't save the state that's not
    modified from the prior xrstor. And if a specific feature state gets
    modified to the init state, then xsaveopt just updates the header bit
    in the xsave memory layout without updating the corresponding memory
    layout.

    Signed-off-by: Suresh Siddha
    LKML-Reference:
    Signed-off-by: H. Peter Anvin

    Suresh Siddha
     

08 Jul, 2010

1 commit


28 May, 2010

1 commit

  • x86 arch specific changes to use generic numa_node_id() based on generic
    percpu variable infrastructure. Back out x86's custom version of
    numa_node_id()

    Signed-off-by: Lee Schermerhorn
    Cc: Tejun Heo
    Cc: Mel Gorman
    Cc: Christoph Lameter
    Cc: Nick Piggin
    Cc: David Rientjes
    Cc: Eric Whitney
    Cc: KAMEZAWA Hiroyuki
    Cc: Ingo Molnar
    Cc: Thomas Gleixner
    Cc: "H. Peter Anvin"
    Cc: "Luck, Tony"
    Cc: Pekka Enberg
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Lee Schermerhorn
     

21 May, 2010

1 commit


20 May, 2010

1 commit

  • Some extra CPU features such as ARAT is needed in early boot so
    that x86_init function pointers can be set up properly.
    http://lkml.org/lkml/2010/5/18/519
    At start_kernel() level, this patch moves init_scattered_cpuid_features()
    from check_bugs() to setup_arch() -> early_cpu_init() which is earlier than
    platform specific x86_init layer setup. Suggested by HPA.

    Signed-off-by: Jacob Pan
    LKML-Reference:
    Acked-by: Thomas Gleixner
    Signed-off-by: H. Peter Anvin

    Jacob Pan
     

11 May, 2010

1 commit

  • The fpu code currently uses current->thread_info->status & TS_XSAVE as
    a way to distinguish between XSAVE capable processors and older processors.
    The decision is not really task specific; instead we use the task status to
    avoid a global memory reference - the value should be the same across all
    threads.

    Eliminate this tie-in into the task structure by using an alternative
    instruction keyed off the XSAVE cpu feature; this results in shorter and
    faster code, without introducing a global memory reference.

    [ hpa: in the future, this probably should use an asm jmp ]

    Signed-off-by: Avi Kivity
    Acked-by: Suresh Siddha
    LKML-Reference:
    Signed-off-by: H. Peter Anvin

    Avi Kivity