11 Jan, 2012

1 commit

  • lib: use generic pci_iomap on all architectures

    Many architectures don't want to pull in iomap.c,
    so they ended up duplicating pci_iomap from that file.
    That function isn't trivial, and we are going to modify it
    https://lkml.org/lkml/2011/11/14/183
    so the duplication hurts.

    This reduces the scope of the problem significantly,
    by moving pci_iomap to a separate file and
    referencing that from all architectures.

    * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost:
    alpha: drop pci_iomap/pci_iounmap from pci-noop.c
    mn10300: switch to GENERIC_PCI_IOMAP
    mn10300: add missing __iomap markers
    frv: switch to GENERIC_PCI_IOMAP
    tile: switch to GENERIC_PCI_IOMAP
    tile: don't panic on iomap
    sparc: switch to GENERIC_PCI_IOMAP
    sh: switch to GENERIC_PCI_IOMAP
    powerpc: switch to GENERIC_PCI_IOMAP
    parisc: switch to GENERIC_PCI_IOMAP
    mips: switch to GENERIC_PCI_IOMAP
    microblaze: switch to GENERIC_PCI_IOMAP
    arm: switch to GENERIC_PCI_IOMAP
    alpha: switch to GENERIC_PCI_IOMAP
    lib: add GENERIC_PCI_IOMAP
    lib: move GENERIC_IOMAP to lib/Kconfig

    Fix up trivial conflicts due to changes nearby in arch/{m68k,score}/Kconfig

    Linus Torvalds
     

07 Jan, 2012

1 commit

  • * 'for-linus' of git://ftp.arm.linux.org.uk/pub/linux/arm/kernel/git-cur/linux-2.6-arm: (207 commits)
    ARM: 7267/1: Remove BUILD_BUG_ON from asm/bug.h
    ARM: 7269/1: mach-sa1100: fix sched_clock breakage
    ARM: 7198/1: arm/imx6: add restart support for imx6q
    ARM: restart: remove the now empty arch_reset()
    ARM: restart: remove comments about adding code to arch_reset()
    ARM: restart: lpc32xx & u300: remove unnecessary printk
    ARM: restart: plat-samsung: remove plat/reset.h and s5p_reset_hook
    ARM: restart: w90x900: use new restart hook
    ARM: restart: Versatile Express: use new restart hook
    ARM: restart: versatile: use new restart hook
    ARM: restart: u300: use new restart hook
    ARM: restart: tegra: use new restart hook
    ARM: restart: spear: use new restart hook
    ARM: restart: shark: use new restart hook
    ARM: restart: sa1100: use new restart hook
    ARM: 7252/1: restart: S5PV210: use new restart hook
    ARM: 7251/1: restart: S5PC100: use new restart hook
    ARM: 7250/1: restart: S5P64X0: use new restart hook
    ARM: 7266/1: restart: S3C64XX: use new restart hook
    ARM: 7265/1: restart: S3C24XX: use new restart hook
    ...

    Fix up trivial conflict in arch/arm/mm/init.c due to removal of
    memblock_init() clashing with the movement of the sorting of the meminfo
    array.

    Linus Torvalds
     

06 Jan, 2012

1 commit

  • * 'core-memblock-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (52 commits)
    memblock: Reimplement memblock allocation using reverse free area iterator
    memblock: Kill early_node_map[]
    score: Use HAVE_MEMBLOCK_NODE_MAP
    s390: Use HAVE_MEMBLOCK_NODE_MAP
    mips: Use HAVE_MEMBLOCK_NODE_MAP
    ia64: Use HAVE_MEMBLOCK_NODE_MAP
    SuperH: Use HAVE_MEMBLOCK_NODE_MAP
    sparc: Use HAVE_MEMBLOCK_NODE_MAP
    powerpc: Use HAVE_MEMBLOCK_NODE_MAP
    memblock: Implement memblock_add_node()
    memblock: s/memblock_analyze()/memblock_allow_resize()/ and update users
    memblock: Track total size of regions automatically
    powerpc: Cleanup memblock usage
    memblock: Reimplement memblock_enforce_memory_limit() using __memblock_remove()
    memblock: Make memblock functions handle overflowing range @size
    memblock: Reimplement __memblock_remove() using memblock_isolate_range()
    memblock: Separate out memblock_isolate_range() from memblock_set_node()
    memblock: Kill memblock_init()
    memblock: Kill sentinel entries at the end of static region arrays
    memblock: Add __memblock_dump_all()
    ...

    Linus Torvalds
     

