1. 21 2月, 2009 4 次提交
    • I
      x86, mm: fault.c, refactor/simplify the is_prefetch() code · 107a0367
      Ingo Molnar 提交于
      Impact: no functionality changed
      
      Factor out the opcode checker into a helper inline.
      
      The code got a tiny bit smaller:
      
         text	   data	    bss	    dec	    hex	filename
         4632	     32	     24	   4688	   1250	fault.o.before
         4618	     32	     24	   4674	   1242	fault.o.after
      
      And it got cleaner / easier to review as well.
      
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      107a0367
    • I
      x86, mm: fault.c cleanup · 2d4a7167
      Ingo Molnar 提交于
      Impact: cleanup, no code changed
      
      Clean up various small details, which can be correctness checked
      automatically:
      
       - tidy up the include file section
       - eliminate unnecessary includes
       - introduce show_signal_msg() to clean up code flow
       - standardize the code flow
       - standardize comments and other style details
       - more cleanups, pointed out by checkpatch
      
      No code changed on either 32-bit nor 64-bit:
      
      arch/x86/mm/fault.o:
      
         text	   data	    bss	    dec	    hex	filename
         4632	     32	     24	   4688	   1250	fault.o.before
         4632	     32	     24	   4688	   1250	fault.o.after
      
      the md5 changed due to a change in a single instruction:
      
         2e8a8241e7f0d69706776a5a26c90bc0  fault.o.before.asm
         c5c3d36e725586eb74f0e10692f0193e  fault.o.after.asm
      
      Because a __LINE__ reference in a WARN_ONCE() has changed.
      
      On 32-bit a few stack offsets changed - no code size difference
      nor any functionality difference.
      
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      2d4a7167
    • I
      x86, pat: add large-PAT check to split_large_page() · 7a5714e0
      Ingo Molnar 提交于
      Impact: future-proof the split_large_page() function
      
      Linus noticed that split_large_page() is not safe wrt. the
      PAT bit: it is bit 12 on the 1GB and 2MB page table level
      (_PAGE_BIT_PAT_LARGE), and it is bit 7 on the 4K page
      table level (_PAGE_BIT_PAT).
      
      Currently it is not a problem because we never set
      _PAGE_BIT_PAT_LARGE on any of the large-page mappings - but
      should this happen in the future the split_large_page() would
      silently lift bit 12 into the lowlevel 4K pte and would start
      corrupting the physical page frame offset. Not fun.
      
      So add a debug warning, to make sure if something ever sets
      the PAT bit then this function gets updated too.
      
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      7a5714e0
    • S
      x86: check PMD in spurious_fault handler · 3c3e5694
      Steven Rostedt 提交于
      Impact: fix to prevent hard lockup on bad PMD permissions
      
      If the PMD does not have the correct permissions for a page access,
      but the PTE does, the spurious fault handler will mistake the fault
      as a lazy TLB transaction. This will result in an infinite loop of:
      
       fault -> spurious_fault check (pass) -> return to code -> fault
      
      This patch adds a check and a warn on if the PTE passes the permissions
      but the PMD does not.
      
      [ Updated: Ingo Molnar suggested using WARN_ONCE with some text ]
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      3c3e5694
  2. 20 2月, 2009 9 次提交
  3. 19 2月, 2009 3 次提交
    • H
      x86: syscalls.h: remove asmlinkage from declaration of sys_rt_sigreturn() · 71d8f978
      Hiroshi Shimamoto 提交于
      Impact: cleanup
      
      asmlinkage for sys_rt_sigreturn() no longer exists in arch/x86/kernel/signal.c.
      Signed-off-by: NHiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      71d8f978
    • J
    • K
      mm: clean up for early_pfn_to_nid() · f2dbcfa7
      KAMEZAWA Hiroyuki 提交于
      What's happening is that the assertion in mm/page_alloc.c:move_freepages()
      is triggering:
      
      	BUG_ON(page_zone(start_page) != page_zone(end_page));
      
      Once I knew this is what was happening, I added some annotations:
      
      	if (unlikely(page_zone(start_page) != page_zone(end_page))) {
      		printk(KERN_ERR "move_freepages: Bogus zones: "
      		       "start_page[%p] end_page[%p] zone[%p]\n",
      		       start_page, end_page, zone);
      		printk(KERN_ERR "move_freepages: "
      		       "start_zone[%p] end_zone[%p]\n",
      		       page_zone(start_page), page_zone(end_page));
      		printk(KERN_ERR "move_freepages: "
      		       "start_pfn[0x%lx] end_pfn[0x%lx]\n",
      		       page_to_pfn(start_page), page_to_pfn(end_page));
      		printk(KERN_ERR "move_freepages: "
      		       "start_nid[%d] end_nid[%d]\n",
      		       page_to_nid(start_page), page_to_nid(end_page));
       ...
      
      And here's what I got:
      
      	move_freepages: Bogus zones: start_page[2207d0000] end_page[2207dffc0] zone[fffff8103effcb00]
      	move_freepages: start_zone[fffff8103effcb00] end_zone[fffff8003fffeb00]
      	move_freepages: start_pfn[0x81f600] end_pfn[0x81f7ff]
      	move_freepages: start_nid[1] end_nid[0]
      
      My memory layout on this box is:
      
      [    0.000000] Zone PFN ranges:
      [    0.000000]   Normal   0x00000000 -> 0x0081ff5d
      [    0.000000] Movable zone start PFN for each node
      [    0.000000] early_node_map[8] active PFN ranges
      [    0.000000]     0: 0x00000000 -> 0x00020000
      [    0.000000]     1: 0x00800000 -> 0x0081f7ff
      [    0.000000]     1: 0x0081f800 -> 0x0081fe50
      [    0.000000]     1: 0x0081fed1 -> 0x0081fed8
      [    0.000000]     1: 0x0081feda -> 0x0081fedb
      [    0.000000]     1: 0x0081fedd -> 0x0081fee5
      [    0.000000]     1: 0x0081fee7 -> 0x0081ff51
      [    0.000000]     1: 0x0081ff59 -> 0x0081ff5d
      
      So it's a block move in that 0x81f600-->0x81f7ff region which triggers
      the problem.
      
      This patch:
      
      Declaration of early_pfn_to_nid() is scattered over per-arch include
      files, and it seems it's complicated to know when the declaration is used.
       I think it makes fix-for-memmap-init not easy.
      
      This patch moves all declaration to include/linux/mm.h
      
      After this,
        if !CONFIG_NODES_POPULATES_NODE_MAP && !CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID
           -> Use static definition in include/linux/mm.h
        else if !CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID
           -> Use generic definition in mm/page_alloc.c
        else
           -> per-arch back end function will be called.
      Signed-off-by: NKAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
      Tested-by: NKOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
      Reported-by: NDavid Miller <davem@davemlloft.net>
      Cc: Mel Gorman <mel@csn.ul.ie>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: <stable@kernel.org>		[2.6.25.x, 2.6.26.x, 2.6.27.x, 2.6.28.x]
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      f2dbcfa7
  4. 18 2月, 2009 24 次提交
    • A
      x86, mce: fix ifdef for 64bit thermal apic vector clear on shutdown · 07db1c14
      Andi Kleen 提交于
      Impact: Bugfix
      
      The ifdef for the apic clear on shutdown for the 64bit intel thermal
      vector was incorrect and never triggered. Fix that.
      Signed-off-by: NAndi Kleen <ak@linux.intel.com>
      Acked-by: NThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NH. Peter Anvin <hpa@zytor.com>
      07db1c14
    • A
      x86, mce: use force_sig_info to kill process in machine check · 380851bc
      Andi Kleen 提交于
      Impact: bug fix (with tolerant == 3)
      
      do_exit cannot be called directly from the exception handler because
      it can sleep and the exception handler runs on the exception stack.
      Use force_sig() instead.
      
      Based on a earlier patch by Ying Huang who debugged the problem.
      Signed-off-by: NAndi Kleen <ak@linux.intel.com>
      Acked-by: NThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NH. Peter Anvin <hpa@zytor.com>
      380851bc
    • A
      x86, mce: reinitialize per cpu features on resume · 6ec68bff
      Andi Kleen 提交于
      Impact: Bug fix
      
      This fixes a long standing bug in the machine check code. On resume the
      boot CPU wouldn't get its vendor specific state like thermal handling
      reinitialized. This means the boot cpu wouldn't ever get any thermal
      events reported again.
      
      Call the respective initialization functions on resume
      
      v2: Remove ancient init because they don't have a resume device anyways.
          Pointed out by Thomas Gleixner.
      v3: Now fix the Subject too to reflect v2 change
      Signed-off-by: NAndi Kleen <ak@linux.intel.com>
      Acked-by: NThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NH. Peter Anvin <hpa@zytor.com>
      6ec68bff
    • I
      x86, apic: separate 32-bit setup functionality out of apic_32.c · 9be1b56a
      Ingo Molnar 提交于
      Impact: build fix, cleanup
      
      A couple of arch setup callbacks were mistakenly in apic_32.c, breaking
      the build.
      
      Also simplify the code a bit.
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      9be1b56a
    • P
      x86, rcu: fix strange load average and ksoftirqd behavior · bf51935f
      Paul E. McKenney 提交于
      Damien Wyart reported high ksoftirqd CPU usage (20%) on an
      otherwise idle system.
      
      The function-graph trace Damien provided:
      
      >   799.521187 |   1)    <idle>-0    |               |  rcu_check_callbacks() {
      >   799.521371 |   1)    <idle>-0    |               |  rcu_check_callbacks() {
      >   799.521555 |   1)    <idle>-0    |               |  rcu_check_callbacks() {
      >   799.521738 |   1)    <idle>-0    |               |  rcu_check_callbacks() {
      >   799.521934 |   1)    <idle>-0    |               |  rcu_check_callbacks() {
      >   799.522068 |   1)  ksoftir-2324  |               |                rcu_check_callbacks() {
      >   799.522208 |   1)    <idle>-0    |               |  rcu_check_callbacks() {
      >   799.522392 |   1)    <idle>-0    |               |  rcu_check_callbacks() {
      >   799.522575 |   1)    <idle>-0    |               |  rcu_check_callbacks() {
      >   799.522759 |   1)    <idle>-0    |               |  rcu_check_callbacks() {
      >   799.522956 |   1)    <idle>-0    |               |  rcu_check_callbacks() {
      >   799.523074 |   1)  ksoftir-2324  |               |                  rcu_check_callbacks() {
      >   799.523214 |   1)    <idle>-0    |               |  rcu_check_callbacks() {
      >   799.523397 |   1)    <idle>-0    |               |  rcu_check_callbacks() {
      >   799.523579 |   1)    <idle>-0    |               |  rcu_check_callbacks() {
      >   799.523762 |   1)    <idle>-0    |               |  rcu_check_callbacks() {
      >   799.523960 |   1)    <idle>-0    |               |  rcu_check_callbacks() {
      >   799.524079 |   1)  ksoftir-2324  |               |                  rcu_check_callbacks() {
      >   799.524220 |   1)    <idle>-0    |               |  rcu_check_callbacks() {
      >   799.524403 |   1)    <idle>-0    |               |  rcu_check_callbacks() {
      >   799.524587 |   1)    <idle>-0    |               |  rcu_check_callbacks() {
      >   799.524770 |   1)    <idle>-0    |               |  rcu_check_callbacks() {
      > [ . . . ]
      
      Shows rcu_check_callbacks() being invoked way too often. It should be called
      once per jiffy, and here it is called no less than 22 times in about
      3.5 milliseconds, meaning one call every 160 microseconds or so.
      
      Why do we need to call rcu_pending() and rcu_check_callbacks() from the
      idle loop of 32-bit x86, especially given that no other architecture does
      this?
      
      The following patch removes the call to rcu_pending() and
      rcu_check_callbacks() from the x86 32-bit idle loop in order to
      reduce the softirq load on idle systems.
      Reported-by: NDamien Wyart <damien.wyart@free.fr>
      Signed-off-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      bf51935f
    • H
      x86: truncate ISA addresses to unsigned int · a7eb5189
      H. Peter Anvin 提交于
      Impact: Cleanup; fix inappropriate macro use
      
      ISA addresses on x86 are mapped 1:1 with the physical address space.
      Since the ISA address space is only 24 bits (32 for VLB or LPC) it
      will always fit in an unsigned int, and at least in the aha1542 driver
      using a wider type would cause an undesirable promotion.  Hence
      explicitly cast the ISA bus addresses to unsigned int.
      Signed-off-by: NH. Peter Anvin <hpa@linux.intel.com>
      Cc: James Bottomley <James.Bottomley@hansenpartnership.com>
      a7eb5189
    • I
      x86, apic: move remaining APIC drivers to arch/x86/kernel/apic/* · 2a05180f
      Ingo Molnar 提交于
      Move the 32-bit extended-arch APIC drivers to arch/x86/kernel/apic/
      too, and rename apic_64.c to probe_64.c.
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      2a05180f
    • I
      x86, apic: move APIC drivers to arch/x86/kernel/apic/* · f62bae50
      Ingo Molnar 提交于
      arch/x86/kernel/ is getting a bit crowded, and the APIC
      drivers are scattered into various different files.
      
      Move them to arch/x86/kernel/apic/*, and also remove
      the 'gen' prefix from those which had it.
      
      Also move APIC related functionality: the IO-APIC driver,
      the NMI and the IPI code.
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      f62bae50
    • I
      x86, apic: rename 'genapic' to 'apic' · be163a15
      Ingo Molnar 提交于
      Impact: cleanup
      
      Now that all APIC code is consolidated there's nothing 'gen' about
      apics anymore - so rename 'struct genapic' to 'struct apic'.
      
      This shortens the code and is nicer to read as well.
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      be163a15
    • I
      x86, apic: remove ->store_NMI_vector() · ab6fb7c0
      Ingo Molnar 提交于
      Impact: cleanup
      
      It's not used by anything anymore.
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      ab6fb7c0
    • I
      x86, numaq_32: clean up, misc · cb81eaed
      Ingo Molnar 提交于
      Impact: cleanup
      
       - misc other cleanups that change the md5 signature
       - consolidate global variables
       - remove unnecessary __numaq_mps_oem_check() wrapper
       - make numaq_mps_oem_check static
       - update copyrights
       - misc other cleanups pointed out by checkpatch
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      cb81eaed
    • I
      x86, numaq_32: clean up · 36afc3af
      Ingo Molnar 提交于
      Impact: cleanup
      
      - refactor smp_dump_qct()
      - tidy up include files, remove duplicates
      - misc other cleanups, pointed out by checkpatch
      
      No code changed:
      
      md5:
         9c0bc01a53558c77df0f2ebcda7e11a9  numaq_32.o.before.asm
         9c0bc01a53558c77df0f2ebcda7e11a9  numaq_32.o.after.asm
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      36afc3af
    • I
      x86, es7000: misc cleanups · 7da18ed9
      Ingo Molnar 提交于
      These are cleanups that change the md5 signature:
      
       - asm/ => linux/ include conversion
       - simplify the code flow of find_unisys_acpi_oem_table()
       - move ACPI methods into one #ifdef block
       - remove 0/NULL initialization of statics
       - simplify/standardize printouts
       - update copyrights
       - more cleanups, pointed out by checkpatch
      
      arch/x86/kernel/es7000_32.o:
      
         text	   data	    bss	    dec	    hex	filename
         2693	    192	     44	   2929	    b71	es7000_32.o.before
         2688	    192	     44	   2924	    b6c	es7000_32.o.after
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      7da18ed9
    • I
      x86, es7000: remove dead code, clean up · 352887d1
      Ingo Molnar 提交于
      Impact: cleanup
      
       - a number of structure definitions were stale
       - remove needless wrappers around apic definitions
       - fix details noticed by checkpatch
      
      No code changed:
      
      md5:
         029d8fde0aaf6e934ea63bd8b36430fd  es7000_32.o.before.asm
         029d8fde0aaf6e934ea63bd8b36430fd  es7000_32.o.after.asm
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      352887d1
    • I
      x86, es7000: remove externs · d3185b37
      Ingo Molnar 提交于
      Impact: cleanup
      
      In the subarch times there were a number of externs between
      various bits of the ES7000 code. Now that there's a single
      es7000-platform support file, the externs can be removed and
      the functions can be changed the statics.
      
      Beyond the cleanup factor, this also shrinks the size of the
      kernel image a bit:
      
      arch/x86/kernel/es7000_32.o:
      
         text	   data	    bss	    dec	    hex	filename
         2813	    192	     44	   3049	    be9	es7000_32.o.before
         2693	    192	     44	   2929	    b71	es7000_32.o.after
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      d3185b37
    • I
      x86, apic: remove apicid_cluster() · b9e0d1aa
      Ingo Molnar 提交于
      There were multiple definitions of apicid_cluster() scattered around
      in APIC drivers - but the definitions are equivalent to the already
      existing generic APIC_CLUSTER() method.
      
      So remove apicid_cluster() and change all users to APIC_CLUSTER().
      
      No code changed:
      
      md5:
         1b8244ba8d3d6a454593ce10f09dfa58  summit_32.o.before.asm
         1b8244ba8d3d6a454593ce10f09dfa58  summit_32.o.after.asm
      
      md5:
         a593d98a882bf534622c70d9568497ac  es7000_32.o.before.asm
         a593d98a882bf534622c70d9568497ac  es7000_32.o.after.asm
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      b9e0d1aa
    • I
      x86, es7000: clean up · 2c4ce18c
      Ingo Molnar 提交于
      No code changed:
      
      arch/x86/kernel/es7000_32.o:
      
         text	   data	    bss	    dec	    hex	filename
         2813	    192	     44	   3049	    be9	es7000_32.o.before
         2813	    192	     44	   3049	    be9	es7000_32.o.after
      
      md5:
         a593d98a882bf534622c70d9568497ac  es7000_32.o.before.asm
         a593d98a882bf534622c70d9568497ac  es7000_32.o.after.asm
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      2c4ce18c
    • I
      x86, apic: clean up the cpu_2_logical_apiciddeclaration · 2f205bc4
      Ingo Molnar 提交于
      extern declarations were scattered in 4 files - consolidate them
      into apic.h.
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      2f205bc4
    • I
      x86, apic: clean up arch/x86/kernel/bigsmp_32.c · 77313190
      Ingo Molnar 提交于
      Impact: cleanup
      
      - remove unnecessary indirections that were artifacts of the subarch code
      - clean up include file section
      - clean up various small details
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      77313190
    • I
      x86, apic: remove stale references to APIC_DEFINITION · 5c615feb
      Ingo Molnar 提交于
      Impact: cleanup
      
      APIC_DEFINITION was a hack from the x86 subarch times, it has no
      meaning anymore - remove it.
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      5c615feb
    • I
      x86, apic: remove duplicate asm/apic.h inclusions · e641f5f5
      Ingo Molnar 提交于
      Impact: cleanup
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      e641f5f5
    • I
      x86, apic: remove genapic.h · 7b6aa335
      Ingo Molnar 提交于
      Impact: cleanup
      
      Remove genapic.h and remove all references to it.
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      7b6aa335
    • I
      x86, apic: merge genapic.h into apic.h · e2780a68
      Ingo Molnar 提交于
      Impact: cleanup
      
      Reduce the number of include files to worry about.
      Also, most of the users of APIC facilities had to
      include genapic.h already, which embedded apic.h,
      so the distinction was meaningless.
      
      [ include apic.h from genapic.h for compatibility. ]
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      e2780a68
    • I
      remove: genapic prepare · 28aa29ee
      Ingo Molnar 提交于
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      28aa29ee