[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 04/23] hyperv: ensure SINTx msrs are reset proper
From: |
Roman Kagan |
Subject: |
[Qemu-devel] [PATCH v2 04/23] hyperv: ensure SINTx msrs are reset properly |
Date: |
Wed, 21 Jun 2017 19:24:05 +0300 |
Initially SINTx msrs should be in "masked" state. To ensure that
happens on *every* reset, move setting their values to
kvm_arch_vcpu_reset.
Signed-off-by: Roman Kagan <address@hidden>
---
v1 -> v2:
- split out of v1 patch 4
target/i386/kvm.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/target/i386/kvm.c b/target/i386/kvm.c
index 183a85b..27404dd 100644
--- a/target/i386/kvm.c
+++ b/target/i386/kvm.c
@@ -647,8 +647,6 @@ static int hyperv_handle_properties(CPUState *cs)
env->features[FEAT_HYPERV_EAX] |= HV_VP_RUNTIME_AVAILABLE;
}
if (cpu->hyperv_synic) {
- int sint;
-
if (!has_msr_hv_synic ||
kvm_vcpu_enable_cap(cs, KVM_CAP_HYPERV_SYNIC, 0)) {
fprintf(stderr, "Hyper-V SynIC is not supported by kernel\n");
@@ -657,9 +655,6 @@ static int hyperv_handle_properties(CPUState *cs)
env->features[FEAT_HYPERV_EAX] |= HV_SYNIC_AVAILABLE;
env->msr_hv_synic_version = HV_SYNIC_VERSION;
- for (sint = 0; sint < ARRAY_SIZE(env->msr_hv_synic_sint); sint++) {
- env->msr_hv_synic_sint[sint] = HV_SINT_MASKED;
- }
}
if (cpu->hyperv_stimer) {
if (!has_msr_hv_stimer) {
@@ -1039,6 +1034,13 @@ void kvm_arch_reset_vcpu(X86CPU *cpu)
} else {
env->mp_state = KVM_MP_STATE_RUNNABLE;
}
+
+ if (cpu->hyperv_synic) {
+ int i;
+ for (i = 0; i < ARRAY_SIZE(env->msr_hv_synic_sint); i++) {
+ env->msr_hv_synic_sint[i] = HV_SINT_MASKED;
+ }
+ }
}
void kvm_arch_do_init_vcpu(X86CPU *cpu)
--
2.9.4
- [Qemu-devel] [PATCH v2 00/23] hyperv fixes and enhancements, Roman Kagan, 2017/06/21
- [Qemu-devel] [PATCH v2 01/23] hyperv: add header with protocol definitions, Roman Kagan, 2017/06/21
- [Qemu-devel] [PATCH v2 02/23] update-linux-headers: prepare for hyperv.h removal, Roman Kagan, 2017/06/21
- [Qemu-devel] [PATCH v2 03/23] hyperv: set partition-wide MSRs only on first vcpu, Roman Kagan, 2017/06/21
- [Qemu-devel] [PATCH v2 04/23] hyperv: ensure SINTx msrs are reset properly,
Roman Kagan <=
- [Qemu-devel] [PATCH v2 05/23] hyperv: make SynIC version msr constant, Roman Kagan, 2017/06/21
- [Qemu-devel] [PATCH v2 06/23] [not to commit] add new hyperv-related caps, Roman Kagan, 2017/06/21
- [Qemu-devel] [PATCH v2 07/23] hyperv: ensure VP index equal to QEMU cpu_index, Roman Kagan, 2017/06/21
- Re: [Qemu-devel] [PATCH v2 07/23] hyperv: ensure VP index equal to QEMU cpu_index, Igor Mammedov, 2017/06/28
- Re: [Qemu-devel] [PATCH v2 07/23] hyperv: ensure VP index equal to QEMU cpu_index, Roman Kagan, 2017/06/29
- Re: [Qemu-devel] [PATCH v2 07/23] hyperv: ensure VP index equal to QEMU cpu_index, Igor Mammedov, 2017/06/29
- Re: [Qemu-devel] [PATCH v2 07/23] hyperv: ensure VP index equal to QEMU cpu_index, Roman Kagan, 2017/06/29
- Re: [Qemu-devel] [PATCH v2 07/23] hyperv: ensure VP index equal to QEMU cpu_index, Igor Mammedov, 2017/06/29
- Re: [Qemu-devel] [PATCH v2 07/23] hyperv: ensure VP index equal to QEMU cpu_index, Roman Kagan, 2017/06/29
[Qemu-devel] [PATCH v2 08/23] hyperv_testdev: refactor for readability, Roman Kagan, 2017/06/21