20 Sep, 2013

3 commits


13 Sep, 2013

3 commits

  • After the last architecture switched to generic hard irqs the config
    options HAVE_GENERIC_HARDIRQS & GENERIC_HARDIRQS and the related code
    for !CONFIG_GENERIC_HARDIRQS can be removed.

    Signed-off-by: Martin Schwidefsky

    Martin Schwidefsky
     
  • Unlike global OOM handling, memory cgroup code will invoke the OOM killer
    in any OOM situation because it has no way of telling faults occuring in
    kernel context - which could be handled more gracefully - from
    user-triggered faults.

    Pass a flag that identifies faults originating in user space from the
    architecture-specific fault handlers to generic code so that memcg OOM
    handling can be improved.

    Signed-off-by: Johannes Weiner
    Reviewed-by: Michal Hocko
    Cc: David Rientjes
    Cc: KAMEZAWA Hiroyuki
    Cc: azurIt
    Cc: KOSAKI Motohiro
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Johannes Weiner
     
  • Kernel faults are expected to handle OOM conditions gracefully (gup,
    uaccess etc.), so they should never invoke the OOM killer. Reserve this
    for faults triggered in user context when it is the only option.

    Most architectures already do this, fix up the remaining few.

    Signed-off-by: Johannes Weiner
    Reviewed-by: Michal Hocko
    Acked-by: KOSAKI Motohiro
    Cc: David Rientjes
    Cc: KAMEZAWA Hiroyuki
    Cc: azurIt
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Johannes Weiner
     

12 Sep, 2013

1 commit

  • Currently hugepage migration works well only for pmd-based hugepages
    (mainly due to lack of testing,) so we had better not enable migration of
    other levels of hugepages until we are ready for it.

    Some users of hugepage migration (mbind, move_pages, and migrate_pages) do
    page table walk and check pud/pmd_huge() there, so they are safe. But the
    other users (softoffline and memory hotremove) don't do this, so without
    this patch they can try to migrate unexpected types of hugepages.

    To prevent this, we introduce hugepage_migration_support() as an
    architecture dependent check of whether hugepage are implemented on a pmd
    basis or not. And on some architecture multiple sizes of hugepages are
    available, so hugepage_migration_support() also checks hugepage size.

    Signed-off-by: Naoya Horiguchi
    Cc: Andi Kleen
    Cc: Hillf Danton
    Cc: Wanpeng Li
    Cc: Mel Gorman
    Cc: Hugh Dickins
    Cc: KOSAKI Motohiro
    Cc: Michal Hocko
    Cc: Rik van Riel
    Cc: "Aneesh Kumar K.V"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Naoya Horiguchi
     

11 Sep, 2013

1 commit

  • Pull device tree core updates from Grant Likely:
    "Generally minor changes. A bunch of bug fixes, particularly for
    initialization and some refactoring. Most notable change if feeding
    the entire flattened tree into the random pool at boot. May not be
    significant, but shouldn't hurt either"

    Tim Bird questions whether the boot time cost of the random feeding may
    be noticeable. And "add_device_randomness()" is definitely not some
    speed deamon of a function.

    * tag 'devicetree-for-linus' of git://git.secretlab.ca/git/linux:
    of/platform: add error reporting to of_amba_device_create()
    irq/of: Fix comment typo for irq_of_parse_and_map
    of: Feed entire flattened device tree into the random pool
    of/fdt: Clean up casting in unflattening path
    of/fdt: Remove duplicate memory clearing on FDT unflattening
    gpio: implement gpio-ranges binding document fix
    of: call __of_parse_phandle_with_args from of_parse_phandle
    of: introduce of_parse_phandle_with_fixed_args
    of: move of_parse_phandle()
    of: move documentation of of_parse_phandle_with_args
    of: Fix missing memory initialization on FDT unflattening
    of: consolidate definition of early_init_dt_alloc_memory_arch()
    of: Make of_get_phy_mode() return int i.s.o. const int
    include: dt-binding: input: create a DT header defining key codes.
    of/platform: Staticize of_platform_device_create_pdata()
    of: Specify initrd location using 64-bit
    dt: Typo fix
    OF: make of_property_for_each_{u32|string}() use parameters if OF is not enabled

    Linus Torvalds
     

