1. 10 9月, 2009 4 次提交
    • S
      KVM: Downsize max support MSI-X entry to 256 · e7333391
      Sheng Yang 提交于
      We only trap one page for MSI-X entry now, so it's 4k/(128/8) = 256 entries at
      most.
      Signed-off-by: NSheng Yang <sheng@linux.intel.com>
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      e7333391
    • J
      KVM: Allow PIT emulation without speaker port · c5ff41ce
      Jan Kiszka 提交于
      The in-kernel speaker emulation is only a dummy and also unneeded from
      the performance point of view. Rather, it takes user space support to
      generate sound output on the host, e.g. console beeps.
      
      To allow this, introduce KVM_CREATE_PIT2 which controls in-kernel
      speaker port emulation via a flag passed along the new IOCTL. It also
      leaves room for future extensions of the PIT configuration interface.
      Signed-off-by: NJan Kiszka <jan.kiszka@siemens.com>
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      c5ff41ce
    • G
      KVM: irqfd · 721eecbf
      Gregory Haskins 提交于
      KVM provides a complete virtual system environment for guests, including
      support for injecting interrupts modeled after the real exception/interrupt
      facilities present on the native platform (such as the IDT on x86).
      Virtual interrupts can come from a variety of sources (emulated devices,
      pass-through devices, etc) but all must be injected to the guest via
      the KVM infrastructure.  This patch adds a new mechanism to inject a specific
      interrupt to a guest using a decoupled eventfd mechnanism:  Any legal signal
      on the irqfd (using eventfd semantics from either userspace or kernel) will
      translate into an injected interrupt in the guest at the next available
      interrupt window.
      Signed-off-by: NGregory Haskins <ghaskins@novell.com>
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      721eecbf
    • H
      KVM: Add MCE support · 890ca9ae
      Huang Ying 提交于
      The related MSRs are emulated. MCE capability is exported via
      extension KVM_CAP_MCE and ioctl KVM_X86_GET_MCE_CAP_SUPPORTED.  A new
      vcpu ioctl command KVM_X86_SETUP_MCE is used to setup MCE emulation
      such as the mcg_cap. MCE is injected via vcpu ioctl command
      KVM_X86_SET_MCE. Extended machine-check state (MCG_EXT_P) and CMCI are
      not implemented.
      Signed-off-by: NHuang Ying <ying.huang@intel.com>
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      890ca9ae
  2. 10 6月, 2009 4 次提交
    • N
      KVM: Make kvm header C++ friendly · 2f8b9ee1
      nathan binkert 提交于
      Two things needed fixing: 1) g++ does not allow a named structure type
      within an anonymous union and 2) Avoid name clash between two padding
      fields within the same struct by giving them different names as is
      done elsewhere in the header.
      Signed-off-by: NNathan Binkert <nate@binkert.org>
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      2f8b9ee1
    • S
      KVM: Device assignment framework rework · e56d532f
      Sheng Yang 提交于
      After discussion with Marcelo, we decided to rework device assignment framework
      together. The old problems are kernel logic is unnecessary complex. So Marcelo
      suggest to split it into a more elegant way:
      
      1. Split host IRQ assign and guest IRQ assign. And userspace determine the
      combination. Also discard msi2intx parameter, userspace can specific
      KVM_DEV_IRQ_HOST_MSI | KVM_DEV_IRQ_GUEST_INTX in assigned_irq->flags to
      enable MSI to INTx convertion.
      
      2. Split assign IRQ and deassign IRQ. Import two new ioctls:
      KVM_ASSIGN_DEV_IRQ and KVM_DEASSIGN_DEV_IRQ.
      
      This patch also fixed the reversed _IOR vs _IOW in definition(by deprecated the
      old interface).
      
      [avi: replace homemade bitcount() by hweight_long()]
      Signed-off-by: NMarcelo Tosatti <mtosatti@redhat.com>
      Signed-off-by: NSheng Yang <sheng@linux.intel.com>
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      e56d532f
    • S
      KVM: Enable MSI-X for KVM assigned device · d510d6cc
      Sheng Yang 提交于
      This patch finally enable MSI-X.
      
      What we need for MSI-X:
      1. Intercept one page in MMIO region of device. So that we can get guest desired
      MSI-X table and set up the real one. Now this have been done by guest, and
      transfer to kernel using ioctl KVM_SET_MSIX_NR and KVM_SET_MSIX_ENTRY.
      
      2. Information for incoming interrupt. Now one device can have more than one
      interrupt, and they are all handled by one workqueue structure. So we need to
      identify them. The previous patch enable gsi_msg_pending_bitmap get this done.
      
      3. Mapping from host IRQ to guest gsi as well as guest gsi to real MSI/MSI-X
      message address/data. We used same entry number for the host and guest here, so
      that it's easy to find the correlated guest gsi.
      
      What we lack for now:
      1. The PCI spec said nothing can existed with MSI-X table in the same page of
      MMIO region, except pending bits. The patch ignore pending bits as the first
      step (so they are always 0 - no pending).
      
      2. The PCI spec allowed to change MSI-X table dynamically. That means, the OS
      can enable MSI-X, then mask one MSI-X entry, modify it, and unmask it. The patch
      didn't support this, and Linux also don't work in this way.
      
      3. The patch didn't implement MSI-X mask all and mask single entry. I would
      implement the former in driver/pci/msi.c later. And for single entry, userspace
      should have reposibility to handle it.
      Signed-off-by: NSheng Yang <sheng@linux.intel.com>
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      d510d6cc
    • S
      KVM: Ioctls for init MSI-X entry · c1e01514
      Sheng Yang 提交于
      Introduce KVM_SET_MSIX_NR and KVM_SET_MSIX_ENTRY two ioctls.
      
      This two ioctls are used by userspace to specific guest device MSI-X entry
      number and correlate MSI-X entry with GSI during the initialization stage.
      
      MSI-X should be well initialzed before enabling.
      
      Don't support change MSI-X entry number for now.
      Signed-off-by: NSheng Yang <sheng@linux.intel.com>
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      c1e01514
  3. 22 4月, 2009 1 次提交
  4. 24 3月, 2009 11 次提交
  5. 15 2月, 2009 1 次提交
  6. 16 1月, 2009 1 次提交
  7. 31 12月, 2008 5 次提交
  8. 28 10月, 2008 1 次提交
  9. 15 10月, 2008 9 次提交
  10. 25 8月, 2008 1 次提交
    • A
      KVM: fix userspace ABI breakage · 1327138e
      Adrian Bunk 提交于
      The following part of commit 9ef621d3
      (KVM: Support mixed endian machines) changed on the size of a struct
      that is exported to userspace:
      
      include/linux/kvm.h:
      
      @@ -318,14 +318,14 @@ struct kvm_trace_rec {
       	__u32 vcpu_id;
       	union {
       		struct {
      -			__u32 cycle_lo, cycle_hi;
      +			__u64 cycle_u64;
       			__u32 extra_u32[KVM_TRC_EXTRA_MAX];
       		} cycle;
       		struct {
       			__u32 extra_u32[KVM_TRC_EXTRA_MAX];
       		} nocycle;
       	} u;
      -};
      +} __attribute__((packed));
      
      Packing a struct was the correct idea, but it packed the wrong struct.
      Signed-off-by: NAdrian Bunk <bunk@kernel.org>
      Signed-off-by: NAvi Kivity <avi@qumranet.com>
      1327138e
  11. 29 7月, 2008 1 次提交
  12. 20 7月, 2008 1 次提交