Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3377571yba; Mon, 6 May 2019 23:37:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqxziKwSwjRMb/vNruLxaJLNLE9mchWeO65G4V7CT3Mj1BuLMb6NgMetgWFI+vxQAswo1PmJ X-Received: by 2002:a62:6444:: with SMTP id y65mr31118491pfb.148.1557211022388; Mon, 06 May 2019 23:37:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557211022; cv=none; d=google.com; s=arc-20160816; b=M5LEydXoVLqOiMbId+Km4czuSdZkHku2huJI8zv2cV722Mlvrg5idtkSuh54tk3yXi o2tofo5T9ZiQur61BxjvA4iV1025kEkYYGp8IqhZoRQH5IbkwUsuMlnAO2OV/GhA6WzU bdP34Lkw9dvpkO8B1OJMy4hGTpZDHwJ6tgdB1LyMwin+QugUksy76epxlVQVAJm7Tqk+ 84z82Z67aoVtcLtBT5437ROl2nBX23QYJ0B3mBCng2SSsI40SVwZPhu2bK8fXYzAunZU cCD8De95LjpGo48Z8dxP3stmtx9dhyMdKNgiE3VQLS5FX4cG+80OgG+hsMO+5KWKuFgQ 0hGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=jKb1FjSdWcmcwNKIIJb76Vebn1xUDLYVYGJdfplsk2E=; b=tz7+TgCcd2g2vNxGFba604kpmTyFgoY9mJYQkywe4rNhRxytWaDbFLcjyi/nExy/Qm Tau6DGMQxJ8zDUH9KGTOfXdqoEPBS8gDBQnqd59YaCzPDzXBX+qOdEtuICQEnEwpoe0C Ud9MQi6v69oPotY/eR0mfTZSaS6QXMwMLzmPDdwDpSGLBDRj79CGaI2/ggURoII7R1kZ PmplqPlAuvjAC5EUwdKHA0IKyVy9ysK/9WsIHYubuz/cncburJFiQtuTDHCLZfnXCeOB Msl5zAny2MsU37uJjVvGPSyI9e1lxI1GPpWOIV4gg1ndSs6FhrpAD/ysBNq2ZygpjIUP D2Lw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z23si17674578pfa.277.2019.05.06.23.36.47; Mon, 06 May 2019 23:37:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726833AbfEGGfw (ORCPT + 99 others); Tue, 7 May 2019 02:35:52 -0400 Received: from mxhk.zte.com.cn ([63.217.80.70]:41708 "EHLO mxhk.zte.com.cn" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726313AbfEGGfw (ORCPT ); Tue, 7 May 2019 02:35:52 -0400 Received: from mse-fl1.zte.com.cn (unknown [10.30.14.238]) by Forcepoint Email with ESMTPS id 2B8AFE1BE5E61E24B8E3; Tue, 7 May 2019 14:35:50 +0800 (CST) Received: from notes_smtp.zte.com.cn ([10.30.1.239]) by mse-fl1.zte.com.cn with ESMTP id x476ZbcW041399; Tue, 7 May 2019 14:35:37 +0800 (GMT-8) (envelope-from wang.yi59@zte.com.cn) Received: from fox-host8.localdomain ([10.74.120.8]) by szsmtp06.zte.com.cn (Lotus Domino Release 8.5.3FP6) with ESMTP id 2019050714354990-10077385 ; Tue, 7 May 2019 14:35:49 +0800 From: Yi Wang 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, wang.yi59@zte.com.cn Subject: [PATCH] [next] KVM: lapic: allow setting apic debug dynamically Date: Tue, 7 May 2019 14:37:33 +0800 Message-Id: <1557211053-17275-1-git-send-email-wang.yi59@zte.com.cn> X-Mailer: git-send-email 1.8.3.1 X-MIMETrack: Itemize by SMTP Server on SZSMTP06/server/zte_ltd(Release 8.5.3FP6|November 21, 2013) at 2019-05-07 14:35:49, Serialize by Router on notes_smtp/zte_ltd(Release 9.0.1FP7|August 17, 2016) at 2019-05-07 14:35:32, Serialize complete at 2019-05-07 14:35:32 X-MAIL: mse-fl1.zte.com.cn x476ZbcW041399 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org There are many functions invoke apic_debug(), which is defined as a null function by default, and that's incovenient for debuging lapic. This patch allows setting apic debug according to add a apic_dbg parameter of kvm. Signed-off-by: Yi Wang --- arch/x86/kvm/lapic.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c index 9bf70cf..4d8f10f 100644 --- a/arch/x86/kvm/lapic.c +++ b/arch/x86/kvm/lapic.c @@ -54,8 +54,13 @@ #define PRIu64 "u" #define PRIo64 "o" +static int apic_dbg; +module_param(apic_dbg, bool, 0644); + /* #define apic_debug(fmt,arg...) printk(KERN_WARNING fmt,##arg) */ -#define apic_debug(fmt, arg...) do {} while (0) +#define apic_debug(fmt, arg...) do { if (apic_dbg) \ + printk(KERN_DEBUG fmt, ##arg); \ +} while (0) /* 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