Merge remote-tracking branch 'qemu-kvm/uq/master' into stable-1.5
authorAnthony Liguori <anthony@codemonkey.ws>
Thu, 29 Aug 2013 22:21:51 +0000 (17:21 -0500)
committerAnthony Liguori <anthony@codemonkey.ws>
Thu, 29 Aug 2013 22:21:51 +0000 (17:21 -0500)
* qemu-kvm/uq/master:
  kvm-stub: fix compilation
  kvm: shorten the parameter list for get_real_device()
  kvm: i386: fix LAPIC TSC deadline timer save/restore
  kvm-all.c: max_cpus should not exceed KVM vcpu limit
  kvm: Simplify kvm_handle_io
  kvm: x86: fix setting IA32_FEATURE_CONTROL with nested VMX disabled
  kvm: add KVM_IRQFD_FLAG_RESAMPLE support
  kvm: migrate vPMU state
  target-i386: remove tabs from target-i386/cpu.h
  Initialize IA32_FEATURE_CONTROL MSR in reset and migration

Conflicts:
target-i386/cpu.h
target-i386/kvm.c

aliguori: fixup trivial conflicts due to whitespace and added cpu
          argument

Signed-off-by: Anthony Liguori <anthony@codemonkey.ws>
1  2 
hw/i386/kvm/pci-assign.c
hw/misc/vfio.c
hw/virtio/virtio-pci.c
include/sysemu/kvm.h
kvm-all.c
kvm-stub.c
target-i386/cpu.h
target-i386/kvm.c

Simple merge
diff --cc hw/misc/vfio.c
Simple merge
Simple merge
Simple merge
diff --cc kvm-all.c
Simple merge
diff --cc kvm-stub.c
Simple merge
Simple merge
@@@ -1130,13 -1159,44 +1175,44 @@@ static int kvm_put_msrs(X86CPU *cpu, in
              kvm_msr_entry_set(&msrs[n++], MSR_KVM_STEAL_TIME,
                                env->steal_time_msr);
          }
 -        if (hyperv_hypercall_available()) {
+         if (has_msr_architectural_pmu) {
+             /* Stop the counter.  */
+             kvm_msr_entry_set(&msrs[n++], MSR_CORE_PERF_FIXED_CTR_CTRL, 0);
+             kvm_msr_entry_set(&msrs[n++], MSR_CORE_PERF_GLOBAL_CTRL, 0);
+             /* Set the counter values.  */
+             for (i = 0; i < MAX_FIXED_COUNTERS; i++) {
+                 kvm_msr_entry_set(&msrs[n++], MSR_CORE_PERF_FIXED_CTR0 + i,
+                                   env->msr_fixed_counters[i]);
+             }
+             for (i = 0; i < num_architectural_pmu_counters; i++) {
+                 kvm_msr_entry_set(&msrs[n++], MSR_P6_PERFCTR0 + i,
+                                   env->msr_gp_counters[i]);
+                 kvm_msr_entry_set(&msrs[n++], MSR_P6_EVNTSEL0 + i,
+                                   env->msr_gp_evtsel[i]);
+             }
+             kvm_msr_entry_set(&msrs[n++], MSR_CORE_PERF_GLOBAL_STATUS,
+                               env->msr_global_status);
+             kvm_msr_entry_set(&msrs[n++], MSR_CORE_PERF_GLOBAL_OVF_CTRL,
+                               env->msr_global_ovf_ctrl);
+             /* Now start the PMU.  */
+             kvm_msr_entry_set(&msrs[n++], MSR_CORE_PERF_FIXED_CTR_CTRL,
+                               env->msr_fixed_ctr_ctrl);
+             kvm_msr_entry_set(&msrs[n++], MSR_CORE_PERF_GLOBAL_CTRL,
+                               env->msr_global_ctrl);
+         }
 +        if (hyperv_hypercall_available(cpu)) {
              kvm_msr_entry_set(&msrs[n++], HV_X64_MSR_GUEST_OS_ID, 0);
              kvm_msr_entry_set(&msrs[n++], HV_X64_MSR_HYPERCALL, 0);
          }
 -        if (hyperv_vapic_recommended()) {
 +        if (cpu->hyperv_vapic) {
              kvm_msr_entry_set(&msrs[n++], HV_X64_MSR_APIC_ASSIST_PAGE, 0);
          }
+         if (has_msr_feature_control) {
+             kvm_msr_entry_set(&msrs[n++], MSR_IA32_FEATURE_CONTROL,
+                               env->msr_ia32_feature_control);
+         }
      }
      if (env->mcg_cap) {
          int i;