1. 12 1月, 2011 5 次提交
  2. 17 5月, 2010 2 次提交
    • J
      KVM: x86: Push potential exception error code on task switches · e269fb21
      Jan Kiszka 提交于
      When a fault triggers a task switch, the error code, if existent, has to
      be pushed on the new task's stack. Implement the missing bits.
      Signed-off-by: NJan Kiszka <jan.kiszka@siemens.com>
      Signed-off-by: NMarcelo Tosatti <mtosatti@redhat.com>
      e269fb21
    • A
      KVM: SVM: implement NEXTRIPsave SVM feature · 6bc31bdc
      Andre Przywara 提交于
      On SVM we set the instruction length of skipped instructions
      to hard-coded, well known values, which could be wrong when (bogus,
      but valid) prefixes (REX, segment override) are used.
      Newer AMD processors (Fam10h 45nm and better, aka. PhenomII or
      AthlonII) have an explicit NEXTRIP field in the VMCB containing the
      desired information.
      Since it is cheap to do so, we use this field to override the guessed
      value on newer processors.
      A fix for older CPUs would be rather expensive, as it would require
      to fetch and partially decode the instruction. As the problem is not
      a security issue and needs special, handcrafted code to trigger
      (no compiler will ever generate such code), I omit a fix for older
      CPUs.
      If someone is interested, I have both a patch for these CPUs as well as
      demo code triggering this issue: It segfaults under KVM, but runs
      perfectly on native Linux.
      Signed-off-by: NAndre Przywara <andre.przywara@amd.com>
      Signed-off-by: NMarcelo Tosatti <mtosatti@redhat.com>
      6bc31bdc
  3. 25 4月, 2010 1 次提交
  4. 01 3月, 2010 1 次提交
  5. 03 12月, 2009 1 次提交
    • M
      KVM: SVM: Support Pause Filter in AMD processors · 565d0998
      Mark Langsdorf 提交于
      New AMD processors (Family 0x10 models 8+) support the Pause
      Filter Feature.  This feature creates a new field in the VMCB
      called Pause Filter Count.  If Pause Filter Count is greater
      than 0 and intercepting PAUSEs is enabled, the processor will
      increment an internal counter when a PAUSE instruction occurs
      instead of intercepting.  When the internal counter reaches the
      Pause Filter Count value, a PAUSE intercept will occur.
      
      This feature can be used to detect contended spinlocks,
      especially when the lock holding VCPU is not scheduled.
      Rescheduling another VCPU prevents the VCPU seeking the
      lock from wasting its quantum by spinning idly.
      
      Experimental results show that most spinlocks are held
      for less than 1000 PAUSE cycles or more than a few
      thousand.  Default the Pause Filter Counter to 3000 to
      detect the contended spinlocks.
      
      Processor support for this feature is indicated by a CPUID
      bit.
      
      On a 24 core system running 4 guests each with 16 VCPUs,
      this patch improved overall performance of each guest's
      32 job kernbench by approximately 3-5% when combined
      with a scheduler algorithm thati caused the VCPU to
      sleep for a brief period. Further performance improvement
      may be possible with a more sophisticated yield algorithm.
      Signed-off-by: NMark Langsdorf <mark.langsdorf@amd.com>
      Signed-off-by: NMarcelo Tosatti <mtosatti@redhat.com>
      565d0998
  6. 10 6月, 2009 1 次提交
  7. 24 3月, 2009 1 次提交
  8. 31 12月, 2008 1 次提交
  9. 27 4月, 2008 1 次提交
  10. 31 1月, 2008 1 次提交
  11. 30 1月, 2008 2 次提交
  12. 16 7月, 2007 1 次提交
  13. 03 5月, 2007 1 次提交
  14. 11 12月, 2006 1 次提交
    • A
      [PATCH] kvm: userspace interface · 6aa8b732
      Avi Kivity 提交于
      web site: http://kvm.sourceforge.net
      
      mailing list: kvm-devel@lists.sourceforge.net
        (http://lists.sourceforge.net/lists/listinfo/kvm-devel)
      
      The following patchset adds a driver for Intel's hardware virtualization
      extensions to the x86 architecture.  The driver adds a character device
      (/dev/kvm) that exposes the virtualization capabilities to userspace.  Using
      this driver, a process can run a virtual machine (a "guest") in a fully
      virtualized PC containing its own virtual hard disks, network adapters, and
      display.
      
      Using this driver, one can start multiple virtual machines on a host.
      
      Each virtual machine is a process on the host; a virtual cpu is a thread in
      that process.  kill(1), nice(1), top(1) work as expected.  In effect, the
      driver adds a third execution mode to the existing two: we now have kernel
      mode, user mode, and guest mode.  Guest mode has its own address space mapping
      guest physical memory (which is accessible to user mode by mmap()ing
      /dev/kvm).  Guest mode has no access to any I/O devices; any such access is
      intercepted and directed to user mode for emulation.
      
      The driver supports i386 and x86_64 hosts and guests.  All combinations are
      allowed except x86_64 guest on i386 host.  For i386 guests and hosts, both pae
      and non-pae paging modes are supported.
      
      SMP hosts and UP guests are supported.  At the moment only Intel
      hardware is supported, but AMD virtualization support is being worked on.
      
      Performance currently is non-stellar due to the naive implementation of the
      mmu virtualization, which throws away most of the shadow page table entries
      every context switch.  We plan to address this in two ways:
      
      - cache shadow page tables across tlb flushes
      - wait until AMD and Intel release processors with nested page tables
      
      Currently a virtual desktop is responsive but consumes a lot of CPU.  Under
      Windows I tried playing pinball and watching a few flash movies; with a recent
      CPU one can hardly feel the virtualization.  Linux/X is slower, probably due
      to X being in a separate process.
      
      In addition to the driver, you need a slightly modified qemu to provide I/O
      device emulation and the BIOS.
      
      Caveats (akpm: might no longer be true):
      
      - The Windows install currently bluescreens due to a problem with the
        virtual APIC.  We are working on a fix.  A temporary workaround is to
        use an existing image or install through qemu
      - Windows 64-bit does not work.  That's also true for qemu, so it's
        probably a problem with the device model.
      
      [bero@arklinux.org: build fix]
      [simon.kagstrom@bth.se: build fix, other fixes]
      [uril@qumranet.com: KVM: Expose interrupt bitmap]
      [akpm@osdl.org: i386 build fix]
      [mingo@elte.hu: i386 fixes]
      [rdreier@cisco.com: add log levels to all printks]
      [randy.dunlap@oracle.com: Fix sparse NULL and C99 struct init warnings]
      [anthony@codemonkey.ws: KVM: AMD SVM: 32-bit host support]
      Signed-off-by: NYaniv Kamay <yaniv@qumranet.com>
      Signed-off-by: NAvi Kivity <avi@qumranet.com>
      Cc: Simon Kagstrom <simon.kagstrom@bth.se>
      Cc: Bernhard Rosenkraenzer <bero@arklinux.org>
      Signed-off-by: NUri Lublin <uril@qumranet.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Roland Dreier <rolandd@cisco.com>
      Signed-off-by: NRandy Dunlap <randy.dunlap@oracle.com>
      Signed-off-by: NAnthony Liguori <anthony@codemonkey.ws>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      6aa8b732