22 Dec, 2011

1 commit

  • 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
     

18 Feb, 2011

1 commit

  • Common infrastructure for low memory trampolines. This code installs
    the trampolines permanently in low memory very early. It also permits
    multiple pieces of code to be used for this purpose.

    This code also introduces a standard infrastructure for computing
    symbol addresses in the trampoline code.

    The only change to the actual SMP trampolines themselves is that the
    64-bit trampoline has been made reusable -- the previous version would
    overwrite the code with a status variable; this moves the status
    variable to a separate location.

    Signed-off-by: H. Peter Anvin
    LKML-Reference:
    Cc: Rafael J. Wysocki
    Cc: Matthieu Castet
    Cc: Stephen Rothwell

    H. Peter Anvin
     

22 Jul, 2010

1 commit


09 Feb, 2010

1 commit

  • In particular, several occurances of funny versions of 'success',
    'unknown', 'therefore', 'acknowledge', 'argument', 'achieve', 'address',
    'beginning', 'desirable', 'separate' and 'necessary' are fixed.

    Signed-off-by: Daniel Mack
    Cc: Joe Perches
    Cc: Junio C Hamano
    Signed-off-by: Jiri Kosina

    Daniel Mack
     

09 Dec, 2009

1 commit

  • * 'x86-mm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (36 commits)
    x86, mm: Correct the implementation of is_untracked_pat_range()
    x86/pat: Trivial: don't create debugfs for memtype if pat is disabled
    x86, mtrr: Fix sorting of mtrr after subtracting
    x86: Move find_smp_config() earlier and avoid bootmem usage
    x86, platform: Change is_untracked_pat_range() to bool; cleanup init
    x86: Change is_ISA_range() into an inline function
    x86, mm: is_untracked_pat_range() takes a normal semiclosed range
    x86, mm: Call is_untracked_pat_range() rather than is_ISA_range()
    x86: UV SGI: Don't track GRU space in PAT
    x86: SGI UV: Fix BAU initialization
    x86, numa: Use near(er) online node instead of roundrobin for NUMA
    x86, numa, bootmem: Only free bootmem on NUMA failure path
    x86: Change crash kernel to reserve via reserve_early()
    x86: Eliminate redundant/contradicting cache line size config options
    x86: When cleaning MTRRs, do not fold WP into UC
    x86: remove "extern" from function prototypes in
    x86, mm: Report state of NX protections during boot
    x86, mm: Clean up and simplify NX enablement
    x86, pageattr: Make set_memory_(x|nx) aware of NX support
    x86, sleep: Always save the value of EFER
    ...

    Fix up conflicts (added both iommu_shutdown and is_untracked_pat_range)
    to 'struct x86_platform_ops') in
    arch/x86/include/asm/x86_init.h
    arch/x86/kernel/x86_init.c

    Linus Torvalds
     

06 Dec, 2009

1 commit

  • * 'x86-asm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    include/linux/compiler-gcc4.h: Fix build bug - gcc-4.0.2 doesn't understand __builtin_object_size
    x86/alternatives: No need for alternatives-asm.h to re-invent stuff already in asm.h
    x86/alternatives: Check replacementlen t use the strict copy checks when branch profiling is in use
    x86, 64-bit: Move K8 B step iret fixup to fault entry asm
    x86: Generate cmpxchg build failures
    x86: Add a Kconfig option to turn the copy_from_user warnings into errors
    x86: Turn the copy_from_user check into an (optional) compile time warning
    x86: Use __builtin_memset and __builtin_memcpy for memset/memcpy
    x86: Use __builtin_object_size() to validate the buffer size for copy_from_user()

    Linus Torvalds
     

26 Nov, 2009

1 commit


20 Oct, 2009

1 commit

  • In the first 2MB, kernel text is co-located with kernel static
    page tables setup by head_64.S. CONFIG_DEBUG_RODATA chops this
    2MB large page mapping to small 4KB pages as we mark the kernel text as RO,
    leaving the static page tables as RW.

    With CONFIG_DEBUG_RODATA disabled, OLTP run on NHM-EP shows 1% improvement
    with 2% reduction in system time and 1% improvement in iowait idle time.

    To recover this, move the kernel static page tables to .data section, so that
    we don't have to break the first 2MB of kernel text to small pages with
    CONFIG_DEBUG_RODATA.

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

    Suresh Siddha
     

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
     

21 Sep, 2009

1 commit

  • This patch changes the remaining direct references to
    .bss.page_aligned in C and assembly code to use the macros in
    include/linux/linkage.h.

    Signed-off-by: Tim Abbott
    Cc: Thomas Gleixner
    Cc: Ingo Molnar
    Cc: H. Peter Anvin
    Acked-by: Paul Mundt
    Cc: Chris Zankel
    Signed-off-by: Sam Ravnborg

    Tim Abbott
     