07 Sep, 2013

1 commit

  • Pull ARM64 update from Catalin Marinas:
    - User tagged pointers support (top 8-bit of user pointers
    automatically ignored by the CPU).
    - Kernel mode NEON (no users for arm64 yet but work in progress).
    - arm64 kernel Image header extended to accommodate future EFI stub.
    - Remove BogoMIPS reporting (not relevant, it's just the timer
    frequency).
    - Clean-up (EM_AARCH64/EM_ARM to elf-em.h, ELF notes in read-only
    segment, unused variable).
    - Bug-fixes (RAM boundaries not 2MB aligned, perf, includes).

    * tag 'arm64-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/cmarinas/linux-aarch64:
    Documentation/arm64: clarify requirements for DTB placement
    arm64: mm: permit use of tagged pointers at EL0
    Move the EM_ARM and EM_AARCH64 definitions to uapi/linux/elf-em.h
    arm64: Remove unused cpu_name ascii in arch/arm64/mm/proc.S
    arm64: delay: don't bother reporting bogomips in /proc/cpuinfo
    arm64: Fix mapping of memory banks not ending on a PMD_SIZE boundary
    arm64: move elf notes into readonly segment
    arm64: Enable interrupts in the EL0 undef handler
    arm64: Expand arm64 image header
    ARM64: include: asm: include "asm/types.h" in "pgtable-2level-types.h" and "pgtable-3level-types.h"
    arm64: add support for kernel mode NEON
    arm64: perf: fix ARMv8 EVTYPE_MASK to include NSH bit
    arm64: perf: fix group validation when using enable_on_exec

    Linus Torvalds
     

04 Sep, 2013

1 commit

  • Pull timer changes from Ingo Molnar:
    "Various clocksource driver updates: extend the core with memory mapped
    hardware (mmio) support and add new (ARM) Moxart SoC and sun4i
    hardware support"

    * 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (23 commits)
    clocksource: arch_timer: Add support for memory mapped timers
    clocksource: arch_timer: Push the read/write wrappers deeper
    Documentation: Add memory mapped ARM architected timer binding
    clocksource: arch_timer: Pass clock event to set_mode callback
    clocksource: arch_timer: Make register accessors less error-prone
    ARM: clocksource: moxart: documentation: Update device tree bindings document
    ARM: clocksource: moxart: Add bitops.h include
    ARM: clocksource: moxart: documentation: Fix device tree bindings document
    ARM: clocksource: Add support for MOXA ART SoCs
    clocksource: cadence_ttc: Reuse clocksource as sched_clock
    clocksource: cadence_ttc: Remove unused header
    clocksource: sun4i: Fix bug when switching from periodic to oneshot modes
    clocksource: sun4i: Cleanup parent clock setup
    clocksource: sun4i: Remove TIMER_SCAL variable
    clocksource: sun4i: Factor out some timer code
    clocksource: sun4i: Fix the next event code
    clocksource: sun4i: Don't forget to enable the clock we use
    clocksource: sun4i: Add clocksource and sched clock drivers
    clocksource: sun4i: rename AUTORELOAD define to RELOAD
    clocksource: sun4i: Wrap macros arguments in parenthesis
    ...

    Linus Torvalds
     

03 Sep, 2013

