1. 22 8月, 2009 2 次提交
    • S
      x86, pat/mtrr: Rendezvous all the cpus for MTRR/PAT init · d0af9eed
      Suresh Siddha 提交于
      SDM Vol 3a section titled "MTRR considerations in MP systems" specifies
      the need for synchronizing the logical cpu's while initializing/updating
      MTRR.
      
      Currently Linux kernel does the synchronization of all cpu's only when
      a single MTRR register is programmed/updated. During an AP online
      (during boot/cpu-online/resume)  where we initialize all the MTRR/PAT registers,
      we don't follow this synchronization algorithm.
      
      This can lead to scenarios where during a dynamic cpu online, that logical cpu
      is initializing MTRR/PAT with cache disabled (cr0.cd=1) etc while other logical
      HT sibling continue to run (also with cache disabled because of cr0.cd=1
      on its sibling).
      
      Starting from Westmere, VMX transitions with cr0.cd=1 don't work properly
      (because of some VMX performance optimizations) and the above scenario
      (with one logical cpu doing VMX activity and another logical cpu coming online)
      can result in system crash.
      
      Fix the MTRR initialization by doing rendezvous of all the cpus. During
      boot and resume, we delay the MTRR/PAT init for APs till all the
      logical cpu's come online and the rendezvous process at the end of AP's bringup,
      will initialize the MTRR/PAT for all AP's.
      
      For dynamic single cpu online, we synchronize all the logical cpus and
      do the MTRR/PAT init on the AP that is coming online.
      Signed-off-by: NSuresh Siddha <suresh.b.siddha@intel.com>
      Signed-off-by: NH. Peter Anvin <hpa@zytor.com>
      d0af9eed
    • S
      generic-ipi: Allow cpus not yet online to call smp_call_function with irqs disabled · 269c861b
      Suresh Siddha 提交于
      Because of deadlock possiblities smp_call_function() is not allowed to
      be called with interrupts disabled. Add an exception for the cpu not
      yet online, as no one else can send smp call function interrupt to this
      cpu that is not yet online and as such deadlock condition is not possible.
      Signed-off-by: NSuresh Siddha <suresh.b.siddha@intel.com>
      Acked-by: NNick Piggin <npiggin@suse.de>
      Signed-off-by: NH. Peter Anvin <hpa@zytor.com>
      269c861b
  2. 10 8月, 2009 1 次提交
  3. 11 7月, 2009 2 次提交
  4. 10 7月, 2009 2 次提交
  5. 05 7月, 2009 1 次提交
    • I
      x86: Further clean up of mtrr/generic.c · e3d0e692
      Ingo Molnar 提交于
      Yinghai noticed that i defined BIOS_BUG_MSG but added no
      usage for it. The usage is to clean up this turd in generic.c:
      
      			printk(KERN_WARNING "WARNING: BIOS bug: VAR MTRR %d "
      				"contains strange UC entry under 1M, check "
      				"with your system vendor!\n", i);
      
      Breaking printk lines in the middle looks ugly, is hard to read
      and breaks 'git grep'. Use the BIOS_BUG_MSG instead.
      
      Also complete the moving of structure definitions and variables
      to the top of the file.
      Reported-by: NYinghai Lu <yinghai@kernel.org>
      LKML-Reference: <20090703164225.GA21447@elte.hu>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      e3d0e692
  6. 04 7月, 2009 10 次提交
    • J
      x86: Clean up mtrr/main.c · dbd51be0
      Jaswinder Singh Rajput 提交于
      Fix following trivial style problems:
      
        ERROR: trailing whitespace X 25
        WARNING: Use #include <linux/uaccess.h> instead of <asm/uaccess.h>
        WARNING: Use #include <linux/kvm_para.h> instead of <asm/kvm_para.h>
        ERROR: do not initialise externals to 0 or NULL X 2
        ERROR: "foo * bar" should be "foo *bar" X 5
        ERROR: do not use assignment in if condition X 2
        WARNING: line over 80 characters X 8
        ERROR: return is not a function, parentheses are not required
        WARNING: braces {} are not necessary for any arm of this statement
        ERROR: space required before the open parenthesis '(' X 2
        ERROR: open brace '{' following function declarations go on the next line
        ERROR: space required after that ',' (ctx:VxV) X 8
        ERROR: space required before the open parenthesis '(' X 3
        ERROR: else should follow close brace '}'
        WARNING: space prohibited between function name and open parenthesis '('
        WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable X 2
      
      Also use pr_debug and pr_warning where possible.
      
      total: 50 errors, 14 warnings
      
      arch/x86/kernel/cpu/mtrr/main.o:
      
         text	   data	    bss	    dec	    hex	filename
         3668	    116	   4156	   7940	   1f04	main.o.before
         3668	    116	   4156	   7940	   1f04	main.o.after
      
      md5:
         e01af2fd28deef77c8d01e71acfbd365  main.o.before.asm
         e01af2fd28deef77c8d01e71acfbd365  main.o.after.asm
      Suggested-by: NAlan Cox <alan@lxorguk.ukuu.org.uk>
      Signed-off-by: NJaswinder Singh Rajput <jaswinderrajput@gmail.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Yinghai Lu <yinghai@kernel.org>
      LKML-Reference: <20090703164225.GA21447@elte.hu>
      Cc: Avi Kivity <avi@redhat.com> # Avi, please have a look at the kvm_para.h bit
      [ More cleanups ]
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      dbd51be0
    • J
      x86: Clean up mtrr/state.c · 09b22c85
      Jaswinder Singh Rajput 提交于
      Fix:
      
        WARNING: Use #include <linux/io.h> instead of <asm/io.h>
        WARNING: line over 80 characters X 4
      
      arch/x86/kernel/cpu/mtrr/state.o:
      
         text	   data	    bss	    dec	    hex	filename
          864	      0	      0	    864	    360	state.o.before
          864	      0	      0	    864	    360	state.o.after
      
      md5:
         c5c4364b9aeac74d70111e1e49667a2c  state.o.before.asm
         c5c4364b9aeac74d70111e1e49667a2c  state.o.after.asm
      Suggested-by: NAlan Cox <alan@lxorguk.ukuu.org.uk>
      Signed-off-by: NJaswinder Singh Rajput <jaswinderrajput@gmail.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Yinghai Lu <yinghai@kernel.org>
      LKML-Reference: <20090703164225.GA21447@elte.hu>
      [ More cleanups ]
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      09b22c85
    • J
      x86: Clean up mtrr/mtrr.h · 3ec8dbcb
      Jaswinder Singh Rajput 提交于
      Fix:
      
        ERROR: do not use C99 // comments
        ERROR: "foo * bar" should be "foo *bar" X 2
      Suggested-by: NAlan Cox <alan@lxorguk.ukuu.org.uk>
      Signed-off-by: NJaswinder Singh Rajput <jaswinderrajput@gmail.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Yinghai Lu <yinghai@kernel.org>
      LKML-Reference: <20090703164225.GA21447@elte.hu>
      [ More tidyups ]
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      3ec8dbcb
    • J
      x86: Clean up mtrr/if.c · 26dc67ed
      Jaswinder Singh Rajput 提交于
      Fix:
      
        WARNING: Use #include <linux/uaccess.h> instead of <asm/uaccess.h>
        ERROR: trailing whitespace X 7
        ERROR: trailing statements should be on next line X 3
        WARNING: line over 80 characters X 5
        ERROR: space required before the open parenthesis '('
      
      arch/x86/kernel/cpu/mtrr/if.o:
      
         text	   data	    bss	    dec	    hex	filename
         2239	      4	      0	   2243	    8c3	if.o.before
         2239	      4	      0	   2243	    8c3	if.o.after
      
      md5:
         78d1f2aa4843ec6509c18e2dee54bc7f  if.o.before.asm
         78d1f2aa4843ec6509c18e2dee54bc7f  if.o.after.asm
      Suggested-by: NAlan Cox <alan@lxorguk.ukuu.org.uk>
      Signed-off-by: NJaswinder Singh Rajput <jaswinderrajput@gmail.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Yinghai Lu <yinghai@kernel.org>
      LKML-Reference: <20090703164225.GA21447@elte.hu>
      [ More cleanups to make the code more consistent. ]
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      26dc67ed
    • J
      x86: Clean up mtrr/generic.c · a1a499a3
      Jaswinder Singh Rajput 提交于
      Fix following trivial style problems:
      
        ERROR: trailing whitespace X 4
        WARNING: Use #include <linux/io.h> instead of <asm/io.h>
        WARNING: braces {} are not necessary for single statement blocks X 3
        ERROR: "foo * bar" should be "foo *bar"
        WARNING: line over 80 characters X 6
        ERROR: "foo * bar" should be "foo *bar"
        ERROR: spaces required around that '=' (ctx:VxO)
        ERROR: space required before that '-' (ctx:OxV)
        WARNING: suspect code indent for conditional statements (8, 12)
        ERROR: spaces required around that '=' (ctx:VxV)
        ERROR: do not initialise statics to 0 or NULL
        ERROR: space prohibited after that open parenthesis '(' X 2
        ERROR: space prohibited before that close parenthesis ')' X 2
        ERROR: trailing statements should be on next line
        ERROR: return is not a function, parentheses are not required
      
      Also use pr_debug and pr_warning where possible.
      
      arch/x86/kernel/cpu/mtrr/generic.o:
      
         text	   data	    bss	    dec	    hex	filename
         5652	     77	   4224	   9953	   26e1	generic.o.before
         5652	     77	   4220	   9949	   26dd	generic.o.after
      
      The md5 changed:
         b34d6c045f06daa4ed092b90cc760e8f  generic.o.before.asm
         a490c6251cfd8442fbffecc0e09a573d  generic.o.after.asm
      
      Because mtrr_state moved from data to bss, changing its
      offsets - and also because __LINE__ numbers changed.
      Suggested-by: NAlan Cox <alan@lxorguk.ukuu.org.uk>
      Signed-off-by: NJaswinder Singh Rajput <jaswinderrajput@gmail.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Yinghai Lu <yinghai@kernel.org>
      LKML-Reference: <20090703164225.GA21447@elte.hu>
      [ Further cleanups to make the code more consistent ]
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      a1a499a3
    • J
      x86: Clean up mtrr/cyrix.c · 23110377
      Jaswinder Singh Rajput 提交于
      Fix trivial style problems:
      
        WARNING: Use #include <linux/io.h> instead of <asm/io.h>
        WARNING: line over 80 characters
        ERROR: do not initialise statics to 0 or NULL
        ERROR: space prohibited after that open parenthesis '(' X 2
        ERROR: space prohibited before that close parenthesis ')' X 2
        ERROR: trailing whitespace X 2
        ERROR: trailing statements should be on next line
        ERROR: do not use C99 // comments X 2
      
      arch/x86/kernel/cpu/mtrr/cyrix.o:
      
         text	   data	    bss	    dec	    hex	filename
         1637	     32	      8	   1677	    68d	cyrix.o.before
         1637	     32	      8	   1677	    68d	cyrix.o.after
      
      md5:
         6f52abd06905be3f4cabb5239f9b0ff0  cyrix.o.before.asm
         6f52abd06905be3f4cabb5239f9b0ff0  cyrix.o.after.asm
      Suggested-by: NAlan Cox <alan@lxorguk.ukuu.org.uk>
      Signed-off-by: NJaswinder Singh Rajput <jaswinderrajput@gmail.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Yinghai Lu <yinghai@kernel.org>
      LKML-Reference: <20090703164225.GA21447@elte.hu>
      [ Made the code more consistent ]
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      23110377
    • J
      x86: Clean up mtrr/cleanup.c · 63f9600f
      Jaswinder Singh Rajput 提交于
      Fix trivial style problems:
      
        WARNING: Use #include <linux/uaccess.h> instead of <asm/uaccess.h>
        WARNING: Use #include <linux/kvm_para.h> instead of <asm/kvm_para.h>
      
      Also, nr_mtrr_spare_reg should be unsigned long.
      
      arch/x86/kernel/cpu/mtrr/cleanup.o:
      
         text	   data	    bss	    dec	    hex	filename
         6241	   8992	   2056	  17289	   4389	cleanup.o.before
         6241	   8992	   2056	  17289	   4389	cleanup.o.after
      
      The md5 has changed:
         1a7a27513aef1825236daf29110fe657  cleanup.o.before.asm
         bcea358efa2532b6020e338e158447af  cleanup.o.after.asm
      
      Because a WARN_ON()'s __LINE__ value changed by 3 lines.
      Suggested-by: NAlan Cox <alan@lxorguk.ukuu.org.uk>
      Signed-off-by: NJaswinder Singh Rajput <jaswinderrajput@gmail.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Yinghai Lu <yinghai@kernel.org>
      LKML-Reference: <20090703164225.GA21447@elte.hu>
      [ Did lots of other cleanups to make the code look more consistent. ]
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      63f9600f
    • J
      x86: Clean up mtrr/centaur.c · 6c4caa1a
      Jaswinder Singh Rajput 提交于
      Remove dead code and fix trivial style problems:
      
        ERROR: trailing whitespace X 2
        WARNING: line over 80 characters X 3
        ROR: trailing whitespace
        ERROR: do not use C99 // comments X 2
      
      arch/x86/kernel/cpu/mtrr/centaur.o:
      
         text	   data	    bss	    dec	    hex	filename
          605	     32	     68	    705	    2c1	centaur.o.before
          605	     32	     68	    705	    2c1	centaur.o.after
      
      md5:
         a4865ea98ce3c163bb1d376a3949b3e3  centaur.o.before.asm
         a4865ea98ce3c163bb1d376a3949b3e3  centaur.o.after.asm
      Suggested-by: NAlan Cox <alan@lxorguk.ukuu.org.uk>
      Signed-off-by: NJaswinder Singh Rajput <jaswinderrajput@gmail.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Yinghai Lu <yinghai@kernel.org>
      LKML-Reference: <20090703164225.GA21447@elte.hu>
      [ Standardized comments, DocBook, curly braces, newlines. ]
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      6c4caa1a
    • J
      x86: Clean up mtrr/amd.c: · 42204455
      Jaswinder Singh Rajput 提交于
      Fix trivial style problems :
      
        ERROR: trailing whitespace
        WARNING: line over 80 characters
        ERROR: do not use C99 // comments
      
      arch/x86/kernel/cpu/mtrr/amd.o:
      
         text	   data	    bss	    dec	    hex	filename
          501	     32	      0	    533	    215	amd.o.before
          501	     32	      0	    533	    215	amd.o.after
      
      md5:
         62f795eb840ee2d17b03df89e789e76c  amd.o.before.asm
         62f795eb840ee2d17b03df89e789e76c  amd.o.after.asm
      Suggested-by: NAlan Cox <alan@lxorguk.ukuu.org.uk>
      Signed-off-by: NJaswinder Singh Rajput <jaswinderrajput@gmail.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Yinghai Lu <yinghai@kernel.org>
      LKML-Reference: <20090703164225.GA21447@elte.hu>
      [ Also restructured comments to be standard, removed stray return,
        converted function description to DocBook style, etc. ]
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      42204455
    • I
      Merge branch 'linus' into x86/cleanups · d7e57676
      Ingo Molnar 提交于
      Merge reason: We were on an older pre-rc1 base, move to almost-rc2.
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      d7e57676
  7. 03 7月, 2009 13 次提交
  8. 02 7月, 2009 9 次提交
    • K
      fs/notify/inotify: decrement user inotify count on close · bdae997f
      Keith Packard 提交于
      The per-user inotify_devs value is incremented each time a new file is
      allocated, but never decremented. This led to inotify_init failing after a
      limited number of calls.
      Signed-off-by: NKeith Packard <keithp@keithp.com>
      Signed-off-by: NEric Paris <eparis@redhat.com>
      bdae997f
    • D
      intel-iommu: Don't keep freeing page zero in dma_pte_free_pagetable() · 6a43e574
      David Woodhouse 提交于
      Check dma_pte_present() and only free the page if there _is_ one.
      Kind of surprising that there was no warning about this.
      Signed-off-by: NDavid Woodhouse <David.Woodhouse@intel.com>
      6a43e574
    • D
      intel-iommu: Introduce first_pte_in_page() to simplify PTE-setting loops · 75e6bf96
      David Woodhouse 提交于
      On Wed, 2009-07-01 at 16:59 -0700, Linus Torvalds wrote:
      > I also _really_ hate how you do
      >
      >         (unsigned long)pte >> VTD_PAGE_SHIFT ==
      >         (unsigned long)first_pte >> VTD_PAGE_SHIFT
      
      Kill this, in favour of just looking to see if the incremented pte
      pointer has 'wrapped' onto the next page. Which means we have to check
      it _after_ incrementing it, not before.
      Signed-off-by: NDavid Woodhouse <David.Woodhouse@intel.com>
      75e6bf96
    • D
      FRV: Add basic performance counter support · 42ca4fb6
      David Howells 提交于
      Add basic performance counter support to the FRV arch.
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      42ca4fb6
    • D
      FRV: Implement atomic64_t · 00460f41
      David Howells 提交于
      Implement atomic64_t and its ops for FRV.  Tested with the following patch:
      
      	diff --git a/arch/frv/kernel/setup.c b/arch/frv/kernel/setup.c
      	index 55e4fab..086d50d 100644
      	--- a/arch/frv/kernel/setup.c
      	+++ b/arch/frv/kernel/setup.c
      	@@ -746,6 +746,52 @@ static void __init parse_cmdline_early(char *cmdline)
      
      	 } /* end parse_cmdline_early() */
      
      	+static atomic64_t xxx;
      	+
      	+static void test_atomic64(void)
      	+{
      	+	atomic64_set(&xxx, 0x12300000023LL);
      	+
      	+	mb();
      	+	BUG_ON(atomic64_read(&xxx) != 0x12300000023LL);
      	+	mb();
      	+	if (atomic64_inc_return(&xxx) != 0x12300000024LL)
      	+		BUG();
      	+	mb();
      	+	BUG_ON(atomic64_read(&xxx) != 0x12300000024LL);
      	+	mb();
      	+	if (atomic64_sub_return(0x36900000050LL, &xxx) != -0x2460000002cLL)
      	+		BUG();
      	+	mb();
      	+	BUG_ON(atomic64_read(&xxx) != -0x2460000002cLL);
      	+	mb();
      	+	if (atomic64_dec_return(&xxx) != -0x2460000002dLL)
      	+		BUG();
      	+	mb();
      	+	BUG_ON(atomic64_read(&xxx) != -0x2460000002dLL);
      	+	mb();
      	+	if (atomic64_add_return(0x36800000001LL, &xxx) != 0x121ffffffd4LL)
      	+		BUG();
      	+	mb();
      	+	BUG_ON(atomic64_read(&xxx) != 0x121ffffffd4LL);
      	+	mb();
      	+	if (atomic64_cmpxchg(&xxx, 0x123456789abcdefLL, 0x121ffffffd4LL) != 0x121ffffffd4LL)
      	+		BUG();
      	+	mb();
      	+	BUG_ON(atomic64_read(&xxx) != 0x121ffffffd4LL);
      	+	mb();
      	+	if (atomic64_cmpxchg(&xxx, 0x121ffffffd4LL, 0x123456789abcdefLL) != 0x121ffffffd4LL)
      	+		BUG();
      	+	mb();
      	+	BUG_ON(atomic64_read(&xxx) != 0x123456789abcdefLL);
      	+	mb();
      	+	if (atomic64_xchg(&xxx, 0xabcdef123456789LL) != 0x123456789abcdefLL)
      	+		BUG();
      	+	mb();
      	+	BUG_ON(atomic64_read(&xxx) != 0xabcdef123456789LL);
      	+	mb();
      	+}
      	+
      	 /*****************************************************************************/
      	 /*
      	  *
      	@@ -845,6 +891,8 @@ void __init setup_arch(char **cmdline_p)
      	 //	asm volatile("movgs %0,timerd" :: "r"(10000000));
      	 //	__set_HSR(0, __get_HSR(0) | HSR0_ETMD);
      
      	+	test_atomic64();
      	+
      	 } /* end setup_arch() */
      
      	 #if 0
      
      Note that this doesn't cover all the trivial wrappers, but does cover all the
      substantial implementations.
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      00460f41
    • D
    • D
      intel-iommu: Warn about unmatched unmap requests · 85b98276
      David Woodhouse 提交于
      This would have found the bug in i386 pci_unmap_addr() a long time ago.
      We shouldn't just silently return without doing anything.
      Signed-off-by: NDavid Woodhouse <David.Woodhouse@intel.com>
      85b98276
    • L
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6 · 5a475ce4
      Linus Torvalds 提交于
      * git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6:
        sh: LCDC dcache flush for deferred io
        sh: Fix compiler error and include the definition of IS_ERR_VALUE
        sh: re-add LCDC fbdev support to the Migo-R defconfig
        sh: fix se7724 ceu names
        sh: ms7724se: Enable sh_eth in defconfig.
        arch/sh/boards/mach-se/7206/io.c: Remove unnecessary semicolons
        sh: ms7724se: Add sh_eth support
        nommu: provide follow_pfn().
        sh: Kill off unused DEBUG_BOOTMEM symbol.
        perf_counter tools: add cpu_relax()/rmb() definitions for sh.
        sh64: Hook up page fault events for software perf counters.
        sh: Hook up page fault events for software perf counters.
        sh: make set_perf_counter_pending() static inline.
        clocksource: sh_tmu: Make undefined TCOR behaviour less undefined.
      5a475ce4
    • D
      intel-iommu: Kill superfluous mapping_lock · 206a73c1
      David Woodhouse 提交于
      Since we're using cmpxchg64() anyway (because that's the only way to do
      an atomic 64-bit store on i386), we might as well ditch the extra
      locking and just use cmpxchg64() to ensure that we don't add the page
      twice.
      Signed-off-by: NDavid Woodhouse <David.Woodhouse@intel.com>
      206a73c1