13 Mar, 2009

1 commit


12 Mar, 2009

1 commit


11 Mar, 2009

2 commits


10 Mar, 2009

6 commits


09 Mar, 2009

6 commits

  • Impact: remove lots of lguest boot WARN_ON() when CONFIG_SPARSE_IRQ=y

    We now need to call irq_to_desc_alloc_cpu() before
    set_irq_chip_and_handler_name(), but we can't do that from init_IRQ (no
    kmalloc available).

    So do it as we use interrupts instead. Also means we only alloc for
    irqs we use, which was the intent of CONFIG_SPARSE_IRQ anyway.

    Signed-off-by: Rusty Russell
    Cc: Ingo Molnar

    Rusty Russell
     
  • Impact: fix lguest boot crash on modern Intel machines

    The code in early_init_intel does:

    if (c->x86 > 6 || (c->x86 == 6 && c->x86_model >= 0xd)) {
    u64 misc_enable;

    rdmsrl(MSR_IA32_MISC_ENABLE, misc_enable);

    And that rdmsr faults (not allowed from non-0 PL). We can get around
    this by mugging the family ID part of the cpuid. 5 seems like a good
    number.

    Of course, this is a hack (how very lguest!). We could just indicate
    that we don't support MSRs, or implement lguest_rdmst.

    Reported-by: Patrick McHardy
    Signed-off-by: Rusty Russell
    Tested-by: Patrick McHardy

    Rusty Russell
     
  • I found that virt_addr_valid() was returning true for fixmap addresses.

    I'm not sure whether pfn_valid() is supposed to include this test,
    but there's no harm in being explicit.

    Signed-off-by: Jeremy Fitzhardinge
    Cc: Jiri Slaby
    Cc: Yinghai Lu
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Jeremy Fitzhardinge
     
  • Impact: fix race+crash in mmiotrace

    The list manipulation in remove_kmmio_fault_pages() was broken. If more
    than one consecutive kmmio_fault_page was re-added during the grace
    period between unregister_kmmio_probe() and remove_kmmio_fault_pages(),
    the list manipulation failed to remove pages from the release list.

    After a second grace period the pages get into rcu_free_kmmio_fault_pages()
    and raise a BUG_ON() kernel crash.

    The list manipulation is fixed to properly remove pages from the release
    list.

    This bug has been present from the very beginning of mmiotrace in the
    mainline kernel. It was introduced in 0fd0e3da ("x86: mmiotrace full
    patch, preview 1");

    An urgent fix for Linus. Tested by Stuart (on 32-bit) and Pekka
    (on amd and intel 64-bit systems, nouveau and nvidia proprietary).

    Signed-off-by: Stuart Bennett
    Signed-off-by: Pekka Paalanen
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Stuart Bennett
     
  • Impact: cleanup

    Ingo found there warning about nodeid with some configs.

    try to use for_each_online_node for non numa too. in that case
    nodeid will be 0.

    also move out boundary checking from setup_node_bootmem(), so
    non-numa config will not check it.

    Signed-off-by: Yinghai Lu
    Cc: Andrew Morton
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Yinghai Lu
     
  • Impact: improve out-of-range fixmap index debugging

    Commit "1b42f51630c7eebce6fb780b480731eb81afd325"
    defined the __this_fixmap_does_not_exist() function
    with a WARN_ON(1) in it.

    This causes the linker to not report an error when
    __this_fixmap_does_not_exist() is called with a
    non-constant parameter.

    Ingo defined __this_fixmap_does_not_exist() because he
    wanted to get virt addresses of fix memory of nest level
    by non-constant index.

    But we can fix this and still keep the link-time check:

    We can get the four slot virt addresses on link time and
    store them to array slot_virt[].

    Then we can then refer the slot_virt with non-constant index,
    in the ioremap-leak detection code.

    Signed-off-by: Wang Chen
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Wang Chen
     

08 Mar, 2009

2 commits

  • Impact: cleanup and code size reduction on 64-bit

    This code is only applied to Intel Pentium and AMD K7 32-bit cpus.

    Move those checks to intel_init()/amd_init() for 32-bit
    so 64-bit will not build this code.

    Also change to use cpu_index check to see if we need to emit warning.

    Signed-off-by: Yinghai Lu
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Yinghai Lu
     
  • In uv_flush_tlb_others() (arch/x86/kernel/tlb_uv.c),
    the "WARN_ON(!in_atomic())" fails if CONFIG_PREEMPT is not enabled.

    And CONFIG_PREEMPT is not enabled by default in the distribution that
    most UV owners will use.

    We could #ifdef CONFIG_PREEMPT the warning, but that is not good form.
    And there seems to be no suitable fix to in_atomic() when CONFIG_PREMPT
    is not on.

    As Ingo commented:

    > and we have no proper primitive to test for atomicity. (mainly
    > because we dont know about atomicity on a non-preempt kernel)

    So we drop the WARN_ON.

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

    Cliff Wickman
     

07 Mar, 2009

1 commit

  • Stephen Rothwell reported:

    |Today's linux-next build (x86_64 allmodconfig) produced this warning:
    |
    |In file included from drivers/char/epca.c:49:
    |drivers/char/digiFep1.h:7:1: warning: "GLOBAL" redefined
    |In file included from include/linux/linkage.h:5,
    | from include/linux/kernel.h:11,
    | from arch/x86/include/asm/system.h:10,
    | from arch/x86/include/asm/processor.h:17,
    | from include/linux/prefetch.h:14,
    | from include/linux/list.h:6,
    | from include/linux/module.h:9,
    | from drivers/char/epca.c:29:
    |arch/x86/include/asm/linkage.h:55:1: warning: this is the location of the previous definition
    |
    |Probably introduced by commit 95695547a7db44b88a7ee36cf5df188de267e99e
    |("x86: asm linkage - introduce GLOBAL macro") from the x86 tree.

    Any assembler specific snippets being placed in headers
    are to be protected by __ASSEMBLY__. Fixed.

    Also move __ALIGN definition under the same protection as well.

    Reported-by: Stephen Rothwell
    Signed-off-by: Cyrill Gorcunov
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Cyrill Gorcunov
     

06 Mar, 2009

16 commits

  • Use fixmaps instead of vmap/vunmap in text_poke() for avoiding
    page allocation and delayed unmapping.

    At the result of above change, text_poke() becomes atomic and can be called
    from stop_machine() etc.

    Signed-off-by: Masami Hiramatsu
    Acked-by: Mathieu Desnoyers
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Masami Hiramatsu
     
  • Use the mutual exclusion provided by the text edit lock in alternatives code.
    Since alternative_smp_* will be called from module init code, etc,
    we'd better protect it from other subsystems.

    Signed-off-by: Masami Hiramatsu
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Masami Hiramatsu
     
  • Conflicts:
    arch/x86/Kconfig
    block/blktrace.c
    kernel/irq/handle.c

    Semantic conflict:
    kernel/trace/blktrace.c

    Signed-off-by: Ingo Molnar

    Ingo Molnar
     
  • ds_write_config() can write the BTS as well as the PEBS part of
    the DS config. ds_request_pebs() passes the wrong qualifier, which
    results in the wrong configuration to be written.

    Reported-by: Stephane Eranian
    Signed-off-by: Markus Metzger
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Markus Metzger
     
  • In case a ptraced task is reaped (while the tracer is still attached),
    ds_exit_thread() is called before ptrace_exit(). The latter will
    release the bts_tracer and remove the thread's ds_ctx.
    The former will WARN() if the context is not NULL.

    Oleg Nesterov submitted patches that move ptrace_exit() before
    exit_thread() and thus reverse the order of the above calls.

    Remove the bad warning. I will add it again when Oleg's changes are in.

    Signed-off-by: Markus Metzger
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Markus Metzger
     
  • As a preparational step for unifying noexec handling on 32-bit and 64-bit,
    rename the do_not_nx variable to disable_nx on 64-bit.

    Signed-off-by: Pekka Enberg
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Pekka Enberg
     
  • Signed-off-by: Pekka Enberg
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Pekka Enberg
     
  • Impact: make boot command line "memtest" do one loop by default

    So don't need to guess many patterns in one loop.

    Signed-off-by: Yinghai Lu
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Yinghai Lu
     
  • Impact: fix relocation overflow during module load

    x86_64 uses 32bit relocations for symbol access and static percpu
    symbols whether in core or modules must be inside 2GB of the percpu
    segement base which the dynamic percpu allocator doesn't guarantee.
    This patch makes x86_64 reserve PERCPU_MODULE_RESERVE bytes in the
    first chunk so that module percpu areas are always allocated from the
    first chunk which is always inside the relocatable range.

    This problem exists for any percpu allocator but is easily triggered
    when using the embedding allocator because the second chunk is located
    beyond 2GB on it.

    This patch also changes the meaning of PERCPU_DYNAMIC_RESERVE such
    that it only indicates the size of the area to reserve for dynamic
    allocation as static and dynamic areas can be separate. New
    PERCPU_DYNAMIC_RESERVED is increased by 4k for both 32 and 64bits as
    the reserved area separation eats away some allocatable space and
    having slightly more headroom (currently between 4 and 8k after
    minimal boot sans module area) makes sense for common case
    performance.

    x86_32 can address anywhere from anywhere and doesn't need reserving.

    Mike Galbraith first reported the problem first and bisected it to the
    embedding percpu allocator commit.

    Signed-off-by: Tejun Heo
    Reported-by: Mike Galbraith
    Reported-by: Jaswinder Singh Rajput

    Tejun Heo
     
  • Impact: add reserved allocation functionality and use it for module
    percpu variables

    This patch implements reserved allocation from the first chunk. When
    setting up the first chunk, arch can ask to set aside certain number
    of bytes right after the core static area which is available only
    through a separate reserved allocator. This will be used primarily
    for module static percpu variables on architectures with limited
    relocation range to ensure that the module perpcu symbols are inside
    the relocatable range.

    If reserved area is requested, the first chunk becomes reserved and
    isn't available for regular allocation. If the first chunk also
    includes piggy-back dynamic allocation area, a separate chunk mapping
    the same region is created to serve dynamic allocation. The first one
    is called static first chunk and the second dynamic first chunk.
    Although they share the page map, their different area map
    initializations guarantee they serve disjoint areas according to their
    purposes.

    If arch doesn't setup reserved area, reserved allocation is handled
    like any other allocation.

    Signed-off-by: Tejun Heo

    Tejun Heo
     
  • Impact: reduce unnecessary memory usage on certain configurations

    Embedding percpu allocator allocates unit_size *
    smp_num_possible_cpus() bytes consecutively and use it for the first
    chunk. However, if the static area is small, this can result in
    excessive prellocated free space in the first chunk due to
    PCPU_MIN_UNIT_SIZE restriction.

    This patch makes embedding percpu allocator preallocate only what's
    necessary as described by PERPCU_DYNAMIC_RESERVE and return the
    leftover to the bootmem allocator.

    Signed-off-by: Tejun Heo

    Tejun Heo
     
  • Impact: argument semantic cleanup

    In pcpu_setup_first_chunk(), zero @unit_size and @dyn_size meant
    auto-sizing. It's okay for @unit_size as 0 doesn't make sense but 0
    dynamic reserve size is valid. Alos, if arch @dyn_size is calculated
    from other parameters, it might end up passing in 0 @dyn_size and
    malfunction when the size is automatically adjusted.

    This patch makes both @unit_size and @dyn_size ssize_t and use -1 for
    auto sizing.

    Signed-off-by: Tejun Heo

    Tejun Heo
     
  • Ingo Molnar
     
  • Ingo Molnar
     
  • Ingo Molnar
     
  • Conflicts:
    arch/x86/include/asm/fixmap_64.h
    Semantic merge:
    arch/x86/include/asm/fixmap.h

    Signed-off-by: Ingo Molnar

    Ingo Molnar
     

05 Mar, 2009

5 commits

  • Make ack_APIC_irq() build on !SMP && !APIC too.

    Cc: Dimitri Sivanich
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Ingo Molnar
     
  • Impact: cleanup, micro-optimization

    Pre-initialize boot_cpu_data.x86_phys_bits to a reasonable default
    to remove the use of system_state tests in __virt_addr_valid()
    and __phys_addr().

    Signed-off-by: Jeremy Fitzhardinge
    Signed-off-by: Ingo Molnar

    Jeremy Fitzhardinge
     
  • Rather than relying on the ever-unreliable system_state,
    add a specific __vmalloc_start_set flag to indicate whether
    the vmalloc area has meaningful boundaries yet, and use that
    in x86-32's __phys_addr and __virt_addr_valid.

    Signed-off-by: Jeremy Fitzhardinge
    Signed-off-by: Ingo Molnar

    Jeremy Fitzhardinge
     
  • gcc 3.2.2 reports:

    In file included from /usr/src/all/linux-next/arch/x86/include/asm/page.h:8,
    from /usr/src/all/linux-next/arch/x86/include/asm/processor.h:18,
    from /usr/src/all/linux-next/arch/x86/include/asm/atomic_32.h:6,
    from /usr/src/all/linux-next/arch/x86/include/asm/atomic.h:2,
    from include/linux/crypto.h:20,
    from arch/x86/kernel/asm-offsets_32.c:7,
    from arch/x86/kernel/asm-offsets.c:2:
    /usr/src/all/linux-next/arch/x86/include/asm/page_types.h:54: warning: parameter has incomplete type
    /usr/src/all/linux-next/arch/x86/include/asm/page_types.h:56: warning: parameter has incomplete type
    In file included from /usr/src/all/linux-next/arch/x86/include/asm/page.h:8,
    from /usr/src/all/linux-next/arch/x86/include/asm/processor.h:18,
    from include/linux/prefetch.h:14,
    from include/linux/list.h:6,
    from include/linux/module.h:9,
    from init/main.c:13:
    /usr/src/all/linux-next/arch/x86/include/asm/page_types.h:54: warning: parameter has incomplete type
    /usr/src/all/linux-next/arch/x86/include/asm/page_types.h:56: warning: parameter has incomplete type

    This is a bogus warning, but moving the pat-related functions
    into asm/pat.h and including asm/pgtable_types.h should fix it.

    Signed-off-by: Jeremy Fitzhardinge
    Reported-by: Tetsuo Handa

    Signed-off-by: Ingo Molnar

    Jeremy Fitzhardinge
     
  • Impact: build fix

    Cc: Pekka Enberg
    Cc: Yinghai Lu
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Ingo Molnar