hw: hyperv: Initial commit for Synthetic Debugging device

Signed-off-by: Jon Doron <arilou@gmail.com>
Reviewed-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
Message-Id: <20220216102500.692781-5-arilou@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
Jon Doron 2022-02-16 12:25:00 +02:00 committed by Paolo Bonzini
parent 73d2407407
commit d8701185f4
4 changed files with 414 additions and 0 deletions

View file

@ -54,6 +54,8 @@
#include "exec/memattrs.h"
#include "trace.h"
#include CONFIG_DEVICES
//#define DEBUG_KVM
#ifdef DEBUG_KVM
@ -965,6 +967,7 @@ static struct {
.bits = HV_DEPRECATING_AEOI_RECOMMENDED}
}
},
#ifdef CONFIG_SYNDBG
[HYPERV_FEAT_SYNDBG] = {
.desc = "Enable synthetic kernel debugger channel (hv-syndbg)",
.flags = {
@ -973,6 +976,7 @@ static struct {
},
.dependencies = BIT(HYPERV_FEAT_SYNIC) | BIT(HYPERV_FEAT_RELAXED)
},
#endif
};
static struct kvm_cpuid2 *try_get_hv_cpuid(CPUState *cs, int max,
@ -3233,11 +3237,13 @@ static int kvm_put_msrs(X86CPU *cpu, int level)
kvm_msr_entry_add(cpu, HV_X64_MSR_TSC_EMULATION_STATUS,
env->msr_hv_tsc_emulation_status);
}
#ifdef CONFIG_SYNDBG
if (hyperv_feat_enabled(cpu, HYPERV_FEAT_SYNDBG) &&
has_msr_hv_syndbg_options) {
kvm_msr_entry_add(cpu, HV_X64_MSR_SYNDBG_OPTIONS,
hyperv_syndbg_query_options());
}
#endif
}
if (hyperv_feat_enabled(cpu, HYPERV_FEAT_VAPIC)) {
kvm_msr_entry_add(cpu, HV_X64_MSR_APIC_ASSIST_PAGE,