1. 21 8月, 2008 1 次提交
  2. 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
  3. 25 7月, 2008 1 次提交
  4. 10 7月, 2008 1 次提交
  5. 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
  6. 24 6月, 2008 1 次提交
  7. 12 6月, 2008 1 次提交
  8. 04 6月, 2008 1 次提交
  9. 24 5月, 2008 2 次提交
  10. 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
  11. 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
  12. 25 4月, 2008 2 次提交
  13. 20 4月, 2008 1 次提交
    • R
      x86: fix arch/x86/mm/ioremap.c warning · 4c8337ac
      Randy Dunlap 提交于
      Fix printk formats in x86/mm/ioremap.c:
      
      next-20080410/arch/x86/mm/ioremap.c:137: warning: format '%llx' expects type 'long long unsigned int', but argument 2 has type 'resource_size_t'
      next-20080410/arch/x86/mm/ioremap.c:188: warning: format '%llx' expects type 'long long unsigned int', but argument 2 has type 'resource_size_t'
      next-20080410/arch/x86/mm/ioremap.c:188: warning: format '%llx' expects type 'long long unsigned int', but argument 3 has type 'long unsigned int'
      Signed-off-by: NRandy Dunlap <randy.dunlap@oracle.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      4c8337ac
  14. 17 4月, 2008 13 次提交
  15. 27 3月, 2008 1 次提交
  16. 25 3月, 2008 1 次提交
  17. 12 3月, 2008 1 次提交
  18. 01 3月, 2008 1 次提交
  19. 19 2月, 2008 3 次提交