05 Jan, 2012

2 commits


24 Dec, 2011

1 commit

  • Activation conditions for a workaround should not be encoded in the
    workaround's direct dependencies if this makes otherwise reasonable
    configuration choices impossible.

    This patches uses the SMP/UP patching facilities instead to compile
    out the workaround if the configuration means that it is definitely
    not needed.

    This means that configs for buggy silicon can simply select
    ARM_ERRATA_751472, without preventing a UP kernel from being built
    or duplicatiing knowledge about when to activate the workaround.
    This seems the correct way to do things, because the erratum is a
    property of the silicon, irrespective of what the kernel config
    happens to be.

    Signed-off-by: Dave Martin
    Signed-off-by: Russell King

    Dave Martin
     

20 Dec, 2011

2 commits


19 Dec, 2011

1 commit

  • Making CACHE_L2X0 depend on (huge list of MACH_ and ARCH_ configs)
    is bothersome to maintain and likely to lead to merge conflicts.

    This patch moves the knowledge of which platforms have a L2x0 or
    PL310 cache controller to the individual machines. To enable this,
    a new MIGHT_HAVE_CACHE_L2X0 config option is introduced to allow
    machines to indicate that they may have such a cache controller
    independently of each other.

    Boards/SoCs which cannot reliably operate without the L2 cache
    controller support will need to select CACHE_L2X0 directly from
    their own Kconfigs instead. This applies to some TrustZone-enabled
    boards where Linux runs in the Normal World, for example.

    Signed-off-by: Dave Martin
    Acked-by: Anton Vorontsov
    (for cns3xxx)
    Acked-by: Tony Lindgren
    (for omap)
    Acked-by: Shawn Guo
    (for imx)
    Acked-by: Kukjin Kim
    (for exynos)
    Acked-by: Sascha Hauer
    (for imx)
    Acked-by: Olof Johansson
    (for tegra)

    Dave Martin
     

11 Dec, 2011

1 commit

  • This patch adds processor info for ARM Ltd. Cortex-A7.

    A7 is architecturally identical to A15 so it shares the
    same SMP initialization code and hwcaps.

    Tested-by: Will Deacon
    Signed-off-by: Pawel Moll
    Signed-off-by: Russell King

    Pawel Moll
     

09 Dec, 2011

