1. 01 3月, 2010 15 次提交
  2. 27 12月, 2009 2 次提交
  3. 23 12月, 2009 1 次提交
  4. 03 12月, 2009 9 次提交
  5. 05 11月, 2009 1 次提交
    • A
      Use Little Endian for Dirty Bitmap · c8240bd6
      Alexander Graf 提交于
      We currently use host endian long types to store information
      in the dirty bitmap.
      
      This works reasonably well on Little Endian targets, because the
      u32 after the first contains the next 32 bits. On Big Endian this
      breaks completely though, forcing us to be inventive here.
      
      So Ben suggested to always use Little Endian, which looks reasonable.
      
      We only have dirty bitmap implemented in Little Endian targets so far
      and since PowerPC would be the first Big Endian platform, we can just
      as well switch to Little Endian always with little effort without
      breaking existing targets.
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      c8240bd6
  6. 16 10月, 2009 1 次提交
    • D
      KVM: Prevent kvm_init from corrupting debugfs structures · 0ea4ed8e
      Darrick J. Wong 提交于
      I'm seeing an oops condition when kvm-intel and kvm-amd are modprobe'd
      during boot (say on an Intel system) and then rmmod'd:
      
         # modprobe kvm-intel
           kvm_init()
           kvm_init_debug()
           kvm_arch_init()  <-- stores debugfs dentries internally
           (success, etc)
      
         # modprobe kvm-amd
           kvm_init()
           kvm_init_debug() <-- second initialization clobbers kvm's
                                internal pointers to dentries
           kvm_arch_init()
           kvm_exit_debug() <-- and frees them
      
         # rmmod kvm-intel
           kvm_exit()
           kvm_exit_debug() <-- double free of debugfs files!
      
           *BOOM*
      
      If execution gets to the end of kvm_init(), then the calling module has been
      established as the kvm provider.  Move the debugfs initialization to the end of
      the function, and remove the now-unnecessary call to kvm_exit_debug() from the
      error path.  That way we avoid trampling on the debugfs entries and freeing
      them twice.
      
      Cc: stable@kernel.org
      Signed-off-by: NDarrick J. Wong <djwong@us.ibm.com>
      Signed-off-by: NMarcelo Tosatti <mtosatti@redhat.com>
      0ea4ed8e
  7. 04 10月, 2009 1 次提交
  8. 02 10月, 2009 1 次提交
  9. 28 9月, 2009 1 次提交
  10. 24 9月, 2009 1 次提交
  11. 10 9月, 2009 7 次提交
    • H
      KVM: fix compile warnings on s390 · 28bcb112
      Heiko Carstens 提交于
      CC      arch/s390/kvm/../../../virt/kvm/kvm_main.o
      arch/s390/kvm/../../../virt/kvm/kvm_main.c: In function '__kvm_set_memory_region':
      arch/s390/kvm/../../../virt/kvm/kvm_main.c:485: warning: unused variable 'j'
      arch/s390/kvm/../../../virt/kvm/kvm_main.c:484: warning: unused variable 'lpages'
      arch/s390/kvm/../../../virt/kvm/kvm_main.c:483: warning: unused variable 'ugfn'
      
      Cc: Carsten Otte <cotte@de.ibm.com>
      Signed-off-by: NHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: NMarcelo Tosatti <mtosatti@redhat.com>
      28bcb112
    • A
      KVM: Move #endif KVM_CAP_IRQ_ROUTING to correct place · 6621fbc2
      Avi Kivity 提交于
      The symbol only controls irq routing, not MSI-X.
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      6621fbc2
    • X
      KVM: fix kvm_init() error handling · aed665f7
      Xiao Guangrong 提交于
      Remove debugfs file if kvm_arch_init() return error
      Signed-off-by: NXiao Guangrong <xiaoguangrong@cn.fujitsu.com>
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      aed665f7
    • J
      KVM: Drop obsolete cpu_get/put in make_all_cpus_request · e601e3be
      Jan Kiszka 提交于
      spin_lock disables preemption, so we can simply read the current cpu.
      Signed-off-by: NJan Kiszka <jan.kiszka@siemens.com>
      Signed-off-by: NMarcelo Tosatti <mtosatti@redhat.com>
      e601e3be
    • G
      KVM: Reduce runnability interface with arch support code · a1b37100
      Gleb Natapov 提交于
      Remove kvm_cpu_has_interrupt() and kvm_arch_interrupt_allowed() from
      interface between general code and arch code. kvm_arch_vcpu_runnable()
      checks for interrupts instead.
      Signed-off-by: NGleb Natapov <gleb@redhat.com>
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      a1b37100
    • G
      KVM: add ioeventfd support · d34e6b17
      Gregory Haskins 提交于
      ioeventfd is a mechanism to register PIO/MMIO regions to trigger an eventfd
      signal when written to by a guest.  Host userspace can register any
      arbitrary IO address with a corresponding eventfd and then pass the eventfd
      to a specific end-point of interest for handling.
      
      Normal IO requires a blocking round-trip since the operation may cause
      side-effects in the emulated model or may return data to the caller.
      Therefore, an IO in KVM traps from the guest to the host, causes a VMX/SVM
      "heavy-weight" exit back to userspace, and is ultimately serviced by qemu's
      device model synchronously before returning control back to the vcpu.
      
      However, there is a subclass of IO which acts purely as a trigger for
      other IO (such as to kick off an out-of-band DMA request, etc).  For these
      patterns, the synchronous call is particularly expensive since we really
      only want to simply get our notification transmitted asychronously and
      return as quickly as possible.  All the sychronous infrastructure to ensure
      proper data-dependencies are met in the normal IO case are just unecessary
      overhead for signalling.  This adds additional computational load on the
      system, as well as latency to the signalling path.
      
      Therefore, we provide a mechanism for registration of an in-kernel trigger
      point that allows the VCPU to only require a very brief, lightweight
      exit just long enough to signal an eventfd.  This also means that any
      clients compatible with the eventfd interface (which includes userspace
      and kernelspace equally well) can now register to be notified. The end
      result should be a more flexible and higher performance notification API
      for the backend KVM hypervisor and perhipheral components.
      
      To test this theory, we built a test-harness called "doorbell".  This
      module has a function called "doorbell_ring()" which simply increments a
      counter for each time the doorbell is signaled.  It supports signalling
      from either an eventfd, or an ioctl().
      
      We then wired up two paths to the doorbell: One via QEMU via a registered
      io region and through the doorbell ioctl().  The other is direct via
      ioeventfd.
      
      You can download this test harness here:
      
      ftp://ftp.novell.com/dev/ghaskins/doorbell.tar.bz2
      
      The measured results are as follows:
      
      qemu-mmio:       110000 iops, 9.09us rtt
      ioeventfd-mmio: 200100 iops, 5.00us rtt
      ioeventfd-pio:  367300 iops, 2.72us rtt
      
      I didn't measure qemu-pio, because I have to figure out how to register a
      PIO region with qemu's device model, and I got lazy.  However, for now we
      can extrapolate based on the data from the NULLIO runs of +2.56us for MMIO,
      and -350ns for HC, we get:
      
      qemu-pio:      153139 iops, 6.53us rtt
      ioeventfd-hc: 412585 iops, 2.37us rtt
      
      these are just for fun, for now, until I can gather more data.
      
      Here is a graph for your convenience:
      
      http://developer.novell.com/wiki/images/7/76/Iofd-chart.png
      
      The conclusion to draw is that we save about 4us by skipping the userspace
      hop.
      
      --------------------
      Signed-off-by: NGregory Haskins <ghaskins@novell.com>
      Acked-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      d34e6b17
    • G
      KVM: make io_bus interface more robust · 090b7aff
      Gregory Haskins 提交于
      Today kvm_io_bus_regsiter_dev() returns void and will internally BUG_ON
      if it fails.  We want to create dynamic MMIO/PIO entries driven from
      userspace later in the series, so we need to enhance the code to be more
      robust with the following changes:
      
         1) Add a return value to the registration function
         2) Fix up all the callsites to check the return code, handle any
            failures, and percolate the error up to the caller.
         3) Add an unregister function that collapses holes in the array
      Signed-off-by: NGregory Haskins <ghaskins@novell.com>
      Acked-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      090b7aff