1. 17 5月, 2010 1 次提交
  2. 25 4月, 2010 5 次提交
  3. 01 3月, 2010 18 次提交
  4. 03 12月, 2009 13 次提交
    • A
      KVM: VMX: Fix comparison of guest efer with stale host value · d5696725
      Avi Kivity 提交于
      update_transition_efer() masks out some efer bits when deciding whether
      to switch the msr during guest entry; for example, NX is emulated using the
      mmu so we don't need to disable it, and LMA/LME are handled by the hardware.
      
      However, with shared msrs, the comparison is made against a stale value;
      at the time of the guest switch we may be running with another guest's efer.
      
      Fix by deferring the mask/compare to the actual point of guest entry.
      
      Noted by Marcelo.
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      d5696725
    • J
      KVM: x86: Add KVM_GET/SET_VCPU_EVENTS · 3cfc3092
      Jan Kiszka 提交于
      This new IOCTL exports all yet user-invisible states related to
      exceptions, interrupts, and NMIs. Together with appropriate user space
      changes, this fixes sporadic problems of vmsave/restore, live migration
      and system reset.
      
      [avi: future-proof abi by adding a flags field]
      Signed-off-by: NJan Kiszka <jan.kiszka@siemens.com>
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      3cfc3092
    • A
      KVM: x86 shared msr infrastructure · 18863bdd
      Avi Kivity 提交于
      The various syscall-related MSRs are fairly expensive to switch.  Currently
      we switch them on every vcpu preemption, which is far too often:
      
      - if we're switching to a kernel thread (idle task, threaded interrupt,
        kernel-mode virtio server (vhost-net), for example) and back, then
        there's no need to switch those MSRs since kernel threasd won't
        be exiting to userspace.
      
      - if we're switching to another guest running an identical OS, most likely
        those MSRs will have the same value, so there's little point in reloading
        them.
      
      - if we're running the same OS on the guest and host, the MSRs will have
        identical values and reloading is unnecessary.
      
      This patch uses the new user return notifiers to implement last-minute
      switching, and checks the msr values to avoid unnecessary reloading.
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      18863bdd
    • G
      KVM: allow userspace to adjust kvmclock offset · afbcf7ab
      Glauber Costa 提交于
      When we migrate a kvm guest that uses pvclock between two hosts, we may
      suffer a large skew. This is because there can be significant differences
      between the monotonic clock of the hosts involved. When a new host with
      a much larger monotonic time starts running the guest, the view of time
      will be significantly impacted.
      
      Situation is much worse when we do the opposite, and migrate to a host with
      a smaller monotonic clock.
      
      This proposed ioctl will allow userspace to inform us what is the monotonic
      clock value in the source host, so we can keep the time skew short, and
      more importantly, never goes backwards. Userspace may also need to trigger
      the current data, since from the first migration onwards, it won't be
      reflected by a simple call to clock_gettime() anymore.
      
      [marcelo: future-proof abi with a flags field]
      [jan: fix KVM_GET_CLOCK by clearing flags field instead of checking it]
      Signed-off-by: NGlauber Costa <glommer@redhat.com>
      Signed-off-by: NMarcelo Tosatti <mtosatti@redhat.com>
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      afbcf7ab
    • J
      KVM: SVM: Cleanup NMI singlestep · 6be7d306
      Jan Kiszka 提交于
      Push the NMI-related singlestep variable into vcpu_svm. It's dealing
      with an AMD-specific deficit, nothing generic for x86.
      Acked-by: NGleb Natapov <gleb@redhat.com>
      Signed-off-by: NJan Kiszka <jan.kiszka@siemens.com>
      
       arch/x86/include/asm/kvm_host.h |    1 -
       arch/x86/kvm/svm.c              |   12 +++++++-----
       2 files changed, 7 insertions(+), 6 deletions(-)
      Signed-off-by: NMarcelo Tosatti <mtosatti@redhat.com>
      6be7d306
    • J
      KVM: x86: Fix guest single-stepping while interruptible · 94fe45da
      Jan Kiszka 提交于
      Commit 705c5323 opened the doors of hell by unconditionally injecting
      single-step flags as long as guest_debug signaled this. This doesn't
      work when the guest branches into some interrupt or exception handler
      and triggers a vmexit with flag reloading.
      
      Fix it by saving cs:rip when user space requests single-stepping and
      restricting the trace flag injection to this guest code position.
      Signed-off-by: NJan Kiszka <jan.kiszka@siemens.com>
      Signed-off-by: NMarcelo Tosatti <mtosatti@redhat.com>
      94fe45da
    • E
      KVM: Xen PV-on-HVM guest support · ffde22ac
      Ed Swierk 提交于
      Support for Xen PV-on-HVM guests can be implemented almost entirely in
      userspace, except for handling one annoying MSR that maps a Xen
      hypercall blob into guest address space.
      
      A generic mechanism to delegate MSR writes to userspace seems overkill
      and risks encouraging similar MSR abuse in the future.  Thus this patch
      adds special support for the Xen HVM MSR.
      
      I implemented a new ioctl, KVM_XEN_HVM_CONFIG, that lets userspace tell
      KVM which MSR the guest will write to, as well as the starting address
      and size of the hypercall blobs (one each for 32-bit and 64-bit) that
      userspace has loaded from files.  When the guest writes to the MSR, KVM
      copies one page of the blob from userspace to the guest.
      
      I've tested this patch with a hacked-up version of Gerd's userspace
      code, booting a number of guests (CentOS 5.3 i386 and x86_64, and
      FreeBSD 8.0-RC1 amd64) and exercising PV network and block devices.
      
      [jan: fix i386 build warning]
      [avi: future proof abi with a flags field]
      Signed-off-by: NEd Swierk <eswierk@aristanetworks.com>
      Signed-off-by: NJan Kiszka <jan.kiszka@siemens.com>
      Signed-off-by: NMarcelo Tosatti <mtosatti@redhat.com>
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      ffde22ac
    • J
      KVM: x86: Rework guest single-step flag injection and filtering · 91586a3b
      Jan Kiszka 提交于
      Push TF and RF injection and filtering on guest single-stepping into the
      vender get/set_rflags callbacks. This makes the whole mechanism more
      robust wrt user space IOCTL order and instruction emulations.
      Signed-off-by: NJan Kiszka <jan.kiszka@siemens.com>
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      91586a3b
    • J
      KVM: x86: Refactor guest debug IOCTL handling · 355be0b9
      Jan Kiszka 提交于
      Much of so far vendor-specific code for setting up guest debug can
      actually be handled by the generic code. This also fixes a minor deficit
      in the SVM part /wrt processing KVM_GUESTDBG_ENABLE.
      Signed-off-by: NJan Kiszka <jan.kiszka@siemens.com>
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      355be0b9
    • A
      KVM: Activate Virtualization On Demand · 10474ae8
      Alexander Graf 提交于
      X86 CPUs need to have some magic happening to enable the virtualization
      extensions on them. This magic can result in unpleasant results for
      users, like blocking other VMMs from working (vmx) or using invalid TLB
      entries (svm).
      
      Currently KVM activates virtualization when the respective kernel module
      is loaded. This blocks us from autoloading KVM modules without breaking
      other VMMs.
      
      To circumvent this problem at least a bit, this patch introduces on
      demand activation of virtualization. This means, that instead
      virtualization is enabled on creation of the first virtual machine
      and disabled on destruction of the last one.
      
      So using this, KVM can be easily autoloaded, while keeping other
      hypervisors usable.
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      Signed-off-by: NMarcelo Tosatti <mtosatti@redhat.com>
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      10474ae8
    • G
      KVM: Move irq ack notifier list to arch independent code · 136bdfee
      Gleb Natapov 提交于
      Mask irq notifier list is already there.
      Signed-off-by: NGleb Natapov <gleb@redhat.com>
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      136bdfee
    • G
      KVM: Move irq sharing information to irqchip level · 1a6e4a8c
      Gleb Natapov 提交于
      This removes assumptions that max GSIs is smaller than number of pins.
      Sharing is tracked on pin level not GSI level.
      
      [avi: no PIC on ia64]
      Signed-off-by: NGleb Natapov <gleb@redhat.com>
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      1a6e4a8c
    • A
      KVM: Don't pass kvm_run arguments · 851ba692
      Avi Kivity 提交于
      They're just copies of vcpu->run, which is readily accessible.
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      851ba692
  5. 04 10月, 2009 1 次提交
  6. 10 9月, 2009 2 次提交