Commit 48a5f3bc authored by Vadim Rozenfeld's avatar Vadim Rozenfeld Committed by Paolo Bonzini
Browse files

kvm: add support for hyper-v timers

http://msdn.microsoft.com/en-us/library/windows/hardware/ff541625%28v=vs.85%29.aspx



This code is generic for activating reference time counter or virtual reference time stamp counter

Signed-off-by: default avatarVadim Rozenfeld <vrozenfe@redhat.com>
Reviewed-by: default avatarMarcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent 5ef68987
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -149,6 +149,9 @@
/* MSR used to read the per-partition time reference counter */
#define HV_X64_MSR_TIME_REF_COUNT		0x40000020

/* A partition's reference time stamp counter (TSC) page */
#define HV_X64_MSR_REFERENCE_TSC		0x40000021

/* MSR used to retrieve the TSC frequency */
#define HV_X64_MSR_TSC_FREQUENCY		0x40000022

+1 −0
Original line number Diff line number Diff line
@@ -674,6 +674,7 @@ struct kvm_ppc_smmu_info {
#define KVM_CAP_ARM_EL1_32BIT 93
#define KVM_CAP_SPAPR_MULTITCE 94
#define KVM_CAP_EXT_EMUL_CPUID 95
#define KVM_CAP_HYPERV_TIME 96

#ifdef KVM_CAP_IRQ_ROUTING

+1 −0
Original line number Diff line number Diff line
@@ -69,6 +69,7 @@ typedef struct X86CPU {
    bool hyperv_vapic;
    bool hyperv_relaxed_timing;
    int hyperv_spinlock_attempts;
    bool hyperv_time;
    bool check_cpuid;
    bool enforce_cpuid;

+1 −0
Original line number Diff line number Diff line
@@ -2702,6 +2702,7 @@ static Property x86_cpu_properties[] = {
    { .name  = "hv-spinlocks", .info  = &qdev_prop_spinlocks },
    DEFINE_PROP_BOOL("hv-relaxed", X86CPU, hyperv_relaxed_timing, false),
    DEFINE_PROP_BOOL("hv-vapic", X86CPU, hyperv_vapic, false),
    DEFINE_PROP_BOOL("hv-time", X86CPU, hyperv_time, false),
    DEFINE_PROP_BOOL("check", X86CPU, check_cpuid, false),
    DEFINE_PROP_BOOL("enforce", X86CPU, enforce_cpuid, false),
    DEFINE_PROP_END_OF_LIST()
+1 −0
Original line number Diff line number Diff line
@@ -865,6 +865,7 @@ typedef struct CPUX86State {
    uint64_t msr_hv_hypercall;
    uint64_t msr_hv_guest_os_id;
    uint64_t msr_hv_vapic;
    uint64_t msr_hv_tsc;

    /* exception/interrupt handling */
    int error_code;
Loading