Re: [PATCH v11 4/7] x86/kvm/hyper-v: Add support for synthetic debugger capability
From: Paolo Bonzini <pbonzini@redhat.com>
Date: 2020-05-29 12:18:03
Also in:
kvm
From: Paolo Bonzini <pbonzini@redhat.com>
Date: 2020-05-29 12:18:03
Also in:
kvm
On 29/05/20 14:08, Vitaly Kuznetsov wrote:
quoted
On 24/04/20 13:37, Jon Doron wrote:quoted
+static int syndbg_get_msr(struct kvm_vcpu *vcpu, u32 msr, u64 *pdata, bool host) +{ + struct kvm_hv_syndbg *syndbg = vcpu_to_hv_syndbg(vcpu); + + if (!syndbg->active && !host) + return 1; +One small thing: is the ENABLE_CAP and active field needed? Can you just check if the guest has the syndbg CPUID bits set?Yes, we can probably get away with a static capability (so userspace knows that the interface is supported and CPUID bit can be set) and check guest_cpuid_has() here but we don't have Hyper-V feature leaves exposed as X86_FEATURE_* (yet). It is probably possible to implement an interim solution by open coding the check with kvm_find_cpuid_entry() or something like that.
Yes, that would be fine if you just abstract it in its own function. Paolo