1. 22 3月, 2009 1 次提交
  2. 13 3月, 2009 2 次提交
  3. 09 3月, 2009 2 次提交
    • J
      x86-32: make sure virt_addr_valid() returns false for fixmap addresses · 0feca851
      Jeremy Fitzhardinge 提交于
      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: NJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
      Cc: Jiri Slaby <jirislaby@gmail.com>
      Cc: Yinghai Lu <yinghai@kernel.org>
      LKML-Reference: <49B166D6.2080505@goop.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      0feca851
    • W
      x86: don't define __this_fixmap_does_not_exist() · 8827247f
      Wang Chen 提交于
      Impact: improve out-of-range fixmap index debugging
      
      Commit "1b42f516"
      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: NWang Chen <wangchen@cn.fujitsu.com>
      LKML-Reference: <49B2075B.4070509@cn.fujitsu.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      8827247f
  4. 05 3月, 2009 2 次提交
  5. 12 2月, 2009 1 次提交
  6. 22 1月, 2009 1 次提交
  7. 16 1月, 2009 1 次提交
    • J
      x86: fix assumed to be contiguous leaf page tables for kmap_atomic region (take 2) · a3c6018e
      Jan Beulich 提交于
      Debugging and original patch from Nick Piggin <npiggin@suse.de>
      
      The early fixmap pmd entry inserted at the very top of the KVA is causing the
      subsequent fixmap mapping code to not provide physically linear pte pages over
      the kmap atomic portion of the fixmap (which relies on said property to
      calculate pte addresses).
      
      This has caused weird boot failures in kmap_atomic much later in the boot
      process (initial userspace faults) on a 32-bit PAE system with a larger number
      of CPUs (smaller CPU counts tend not to run over into the next page so don't
      show up the problem).
      
      Solve this by attempting to clear out the page table, and copy any of its
      entries to the new one. Also, add a bug if a nonlinear condition is encountered
      and can't be resolved, which might save some hours of debugging if this fragile
      scheme ever breaks again...
      
      Once we have such logic, we can also use it to eliminate the early ioremap
      trickery around the page table setup for the fixmap area. This also fixes
      potential issues with FIX_* entries sharing the leaf page table with the early
      ioremap ones getting discarded by early_ioremap_clear() and not restored by
      early_ioremap_reset(). It at once eliminates the temporary (and configuration,
      namely NR_CPUS, dependent) unavailability of early fixed mappings during the
      time the fixmap area page tables get constructed.
      
      Finally, also replace the hard coded calculation of the initial table space
      needed for the fixmap area with a proper one, allowing kernels configured for
      large CPU counts to actually boot.
      
      Based-on: Nick Piggin <npiggin@suse.de>
      Signed-off-by: NJan Beulich <jbeulich@novell.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      a3c6018e
  8. 12 12月, 2008 1 次提交
  9. 29 10月, 2008 1 次提交
    • H
      x86: start annotating early ioremap pointers with __iomem · 1d6cf1fe
      Harvey Harrison 提交于
      Impact: some new sparse warnings in e820.c etc, but no functional change.
      
      As with regular ioremap, iounmap etc, annotate with __iomem.
      
      Fixes the following sparse warnings, will produce some new ones
      elsewhere in arch/x86 that will get worked out over time.
      
      arch/x86/mm/ioremap.c:402:9: warning: cast removes address space of expression
      arch/x86/mm/ioremap.c:406:10: warning: cast adds address space to expression (<asn:2>)
      arch/x86/mm/ioremap.c:782:19: warning: Using plain integer as NULL pointer
      Signed-off-by: NHarvey Harrison <harvey.harrison@gmail.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      1d6cf1fe
  10. 13 10月, 2008 4 次提交
  11. 12 10月, 2008 1 次提交
    • A
      x86, early_ioremap: fix fencepost error · c613ec1a
      Alan Cox 提交于
      The x86 implementation of early_ioremap has an off by one error. If we get
      an object which ends on the first byte of a page we undermap by one page and
      this causes a crash on boot with the ASUS P5QL whose DMI table happens to fit
      this alignment.
      
      The size computation is currently
      
      	last_addr = phys_addr + size - 1;
      	npages = (PAGE_ALIGN(last_addr) - phys_addr)
      
      (Consider a request for 1 byte at alignment 0...)
      
      Closes #11693
      
      Debugging work by Ian Campbell/Felix Geyer
      Signed-off-by: NAlan Cox <alan@rehat.com>
      Cc: <stable@kernel.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      c613ec1a
  12. 11 10月, 2008 1 次提交
  13. 26 9月, 2008 1 次提交
  14. 21 8月, 2008 1 次提交
  15. 16 8月, 2008 1 次提交
    • A
      x86: Fix ioremap off by one BUG · e213e877
      Andi Kleen 提交于
      Jean Delvare's machine triggered this BUG
      
      acpi_os_map_memory phys ffff0000 size 65535
      ------------[ cut here ]------------
      kernel BUG at arch/x86/mm/pat.c:233!
      
      with ACPI in the backtrace.
      
      Adding some debugging output showed that ACPI calls
      
      acpi_os_map_memory phys ffff0000 size 65535
      
      And ioremap/PAT does this check in 32bit, so addr+size wraps and the BUG
      in reserve_memtype() triggers incorrectly.
      
              BUG_ON(start >= end); /* end is exclusive */
      
      But reserve_memtype already uses u64:
      
      int reserve_memtype(u64 start, u64 end,
      
      so the 32bit truncation must happen in the caller. Presumably in ioremap
      when it passes this information to reserve_memtype().
      
      This patch does this computation in 64bit.
      
      http://bugzilla.kernel.org/show_bug.cgi?id=11346Signed-off-by: NAndi Kleen <ak@linux.intel.com>
      e213e877
  16. 25 7月, 2008 1 次提交
  17. 23 7月, 2008 1 次提交
  18. 10 7月, 2008 1 次提交
  19. 08 7月, 2008 4 次提交
    • J
      x86, 64-bit: adjust mapping of physical pagetables to work with Xen · 4f9c11dd
      Jeremy Fitzhardinge 提交于
      This makes a few of changes to the construction of the initial
      pagetables to work better with paravirt_ops/Xen.  The main areas
      are:
      
       1. Support non-PSE mapping of memory, since Xen doesn't currently
          allow 2M pages to be mapped in guests.
      
       2. Make sure that the ioremap alias of all pages are dropped before
          attaching the new page to the pagetable.  This avoids having
          writable aliases of pagetable pages.
      
       3. Preserve existing pagetable entries, rather than overwriting.  Its
          possible that a fair amount of pagetable has already been constructed,
          so reuse what's already in place rather than ignoring and overwriting it.
      
      The algorithm relies on the invariant that any page which is part of
      the kernel pagetable is itself mapped in the linear memory area.  This
      way, it can avoid using ioremap on a pagetable page.
      
      The invariant holds because it maps memory from low to high addresses,
      and also allocates memory from low to high.  Each allocated page can
      map at least 2M of address space, so the mapped area will always
      progress much faster than the allocated area.  It relies on the early
      boot code mapping enough pages to get started.
      Signed-off-by: NJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
      Cc: xen-devel <xen-devel@lists.xensource.com>
      Cc: Stephen Tweedie <sct@redhat.com>
      Cc: Eduardo Habkost <ehabkost@redhat.com>
      Cc: Mark McLoughlin <markmc@redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      4f9c11dd
    • J
      x86, 64-bit: unify early_ioremap · 4583ed51
      Jeremy Fitzhardinge 提交于
      The 32-bit early_ioremap will work equally well for 64-bit, so just use it.
      Signed-off-by: NJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
      Cc: xen-devel <xen-devel@lists.xensource.com>
      Cc: Stephen Tweedie <sct@redhat.com>
      Cc: Eduardo Habkost <ehabkost@redhat.com>
      Cc: Mark McLoughlin <markmc@redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      4583ed51
    • J
      build: add __page_aligned_data and __page_aligned_bss · a7bf0bd5
      Jeremy Fitzhardinge 提交于
      Making a variable page-aligned by using
      __attribute__((section(".data.page_aligned"))) is fragile because if
      sizeof(variable) is not also a multiple of page size, it leaves
      variables in the remainder of the section unaligned.
      
      This patch introduces two new qualifiers, __page_aligned_data and
      __page_aligned_bss to set the section *and* the alignment of
      variables.  This makes page-aligned variables more robust because the
      linker will make sure they're aligned properly.  Unfortunately it
      requires *all* page-aligned data to use these macros...
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      a7bf0bd5
    • T
      x86: add sparse annotations to ioremap · 6e92a5a6
      Thomas Gleixner 提交于
      arch/x86/mm/ioremap.c:308:11: error: incompatible types in comparison expression (different address spaces)
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      6e92a5a6
  20. 24 6月, 2008 1 次提交
  21. 19 6月, 2008 2 次提交
    • J
      x86, MM: virtual address debug, v2 · a1bf9631
      Jiri Slaby 提交于
      I've removed the test from phys_to_nid and made a function from __phys_addr
      only when the debugging is enabled (on x86_32).
      Signed-off-by: NJiri Slaby <jirislaby@gmail.com>
      Cc: tglx@linutronix.de
      Cc: hpa@zytor.com
      Cc: Mike Travis <travis@sgi.com>
      Cc: Nick Piggin <nickpiggin@yahoo.com.au>
      Cc: <x86@kernel.org>
      Cc: linux-mm@kvack.org
      Cc: Jiri Slaby <jirislaby@gmail.com>
      Cc: Andi Kleen <andi@firstfloor.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      a1bf9631
    • J
      MM: virtual address debug · 59ea7463
      Jiri Slaby 提交于
      Add some (configurable) expensive sanity checking to catch wrong address
      translations on x86.
      
      - create linux/mmdebug.h file to be able include this file in
        asm headers to not get unsolvable loops in header files
      - __phys_addr on x86_32 became a function in ioremap.c since
        PAGE_OFFSET, is_vmalloc_addr and VMALLOC_* non-constasts are undefined
        if declared in page_32.h
      - add __phys_addr_const for initializing doublefault_tss.__cr3
      
      Tested on 386, 386pae, x86_64 and x86_64 numa=fake=2.
      
      Contains Andi's enable numa virtual address debug patch.
      Signed-off-by: NJiri Slaby <jirislaby@gmail.com>
      Cc: Andi Kleen <andi@firstfloor.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      59ea7463
  22. 12 6月, 2008 1 次提交
  23. 04 6月, 2008 1 次提交
  24. 24 5月, 2008 2 次提交
  25. 01 5月, 2008 3 次提交
    • A
      x86: ioremap ram check fix · cb8ab687
      Andres Salomon 提交于
      bdd3cee2 (x86: ioremap(), extend check
      to all RAM pages) breaks OLPC's ioremap call.  The ioremap that OLPC uses is:
      
              romsig = ioremap(0xffffffc0, 16);
      
      The commit that breaks it is basically:
      
      -       for (pfn = phys_addr >> PAGE_SHIFT; pfn < max_pfn_mapped &&
      -            (pfn << PAGE_SHIFT) < last_addr; pfn++) {
      +       for (pfn = phys_addr >> PAGE_SHIFT;
      +                               (pfn << PAGE_SHIFT) < last_addr; pfn++) {
      +
      
      Previously, the 'pfn < max_pfn_mapped' check would've caused us to not
      enter the loop.  Removing that check means we loop infinitely.  The
      reason for that is because pfn is 0xfffff, and last_addr is 0xffffffcf.
      The remaining check that is used to exit the loop is not sufficient;
      when pfn<<PAGE_SHIFT is 0xfffff000, that is less than 0xffffffcf; when
      we increment pfn and it overflows (pfn == 0x100000), pfn<<PAGE_SHIFT
      ends up being 0.  That, of course, is less than last_addr.  In effect,
      pfn<<PAGE_SHIFT is never lower than last_addr.
      
      The simple fix for this is to limit the last_addr check to the PAGE_MASK;
      a patch is below.
      Signed-off-by: NAndres Salomon <dilinger@debian.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      cb8ab687
    • S
      x86 PAT: fix performance drop for glx, use UC minus for ioremap(),... · de33c442
      Suresh Siddha 提交于
      x86 PAT: fix performance drop for glx, use UC minus for ioremap(), ioremap_nocache() and pci_mmap_page_range()
      
      Use UC_MINUS for ioremap(), ioremap_nocache() instead of strong UC.
      Once all the X drivers move to ioremap_wc(), we can go back to strong
      UC semantics for ioremap() and ioremap_nocache().
      
      To avoid attribute aliasing issues, pci_mmap_page_range() will also
      use UC_MINUS for default non write-combining mapping request.
      
      Next steps:
      	a) change all the video drivers using ioremap() or ioremap_nocache()
      	   and adding WC MTTR using mttr_add() to ioremap_wc()
      
      	b) for strict usage, we can go back to strong uc semantics
      	   for ioremap() and ioremap_nocache() after some grace period for
      	   completing step-a.
      
      	c) user level X server needs to use the appropriate method for setting
      	   up WC mapping (like using resourceX_wc sysfs file instead of
      	   adding MTRR for WC and using /dev/mem or resourceX under /sys)
      Signed-off-by: NSuresh Siddha <suresh.b.siddha@intel.com>
      Signed-off-by: NVenkatesh Pallipadi <venkatesh.pallipadi@intel.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      de33c442
    • I
      revert: "x86: ioremap(), extend check to all RAM pages" · 2544a873
      Ingo Molnar 提交于
      Vegard Nossum reported a large (150 seconds) boot delay during bootup,
      and bisected it to "x86: ioremap(), extend check to all RAM pages"
      (commit bdd3cee2). Revert this commit for now.
      Bisected-by: NVegard Nossum <vegard.nossum@gmail.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      2544a873
  26. 28 4月, 2008 1 次提交
    • C
      vmallocinfo: add caller information · 23016969
      Christoph Lameter 提交于
      Add caller information so that /proc/vmallocinfo shows where the allocation
      request for a slice of vmalloc memory originated.
      
      Results in output like this:
      
      0xffffc20000000000-0xffffc20000801000 8392704 alloc_large_system_hash+0x127/0x246 pages=2048 vmalloc vpages
      0xffffc20000801000-0xffffc20000806000   20480 alloc_large_system_hash+0x127/0x246 pages=4 vmalloc
      0xffffc20000806000-0xffffc20000c07000 4198400 alloc_large_system_hash+0x127/0x246 pages=1024 vmalloc vpages
      0xffffc20000c07000-0xffffc20000c0a000   12288 alloc_large_system_hash+0x127/0x246 pages=2 vmalloc
      0xffffc20000c0a000-0xffffc20000c0c000    8192 acpi_os_map_memory+0x13/0x1c phys=cff68000 ioremap
      0xffffc20000c0c000-0xffffc20000c0f000   12288 acpi_os_map_memory+0x13/0x1c phys=cff64000 ioremap
      0xffffc20000c10000-0xffffc20000c15000   20480 acpi_os_map_memory+0x13/0x1c phys=cff65000 ioremap
      0xffffc20000c16000-0xffffc20000c18000    8192 acpi_os_map_memory+0x13/0x1c phys=cff69000 ioremap
      0xffffc20000c18000-0xffffc20000c1a000    8192 acpi_os_map_memory+0x13/0x1c phys=fed1f000 ioremap
      0xffffc20000c1a000-0xffffc20000c1c000    8192 acpi_os_map_memory+0x13/0x1c phys=cff68000 ioremap
      0xffffc20000c1c000-0xffffc20000c1e000    8192 acpi_os_map_memory+0x13/0x1c phys=cff68000 ioremap
      0xffffc20000c1e000-0xffffc20000c20000    8192 acpi_os_map_memory+0x13/0x1c phys=cff68000 ioremap
      0xffffc20000c20000-0xffffc20000c22000    8192 acpi_os_map_memory+0x13/0x1c phys=cff68000 ioremap
      0xffffc20000c22000-0xffffc20000c24000    8192 acpi_os_map_memory+0x13/0x1c phys=cff68000 ioremap
      0xffffc20000c24000-0xffffc20000c26000    8192 acpi_os_map_memory+0x13/0x1c phys=e0081000 ioremap
      0xffffc20000c26000-0xffffc20000c28000    8192 acpi_os_map_memory+0x13/0x1c phys=e0080000 ioremap
      0xffffc20000c28000-0xffffc20000c2d000   20480 alloc_large_system_hash+0x127/0x246 pages=4 vmalloc
      0xffffc20000c2d000-0xffffc20000c31000   16384 tcp_init+0xd5/0x31c pages=3 vmalloc
      0xffffc20000c31000-0xffffc20000c34000   12288 alloc_large_system_hash+0x127/0x246 pages=2 vmalloc
      0xffffc20000c34000-0xffffc20000c36000    8192 init_vdso_vars+0xde/0x1f1
      0xffffc20000c36000-0xffffc20000c38000    8192 pci_iomap+0x8a/0xb4 phys=d8e00000 ioremap
      0xffffc20000c38000-0xffffc20000c3a000    8192 usb_hcd_pci_probe+0x139/0x295 [usbcore] phys=d8e00000 ioremap
      0xffffc20000c3a000-0xffffc20000c3e000   16384 sys_swapon+0x509/0xa15 pages=3 vmalloc
      0xffffc20000c40000-0xffffc20000c61000  135168 e1000_probe+0x1c4/0xa32 phys=d8a20000 ioremap
      0xffffc20000c61000-0xffffc20000c6a000   36864 _xfs_buf_map_pages+0x8e/0xc0 vmap
      0xffffc20000c6a000-0xffffc20000c73000   36864 _xfs_buf_map_pages+0x8e/0xc0 vmap
      0xffffc20000c73000-0xffffc20000c7c000   36864 _xfs_buf_map_pages+0x8e/0xc0 vmap
      0xffffc20000c7c000-0xffffc20000c7f000   12288 e1000e_setup_tx_resources+0x29/0xbe pages=2 vmalloc
      0xffffc20000c80000-0xffffc20001481000 8392704 pci_mmcfg_arch_init+0x90/0x118 phys=e0000000 ioremap
      0xffffc20001481000-0xffffc20001682000 2101248 alloc_large_system_hash+0x127/0x246 pages=512 vmalloc
      0xffffc20001682000-0xffffc20001e83000 8392704 alloc_large_system_hash+0x127/0x246 pages=2048 vmalloc vpages
      0xffffc20001e83000-0xffffc20002204000 3674112 alloc_large_system_hash+0x127/0x246 pages=896 vmalloc vpages
      0xffffc20002204000-0xffffc2000220d000   36864 _xfs_buf_map_pages+0x8e/0xc0 vmap
      0xffffc2000220d000-0xffffc20002216000   36864 _xfs_buf_map_pages+0x8e/0xc0 vmap
      0xffffc20002216000-0xffffc2000221f000   36864 _xfs_buf_map_pages+0x8e/0xc0 vmap
      0xffffc2000221f000-0xffffc20002228000   36864 _xfs_buf_map_pages+0x8e/0xc0 vmap
      0xffffc20002228000-0xffffc20002231000   36864 _xfs_buf_map_pages+0x8e/0xc0 vmap
      0xffffc20002231000-0xffffc20002234000   12288 e1000e_setup_rx_resources+0x35/0x122 pages=2 vmalloc
      0xffffc20002240000-0xffffc20002261000  135168 e1000_probe+0x1c4/0xa32 phys=d8a60000 ioremap
      0xffffc20002261000-0xffffc2000270c000 4894720 sys_swapon+0x509/0xa15 pages=1194 vmalloc vpages
      0xffffffffa0000000-0xffffffffa0022000  139264 module_alloc+0x4f/0x55 pages=33 vmalloc
      0xffffffffa0022000-0xffffffffa0029000   28672 module_alloc+0x4f/0x55 pages=6 vmalloc
      0xffffffffa002b000-0xffffffffa0034000   36864 module_alloc+0x4f/0x55 pages=8 vmalloc
      0xffffffffa0034000-0xffffffffa003d000   36864 module_alloc+0x4f/0x55 pages=8 vmalloc
      0xffffffffa003d000-0xffffffffa0049000   49152 module_alloc+0x4f/0x55 pages=11 vmalloc
      0xffffffffa0049000-0xffffffffa0050000   28672 module_alloc+0x4f/0x55 pages=6 vmalloc
      
      [akpm@linux-foundation.org: coding-style fixes]
      Signed-off-by: NChristoph Lameter <clameter@sgi.com>
      Reviewed-by: NKOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
      Cc: Hugh Dickins <hugh@veritas.com>
      Cc: Nick Piggin <nickpiggin@yahoo.com.au>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      23016969
  27. 25 4月, 2008 1 次提交