1. 03 3月, 2009 1 次提交
  2. 20 1月, 2009 1 次提交
    • G
      x86: remove kernel_physical_mapping_init() from init section · f5495506
      Gary Hade 提交于
      Impact: fix crash with memory hotplug enabled
      
      kernel_physical_mapping_init() is called during memory hotplug
      so it does not belong in the init section.
      
      If the kernel is built with CONFIG_DEBUG_SECTION_MISMATCH=y on
      the make command line, arch/x86/mm/init_64.c is compiled with
      the -fno-inline-functions-called-once gcc option defeating
      inlining of kernel_physical_mapping_init() within init_memory_mapping().
      
      When kernel_physical_mapping_init() is not inlined it is placed
      in the .init.text section according to the __init in it's current
      declaration.  A later call to kernel_physical_mapping_init() during
      a memory hotplug operation encounters an int3 trap because the
      .init.text section memory has been freed.
      
      This patch eliminates the crash caused by the int3 trap by moving the
      non-inlined kernel_physical_mapping_init() from .init.text to .meminit.text.
      Signed-off-by: NGary Hade <garyhade@us.ibm.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      f5495506
  3. 08 1月, 2009 1 次提交
    • A
      resource: allow MMIO exclusivity for device drivers · e8de1481
      Arjan van de Ven 提交于
      Device drivers that use pci_request_regions() (and similar APIs) have a
      reasonable expectation that they are the only ones accessing their device.
      As part of the e1000e hunt, we were afraid that some userland (X or some
      bootsplash stuff) was mapping the MMIO region that the driver thought it
      had exclusively via /dev/mem or via various sysfs resource mappings.
      
      This patch adds the option for device drivers to cause their reserved
      regions to the "banned from /dev/mem use" list, so now both kernel memory
      and device-exclusive MMIO regions are banned.
      NOTE: This is only active when CONFIG_STRICT_DEVMEM is set.
      
      In addition to the config option, a kernel parameter iomem=relaxed is
      provided for the cases where developers want to diagnose, in the field,
      drivers issues from userspace.
      Reviewed-by: NMatthew Wilcox <willy@linux.intel.com>
      Signed-off-by: NArjan van de Ven <arjan@linux.intel.com>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      e8de1481
  4. 07 1月, 2009 1 次提交
    • G
      mm: show node to memory section relationship with symlinks in sysfs · c04fc586
      Gary Hade 提交于
      Show node to memory section relationship with symlinks in sysfs
      
      Add /sys/devices/system/node/nodeX/memoryY symlinks for all
      the memory sections located on nodeX.  For example:
      /sys/devices/system/node/node1/memory135 -> ../../memory/memory135
      indicates that memory section 135 resides on node1.
      
      Also revises documentation to cover this change as well as updating
      Documentation/ABI/testing/sysfs-devices-memory to include descriptions
      of memory hotremove files 'phys_device', 'phys_index', and 'state'
      that were previously not described there.
      
      In addition to it always being a good policy to provide users with
      the maximum possible amount of physical location information for
      resources that can be hot-added and/or hot-removed, the following
      are some (but likely not all) of the user benefits provided by
      this change.
      Immediate:
        - Provides information needed to determine the specific node
          on which a defective DIMM is located.  This will reduce system
          downtime when the node or defective DIMM is swapped out.
        - Prevents unintended onlining of a memory section that was
          previously offlined due to a defective DIMM.  This could happen
          during node hot-add when the user or node hot-add assist script
          onlines _all_ offlined sections due to user or script inability
          to identify the specific memory sections located on the hot-added
          node.  The consequences of reintroducing the defective memory
          could be ugly.
        - Provides information needed to vary the amount and distribution
          of memory on specific nodes for testing or debugging purposes.
      Future:
        - Will provide information needed to identify the memory
          sections that need to be offlined prior to physical removal
          of a specific node.
      
      Symlink creation during boot was tested on 2-node x86_64, 2-node
      ppc64, and 2-node ia64 systems.  Symlink creation during physical
      memory hot-add tested on a 2-node x86_64 system.
      Signed-off-by: NGary Hade <garyhade@us.ibm.com>
      Signed-off-by: NBadari Pulavarty <pbadari@us.ibm.com>
      Acked-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      c04fc586
  5. 29 10月, 2008 2 次提交
    • G
      x86: remove debug code from arch_add_memory() · fe8b868e
      Gary Hade 提交于
      Impact: remove incorrect WARN_ON(1)
      
      Gets rid of dmesg spam created during physical memory hot-add which
      will very likely confuse users.  The change removes what appears to
      be debugging code which I assume was unintentionally included in:
      
        x86: arch/x86/mm/init_64.c printk fixes
        commit 10f22ddeSigned-off-by: NGary Hade <garyhade@us.ibm.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      fe8b868e
    • Y
      x86: fix init_memory_mapping for [dc000000 - e0000000) - v2 · f96f57d9
      Yinghai Lu 提交于
      Impact: change over-mapping to precise mapping, fix /proc/meminfo output
      
      v2: fix less than 1G ram system handling
      
      when gart aperture is 0xdc000000 - 0xe0000000
      it return 0xc0000000 - 0xe0000000
      
      that is not right.
      
      this patch fix that will get exact mapping
      
      on 256g sytem with that aperture after patch
      LBSuse:~ # cat /proc/meminfo
      MemTotal:       264742432 kB
      MemFree:        263920628 kB
      Buffers:            1416 kB
      Cached:            24468 kB
      ...
      DirectMap4k:      5760 kB
      DirectMap2M:   3205120 kB
      DirectMap1G:  265289728 kB
      
      it is consistent to
      LBSuse:~ # cat /sys/kernel/debug/kernel_page_tables
      ..
      ---[ Low Kernel Mapping ]---
      0xffff880000000000-0xffff880000200000           2M     RW             GLB x  pte
      0xffff880000200000-0xffff880040000000        1022M     RW         PSE GLB x  pmd
      0xffff880040000000-0xffff8800c0000000           2G     RW         PSE GLB NX pud
      0xffff8800c0000000-0xffff8800d7e00000         382M     RW         PSE GLB NX pmd
      0xffff8800d7e00000-0xffff8800d7fa0000        1664K     RW             GLB NX pte
      0xffff8800d7fa0000-0xffff8800d8000000         384K                           pte
      0xffff8800d8000000-0xffff8800dc000000          64M                           pmd
      0xffff8800dc000000-0xffff8800e0000000          64M     RW         PSE GLB NX pmd
      0xffff8800e0000000-0xffff880100000000         512M                           pmd
      0xffff880100000000-0xffff880800000000          28G     RW         PSE GLB NX pud
      0xffff880800000000-0xffff880824600000         582M     RW         PSE GLB NX pmd
      0xffff880824600000-0xffff8808247f0000        1984K     RW             GLB NX pte
      0xffff8808247f0000-0xffff880824800000          64K     RW     PCD     GLB NX pte
      0xffff880824800000-0xffff880840000000         440M     RW         PSE GLB NX pmd
      0xffff880840000000-0xffff884000000000         223G     RW         PSE GLB NX pud
      0xffff884000000000-0xffff884028000000         640M     RW         PSE GLB NX pmd
      0xffff884028000000-0xffff884040000000         384M                           pmd
      0xffff884040000000-0xffff888000000000         255G                           pud
      0xffff888000000000-0xffffc20000000000       58880G                           pgd
      Signed-off-by: NYinghai Lu <yinghai@kernel.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      f96f57d9
  6. 28 10月, 2008 4 次提交
  7. 13 10月, 2008 4 次提交
  8. 12 10月, 2008 1 次提交
  9. 11 10月, 2008 5 次提交
    • S
      x86, cpa: make the kernel physical mapping initialization a two pass sequence, fix · b27a43c1
      Suresh Siddha 提交于
      Jeremy Fitzhardinge wrote:
      
      > I'd noticed that current tip/master hasn't been booting under Xen, and I
      > just got around to bisecting it down to this change.
      >
      > commit 065ae73c5462d42e9761afb76f2b52965ff45bd6
      > Author: Suresh Siddha <suresh.b.siddha@intel.com>
      >
      >    x86, cpa: make the kernel physical mapping initialization a two pass sequence
      >
      > This patch is causing Xen to fail various pagetable updates because it
      > ends up remapping pagetables to RW, which Xen explicitly prohibits (as
      > that would allow guests to make arbitrary changes to pagetables, rather
      > than have them mediated by the hypervisor).
      
      Instead of making init a two pass sequence, to satisfy the Intel's TLB
      Application note (developer.intel.com/design/processor/applnots/317080.pdf
      Section 6 page 26), we preserve the original page permissions
      when fragmenting the large mappings and don't touch the existing memory
      mapping (which satisfies Xen's requirements).
      
      Only open issue is: on a native linux kernel, we will go back to mapping
      the first 0-1GB kernel identity mapping as executable (because of the
      static mapping setup in head_64.S). We can fix this in a different
      patch if needed.
      Signed-off-by: NSuresh Siddha <suresh.b.siddha@intel.com>
      Acked-by: NJeremy Fitzhardinge <jeremy@goop.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      b27a43c1
    • S
      x86: fix pagetable init 64-bit breakage · 28dd033f
      Suresh Siddha 提交于
      Fix _end alignment check - can trigger a crash if _end happens to be
      on a page boundary.
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      28dd033f
    • S
      x86, cpa: remove cpa pool code · 8311eb84
      Suresh Siddha 提交于
      Interrupt context no longer splits large page in cpa(). So we can do away
      with cpa memory pool code.
      Signed-off-by: NSuresh Siddha <suresh.b.siddha@intel.com>
      Cc: Suresh Siddha <suresh.b.siddha@intel.com>
      Cc: arjan@linux.intel.com
      Cc: venkatesh.pallipadi@intel.com
      Cc: jeremy@goop.org
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      8311eb84
    • S
      x86, cpa: dont use large pages for kernel identity mapping with DEBUG_PAGEALLOC · 0b8fdcbc
      Suresh Siddha 提交于
      Don't use large pages for kernel identity mapping with DEBUG_PAGEALLOC.
      This will remove the need to split the large page for the
      allocated kernel page in the interrupt context.
      
      This will simplify cpa code(as we don't do the split any more from the
      interrupt context). cpa code simplication in the subsequent patches.
      Signed-off-by: NSuresh Siddha <suresh.b.siddha@intel.com>
      Cc: Suresh Siddha <suresh.b.siddha@intel.com>
      Cc: arjan@linux.intel.com
      Cc: venkatesh.pallipadi@intel.com
      Cc: jeremy@goop.org
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      0b8fdcbc
    • S
      x86, cpa: make the kernel physical mapping initialization a two pass sequence · a2699e47
      Suresh Siddha 提交于
      In the first pass, kernel physical mapping will be setup using large or
      small pages but uses the same PTE attributes as that of the early
      PTE attributes setup by early boot code in head_[32|64].S
      
      After flushing TLB's, we go through the second pass, which setups the
      direct mapped PTE's with the appropriate attributes (like NX, GLOBAL etc)
      which are runtime detectable.
      
      This two pass mechanism conforms to the TLB app note which says:
      
      "Software should not write to a paging-structure entry in a way that would
       change, for any linear address, both the page size and either the page frame
       or attributes."
      Signed-off-by: NSuresh Siddha <suresh.b.siddha@intel.com>
      Cc: Suresh Siddha <suresh.b.siddha@intel.com>
      Cc: arjan@linux.intel.com
      Cc: venkatesh.pallipadi@intel.com
      Cc: jeremy@goop.org
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      a2699e47
  10. 07 9月, 2008 1 次提交
  11. 05 9月, 2008 2 次提交
  12. 22 8月, 2008 2 次提交
  13. 16 8月, 2008 1 次提交
    • M
      x86: fix section mismatch warning - spp_getpage() · 8d6ea967
      Marcin Slusarz 提交于
      WARNING: vmlinux.o(.text+0x17a3e): Section mismatch in reference from the function set_pte_vaddr_pud() to the function .init.text:spp_getpage()
      The function set_pte_vaddr_pud() references
      the function __init spp_getpage().
      This is often because set_pte_vaddr_pud lacks a __init
      annotation or the annotation of spp_getpage is wrong.
      
      spp_getpage is called from __init (__init_extra_mapping) and
      non __init (set_pte_vaddr_pud) functions, so it can't be __init.
      Unfortunately it calls alloc_bootmem_pages which is __init,
      but does it only when bootmem allocator is available (after_bootmem == 0).
      
      So annotate it accordingly.
      Signed-off-by: NMarcin Slusarz <marcin.slusarz@gmail.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      Cc: H. Peter Anvin <hpa@zytor.com>
      8d6ea967
  14. 15 8月, 2008 1 次提交
    • H
      x86: fix /proc/meminfo DirectMap · a06de630
      Hugh Dickins 提交于
      Do we actually want these DirectMap lines in the x86 /proc/meminfo?
      I can see they're interesting to CPA developers and TLB optimizers,
      but they don't fit its usual "where has all my memory gone?" usage.
      If they are to stay, here are some fixes.
      
      1. On x86_32 without PAE, they're not 2M but 4M pages: no need to
         mess with the internal enum, but show the right name to users.
      
      2. Many machines can never show anything but 0 for DirectMap1G,
         so suppress that line unless direct_gbpages are really enabled.
      
      3. The unit in /proc/meminfo is kB not number of pages: HugePages
         messed that up, but they're an example to regret not to follow.
      
      4. Once we use kB, it's easy to see that 1GB has gone missing (which
         explains why CONFIG_CPA_DEBUG=y soon wraps DirectMap2M negative):
         because head_64.S's level2_ident_pgt entries were not counted.
         My fix is not ideal, but works for more and for less than 1G,
         and avoids interfering with early bootup pagetable contortions.
      Signed-off-by: NHugh Dickins <hugh@veritas.com>
      Cc: Andi Kleen <andi@firstfloor.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      a06de630
  15. 27 7月, 2008 1 次提交
  16. 26 7月, 2008 1 次提交
  17. 18 7月, 2008 1 次提交
  18. 17 7月, 2008 1 次提交
  19. 13 7月, 2008 1 次提交
  20. 11 7月, 2008 1 次提交
  21. 10 7月, 2008 1 次提交
  22. 09 7月, 2008 4 次提交
  23. 08 7月, 2008 2 次提交
    • J
      x86_64/setup: unconditionally populate the pgd · 574977a2
      Jeremy Fitzhardinge 提交于
      When allocating a new pud, unconditionally populate the pgd (why did
      we bother to create a new pud if we weren't going to populate it?).
      
      This will only happen if the pgd slot was empty, since any existing
      pud will be reused.
      Signed-off-by: NJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.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>
      574977a2
    • J
      x86/paravirt: groundwork for 64-bit Xen support, fix #2 · 22b45144
      Jeremy Fitzhardinge 提交于
      Ingo Molnar wrote:
      > that fixed the build but now we've got a boot crash with this config:
      >
      >  time.c: Detected 2010.304 MHz processor.
      >  spurious 8259A interrupt: IRQ7.
      >  BUG: unable to handle kernel NULL pointer dereference at  0000000000000000
      >  IP: [<0000000000000000>]
      >  PGD 0
      >  Thread overran stack, or stack corrupted
      >  Oops: 0010 [1] SMP
      >  CPU 0
      >
      
      I don't know if this will fix this bug, but it's definitely a bugfix.
      It was trashing random pages by overwriting them with pagetables...
      
      Don't trash a large pmd's data when mapping physical memory.
      This is a bugfix for "x86_64: adjust mapping of physical pagetables
      to work with Xen".
      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>
      Cc: Vegard Nossum <vegard.nossum@gmail.com>
      Cc: Nick Piggin <npiggin@suse.de>
      Cc: Yinghai Lu <yhlu.kernel@gmail.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      22b45144