Message ID | 20241114130152.352009-1-vkuznets@redhat.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | target/i386: Fix !CONFIG_SYNDBG build | expand |
On 14/11/24 13:01, Vitaly Kuznetsov wrote: > Commit bbf3810f2c4f ("target/i386: Fix conditional CONFIG_SYNDBG > enablement") broke !CONFIG_SYNDBG builds as hyperv_syndbg_query_options() > is missing there. The idea probably was that as "hv-syndbg" is now under > '#ifdef CONFIG_SYNDBG', hyperv_feat_enabled(cpu, HYPERV_FEAT_SYNDBG) cannot > be true anyway. > > It would have been possible to add a stub for hyperv_syndbg_query_options() > instead of resurrecting '#ifdef CONFIG_SYNDBG' but avoiding > HV_X64_MSR_SYNDBG_OPTIONS altogether instead of zeroing it when > !CONFIG_SYNDBG seems preferable. > > Reported-by: Michael Tokarev <mjt@tls.msk.ru> > Fixes: bbf3810f2c4f ("target/i386: Fix conditional CONFIG_SYNDBG enablement") > Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com> > --- > target/i386/kvm/kvm.c | 2 ++ > 1 file changed, 2 insertions(+) Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c index 8e17942c3ba1..11f9526c8f8c 100644 --- a/target/i386/kvm/kvm.c +++ b/target/i386/kvm/kvm.c @@ -4034,11 +4034,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,
Commit bbf3810f2c4f ("target/i386: Fix conditional CONFIG_SYNDBG enablement") broke !CONFIG_SYNDBG builds as hyperv_syndbg_query_options() is missing there. The idea probably was that as "hv-syndbg" is now under '#ifdef CONFIG_SYNDBG', hyperv_feat_enabled(cpu, HYPERV_FEAT_SYNDBG) cannot be true anyway. It would have been possible to add a stub for hyperv_syndbg_query_options() instead of resurrecting '#ifdef CONFIG_SYNDBG' but avoiding HV_X64_MSR_SYNDBG_OPTIONS altogether instead of zeroing it when !CONFIG_SYNDBG seems preferable. Reported-by: Michael Tokarev <mjt@tls.msk.ru> Fixes: bbf3810f2c4f ("target/i386: Fix conditional CONFIG_SYNDBG enablement") Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com> --- target/i386/kvm/kvm.c | 2 ++ 1 file changed, 2 insertions(+)