19 Sep, 2009

1 commit

  • This has the consequence of changing the section name use for head
    code from ".text.head" to ".head.text". It also eliminates the
    ".text.head" output section (instead placing head code at the start of
    the .text output section), which should be harmless.

    This patch only changes the sections in the actual kernel, not those
    in the compressed boot loader.

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

    Tim Abbott
     

18 Jun, 2009

1 commit

  • asm/desc.h is included in three assembly files, but the only macro
    it defines, GET_DESC_BASE, is never used. This patch removes the
    includes, removes the macro GET_DESC_BASE and the ASSEMBLY guard
    from asm/desc.h.

    Signed-off-by: Alexander van Heukelum
    Signed-off-by: H. Peter Anvin

    Alexander van Heukelum
     

25 Feb, 2009

2 commits


09 Feb, 2009

1 commit

  • Impact: cleanup and bug fix

    Use the linker to create symbols for certain per-cpu variables
    that are offset by __per_cpu_load. This allows the removal of
    the runtime fixup of the GDT pointer, which fixes a bug with
    resume reported by Jiri Slaby.

    Reported-by: Jiri Slaby
    Signed-off-by: Brian Gerst
    Acked-by: Jiri Slaby
    Signed-off-by: Ingo Molnar

    Brian Gerst
     

20 Jan, 2009

2 commits

  • Impact: x86_64 percpu area layout change, irq_stack now at the beginning

    Now that the PDA is empty except for the stack canary, it can be removed.
    The irqstack is moved to the start of the per-cpu section. If the stack
    protector is enabled, the canary overlaps the bottom 48 bytes of the irqstack.

    tj: * updated subject
    * dropped asm relocation of irq_stack_ptr
    * updated comments a bit
    * rebased on top of stack canary changes

    Signed-off-by: Brian Gerst
    Signed-off-by: Tejun Heo

    Brian Gerst
     
  • Impact: cleanup

    Use cpu_number to determine if the adjustment is necessary.

    Signed-off-by: Brian Gerst
    Signed-off-by: Tejun Heo

    Brian Gerst
     

16 Jan, 2009

4 commits

  • [ Based on original patch from Christoph Lameter and Mike Travis. ]

    As pda is now allocated in percpu area, it can easily be made a proper
    percpu variable. Make it so by defining per cpu symbol from linker
    script and declaring it in C code for SMP and simply defining it for
    UP. This change cleans up code and brings SMP and UP closer a bit.

    Signed-off-by: Tejun Heo
    Signed-off-by: Ingo Molnar

    Tejun Heo
     
  • [ Based on original patch from Christoph Lameter and Mike Travis. ]

    Currently pdas and percpu areas are allocated separately. %gs points
    to local pda and percpu area can be reached using pda->data_offset.
    This patch folds pda into percpu area.

    Due to strange gcc requirement, pda needs to be at the beginning of
    the percpu area so that pda->stack_canary is at %gs:40. To achieve
    this, a new percpu output section macro - PERCPU_VADDR_PREALLOC() - is
    added and used to reserve pda sized chunk at the start of the percpu
    area.

    After this change, for boot cpu, %gs first points to pda in the
    data.init area and later during setup_per_cpu_areas() gets updated to
    point to the actual pda. This means that setup_per_cpu_areas() need
    to reload %gs for CPU0 while clearing pda area for other cpus as cpu0
    already has modified it when control reaches setup_per_cpu_areas().

    This patch also removes now unnecessary get_local_pda() and its call
    sites.

    A lot of this patch is taken from Mike Travis' "x86_64: Fold pda into
    per cpu area" patch.

    Signed-off-by: Tejun Heo
    Signed-off-by: Ingo Molnar

    Tejun Heo
     
  • [ Based on original patch from Christoph Lameter and Mike Travis. ]

    CPU startup code in head_64.S loaded address of a zero page into %gs
    for temporary use till pda is loaded but address to the actual pda is
    available at the point. Load the real address directly instead.

    This will help unifying percpu and pda handling later on.

    This patch is mostly taken from Mike Travis' "x86_64: Fold pda into
    per cpu area" patch.

    Signed-off-by: Tejun Heo

    Tejun Heo
     
  • [ Based on original patch from Christoph Lameter and Mike Travis. ]

    This patch makes percpu symbols zerobased on x86_64 SMP by adding
    PERCPU_VADDR() to vmlinux.lds.h which helps setting explicit vaddr on
    the percpu output section and using it in vmlinux_64.lds.S. A new
    PHDR is added as existing ones cannot contain sections near address
    zero. PERCPU_VADDR() also adds a new symbol __per_cpu_load which
    always points to the vaddr of the loaded percpu data.init region.

    The following adjustments have been made to accomodate the address
    change.

    * code to locate percpu gdt_page in head_64.S is updated to add the
    load address to the gdt_page offset.

    * __per_cpu_load is used in places where access to the init data area
    is necessary.

    * pda->data_offset is initialized soon after C code is entered as zero
    value doesn't work anymore.

    This patch is mostly taken from Mike Travis' "x86_64: Base percpu
    variables at zero" patch.

    Signed-off-by: Tejun Heo
    Signed-off-by: Ingo Molnar

    Tejun Heo
     

