1. 21 1月, 2016 5 次提交
  2. 16 1月, 2016 1 次提交
  3. 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
  4. 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
  5. 26 11月, 2015 3 次提交
  6. 18 11月, 2015 2 次提交
  7. 06 11月, 2015 7 次提交
  8. 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
  9. 04 11月, 2015 2 次提交
  10. 29 10月, 2015 1 次提交
  11. 28 10月, 2015 2 次提交
    • E
      target-i386: Enable "check" mode by default · 15e41345
      Eduardo Habkost 提交于
      Current default behavior of QEMU is to silently disable features that
      are not supported by the host when a CPU model is requested in the
      command-line. This means that in addition to risking breaking guest ABI
      by default, we are silent about it.
      
      I would like to enable "enforce" by default, but this can easily break
      existing production systems because of the way libvirt makes assumptions
      about CPU models today (this will change in the future, once QEMU
      provide a proper interface for checking if a CPU model is runnable).
      
      But there's no reason we should be silent about it. So, change
      target-i386 to enable "check" mode by default so at least we have some
      warning printed to stderr (and hopefully logged somewhere) when QEMU
      disables a feature that is not supported by the host system.
      Reviewed-by: NIgor Mammedov <imammedo@redhat.com>
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      15e41345
    • E
      target-i386: Don't left shift negative constant · 712b4243
      Eduardo Habkost 提交于
      Left shift of negative values is undefined behavior. Detected by clang:
        qemu/target-i386/translate.c:2423:26: runtime error:
          left shift of negative value -8
      
      This changes the code to reverse the sign after the left shift.
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      712b4243
  12. 23 10月, 2015 11 次提交