1 commit

  • TCR.TBI0 can be used to cause hardware address translation to ignore the
    top byte of userspace virtual addresses. Whilst not especially useful in
    standard C programs, this can be used by JITs to `tag' pointers with
    various pieces of metadata.

    This patch enables this bit for AArch64 Linux, and adds a new file to
    Documentation/arm64/ which describes some potential caveats when using
    tagged virtual addresses.

    Signed-off-by: Will Deacon
    Signed-off-by: Catalin Marinas

    Will Deacon
     

02 Sep, 2013

2 commits


31 Aug, 2013

1 commit


29 Aug, 2013

2 commits


28 Aug, 2013

2 commits

  • The map_mem() function limits the current memblock limit to PGDIR_SIZE
    (the initial swapper_pg_dir mapping) to avoid create_mapping()
    allocating memory from unmapped areas. However, if the first block is
    within PGDIR_SIZE and not ending on a PMD_SIZE boundary, when 4K page
    configuration is enabled, create_mapping() will try to allocate a pte
    page. Such page may be returned by memblock_alloc() from the end of such
    bank (or any subsequent bank within PGDIR_SIZE) which is not mapped yet.

    The patch limits the current memblock limit to the aligned end of the
    first bank and gradually increases it as more memory is mapped. It also
    ensures that the start of the first bank is aligned to PMD_SIZE to avoid
    pte page allocation for this mapping.

    Signed-off-by: Catalin Marinas
    Reported-by: "Leizhen (ThunderTown, Euler)"
    Tested-by: "Leizhen (ThunderTown, Euler)"

    Catalin Marinas
     
  • The current vmlinux.lds.S places the notes sections between the
    end of rw data and start of bss. This means that _edata doesn't
    really point to the end of data. Since notes are read-only, this
    patch moves them to the read-only segment so that _edata does
    point to the end of initialized rw data.

    Signed-off-by: Mark Salter
    Signed-off-by: Catalin Marinas

    Mark Salter
     

22 Aug, 2013

5 commits

  • do_undefinstr() has to be called with interrupts disabled since it may
    read the instruction from the user address space which could lead to a
    data abort and subsequent might_sleep() warning in do_page_fault().

    Signed-off-by: Catalin Marinas

    Catalin Marinas
     
  • Expand the arm64 image header to allow for co-existance with
    PE/COFF header required by the EFI stub. The PE/COFF format
    requires the "MZ" header to be at offset 0, and the offset
    to the PE/COFF header to be at offset 0x3c. The image
    header is expanded to allow 2 instructions at the beginning
    to accommodate a benign intruction at offset 0 that includes
    the "MZ" header, a magic number, and the offset to the PE/COFF
    header.

    Signed-off-by: Roy Franz
    Signed-off-by: Catalin Marinas

    Roy Franz
     
  • Need include "asm/types.h", just like arm has done, or can not pass
    compiling, the related error:

    In file included from arch/arm64/include/asm/page.h:37:0,
    from drivers/staging/lustre/include/linux/lnet/linux/lib-lnet.h:42,
    from drivers/staging/lustre/include/linux/lnet/lib-lnet.h:44,
    from drivers/staging/lustre/lnet/lnet/api-ni.c:38:
    arch/arm64/include/asm/pgtable-2level-types.h:19:1: error: unknown type name ‘u64
    arch/arm64/include/asm/pgtable-2level-types.h:20:1: error: unknown type name ‘u64’

    Signed-off-by: Chen Gang
    Signed-off-by: Catalin Marinas

    Chen Gang
     
  • Pull arm64 perf fixes from Catalin Marinas:
    "Perf backend fixes for arm64 where the user can cause kernel panic
    (discovered with Vince's fuzzing tool)"

    * tag 'arm64-stable' of git://git.kernel.org/pub/scm/linux/kernel/git/cmarinas/linux-aarch64:
    arm64: perf: fix event validation for software group leaders
    arm64: perf: fix array out of bounds access in armpmu_map_hw_event()

    Linus Torvalds
     
  • Pull kvm fixes from Paolo Bonzini:
    "Fixes for ARM and aarch64.

    This pull request is coming a bit later than I would have preferred,
    because I and Gleb happened to have holidays around the same weeks of
    August... sorry about that"

    * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm:
    KVM: ARM: Squash len warning
    arm64: KVM: use 'int' instead of 'u32' for variable 'target' in kvm_host.h.
    arm64: KVM: add missing dsb before invalidating Stage-2 TLBs
    arm64: KVM: perform save/restore of PAR_EL1
    arm64: KVM: fix 2-level page tables unmapping
    ARM: KVM: Fix unaligned unmap_range leak
    ARM: KVM: Fix 64-bit coprocessor handling

    Linus Torvalds
     

21 Aug, 2013

1 commit


20 Aug, 2013

5 commits


16 Aug, 2013

1 commit

  • Ben Tebulin reported:

    "Since v3.7.2 on two independent machines a very specific Git
    repository fails in 9/10 cases on git-fsck due to an SHA1/memory
    failures. This only occurs on a very specific repository and can be
    reproduced stably on two independent laptops. Git mailing list ran
    out of ideas and for me this looks like some very exotic kernel issue"

    and bisected the failure to the backport of commit 53a59fc67f97 ("mm:
    limit mmu_gather batching to fix soft lockups on !CONFIG_PREEMPT").

    That commit itself is not actually buggy, but what it does is to make it
    much more likely to hit the partial TLB invalidation case, since it
    introduces a new case in tlb_next_batch() that previously only ever
    happened when running out of memory.

    The real bug is that the TLB gather virtual memory range setup is subtly
    buggered. It was introduced in commit 597e1c3580b7 ("mm/mmu_gather:
    enable tlb flush range in generic mmu_gather"), and the range handling
    was already fixed at least once in commit e6c495a96ce0 ("mm: fix the TLB
    range flushed when __tlb_remove_page() runs out of slots"), but that fix
    was not complete.

    The problem with the TLB gather virtual address range is that it isn't
    set up by the initial tlb_gather_mmu() initialization (which didn't get
    the TLB range information), but it is set up ad-hoc later by the
    functions that actually flush the TLB. And so any such case that forgot
    to update the TLB range entries would potentially miss TLB invalidates.

    Rather than try to figure out exactly which particular ad-hoc range
    setup was missing (I personally suspect it's the hugetlb case in
    zap_huge_pmd(), which didn't have the same logic as zap_pte_range()
    did), this patch just gets rid of the problem at the source: make the
    TLB range information available to tlb_gather_mmu(), and initialize it
    when initializing all the other tlb gather fields.

    This makes the patch larger, but conceptually much simpler. And the end
    result is much more understandable; even if you want to play games with
    partial ranges when invalidating the TLB contents in chunks, now the
    range information is always there, and anybody who doesn't want to
    bother with it won't introduce subtle bugs.

    Ben verified that this fixes his problem.

    Reported-bisected-and-tested-by: Ben Tebulin
    Build-testing-by: Stephen Rothwell
    Build-testing-by: Richard Weinberger
    Reviewed-by: Michal Hocko
    Acked-by: Peter Zijlstra
    Cc: stable@vger.kernel.org
    Signed-off-by: Linus Torvalds

    Linus Torvalds
     

09 Aug, 2013

3 commits

  • 'target' will be set to '-1' in kvm_arch_vcpu_init(), and it need check
    'target' whether less than zero or not in kvm_vcpu_initialized().

    So need define target as 'int' instead of 'u32', just like ARM has done.

    The related warning:

    arch/arm64/kvm/../../../arch/arm/kvm/arm.c:497:2: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]

    Signed-off-by: Chen Gang
    [Marc: reformated the Subject line to fit the series]
    Signed-off-by: Marc Zyngier

    Chen Gang
     
  • When performing a Stage-2 TLB invalidation, it is necessary to
    make sure the write to the page tables is observable by all CPUs.

    For this purpose, add dsb instructions to __kvm_tlb_flush_vmid_ipa
    and __kvm_flush_vm_context before doing the TLB invalidation itself.

    Signed-off-by: Marc Zyngier

    Marc Zyngier
     
  • Not saving PAR_EL1 is an unfortunate oversight. If the guest
    performs an AT* operation and gets scheduled out before reading
    the result of the translation from PAREL1, it could become
    corrupted by another guest or the host.

    Saving this register is made slightly more complicated as KVM also
    uses it on the permission fault handling path, leading to an ugly
    "stash and restore" sequence. Fortunately, this is already a slow
    path so we don't really care. Also, Linux doesn't do any AT*
    operation, so Linux guests are not impacted by this bug.

    Signed-off-by: Marc Zyngier

    Marc Zyngier
     

01 Aug, 2013

2 commits

  • We're going to introduce support to read and write the memory
    mapped timer registers in the next patch, so push the cp15
    read/write functions one level deeper. This simplifies the next
    patch and makes it clearer what's going on.

    Cc: Mark Rutland
    Cc: Marc Zyngier
    Signed-off-by: Stephen Boyd
    Signed-off-by: Daniel Lezcano
    Acked-by: Mark Rutland

    Stephen Boyd
     
  • Using an enum for the register we wish to access allows newer
    compilers to determine if we've forgotten a case in our switch
    statement. This allows us to remove the BUILD_BUG() instances in
    the arm64 port, avoiding problems where optimizations may not
    happen.

    To try and force better code generation we're currently marking
    the accessor functions as inline, but newer compilers can ignore
    the inline keyword unless it's marked __always_inline. Luckily on
    arm and arm64 inline is __always_inline, but let's make
    everything __always_inline to be explicit.

    Suggested-by: Thomas Gleixner
    Cc: Thomas Gleixner
    Cc: Mark Rutland
    Cc: Marc Zyngier
    Signed-off-by: Stephen Boyd
    Signed-off-by: Daniel Lezcano
    Acked-by: Mark Rutland

    Stephen Boyd
     

26 Jul, 2013

1 commit

  • Written by Catalin Marinas, tested by APM on storm platform. This is needed
    because of the failures encountered when running SpecWeb benchmark test.

    Signed-off-by: Feng Kan
    Acked-by: Kumar Sankaran
    Signed-off-by: Catalin Marinas

    Feng Kan
     

24 Jul, 2013

1 commit

  • On some PAE architectures, the entire range of physical memory could reside
    outside the 32-bit limit. These systems need the ability to specify the
    initrd location using 64-bit numbers.

    This patch globally modifies the early_init_dt_setup_initrd_arch() function to
    use 64-bit numbers instead of the current unsigned long.

    There has been quite a bit of debate about whether to use u64 or phys_addr_t.
    It was concluded to stick to u64 to be consistent with rest of the device
    tree code. As summarized by Geert, "The address to load the initrd is decided
    by the bootloader/user and set at that point later in time. The dtb should not
    be tied to the kernel you are booting"

    More details on the discussion can be found here:
    https://lkml.org/lkml/2013/6/20/690
    https://lkml.org/lkml/2012/9/13/544

    Signed-off-by: Santosh Shilimkar
    Acked-by: Rob Herring
    Acked-by: Vineet Gupta
    Acked-by: Jean-Christophe PLAGNIOL-VILLARD
    Signed-off-by: Grant Likely

    Santosh Shilimkar
     

23 Jul, 2013

2 commits


20 Jul, 2013

1 commit

  • Pull arm64 fixes from Catalin Marinas:
    - Post -rc1 update to the common reboot infrastructure.
    - Fixes (user cache maintenance fault handling, !COMPAT compilation,
    CPU online and interrupt hanlding).

    * tag 'arm64-stable' of git://git.kernel.org/pub/scm/linux/kernel/git/cmarinas/linux-aarch64:
    arm64: use common reboot infrastructure
    arm64: mm: don't treat user cache maintenance faults as writes
    arm64: add '#ifdef CONFIG_COMPAT' for aarch32_break_handler()
    arm64: Only enable local interrupts after the CPU is marked online

    Linus Torvalds