Loading target-i386/cpu.h +1 −0 Original line number Diff line number Diff line Loading @@ -864,6 +864,7 @@ typedef struct CPUX86State { uint64_t msr_gp_evtsel[MAX_GP_COUNTERS]; uint64_t msr_hv_hypercall; uint64_t msr_hv_guest_os_id; uint64_t msr_hv_vapic; /* exception/interrupt handling */ int error_code; Loading target-i386/kvm.c +9 −1 Original line number Diff line number Diff line Loading @@ -1236,7 +1236,8 @@ static int kvm_put_msrs(X86CPU *cpu, int level) env->msr_hv_hypercall); } if (has_msr_hv_vapic) { kvm_msr_entry_set(&msrs[n++], HV_X64_MSR_APIC_ASSIST_PAGE, 0); kvm_msr_entry_set(&msrs[n++], HV_X64_MSR_APIC_ASSIST_PAGE, env->msr_hv_vapic); } /* Note: MSR_IA32_FEATURE_CONTROL is written separately, see Loading Loading @@ -1526,6 +1527,10 @@ static int kvm_get_msrs(X86CPU *cpu) msrs[n++].index = HV_X64_MSR_HYPERCALL; msrs[n++].index = HV_X64_MSR_GUEST_OS_ID; } if (has_msr_hv_vapic) { msrs[n++].index = HV_X64_MSR_APIC_ASSIST_PAGE; } msr_data.info.nmsrs = n; ret = kvm_vcpu_ioctl(CPU(cpu), KVM_GET_MSRS, &msr_data); if (ret < 0) { Loading Loading @@ -1639,6 +1644,9 @@ static int kvm_get_msrs(X86CPU *cpu) case HV_X64_MSR_GUEST_OS_ID: env->msr_hv_guest_os_id = msrs[i].data; break; case HV_X64_MSR_APIC_ASSIST_PAGE: env->msr_hv_vapic = msrs[i].data; break; } } Loading target-i386/machine.c +22 −0 Original line number Diff line number Diff line Loading @@ -574,6 +574,25 @@ static const VMStateDescription vmstate_msr_hypercall_hypercall = { } }; static bool hyperv_vapic_enable_needed(void *opaque) { X86CPU *cpu = opaque; CPUX86State *env = &cpu->env; return env->msr_hv_vapic != 0; } static const VMStateDescription vmstate_msr_hyperv_vapic = { .name = "cpu/msr_hyperv_vapic", .version_id = 1, .minimum_version_id = 1, .minimum_version_id_old = 1, .fields = (VMStateField []) { VMSTATE_UINT64(env.msr_hv_vapic, X86CPU), VMSTATE_END_OF_LIST() } }; const VMStateDescription vmstate_x86_cpu = { .name = "cpu", .version_id = 12, Loading Loading @@ -711,6 +730,9 @@ const VMStateDescription vmstate_x86_cpu = { }, { .vmsd = &vmstate_msr_hypercall_hypercall, .needed = hyperv_hypercall_enable_needed, }, { .vmsd = &vmstate_msr_hyperv_vapic, .needed = hyperv_vapic_enable_needed, } , { /* empty */ } Loading Loading
target-i386/cpu.h +1 −0 Original line number Diff line number Diff line Loading @@ -864,6 +864,7 @@ typedef struct CPUX86State { uint64_t msr_gp_evtsel[MAX_GP_COUNTERS]; uint64_t msr_hv_hypercall; uint64_t msr_hv_guest_os_id; uint64_t msr_hv_vapic; /* exception/interrupt handling */ int error_code; Loading
target-i386/kvm.c +9 −1 Original line number Diff line number Diff line Loading @@ -1236,7 +1236,8 @@ static int kvm_put_msrs(X86CPU *cpu, int level) env->msr_hv_hypercall); } if (has_msr_hv_vapic) { kvm_msr_entry_set(&msrs[n++], HV_X64_MSR_APIC_ASSIST_PAGE, 0); kvm_msr_entry_set(&msrs[n++], HV_X64_MSR_APIC_ASSIST_PAGE, env->msr_hv_vapic); } /* Note: MSR_IA32_FEATURE_CONTROL is written separately, see Loading Loading @@ -1526,6 +1527,10 @@ static int kvm_get_msrs(X86CPU *cpu) msrs[n++].index = HV_X64_MSR_HYPERCALL; msrs[n++].index = HV_X64_MSR_GUEST_OS_ID; } if (has_msr_hv_vapic) { msrs[n++].index = HV_X64_MSR_APIC_ASSIST_PAGE; } msr_data.info.nmsrs = n; ret = kvm_vcpu_ioctl(CPU(cpu), KVM_GET_MSRS, &msr_data); if (ret < 0) { Loading Loading @@ -1639,6 +1644,9 @@ static int kvm_get_msrs(X86CPU *cpu) case HV_X64_MSR_GUEST_OS_ID: env->msr_hv_guest_os_id = msrs[i].data; break; case HV_X64_MSR_APIC_ASSIST_PAGE: env->msr_hv_vapic = msrs[i].data; break; } } Loading
target-i386/machine.c +22 −0 Original line number Diff line number Diff line Loading @@ -574,6 +574,25 @@ static const VMStateDescription vmstate_msr_hypercall_hypercall = { } }; static bool hyperv_vapic_enable_needed(void *opaque) { X86CPU *cpu = opaque; CPUX86State *env = &cpu->env; return env->msr_hv_vapic != 0; } static const VMStateDescription vmstate_msr_hyperv_vapic = { .name = "cpu/msr_hyperv_vapic", .version_id = 1, .minimum_version_id = 1, .minimum_version_id_old = 1, .fields = (VMStateField []) { VMSTATE_UINT64(env.msr_hv_vapic, X86CPU), VMSTATE_END_OF_LIST() } }; const VMStateDescription vmstate_x86_cpu = { .name = "cpu", .version_id = 12, Loading Loading @@ -711,6 +730,9 @@ const VMStateDescription vmstate_x86_cpu = { }, { .vmsd = &vmstate_msr_hypercall_hypercall, .needed = hyperv_hypercall_enable_needed, }, { .vmsd = &vmstate_msr_hyperv_vapic, .needed = hyperv_vapic_enable_needed, } , { /* empty */ } Loading