public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Pankaj Gupta <pankaj.gupta.linux@gmail.com>
To: kvm@vger.kernel.org
Cc: pbonzini@redhat.com, sean.j.christopherson@intel.com,
	vkuznets@redhat.com, wanpengli@tencent.com, jmattson@google.com,
	tglx@linutronix.de, oro@8bytes.org, mingo@redhat.com,
	bp@alien8.de, x86@kernel.org, hpa@zytor.com,
	pankaj.gupta.linux@gmail.com,
	Pankaj Gupta <pankaj.gupta@cloud.ionos.com>
Subject: [PATCH] KVM: x86: handle MSR_IA32_DEBUGCTLMSR with report_ignored_msrs
Date: Thu,  5 Nov 2020 16:39:32 +0100	[thread overview]
Message-ID: <20201105153932.24316-1-pankaj.gupta.linux@gmail.com> (raw)

From: Pankaj Gupta <pankaj.gupta@cloud.ionos.com>

 Guest tries to enable LBR (last branch/interrupt/exception) repeatedly,
 thus spamming the host kernel logs. As MSR_IA32_DEBUGCTLMSR is not emulated by
 KVM, its better to add the error log only with "report_ignored_msrs".
 
Signed-off-by: Pankaj Gupta <pankaj.gupta@cloud.ionos.com>
---
 arch/x86/kvm/x86.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index f5ede41bf9e6..99c69ae43c69 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -3063,9 +3063,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);
-- 
2.20.1


             reply	other threads:[~2020-11-05 15:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-05 15:39 Pankaj Gupta [this message]
2020-11-05 17:01 ` [PATCH] KVM: x86: handle MSR_IA32_DEBUGCTLMSR with report_ignored_msrs Paolo Bonzini
2020-11-05 18:58   ` Pankaj Gupta
2020-11-06 10:08     ` Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201105153932.24316-1-pankaj.gupta.linux@gmail.com \
    --to=pankaj.gupta.linux@gmail.com \
    --cc=bp@alien8.de \
    --cc=hpa@zytor.com \
    --cc=jmattson@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=oro@8bytes.org \
    --cc=pankaj.gupta@cloud.ionos.com \
    --cc=pbonzini@redhat.com \
    --cc=sean.j.christopherson@intel.com \
    --cc=tglx@linutronix.de \
    --cc=vkuznets@redhat.com \
    --cc=wanpengli@tencent.com \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox