1. 22 8月, 2009 2 次提交
    • H
      x86, mtrr: make mtrr_aps_delayed_init static bool · 5400743d
      H. Peter Anvin 提交于
      mtr_aps_delayed_init was declared u32 and made global, but it only
      ever takes boolean values and is only ever used in
      arch/x86/kernel/cpu/mtrr/main.c.  Declare it "static bool" and remove
      external references.
      Signed-off-by: NH. Peter Anvin <hpa@zytor.com>
      Cc: Suresh Siddha <suresh.b.siddha@intel.com>
      5400743d
    • 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
  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 9 次提交
    • 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
  7. 03 7月, 2009 2 次提交
  8. 02 7月, 2009 2 次提交
  9. 01 7月, 2009 1 次提交
    • Y
      x86: only clear node_states for 64bit · 66918dcd
      Yinghai Lu 提交于
      Nathan reported that
      
      | commit 73d60b7f
      | Author: Yinghai Lu <yinghai@kernel.org>
      | Date:   Tue Jun 16 15:33:00 2009 -0700
      |
      |    page-allocator: clear N_HIGH_MEMORY map before we set it again
      |
      |    SRAT tables may contains nodes of very small size.  The arch code may
      |    decide to not activate such a node.  However, currently the early boot
      |    code sets N_HIGH_MEMORY for such nodes.  These nodes therefore seem to be
      |    active although these nodes have no present pages.
      |
      |    For 64bit N_HIGH_MEMORY == N_NORMAL_MEMORY, so that works for 64 bit too
      
      unintentionally and incorrectly clears the cpuset.mems cgroup attribute on
      an i386 kvm guest, meaning that cpuset.mems can not be used.
      
      Fix this by only clearing node_states[N_NORMAL_MEMORY] for 64bit only.
      and need to do save/restore for that in find_zone_movable_pfn
      Reported-by: NNathan Lynch <ntl@pobox.com>
      Tested-by: NNathan Lynch <ntl@pobox.com>
      Signed-off-by: NYinghai Lu <yinghai@kernel.org>
      Cc: Christoph Lameter <cl@linux-foundation.org>
      Cc: Ingo Molnar <mingo@elte.hu>,
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      66918dcd
  10. 29 6月, 2009 2 次提交
  11. 28 6月, 2009 6 次提交
  12. 26 6月, 2009 6 次提交
    • P
      x86, delay: tsc based udelay should have rdtsc_barrier · e888d7fa
      Pallipadi, Venkatesh 提交于
      delay_tsc needs rdtsc_barrier to provide proper delay.
      
      Output from a test driver using hpet to cross check delay
      provided by udelay().
      
      Before:
      [   86.794363] Expected delay 5us actual 4679ns
      [   87.154362] Expected delay 5us actual 698ns
      [   87.514162] Expected delay 5us actual 4539ns
      [   88.653716] Expected delay 5us actual 4539ns
      [   94.664106] Expected delay 10us actual 9638ns
      [   95.049351] Expected delay 10us actual 10126ns
      [   95.416110] Expected delay 10us actual 9568ns
      [   95.799216] Expected delay 10us actual 9638ns
      [  103.624104] Expected delay 10us actual 9707ns
      [  104.020619] Expected delay 10us actual 768ns
      [  104.419951] Expected delay 10us actual 9707ns
      
      After:
      [   50.983320] Expected delay 5us actual 5587ns
      [   51.261807] Expected delay 5us actual 5587ns
      [   51.565715] Expected delay 5us actual 5657ns
      [   51.861171] Expected delay 5us actual 5587ns
      [   52.164704] Expected delay 5us actual 5726ns
      [   52.487457] Expected delay 5us actual 5657ns
      [   52.789338] Expected delay 5us actual 5726ns
      [   57.119680] Expected delay 10us actual 10755ns
      [   57.893997] Expected delay 10us actual 10615ns
      [   58.261287] Expected delay 10us actual 10755ns
      [   58.620505] Expected delay 10us actual 10825ns
      [   58.941035] Expected delay 10us actual 10755ns
      [   59.320903] Expected delay 10us actual 10615ns
      [   61.306311] Expected delay 10us actual 10755ns
      [   61.520542] Expected delay 10us actual 10615ns
      Signed-off-by: NVenkatesh Pallipadi <venkatesh.pallipadi@intel.com>
      Signed-off-by: NH. Peter Anvin <hpa@zytor.com>
      e888d7fa
    • H
      x86, setup: correct include file in <asm/boot.h> · 658dbfeb
      H. Peter Anvin 提交于
      <asm/boot.h> needs <asm/pgtable_types.h>, not <asm/page_types.h> in
      order to resolve PMD_SHIFT.  Also, correct a +1 which really should be
      + THREAD_ORDER.
      
      This is a build error which was masked by a typoed #ifdef.
      Signed-off-by: NH. Peter Anvin <hpa@zytor.com>
      658dbfeb
    • R
      x86, setup: Fix typo "CONFIG_x86_64" in <asm/boot.h> · 22f4319d
      Robert P. J. Day 提交于
      CONFIG_X86_64 was misspelled (wrong case), which caused the x86-64
      kernel to advertise itself as more relocatable than it really is.
      This could in theory cause boot failures once bootloaders start
      support the new relocation fields.
      Signed-off-by: NRobert P. J. Day <rpjday@crashcourse.ca>
      Signed-off-by: NH. Peter Anvin <hpa@zytor.com>
      22f4319d
    • H
      x86, mce: percpu mcheck_timer should be pinned · 5be6066a
      Hidetoshi Seto 提交于
      If CONFIG_NO_HZ + CONFIG_SMP, timer added via add_timer() might
      be migrated on other cpu.  Use add_timer_on() instead.
      
      Avoids the following failure:
      
      Maciej Rutecki wrote:
      > > After normal boot I try:
      > >
      > > echo 1 > /sys/devices/system/machinecheck/machinecheck0/check_interval
      > >
      > > I found this in dmesg:
      > >
      > > [  141.704025] ------------[ cut here ]------------
      > > [  141.704039] WARNING: at arch/x86/kernel/cpu/mcheck/mce.c:1102
      > > mcheck_timer+0xf5/0x100()
      Reported-by: NMaciej Rutecki <maciej.rutecki@gmail.com>
      Signed-off-by: NHidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
      Tested-by: NMaciej Rutecki <maciej.rutecki@gmail.com>
      Acked-by: NAndi Kleen <ak@linux.intel.com>
      Signed-off-by: NH. Peter Anvin <hpa@zytor.com>
      5be6066a
    • K
      x86: Add sysctl to allow panic on IOCK NMI error · 5211a242
      Kurt Garloff 提交于
      This patch introduces a new sysctl:
      
          /proc/sys/kernel/panic_on_io_nmi
      
      which defaults to 0 (off).
      
      When enabled, the kernel panics when the kernel receives an NMI
      caused by an IO error.
      
      The IO error triggered NMI indicates a serious system
      condition, which could result in IO data corruption. Rather
      than contiuing, panicing and dumping might be a better choice,
      so one can figure out what's causing the IO error.
      
      This could be especially important to companies running IO
      intensive applications where corruption must be avoided, e.g. a
      bank's databases.
      
      [ SuSE has been shipping it for a while, it was done at the
        request of a large database vendor, for their users. ]
      Signed-off-by: NKurt Garloff <garloff@suse.de>
      Signed-off-by: NRoberto Angelino <robertangelino@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      Cc: "Eric W. Biederman" <ebiederm@xmission.com>
      LKML-Reference: <20090624213211.GA11291@kroah.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      5211a242
    • P
      perf_counter, x86: Add mmap counter read support · 194002b2
      Peter Zijlstra 提交于
      Update the mmap control page with the needed information to
      use the userspace RDPMC instruction for self monitoring.
      Signed-off-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
      LKML-Reference: <new-submission>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      194002b2
  13. 25 6月, 2009 1 次提交
  14. 24 6月, 2009 3 次提交
    • C
      x86: Fix uv bau sending buffer initialization · 9c26f52b
      Cliff Wickman 提交于
      The initialization of the UV Broadcast Assist Unit's sending
      buffers was making an invalid assumption about the
      initialization of an MMR that defines its address.
      
      The BIOS will not be providing that MMR.  So
      uv_activation_descriptor_init() should unconditionally set it.
      
      Tested on UV simulator.
      Signed-off-by: NCliff Wickman <cpw@sgi.com>
      Cc: <stable@kernel.org> # for v2.6.30.x
      LKML-Reference: <E1MJTfj-0005i1-W8@eag09.americas.sgi.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      9c26f52b
    • Y
      perf_counter, x86: Set global control MSR correctly · c14dab5c
      Yong Wang 提交于
      Previous code made an assumption that the power on value of global
      control MSR has enabled all fixed and general purpose counters properly.
      
      However, this is not the case for certain Intel processors, such as
      Atom - and it might also be firmware dependent.
      
      Each enable bit in IA32_PERF_GLOBAL_CTRL is AND'ed with the
      enable bits for all privilege levels in the respective IA32_PERFEVTSELx
      or IA32_PERF_FIXED_CTR_CTRL MSRs to start/stop the counting of
      respective counters. Counting is enabled if the AND'ed results is true;
      counting is disabled when the result is false.
      
      The end result is that all fixed counters are always disabled on Atom
      processors because the assumption is just invalid.
      
      Fix this by not initializing the ctrl-mask out of the global MSR,
      but setting it to perf_counter_mask.
      Reported-by: NStephane Eranian <eranian@googlemail.com>
      Signed-off-by: NYong Wang <yong.y.wang@intel.com>
      Cc: Arjan van de Ven <arjan@infradead.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      LKML-Reference: <20090624021324.GA2788@ywang-moblin2.bj.intel.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      c14dab5c
    • W
      Intel-IOMMU, intr-remap: source-id checking · f007e99c
      Weidong Han 提交于
      To support domain-isolation usages, the platform hardware must be
      capable of uniquely identifying the requestor (source-id) for each
      interrupt message. Without source-id checking for interrupt remapping
      , a rouge guest/VM with assigned devices can launch interrupt attacks
      to bring down anothe guest/VM or the VMM itself.
      
      This patch adds source-id checking for interrupt remapping, and then
      really isolates interrupts for guests/VMs with assigned devices.
      
      Because PCI subsystem is not initialized yet when set up IOAPIC
      entries, use read_pci_config_byte to access PCI config space directly.
      Signed-off-by: NWeidong Han <weidong.han@intel.com>
      Signed-off-by: NDavid Woodhouse <David.Woodhouse@intel.com>
      f007e99c