]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
KVM: x86: handle MSR_IA32_DEBUGCTLMSR with report_ignored_msrs
authorPankaj Gupta <pankaj.gupta@cloud.ionos.com>
Thu, 5 Nov 2020 15:39:32 +0000 (16:39 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Sun, 8 Nov 2020 09:41:31 +0000 (04:41 -0500)
Windows2016 guest tries to enable LBR by setting the corresponding bits
in MSR_IA32_DEBUGCTLMSR. KVM does not emulate MSR_IA32_DEBUGCTLMSR and
spams the host kernel logs with error messages like:

kvm [...]: vcpu1, guest rIP: 0xfffff800a8b687d3 kvm_set_msr_common: MSR_IA32_DEBUGCTLMSR 0x1, nop"

This patch fixes this by enabling error logging only with
'report_ignored_msrs=1'.

Signed-off-by: Pankaj Gupta <pankaj.gupta@cloud.ionos.com>
Message-Id: <20201105153932.24316-1-pankaj.gupta.linux@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/x86.c

index d9651faabe6833df959910cbf44baa9535591554..447edc0d1d5a68f7bc3c82f8d9c969cc58e73b6a 100644 (file)
@@ -3065,9 +3065,9 @@ int kvm_set_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr_info)
                        /* Values other than LBR and BTF are vendor-specific,
                           thus reserved and should throw a #GP */
                        return 1;
-               }
-               vcpu_unimpl(vcpu, "%s: MSR_IA32_DEBUGCTLMSR 0x%llx, nop\n",
-                           __func__, data);
+               } else if (report_ignored_msrs)
+                       vcpu_unimpl(vcpu, "%s: MSR_IA32_DEBUGCTLMSR 0x%llx, nop\n",
+                                   __func__, data);
                break;
        case 0x200 ... 0x2ff:
                return kvm_mtrr_set_msr(vcpu, msr, data);