04 Jan, 2009

1 commit


11 Oct, 2008

1 commit


16 Jul, 2008

3 commits


08 Jul, 2008

6 commits

  • Consistently set _PAGE_GLOBAL in _PAGE_KERNEL flags. This makes 32-
    and 64-bit code consistent, and removes some special cases where
    __PAGE_KERNEL* did not have _PAGE_GLOBAL set, causing confusion as a
    result of the inconsistencies.

    This patch only affects x86-64, which generally always supports PGD.
    The x86-32 patch is next.

    Signed-off-by: Jeremy Fitzhardinge
    Cc: Stephen Tweedie
    Cc: Eduardo Habkost
    Cc: Mark McLoughlin
    Signed-off-by: Ingo Molnar

    Jeremy Fitzhardinge
     
  • Ingo Molnar wrote:
    > -tip auto-testing found pagetable corruption (CPA self-test failure):
    >
    > [ 32.956015] CPA self-test:
    > [ 32.958822] 4k 2048 large 508 gb 0 x 2556[ffff880000000000-ffff88003fe00000] miss 0
    > [ 32.964000] CPA ffff88001d54e000: bad pte 1d4000e3
    > [ 32.968000] CPA ffff88001d54e000: unexpected level 2
    > [ 32.972000] CPA ffff880022c5d000: bad pte 22c000e3
    > [ 32.976000] CPA ffff880022c5d000: unexpected level 2
    > [ 32.980000] CPA ffff8800200ce000: bad pte 200000e3
    > [ 32.984000] CPA ffff8800200ce000: unexpected level 2
    > [ 32.988000] CPA ffff8800210f0000: bad pte 210000e3
    >
    > config and full log can be found at:
    >
    > http://redhat.com/~mingo/misc/config-Mon_Jun_30_11_11_51_CEST_2008.bad
    > http://redhat.com/~mingo/misc/log-Mon_Jun_30_11_11_51_CEST_2008.bad

    Phew. OK, I've worked this out. Short version is that's it's a false
    alarm, and there was no real failure here. Long version:

    * I changed the code to create the physical mapping pagetables to
    reuse any existing mapping rather than replace it. Specifically,
    reusing an pud pointed to by the pgd caused this symptom to appear.
    * The specific PUD being reused is the one created statically in
    head_64.S, which creates an initial 1GB mapping.
    * That mapping doesn't have _PAGE_GLOBAL set on it, due to the
    inconsistency between __PAGE_* and PAGE_*.
    * The CPA test attempts to clear _PAGE_GLOBAL, and then checks to
    see that the resulting range is 1) shattered into 4k pages, and 2)
    has no _PAGE_GLOBAL.
    * However, since it didn't have _PAGE_GLOBAL on that range to start
    with, change_page_attr_clear() had nothing to do, and didn't
    bother shattering the range,
    * resulting in the reported messages

    The simple fix is to set _PAGE_GLOBAL in level2_ident_pgt.

    An additional fix to make CPA testing more robust by using some other
    pagetable bit (one of the unused available-to-software ones). This
    would solve spurious CPA test warnings under Xen which uses _PAGE_GLOBAL
    for its own purposes (ie, not under guest control).

    Also, we should revisit the use of _PAGE_GLOBAL in asm-x86/pgtable.h,
    and use it consistently, and drop MAKE_GLOBAL. The first time I
    proposed it it caused breakages in the very early CPA code; with luck
    that's all fixed now.

    Signed-off-by: Jeremy Fitzhardinge
    Cc: Nick Piggin
    Cc: Mark McLoughlin
    Cc: xen-devel
    Cc: Eduardo Habkost
    Cc: Vegard Nossum
    Cc: Stephen Tweedie
    Cc: Yinghai Lu
    Signed-off-by: Ingo Molnar

    Jeremy Fitzhardinge
     
  • Set __PAGE_OFFSET to the most negative possible address +
    16*PGDIR_SIZE. The gap is to allow a space for a hypervisor to fit.
    The gap is more or less arbitrary, but it's what Xen needs.

    When booting native, kernel/head_64.S has a set of compile-time
    generated pagetables used at boot time. This patch removes their
    absolutely hard-coded layout, and makes it parameterised on
    __PAGE_OFFSET (and __START_KERNEL_map).

    Signed-off-by: Eduardo Habkost
    Signed-off-by: Jeremy Fitzhardinge
    Cc: xen-devel
    Cc: Stephen Tweedie
    Cc: Eduardo Habkost
    Cc: Mark McLoughlin
    Signed-off-by: Ingo Molnar

    Eduardo Habkost
     
  • i386 and x86_64 used two different schemes for maintaining the gdt.
    With this patch, x86_64 initial gdt table is defined in a .c file,
    same way as i386 is now. Also, we call it "gdt_page", and the descriptor,
    "early_gdt_descr". This way we achieve common naming, which can allow for
    more code integration.

    Signed-off-by: Glauber Costa
    Signed-off-by: Ingo Molnar

    Glauber Costa
     
  • call x86_64's init_rsp stack_start, just as i386 does.
    Put a zeroed stack segment for consistency. With this,
    we can eliminate one ugly ifdef in smpboot.c.

    Signed-off-by: Glauber Costa
    Signed-off-by: Ingo Molnar

    Glauber Costa
     
  • …', 'x86/cleanups', 'x86/cpa', 'x86/cpu', 'x86/defconfig', 'x86/gart', 'x86/i8259', 'x86/intel', 'x86/irqstats', 'x86/kconfig', 'x86/ldt', 'x86/mce', 'x86/memtest', 'x86/pat', 'x86/ptemask', 'x86/resumetrace', 'x86/threadinfo', 'x86/timers', 'x86/vdso' and 'x86/xen' into x86/devel

    Ingo Molnar
     

