mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Yi Wang <wang.yi59@zte.com.cn>
To: pbonzini@redhat.com
Cc: rkrcmar@redhat.com, tglx@linutronix.de, mingo@redhat.com,
	bp@alien8.de, hpa@zytor.com, x86@kernel.org, kvm@vger.kernel.org,
	linux-kernel@vger.kernel.org, xue.zhihong@zte.com.cn,
	wang.yi59@zte.com.cn, up2wing@gmail.com, wang.liang82@zte.com.cn
Subject: [PATCH 2/4] kvm: x86: allow set apic and ioapic debug dynamically
Date: Mon, 1 Jul 2019 14:21:09 +0800	[thread overview]
Message-ID: <1561962071-25974-3-git-send-email-wang.yi59@zte.com.cn> (raw)
In-Reply-To: <1561962071-25974-1-git-send-email-wang.yi59@zte.com.cn>

There are two *_debug() macros in kvm apic source file:
- ioapic_debug, which is disable using #if 0
- apic_debug, which is commented

Maybe it's better to control these two macros using CONFIG_KVM_DEBUG,
which can be set in make menuconfig.

Signed-off-by: Yi Wang <wang.yi59@zte.com.cn>
---
 arch/x86/kvm/ioapic.c | 2 +-
 arch/x86/kvm/lapic.c  | 5 ++++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kvm/ioapic.c b/arch/x86/kvm/ioapic.c
index 1add1bc..8099253 100644
--- a/arch/x86/kvm/ioapic.c
+++ b/arch/x86/kvm/ioapic.c
@@ -45,7 +45,7 @@
 #include "lapic.h"
 #include "irq.h"
 
-#if 0
+#ifdef CONFIG_KVM_DEBUG
 #define ioapic_debug(fmt,arg...) printk(KERN_WARNING fmt,##arg)
 #else
 #define ioapic_debug(fmt, arg...)
diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
index 4924f83..dfff5c6 100644
--- a/arch/x86/kvm/lapic.c
+++ b/arch/x86/kvm/lapic.c
@@ -54,8 +54,11 @@
 #define PRIu64 "u"
 #define PRIo64 "o"
 
-/* #define apic_debug(fmt,arg...) printk(KERN_WARNING fmt,##arg) */
+#ifdef CONFIG_KVM_DEBUG
+#define apic_debug(fmt,arg...) printk(KERN_WARNING fmt,##arg)
+#else
 #define apic_debug(fmt, arg...) do {} while (0)
+#endif
 
 /* 14 is the version for Xeon and Pentium 8.4.8*/
 #define APIC_VERSION			(0x14UL | ((KVM_APIC_LVT_NUM - 1) << 16))
-- 
1.8.3.1


  parent reply	other threads:[~2019-07-01  6:23 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-01  6:21 [PATCH 0/4] kvm: x86: introduce CONFIG_KVM_DEBUG Yi Wang
2019-07-01  6:21 ` [PATCH 1/4] kvm: x86: Add CONFIG_KVM_DEBUG Yi Wang
2019-07-01  6:21 ` Yi Wang [this message]
2019-07-03 16:23   ` [PATCH 2/4] kvm: x86: allow set apic and ioapic debug dynamically Paolo Bonzini
2019-07-03 16:27     ` Liran Alon
2019-07-01  6:21 ` [PATCH 3/4] kvm: x86: replace MMU_DEBUG with CONFIG_KVM_DEBUG Yi Wang
2019-07-01  6:21 ` [PATCH 4/4] kvm: x86: convert TSC pr_debugs to be gated by CONFIG_KVM_DEBUG Yi Wang
2019-07-03 16:25   ` Paolo Bonzini
2019-07-03 16:26 ` [PATCH 0/4] kvm: x86: introduce CONFIG_KVM_DEBUG Paolo Bonzini
     [not found] <201907041000221336892@zte.com.cn>
2019-07-04 12:21 ` [PATCH 2/4] kvm: x86: allow set apic and ioapic debug dynamically 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=1561962071-25974-3-git-send-email-wang.yi59@zte.com.cn \
    --to=wang.yi59@zte.com.cn \
    --cc=bp@alien8.de \
    --cc=hpa@zytor.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=rkrcmar@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=up2wing@gmail.com \
    --cc=wang.liang82@zte.com.cn \
    --cc=x86@kernel.org \
    --cc=xue.zhihong@zte.com.cn \
    /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

all inboxes | Powered by JetHome®