4 commits

  • The only function of memblock_analyze() is now allowing resize of
    memblock region arrays. Rename it to memblock_allow_resize() and
    update its users.

    * The following users remain the same other than renaming.

    arm/mm/init.c::arm_memblock_init()
    microblaze/kernel/prom.c::early_init_devtree()
    powerpc/kernel/prom.c::early_init_devtree()
    openrisc/kernel/prom.c::early_init_devtree()
    sh/mm/init.c::paging_init()
    sparc/mm/init_64.c::paging_init()
    unicore32/mm/init.c::uc32_memblock_init()

    * In the following users, analyze was used to update total size which
    is no longer necessary.

    powerpc/kernel/machine_kexec.c::reserve_crashkernel()
    powerpc/kernel/prom.c::early_init_devtree()
    powerpc/mm/init_32.c::MMU_init()
    powerpc/mm/tlb_nohash.c::__early_init_mmu()
    powerpc/platforms/ps3/mm.c::ps3_mm_add_memory()
    powerpc/platforms/embedded6xx/wii.c::wii_memory_fixups()
    sh/kernel/machine_kexec.c::reserve_crashkernel()

    * x86/kernel/e820.c::memblock_x86_fill() was directly setting
    memblock_can_resize before populating memblock and calling analyze
    afterwards. Call memblock_allow_resize() before start populating.

    memblock_can_resize is now static inside memblock.c.

    Signed-off-by: Tejun Heo
    Cc: Benjamin Herrenschmidt
    Cc: Yinghai Lu
    Cc: Russell King
    Cc: Michal Simek
    Cc: Paul Mundt
    Cc: "David S. Miller"
    Cc: Guan Xuetao
    Cc: "H. Peter Anvin"

    Tejun Heo
     
  • memblock_init() initializes arrays for regions and memblock itself;
    however, all these can be done with struct initializers and
    memblock_init() can be removed. This patch kills memblock_init() and
    initializes memblock with struct initializer.

    The only difference is that the first dummy entries don't have .nid
    set to MAX_NUMNODES initially. This doesn't cause any behavior
    difference.

    Signed-off-by: Tejun Heo
    Cc: Benjamin Herrenschmidt
    Cc: Yinghai Lu
    Cc: Russell King
    Cc: Michal Simek
    Cc: Paul Mundt
    Cc: "David S. Miller"
    Cc: Guan Xuetao
    Cc: "H. Peter Anvin"

    Tejun Heo
     
  • 24aa07882b (memblock, x86: Replace memblock_x86_reserve/free_range()
    with generic ones) removed arch/x86/include/asm/memblock.h and dropped
    its inclusion from include/linux/memblock.h which breaks other
    architectures which depended on the generic memblock.h pulling in the
    arch specific one.

    However, the proper fix isn't adding back the asm inclusion. memblock
    doesn't have any arch dependent part and doesn't need arch specific
    header file and asm/memblock.h files are either practically empty or
    contain mostly unrelated arch specific stuff.

    * In microblaze, sh, powerpc, sparc and openrisc, asm/memblock.h is
    either empty or just contains unused MEMBLOCK_DBG() macro. Remove
    them.

    * In arm and unicore32, asm/memblock.h contains arch specific stuff.
    Include it directly from its users. It might be a good idea to
    rename the header file to avoid confusion.

    Signed-off-by: Tejun Heo
    Reported-by: "H. Peter Anvin"
    Cc: Yinghai Lu
    Cc: Russell King
    Cc: Michal Simek
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mundt
    Cc: "David S. Miller"
    Cc: Guan Xuetao

    Tejun Heo
     
  • …/linux into devel-stable

    Conflicts:
    arch/arm/mm/ioremap.c

    Russell King
     

08 Dec, 2011

10 commits

  • This patch adds the ARM_LPAE and ARCH_PHYS_ADDR_T_64BIT Kconfig entries
    allowing LPAE support to be compiled into the kernel.

    Signed-off-by: Catalin Marinas

    Catalin Marinas
     
  • Memory banks living outside of the 32-bit physical address
    space do not have a 1:1 pa va mapping and therefore the
    __va macro may wrap.

    This patch ensures that such banks are marked as highmem so
    that the Kernel doesn't try to split them up when it sees that
    the wrapped virtual address overlaps the vmalloc space.

    Signed-off-by: Will Deacon
    Signed-off-by: Catalin Marinas
    Acked-by: Nicolas Pitre

    Will Deacon
     
  • With LPAE, the pgd is a separate page table with entries pointing to the
    pmd. The identity_mapping_add() function needs to ensure that the pgd is
    populated before populating the pmd level. The do..while blocks now loop
    over the pmd in order to have the same implementation for the two page
    table formats. The pmd_addr_end() definition has been removed and the
    generic one used instead. The pmd clean-up is done in the pgd_free()
    function.

    Signed-off-by: Catalin Marinas

    Catalin Marinas
     
  • With LPAE, TTBRx registers are 64-bit. The ASID is stored in TTBR0
    rather than a separate Context ID register. This patch makes the
    necessary changes to handle context switching on LPAE.

    Signed-off-by: Catalin Marinas

    Catalin Marinas
     
  • The DFSR and IFSR register format is different when LPAE is enabled. In
    addition, DFSR and IFSR have similar definitions for the fault type.
    This modifies the fault code to correctly handle the new format.

    Signed-off-by: Catalin Marinas

    Catalin Marinas
     
  • This patch adds the MMU initialisation for the LPAE page table format.
    The swapper_pg_dir size with LPAE is 5 rather than 4 pages. A new
    proc-v7-3level.S file contains the TTB initialisation, context switch
    and PTE setting code with the LPAE. The TTBRx split is based on the
    PAGE_OFFSET with TTBR1 used for the kernel mappings. The 36-bit mappings
    (supersections) and a few other memory types in mmu.c are conditionally
    compiled.

    Signed-off-by: Catalin Marinas

    Catalin Marinas
     
  • This patch modifies the pgd/pmd/pte manipulation functions to support
    the 3-level page table format. Since there is no need for an 'ext'
    argument to cpu_set_pte_ext(), this patch conditionally defines a
    different prototype for this function when CONFIG_ARM_LPAE.

    The patch also introduces the L_PGD_SWAPPER flag to mark pgd entries
    pointing to pmd tables pre-allocated in the swapper_pg_dir and avoid
    trying to free them at run-time. This flag is 0 with the classic page
    table format.

    Signed-off-by: Catalin Marinas

    Catalin Marinas
     
  • This patch modifies the proc-v7.S file so that it only contains code
    shared between classic MMU and LPAE. The non-common code is factored out
    into a separate file.

    Signed-off-by: Catalin Marinas

    Catalin Marinas
     
  • The FSR structure is different with LPAE and this patch moves the
    classic MMU specific definition to a separate fsr-2level.c file that is
    included in fault.c. It also moves the fsr_fs and FSR bits to the
    fault.h file.

    Signed-off-by: Catalin Marinas

    Catalin Marinas
     
  • With the arch/arm code conversion to pgtable-nopud.h, the section and
    supersection (un|re)map code triggers compiler warnings on UP systems.
    This is caused by pmd_offset() being given a pgd_t argument rather than
    a pud_t one. This patch makes the necessary conversion with the
    assumption that the pud is folded into the pgd. The page table setting
    code only loops over the pmd which is enough with the classic page
    tables. This code is not compiled when LPAE is enabled.

    Signed-off-by: Catalin Marinas

    Catalin Marinas
     

