1. 21 1月, 2016 1 次提交
  2. 18 12月, 2015 2 次提交
    • M
      target-i386: kvm: clear unusable segments' flags in migration · 4cae9c97
      Michael Chapman 提交于
      This commit fixes migration of a QEMU/KVM guest from kernel >= v3.9 to
      kernel <= v3.7 (e.g. from RHEL 7 to RHEL 6). Without this commit a guest
      migrated across these kernel versions fails to resume on the target host
      as its segment descriptors are invalid.
      
      Two separate kernel commits combined together to result in this bug:
      
        commit f0495f9b9992f80f82b14306946444b287193390
        Author: Avi Kivity <avi@redhat.com>
        Date:   Thu Jun 7 17:06:10 2012 +0300
      
            KVM: VMX: Relax check on unusable segment
      
            Some userspace (e.g. QEMU 1.1) munge the d and g bits of segment
            descriptors, causing us not to recognize them as unusable segments
            with emulate_invalid_guest_state=1.  Relax the check by testing for
            segment not present (a non-present segment cannot be usable).
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      
        commit 25391454e73e3156202264eb3c473825afe4bc94
        Author: Gleb Natapov <gleb@redhat.com>
        Date:   Mon Jan 21 15:36:46 2013 +0200
      
            KVM: VMX: don't clobber segment AR of unusable segments.
      
            Usability is returned in unusable field, so not need to clobber entire
            AR. Callers have to know how to deal with unusable segments already
            since if emulate_invalid_guest_state=true AR is not zeroed.
      Signed-off-by: NGleb Natapov <gleb@redhat.com>
      Signed-off-by: NMarcelo Tosatti <mtosatti@redhat.com>
      
      The first commit changed the KVM_SET_SREGS ioctl so that it did no treat
      segment flags == 0 as an unusable segment, instead only looking at the
      "present" flag.
      
      The second commit changed KVM_GET_SREGS so that it did not clear the
      flags of an unusable segment.
      
      Since QEMU does not itself maintain the "unusable" flag across a
      migration, the end result is that unusable segments read from a kernel
      with these commits and loaded into a kernel without these commits are
      not properly recognised as being unusable.
      
      This commit updates both get_seg and set_seg so that the problem is
      avoided even when migrating to or migrating from a QEMU without this
      commit. In get_seg, we clear the segment flags if the segment is marked
      unusable. In set_seg, we mark the segment unusable if the segment's
      "present" flag is not set.
      Signed-off-by: NMichael Chapman <mike@very.puzzling.org>
      Message-Id: <1449464047-17467-1-git-send-email-mike@very.puzzling.org>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      4cae9c97
    • P
      kvm: x86: add support for KVM_CAP_SPLIT_IRQCHIP · 15eafc2e
      Paolo Bonzini 提交于
      This patch adds support for split IRQ chip mode. When
      KVM_CAP_SPLIT_IRQCHIP is enabled:
      
          1.) The PIC, PIT, and IOAPIC are implemented in userspace while
          the LAPIC is implemented by KVM.
      
          2.) The software IOAPIC delivers interrupts to the KVM LAPIC via
          kvm_set_irq. Interrupt delivery is configured via the MSI routing
          table, for which routes are reserved in target-i386/kvm.c then
          configured in hw/intc/ioapic.c
      
          3.) KVM delivers IOAPIC EOIs via a new exit KVM_EXIT_IOAPIC_EOI,
          which is handled in target-i386/kvm.c and relayed to the software
          IOAPIC via ioapic_eoi_broadcast.
      Signed-off-by: NMatt Gingell <gingell@google.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      15eafc2e
  3. 17 12月, 2015 3 次提交
    • A
      target-i386/kvm: Hyper-V SynIC timers MSR's support · ff99aa64
      Andrey Smetanin 提交于
      Hyper-V SynIC timers are host timers that are configurable
      by guest through corresponding MSR's (HV_X64_MSR_STIMER*).
      Guest setup and use fired by host events(SynIC interrupt
      and appropriate timer expiration message) as guest clock
      events.
      
      The state of Hyper-V SynIC timers are stored in corresponding
      MSR's. This patch seria implements such MSR's support and migration.
      Signed-off-by: NAndrey Smetanin <asmetanin@virtuozzo.com>
      CC: Paolo Bonzini <pbonzini@redhat.com>
      CC: Richard Henderson <rth@twiddle.net>
      CC: Eduardo Habkost <ehabkost@redhat.com>
      CC: "Andreas Färber" <afaerber@suse.de>
      CC: Marcelo Tosatti <mtosatti@redhat.com>
      CC: Denis V. Lunev <den@openvz.org>
      CC: Roman Kagan <rkagan@virtuozzo.com>
      CC: kvm@vger.kernel.org
      
      Message-Id: <1448464885-8300-3-git-send-email-asmetanin@virtuozzo.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      ff99aa64
    • A
      target-i386/hyperv: Hyper-V SynIC SINT routing and vcpu exit · 50efe82c
      Andrey Smetanin 提交于
      Hyper-V SynIC(synthetic interrupt controller) helpers for
      Hyper-V SynIC irq routing setup, irq injection, irq ack
      notifications event/message pages changes tracking for future use.
      Signed-off-by: NAndrey Smetanin <asmetanin@virtuozzo.com>
      Reviewed-by: NRoman Kagan <rkagan@virtuozzo.com>
      Signed-off-by: NDenis V. Lunev <den@openvz.org>
      CC: Paolo Bonzini <pbonzini@redhat.com>
      CC: Richard Henderson <rth@twiddle.net>
      CC: Eduardo Habkost <ehabkost@redhat.com>
      CC: "Andreas Färber" <afaerber@suse.de>
      CC: Marcelo Tosatti <mtosatti@redhat.com>
      CC: Roman Kagan <rkagan@virtuozzo.com>
      CC: Denis V. Lunev <den@openvz.org>
      CC: kvm@vger.kernel.org
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      50efe82c
    • A
      target-i386/kvm: Hyper-V SynIC MSR's support · 866eea9a
      Andrey Smetanin 提交于
      This patch does Hyper-V Synthetic interrupt
      controller(Hyper-V SynIC) MSR's support and
      migration. Hyper-V SynIC is enabled by cpu's
      'hv-synic' option.
      
      This patch does not allow cpu creation if
      'hv-synic' option specified but kernel
      doesn't support Hyper-V SynIC.
      
      Changes v3:
      * removed 'msr_hv_synic_version' migration because
      it's value always the same
      * moved SynIC msr's initialization into kvm_arch_init_vcpu
      Signed-off-by: NAndrey Smetanin <asmetanin@virtuozzo.com>
      Reviewed-by: NRoman Kagan <rkagan@virtuozzo.com>
      Signed-off-by: NDenis V. Lunev <den@openvz.org>
      CC: Paolo Bonzini <pbonzini@redhat.com>
      CC: Richard Henderson <rth@twiddle.net>
      CC: Eduardo Habkost <ehabkost@redhat.com>
      CC: "Andreas Färber" <afaerber@suse.de>
      CC: Marcelo Tosatti <mtosatti@redhat.com>
      CC: Roman Kagan <rkagan@virtuozzo.com>
      CC: Denis V. Lunev <den@openvz.org>
      CC: kvm@vger.kernel.org
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      866eea9a
  4. 26 11月, 2015 3 次提交
  5. 05 11月, 2015 1 次提交
    • L
      kvmclock: add a new function to update env->tsc. · 0fd7e098
      Liang Li 提交于
      The commit 317b0a6d fixed an issue which caused by the outdated
      env->tsc value, but the fix lead to 'cpu_synchronize_all_states()'
      called twice during live migration. The 'cpu_synchronize_all_states()'
      takes about 130us for a VM which has 4 vcpus, it's a bit expensive.
      
      Synchronize the whole CPU context just for updating env->tsc is too
      wasting, this patch use a new function to update the env->tsc.
      Comparing to 'cpu_synchronize_all_states()', it only takes about 20us.
      Signed-off-by: NLiang Li <liang.z.li@intel.com>
      Message-Id: <1446695464-27116-2-git-send-email-liang.z.li@intel.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      0fd7e098
  6. 19 10月, 2015 3 次提交
  7. 13 10月, 2015 3 次提交
  8. 03 10月, 2015 1 次提交
  9. 16 9月, 2015 2 次提交
  10. 07 7月, 2015 2 次提交
  11. 06 7月, 2015 2 次提交
  12. 01 7月, 2015 1 次提交
    • J
      kvm: First step to push iothread lock out of inner run loop · 4b8523ee
      Jan Kiszka 提交于
      This opens the path to get rid of the iothread lock on vmexits in KVM
      mode. On x86, the in-kernel irqchips has to be used because we otherwise
      need to synchronize APIC and other per-cpu state accesses that could be
      changed concurrently.
      
      Regarding pre/post-run callbacks, s390x and ARM should be fine without
      specific locking as the callbacks are empty. MIPS and POWER require
      locking for the pre-run callback.
      
      For the handle_exit callback, it is non-empty in x86, POWER and s390.
      Some POWER cases could do without the locking, but it is left in
      place for now.
      Signed-off-by: NJan Kiszka <jan.kiszka@siemens.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Message-Id: <1434646046-27150-7-git-send-email-pbonzini@redhat.com>
      4b8523ee
  13. 23 6月, 2015 1 次提交
  14. 05 6月, 2015 1 次提交
  15. 02 6月, 2015 1 次提交
  16. 30 4月, 2015 1 次提交
  17. 12 3月, 2015 2 次提交
  18. 10 3月, 2015 1 次提交
  19. 03 3月, 2015 1 次提交
  20. 26 2月, 2015 1 次提交
  21. 26 1月, 2015 1 次提交
    • P
      target-i386: make xmm_regs 512-bit wide · b7711471
      Paolo Bonzini 提交于
      Right now, the AVX512 registers are split in many different fields:
      xmm_regs for the low 128 bits of the first 16 registers, ymmh_regs
      for the next 128 bits of the same first 16 registers, zmmh_regs
      for the next 256 bits of the same first 16 registers, and finally
      hi16_zmm_regs for the full 512 bits of the second 16 bit registers.
      
      This makes it simple to move data in and out of the xsave region,
      but would be a nightmare for a hypothetical TCG implementation and
      leads to a proliferation of [XYZ]MM_[BWLSQD] macros.  Instead,
      this patch marshals data manually from the xsave region to a single
      32x512-bit array, simplifying the macro jungle and clarifying which
      bits are in which vmstate subsection.
      
      The migration format is unaffected.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      b7711471
  22. 14 1月, 2015 1 次提交
  23. 12 1月, 2015 1 次提交
  24. 15 12月, 2014 4 次提交