05 Jul, 2008

1 commit

  • Since the trampoline code is now used for ACPI resume from suspend to RAM,
    the trampoline page tables have to be fixed up during boot not only on SMP
    systems, but also on UP systems that use the trampoline.

    Reference: http://bugzilla.kernel.org/show_bug.cgi?id=10923

    Reported-by: Dionisus Torimens
    Signed-off-by: Rafael J. Wysocki
    Cc: Andi Kleen
    Cc: Andrew Morton
    Cc: pm list
    Signed-off-by: Ingo Molnar

    Rafael J. Wysocki
     

25 May, 2008

3 commits


17 Apr, 2008

4 commits

  • Move wakeup code to .c, so that video mode setting code can be shared
    between boot and wakeup. Remove nasty assembly code in 64-bit case by
    re-using trampoline code. Stack setup was fixed to clear high 16bits
    of %esp, maybe that fixes some machines.

    .c code sharing and morse code was done H. Peter Anvin, Sam Ravnborg
    reviewed kbuild related stuff, and it seems okay to him. Rafael did
    some cleanups.

    [rjw:
    * Made the patch stop breaking compilation on x86-32
    * Added arch/x86/kernel/acpi/sleep.h
    * Got rid of compiler warnings in arch/x86/kernel/acpi/sleep.c
    * Fixed 32-bit compilation on x86-64 systems
    * Added include/asm-x86/trampoline.h and fixed the non-SMP
    compilation on 64-bit x86
    * Removed arch/x86/kernel/acpi/sleep_32.c which was not used
    * Fixed some breakage caused by the integration of smpboot.c done
    under us in the meantime]

    Signed-off-by: Pavel Machek
    Signed-off-by: H. Peter Anvin
    Reviewed-by: Sam Ravnborg
    Signed-off-by: Rafael J. Wysocki
    Signed-off-by: Ingo Molnar

    Pavel Machek
     
  • Currently they are in .text.head because the rest of head_64.S.
    .text.head is not removed as init data, but the early exception handlers
    should be because they are not needed after early boot of the BP.
    So move them over.

    Signed-off-by: Andi Kleen
    Cc: mingo@elte.hu
    Signed-off-by: Thomas Gleixner
    Signed-off-by: Ingo Molnar

    Andi Kleen
     
  • The early exception handlers are currently set up using a macro
    recursion. There is only one user left. Replace the macro with a
    standard loop in place.

    Noop patch, just a cleanup.

    [ tglx@linutronix.de: simplified ]

    Signed-off-by: Andi Kleen
    Cc: mingo@elte.hu
    Signed-off-by: Thomas Gleixner
    Signed-off-by: Ingo Molnar

    Andi Kleen
     
  • All of early setup runs with interrupts disabled, so there is no
    need to set up early exception handlers for vectors >= 32

    This saves some minor text size.

    Signed-off-by: Andi Kleen
    Cc: mingo@elte.hu
    Signed-off-by: Thomas Gleixner
    Signed-off-by: Ingo Molnar

    Andi Kleen