07 Dec, 2011

1 commit


06 Dec, 2011

8 commits

  • The ARM SMP booting code allocates a temporary set of page tables
    containing an identity mapping of the kernel image and provides this
    to secondary CPUs for initial booting.

    In reality, we only need to include the __turn_mmu_on function in the
    identity mapping since the rest of the kernel is executing from virtual
    addresses after this point.

    This patch adds __turn_mmu_on to the .idmap.text section, allowing the
    SMP booting code to use the idmap_pgd directly and not have to populate
    its own set of page table.

    As a result of this patch, we can make the identity_mapping_add function
    static (since it is only used within mm/idmap.c) and also remove the
    identity_mapping_del function. The identity map population is moved to
    an early initcall so that it is setup in time for secondary CPU bringup.

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

    Will Deacon
     
  • For soft-rebooting a system, it is necessary to map the MMU-off code
    with an identity mapping so that execution can continue safely once the
    MMU has been switched off.

    Currently, switch_mm_for_reboot takes out a 1:1 mapping from 0x0 to
    TASK_SIZE during reboot in the hope that the reset code lives at a
    physical address corresponding to a userspace virtual address.

    This patch modifies the code so that we switch to the idmap_pgd tables,
    which contain a 1:1 mapping of the cpu_reset code. This has the
    advantage of only remapping the code that we need and also means we
    don't need to worry about allocating a pgd from an atomic context in the
    case that the physical address of the cpu_reset code aliases with the
    virtual space used by the kernel.

    Acked-by: Dave Martin
    Reviewed-by: Catalin Marinas
    Signed-off-by: Will Deacon

    Will Deacon
     
  • The CPU reset functions disable the MMU and therefore must be executed
    with an identity mapping in place.

    This patch places the CPU reset functions into the .idmap.text section,
    causing the idmap code to include them as part of the identity mapping.

    Acked-by: Dave Martin
    Signed-off-by: Will Deacon

    Will Deacon
     
  • When disabling and re-enabling the MMU, it is necessary to take out an
    identity mapping for the code that manipulates the SCTLR in order to
    avoid it disappearing from under our feet. This is useful when soft
    rebooting and returning from CPU suspend.

    This patch allocates a set of page tables during boot and populates them
    with an identity mapping for the .idmap.text section. This means that
    users of the identity map do not need to manage their own pgd and can
    instead annotate their functions with __idmap or, in the case of assembly
    code, place them in the correct section.

    Acked-by: Dave Martin
    Reviewed-by: Catalin Marinas
    Tested-by: Lorenzo Pieralisi
    Signed-off-by: Will Deacon

    Will Deacon
     
  • Commit d065bd810b6deb67d4897a14bfe21f8eb526ba99
    (mm: retry page fault when blocking on disk transfer) and
    commit 37b23e0525d393d48a7d59f870b3bc061a30ccdb
    (x86,mm: make pagefault killable)

    The above commits introduced changes into the x86 pagefault handler
    for making the page fault handler retryable as well as killable.

    These changes reduce the mmap_sem hold time, which is crucial
    during OOM killer invocation.

    Port these changes to ARM.

    Without these changes, my ARM board encounters many hang and livelock
    scenarios.
    After applying this patch, OOM feature performance improves according to
    my testing.

    Signed-off-by: Kautuk Consul
    Signed-off-by: Russell King

    Kautuk Consul
     
  • Similar to other architectures, this adds topdown mmap support in user
    process address space allocation policy. This allows mmap sizes greater
    than 2GB. This support is largely copied from MIPS and the generic
    implementations.

    The address space randomization is moved into arch_pick_mmap_layout.

    Tested on V-Express with ubuntu and a mmap test from here:
    https://bugs.launchpad.net/bugs/861296

    Signed-off-by: Rob Herring
    Acked-by: Nicolas Pitre
    Signed-off-by: Russell King

    Rob Herring
     
  • Russell King
     
  • Conflicts:
    arch/arm/common/gic.c
    arch/arm/plat-omap/include/plat/common.h

    Russell King
     

