LKML Archive on
help / color / mirror / Atom feed
From: Sean Christopherson <>
Subject: Re: [PATCH v2] [next] KVM: lapic: allow set apic debug dynamically
Date: Fri, 10 May 2019 10:49:00 -0700	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

On Fri, May 10, 2019 at 12:54:21PM +0800, wrote:
> I grep "debug" in arch/x86/kvm, and find these *_debug:
> ioapic_debug
> apic_debug
> and dbg in mmu.c, which is better to be renamed to mmu_debug as you said.
> and vcpu_debug, which uses kvm_debug macro.
> kvm_debug macro uses pr_debug which can be dynamically set during running
> time, so, how about change all *_debug in kvm to pr_debug like vcpu_debug?

It's still the same end result, we're bloating and slowing KVM with code
and conditionals that aren't useful in normal operation.  grep vcpu_debug
a bit further and you'll see that the only uses in x86 are when the guest
has crashed, is being reset, or is accessing an unhandled MSR and KVM is
injecting a #GP in response.  In other words, the existing uses are only
in code that isn't remotely performance critical.

  hyperv.c: vcpu_debug(vcpu, "hv crash (0x%llx 0x%llx 0x%llx 0x%llx 0x%llx)\n",
  hyperv.c: vcpu_debug(vcpu, "hyper-v reset requested\n");
  x86.c:    vcpu_debug_ratelimited(vcpu, "unhandled wrmsr: 0x%x data 0x%llx\n",
  x86.c:    vcpu_debug_ratelimited(vcpu, "unhandled rdmsr: 0x%x\n",

pr_debug does have more direct uses, notably in nested VMX and KVM TSC
handling.  Similar to the above vcpu_debug case, the nVMX uses are all
failing paths and not performance critical.  The TSC code does have one
path that may affect performance (get_kvmclock_ns()->kvm_get_time_scale()),
but I don't think that should be considered as setting the precedent.  In
fact, it may make sense to convert the TSC pr_debugs to be gated by

Paolo, do you have any thoughts?

      parent reply	other threads:[~2019-05-10 17:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-09 10:47 Yi Wang
2019-05-09 20:20 ` Sean Christopherson
     [not found]   ` <>
2019-05-10 17:49     ` Sean Christopherson [this message]

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:

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

  git send-email \ \ \ \ \ \ \ \ \ \ \ \ \
    --subject='Re: [PATCH v2] [next] KVM: lapic: allow set apic debug dynamically' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).