1. 11 6月, 2011 1 次提交
  2. 06 6月, 2011 1 次提交
  3. 26 5月, 2011 1 次提交
    • W
      ARM: 6913/1: sparsemem: allow pfn_valid to be overridden when using SPARSEMEM · 7b7bf499
      Will Deacon 提交于
      In commit eb33575c ("[ARM] Double check memmap is actually valid with a
      memmap has unexpected holes V2"), a new function, memmap_valid_within,
      was introduced to mmzone.h so that holes in the memmap which pass
      pfn_valid in SPARSEMEM configurations can be detected and avoided.
      
      The fix to this problem checks that the pfn <-> page linkages are
      correct by calculating the page for the pfn and then checking that
      page_to_pfn on that page returns the original pfn. Unfortunately, in
      SPARSEMEM configurations, this results in reading from the page flags to
      determine the correct section. Since the memmap here has been freed,
      junk is read from memory and the check is no longer robust.
      
      In the best case, reading from /proc/pagetypeinfo will give you the
      wrong answer. In the worst case, you get SEGVs, Kernel OOPses and hung
      CPUs. Furthermore, ioremap implementations that use pfn_valid to
      disallow the remapping of normal memory will break.
      
      This patch allows architectures to provide their own pfn_valid function
      instead of using the default implementation used by sparsemem. The
      architecture-specific version is aware of the memmap state and will
      return false when passed a pfn for a freed page within a valid section.
      Acked-by: NMel Gorman <mgorman@suse.de>
      Acked-by: NCatalin Marinas <catalin.marinas@arm.com>
      Tested-by: NH Hartley Sweeten <hsweeten@visionengravers.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      7b7bf499
  4. 25 5月, 2011 1 次提交
    • D
      arch, mm: filter disallowed nodes from arch specific show_mem functions · 7bf02ea2
      David Rientjes 提交于
      Architectures that implement their own show_mem() function did not pass
      the filter argument to show_free_areas() to appropriately avoid emitting
      the state of nodes that are disallowed in the current context.  This patch
      now passes the filter argument to show_free_areas() so those nodes are now
      avoided.
      
      This patch also removes the show_free_areas() wrapper around
      __show_free_areas() and converts existing callers to pass an empty filter.
      
      ia64 emits additional information for each node, so skip_free_areas_zone()
      must be made global to filter disallowed nodes and it is converted to use
      a nid argument rather than a zone for this use case.
      Signed-off-by: NDavid Rientjes <rientjes@google.com>
      Cc: Russell King <linux@arm.linux.org.uk>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Fenghua Yu <fenghua.yu@intel.com>
      Cc: Kyle McMartin <kyle@mcmartin.ca>
      Cc: Helge Deller <deller@gmx.de>
      Cc: James Bottomley <jejb@parisc-linux.org>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Guan Xuetao <gxt@mprc.pku.edu.cn>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      7bf02ea2
  5. 23 5月, 2011 1 次提交
    • G
      arm/dt: probe for platforms via the device tree · 93c02ab4
      Grant Likely 提交于
      If a dtb is passed to the kernel then the kernel needs to iterate
      through compiled-in mdescs looking for one that matches and move the
      dtb data to a safe location before it gets accidentally overwritten by
      the kernel.
      
      This patch creates a new function, setup_machine_fdt() which is
      analogous to the setup_machine_atags() created in the previous patch.
      It does all the early setup needed to use a device tree machine
      description.
      
      v5: - Print warning with neither dtb nor atags are passed to the kernel
          - Fix bug in setting of __machine_arch_type to the selected machine,
            not just the last machine in the list.
      Reported-by: NTixy <tixy@yxit.co.uk>
          - Copy command line directly into boot_command_line instead of cmd_line
      v4: - Dump some output when a matching machine_desc cannot be found
      v3: - Added processing of reserved list.
          - Backed out the v2 change that copied instead of reserved the
            dtb.  dtb is reserved again and the real problem was fixed by
            using alloc_bootmem_align() for early allocation of RAM for
            unflattening the tree.
          - Moved cmd_line and initrd changes to earlier patch to make series
            bisectable.
      v2: Changed to save the dtb by copying into an allocated buffer.
          - Since the dtb will very likely be passed in the first 16k of ram
            where the interrupt vectors live, memblock_reserve() is
            insufficient to protect the dtb data.
      
      [based on work originally written by Jeremy Kerr <jeremy.kerr@canonical.com>]
      Tested-by: NTony Lindgren <tony@atomide.com>
      Acked-by: NNicolas Pitre <nicolas.pitre@linaro.org>
      Acked-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      93c02ab4
  6. 12 5月, 2011 2 次提交
  7. 11 5月, 2011 1 次提交
  8. 25 3月, 2011 1 次提交
  9. 15 2月, 2011 1 次提交
  10. 31 1月, 2011 1 次提交
  11. 28 10月, 2010 7 次提交
  12. 13 10月, 2010 1 次提交
    • Y
      memblock, bootmem: Round pfn properly for memory and reserved regions · c7fc2de0
      Yinghai Lu 提交于
      We need to round memory regions correctly -- specifically, we need to
      round reserved region in the more expansive direction (lower limit
      down, upper limit up) whereas usable memory regions need to be rounded
      in the more restrictive direction (lower limit up, upper limit down).
      
      This introduces two set of inlines:
      
      	memblock_region_memory_base_pfn()
      	memblock_region_memory_end_pfn()
      	memblock_region_reserved_base_pfn()
      	memblock_region_reserved_end_pfn()
      
      Although they are antisymmetric (and therefore are technically
      duplicates) the use of the different inlines explicitly documents the
      programmer's intention.
      
      The lack of proper rounding caused a bug on ARM, which was then found
      to also affect other architectures.
      Reported-by: NRussell King <rmk@arm.linux.org.uk>
      Signed-off-by: NYinghai Lu <yinghai@kernel.org>
      LKML-Reference: <4CB4CDFD.4020105@kernel.org>
      Cc: Jeremy Fitzhardinge <jeremy@goop.org>
      Signed-off-by: NH. Peter Anvin <hpa@linux.intel.com>
      c7fc2de0
  13. 08 10月, 2010 1 次提交
  14. 16 9月, 2010 1 次提交
    • Y
      arm, memblock: Fix the sparsemem build · 7c996361
      Yinghai Lu 提交于
      Stephen Rothwell reported this build failure:
      
        arch/arm/mm/init.c: In function 'arm_memory_present':
        arch/arm/mm/init.c:260: warning: ISO C90 forbids mixed declarations and code
      
      Caused by commit 719c1514 ("memblock/arm: Use new accessors")
      which forgot a closing brace on a new for_each_memblock() in
      arm_memory_present().
      Reported-by: NStephen Rothwell <sfr@canb.auug.org.au>
      Signed-off-by: NYinghai Lu <yinghai@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Russell King <linux@arm.linux.org.uk>
      LKML-Reference: <4C91C544.5050907@kernel.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      7c996361
  15. 05 8月, 2010 1 次提交
  16. 04 8月, 2010 2 次提交
  17. 27 7月, 2010 6 次提交
  18. 19 7月, 2010 1 次提交
  19. 16 7月, 2010 3 次提交
  20. 16 6月, 2010 1 次提交
  21. 27 5月, 2010 1 次提交
  22. 15 5月, 2010 2 次提交
  23. 05 5月, 2010 1 次提交
  24. 30 3月, 2010 1 次提交
    • T
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking... · 5a0e3ad6
      Tejun Heo 提交于
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
      
      percpu.h is included by sched.h and module.h and thus ends up being
      included when building most .c files.  percpu.h includes slab.h which
      in turn includes gfp.h making everything defined by the two files
      universally available and complicating inclusion dependencies.
      
      percpu.h -> slab.h dependency is about to be removed.  Prepare for
      this change by updating users of gfp and slab facilities include those
      headers directly instead of assuming availability.  As this conversion
      needs to touch large number of source files, the following script is
      used as the basis of conversion.
      
        http://userweb.kernel.org/~tj/misc/slabh-sweep.py
      
      The script does the followings.
      
      * Scan files for gfp and slab usages and update includes such that
        only the necessary includes are there.  ie. if only gfp is used,
        gfp.h, if slab is used, slab.h.
      
      * When the script inserts a new include, it looks at the include
        blocks and try to put the new include such that its order conforms
        to its surrounding.  It's put in the include block which contains
        core kernel includes, in the same order that the rest are ordered -
        alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
        doesn't seem to be any matching order.
      
      * If the script can't find a place to put a new include (mostly
        because the file doesn't have fitting include block), it prints out
        an error message indicating which .h file needs to be added to the
        file.
      
      The conversion was done in the following steps.
      
      1. The initial automatic conversion of all .c files updated slightly
         over 4000 files, deleting around 700 includes and adding ~480 gfp.h
         and ~3000 slab.h inclusions.  The script emitted errors for ~400
         files.
      
      2. Each error was manually checked.  Some didn't need the inclusion,
         some needed manual addition while adding it to implementation .h or
         embedding .c file was more appropriate for others.  This step added
         inclusions to around 150 files.
      
      3. The script was run again and the output was compared to the edits
         from #2 to make sure no file was left behind.
      
      4. Several build tests were done and a couple of problems were fixed.
         e.g. lib/decompress_*.c used malloc/free() wrappers around slab
         APIs requiring slab.h to be added manually.
      
      5. The script was run on all .h files but without automatically
         editing them as sprinkling gfp.h and slab.h inclusions around .h
         files could easily lead to inclusion dependency hell.  Most gfp.h
         inclusion directives were ignored as stuff from gfp.h was usually
         wildly available and often used in preprocessor macros.  Each
         slab.h inclusion directive was examined and added manually as
         necessary.
      
      6. percpu.h was updated not to include slab.h.
      
      7. Build test were done on the following configurations and failures
         were fixed.  CONFIG_GCOV_KERNEL was turned off for all tests (as my
         distributed build env didn't work with gcov compiles) and a few
         more options had to be turned off depending on archs to make things
         build (like ipr on powerpc/64 which failed due to missing writeq).
      
         * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
         * powerpc and powerpc64 SMP allmodconfig
         * sparc and sparc64 SMP allmodconfig
         * ia64 SMP allmodconfig
         * s390 SMP allmodconfig
         * alpha SMP allmodconfig
         * um on x86_64 SMP allmodconfig
      
      8. percpu.h modifications were reverted so that it could be applied as
         a separate patch and serve as bisection point.
      
      Given the fact that I had only a couple of failures from tests on step
      6, I'm fairly confident about the coverage of this conversion patch.
      If there is a breakage, it's likely to be something in one of the arch
      headers which should be easily discoverable easily on most builds of
      the specific arch.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Guess-its-ok-by: NChristoph Lameter <cl@linux-foundation.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
      5a0e3ad6