29 Nov, 2011

1 commit


27 Nov, 2011

5 commits

  • Now that we have all the static mappings from iotable_init() located
    in the vmalloc area, it is trivial to optimize ioremap by reusing those
    static mappings when the requested physical area fits in one of them,
    and so in a generic way for all platforms.

    Signed-off-by: Nicolas Pitre
    Tested-by: Stephen Warren
    Tested-by: Kevin Hilman
    Tested-by: Jamie Iles

    Nicolas Pitre
     
  • Firstly, there is no need to have a double pointer here as we're only
    walking the vmlist and not modifying it.

    Secondly, for the same reason, we don't need a write lock but only a
    read lock here, since the lock only protects the coherency of the list
    nothing else.

    Lastly, the reason for holding a lock is not what the comment says, so
    let's remove that misleading piece of information.

    Signed-off-by: Nicolas Pitre

    Nicolas Pitre
     
  • In order to remove the build time variation between different SOCs with
    regards to VMALLOC_END, the iotable mappings are now allocated inside
    the vmalloc region. This allows for VMALLOC_END to be identical across
    all machines.

    The value for VMALLOC_END is now set to 0xff000000 which is right where
    the consistent DMA area starts.

    To accommodate all static mappings on machines with possible highmem usage,
    the default vmalloc area size is changed to 240 MB so that VMALLOC_START
    is no higher than 0xf0000000 by default.

    Signed-off-by: Nicolas Pitre
    Tested-by: Stephen Warren
    Tested-by: Kevin Hilman
    Tested-by: Jamie Iles

    Nicolas Pitre
     
  • dma_alloc_coherent wants to split pages after allocation in order to
    reduce the memory footprint. This does not work well with GFP_COMP
    pages, so drop this flag before allocation.

    This patch is ported from arch/avr32
    (commit 3611553ef985ef7c5863c8a94641738addd04cff).

    [swarren: s/HUGETLB_PAGE/HUGETLBFS/ in comment, minor comment cleanup]

    Signed-off-by: Sumit Bhattacharya
    Tested-by: Varun Colbert
    Signed-off-by: Stephen Warren
    Signed-off-by: Russell King

    Sumit Bhattacharya
     
  • There are already cache type decoding functions, so use those instead
    of custom decode code which only works for ARMv6.

    Signed-off-by: Rob Herring
    Acked-by: Nicolas Pitre
    Acked-by: Will Deacon
    Signed-off-by: Russell King

    Rob Herring
     

21 Nov, 2011

1 commit