1. 30 1月, 2008 15 次提交
  2. 15 1月, 2008 1 次提交
    • I
      x86: fix boot crash on HIGHMEM4G && SPARSEMEM · 23be8c7d
      Ingo Molnar 提交于
      Denys Fedoryshchenko reported a bootup crash when he upgraded
      his system from 3GB to 4GB RAM:
      
         http://lkml.org/lkml/2008/1/7/9
      
      the bug is due to HIGHMEM4G && SPARSEMEM kernels making pfn_to_page()
      to return an invalid pointer when the pfn is in a memory hole. The
      256 MB PCI aperture at the end of RAM was not mapped by sparsemem,
      and hence the pfn was not valid. But set_highmem_pages_init() iterated
      this range without checking the pfn's validity first.
      
      this bug was probably present in the sparsemem code ever since sparsemem
      has been introduced in v2.6.13. It was masked due to HIGHMEM64G using
      larger memory regions in sparsemem_32.h:
      
       #ifdef CONFIG_X86_PAE
       #define SECTION_SIZE_BITS       30
       #define MAX_PHYSADDR_BITS       36
       #define MAX_PHYSMEM_BITS        36
       #else
       #define SECTION_SIZE_BITS       26
       #define MAX_PHYSADDR_BITS       32
       #define MAX_PHYSMEM_BITS        32
       #endif
      
      which creates 1GB sparsemem regions instead of 64MB sparsemem regions.
      So in practice we only ever created true sparsemem holes on x86 with
      HIGHMEM4G - but that was rarely used by distros.
      
      ( btw., we could probably save 2MB of mem_map[]s on X86_PAE if we reduced
        the sparsemem region size to 256 MB. )
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      Acked-by: NThomas Gleixner <tglx@linutronix.de>
      23be8c7d
  3. 30 11月, 2007 1 次提交
  4. 30 10月, 2007 2 次提交
  5. 25 10月, 2007 1 次提交
  6. 24 10月, 2007 1 次提交
  7. 22 10月, 2007 1 次提交
  8. 20 10月, 2007 8 次提交
  9. 19 10月, 2007 1 次提交
    • I
      x86: fix global_flush_tlb() bug · 9a24d04a
      Ingo Molnar 提交于
      While we were reviewing pageattr_32/64.c for unification,
      Thomas Gleixner noticed the following serious SMP bug in
      global_flush_tlb():
      
      	down_read(&init_mm.mmap_sem);
      	list_replace_init(&deferred_pages, &l);
      	up_read(&init_mm.mmap_sem);
      
      this is SMP-unsafe because list_replace_init() done on two CPUs in
      parallel can corrupt the list.
      
      This bug has been introduced about a year ago in the 64-bit tree:
      
             commit ea7322de
             Author: Andi Kleen <ak@suse.de>
             Date:   Thu Dec 7 02:14:05 2006 +0100
      
             [PATCH] x86-64: Speed and clean up cache flushing in change_page_attr
      
                      down_read(&init_mm.mmap_sem);
              -       dpage = xchg(&deferred_pages, NULL);
              +       list_replace_init(&deferred_pages, &l);
                      up_read(&init_mm.mmap_sem);
      
      the xchg() based version was SMP-safe, but list_replace_init() is not.
      So this "cleanup" introduced a nasty bug.
      
      why this bug never become prominent is a mystery - it can probably be
      explained with the (still) relative obscurity of the x86_64 architecture.
      
      the safe fix for now is to write-lock init_mm.mmap_sem.
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      9a24d04a
  10. 18 10月, 2007 9 次提交
    • L
      x86: convert mm_context_t semaphore to a mutex · de8aacbe
      Luiz Fernando N. Capitulino 提交于
      convert mm_context_t semaphore to a mutex.
      Signed-off-by: NLuiz Fernando N. Capitulino <lcapitulino@mandriva.com.br>
      Cc: Andi Kleen <ak@suse.de>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      de8aacbe
    • P
      i386: clean up oops/bug reports · 9aa8d719
      Pavel Emelyanov 提交于
      Typically the oops first lines look like this:
      
      BUG: unable to handle kernel NULL pointer dereference at virtual address 00000000
       printing eip:
      c049dfbd
      *pde = 00000000
      Oops: 0002 [#1]
      PREEMPT SMP
      ...
      
      Such output is gained with some ugly if (!nl) printk("\n"); code and
      besides being a waste of lines, this is also annoying to read. The
      following output looks better (and it is how it looks on x86_64):
      
      BUG: unable to handle kernel NULL pointer dereference at virtual address 00000000
      printing eip: c049dfbd *pde = 00000000
      Oops: 0002 [#1] PREEMPT SMP
      ...
      
      [ tglx: arch/x86 adaptation ]
      Signed-off-by: NPavel Emelyanov <xemul@openvz.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NAndi Kleen <ak@suse.de>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      9aa8d719
    • M
      x86: fix cpu_to_node references · 98c9e27a
      Mike Travis 提交于
      In x86_64 and i386 architectures most arrays that are sized using
      NR_CPUS lay in local memory on node 0.  Not only will most (99%?) of the
      systems not use all the slots in these arrays, particularly when NR_CPUS
      is increased to accommodate future very high cpu count systems, but a
      number of cache lines are passed unnecessarily on the system bus when
      these arrays are referenced by cpus on other nodes.
      
      Typically, the values in these arrays are referenced by the cpu
      accessing it's own values, though when passing IPI interrupts, the cpu
      does access the data relevant to the targeted cpu/node.  Of course, if
      the referencing cpu is not on node 0, then the reference will still
      require cross node exchanges of cache lines.  A common use of this is
      for an interrupt service routine to pass the interrupt to other cpus
      local to that node.
      
      Ideally, all the elements in these arrays should be moved to the per_cpu
      data area.  In some cases (such as x86_cpu_to_apicid) the array is
      referenced before the per_cpu data areas are setup.  In this case, a
      static array is declared in the __initdata area and initialized by the
      booting cpu (BSP).  The values are then moved to the per_cpu area after
      it is initialized and the original static array is freed with the rest
      of the __initdata.
      
      This patch:
      
      Fix four instances where cpu_to_node is referenced by array instead of
      via the cpu_to_node macro.  This is preparation to moving it to the
      per_cpu data area.
      Signed-off-by: NMike Travis <travis@sgi.com>
      Cc: Andi Kleen <ak@suse.de>
      Cc: Christoph Lameter <clameter@sgi.com>
      Cc: "Siddha, Suresh B" <suresh.b.siddha@intel.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      98c9e27a
    • H
      x86: Create clflush() inline, remove hardcoded wbinvd · 6619a8fb
      H. Peter Anvin 提交于
      Create an inline function for clflush(), with the proper arguments,
      and use it instead of hard-coding the instruction.
      
      This also removes one instance of hard-coded wbinvd, based on a patch
      by Bauder de Oliveira Costa.
      
      [ tglx: arch/x86 adaptation ]
      
      Cc: Andi Kleen <andi@firstfloor.org>
      Cc: Glauber de Oliveira Costa <gcosta@redhat.com>
      Signed-off-by: NH. Peter Anvin <hpa@zytor.com>
      Signed-off-by: NAndi Kleen <ak@suse.de>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      6619a8fb
    • A
      i386: make some variables static · 59659f14
      Adrian Bunk 提交于
      This patch makes some needlessly global variables static.
      
      [ tglx: arch/x86 adaptation ]
      Signed-off-by: NAdrian Bunk <bunk@stusta.de>
      Signed-off-by: NAndi Kleen <ak@suse.de>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      59659f14
    • Y
      x86: 0 -> NULL, for arch/x86_64 · 83e83d54
      Yoann Padioleau 提交于
      When comparing a pointer, it's clearer to compare it to NULL than to 0.
      
      [ tglx: arch/x86 adaptation ]
      Signed-off-by: NYoann Padioleau <padator@wanadoo.fr>
      Signed-off-by: NAndi Kleen <ak@suse.de>
      Cc: ak@suse.de
      Cc: discuss@x86-64.org
      Cc: akpm@linux-foundation.org
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      83e83d54
    • H
      x86: NX bit handling in change_page_attr() · 84e0fdb1
      Huang, Ying 提交于
      This patch fixes a bug of change_page_attr/change_page_attr_addr on
      Intel x86_64 CPUs.  After changing page attribute to be executable with
      these functions, the page remains un-executable on Intel x86_64 CPU.
      Because on Intel x86_64 CPU, only if the "NX" bits of all four level
      page tables are cleared, the corresponding page is executable (refer to
      section 4.13.2 of Intel 64 and IA-32 Architectures Software Developer's
      Manual).  So, the bug is fixed through clearing the "NX" bit of PMD when
      splitting the huge PMD.
      Signed-off-by: NHuang Ying <ying.huang@intel.com>
      Cc: Andi Kleen <ak@suse.de>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      84e0fdb1
    • P
      x86: stop nmi softlockup warnings in show_mem() · 27eb0b28
      Prarit Bhargava 提交于
      When dumping memory via sysrq-m it is possible to take a bogus NMI
      watchdog or softlockup watchdog because the dump can take a long time on
      big memory systems.
      
      Occasionally tickle the watchdog when doing the dump.
      Signed-off-by: NPrarit Bhargava <prarit@redhat.com>
      Cc: Andi Kleen <ak@suse.de>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      27eb0b28
    • I
      x86: fix CONFIG_PAGEALLOC related boot hangs/OOMs · 509a80c4
      Ingo Molnar 提交于
      if CONFIG_PAGEALLOC is enabled then X86_FEATURE_PSE is disabled and all
      the kernel physical RAM pagetables are set up as 4K pages. This is
      needed so that CONFIG_PAGEALLOC can do finegrained mapping and unmapping
      of pages.
      
      as a side-effect though, the total size of memory allocated as kernel
      pagetables increases significantly. All these pagetables are allocated
      via alloc_bootmem_low_pages(), straight out of the lowmem DMA pool. If
      the system has enough RAM and a large kernel image then almost all of
      the 16 MB lowmem DMA pool is allocated to the image and to pagetables -
      leaving no space for __GFP_DMA allocations.
      
      this results in drivers failing and the bootup hanging:
      
       swapper invoked oom-killer: gfp_mask=0x80d1, order=0, oomkilladj=0
        [<4015059f>] out_of_memory+0x17f/0x1c0
        [<40151f3c>] __alloc_pages+0x37c/0x3a0
        [<40168cd7>] slob_new_page+0x37/0x50
        [<40168dff>] slob_alloc+0x10f/0x190
        [<40169010>] __kmalloc_node+0x80/0x90
        [<405a17e3>] scsi_host_alloc+0x33/0x2c0
        [<405a1a82>] scsi_register+0x12/0x60
        [<40d5889e>] aha1542_detect+0x9e/0x940
        [<405c5ba5>] ultrastor_detect+0x265/0x5f0
        [<401352f5>] getnstimeofday+0x35/0xf0
        [<40d58751>] init_this_scsi_driver+0x41/0xf0
        [<40d0b856>] kernel_init+0x136/0x310
        [<40d58710>] init_this_scsi_driver+0x0/0xf0
        [<40d0b720>] kernel_init+0x0/0x310
        [<40105547>] kernel_thread_helper+0x7/0x10
        =======================
      
      the fix is to first allocate from above the DMA pool, and if that fails
      (for example due to it being a machine with less than 16 MB of RAM),
      allocate from the DMA pool as a fallback.
      
      With this fix applied i was able to boot a PAGEALLOC=y kernel that would
      hang before.
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      509a80c4