lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20190509201959.GA12810@linux.intel.com>
Date:   Thu, 9 May 2019 13:20:00 -0700
From:   Sean Christopherson <sean.j.christopherson@...el.com>
To:     Yi Wang <wang.yi59@....com.cn>
Cc:     pbonzini@...hat.com, rkrcmar@...hat.com, tglx@...utronix.de,
        mingo@...hat.com, bp@...en8.de, hpa@...or.com, x86@...nel.org,
        kvm@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] [next] KVM: lapic: allow set apic debug dynamically

On Thu, May 09, 2019 at 06:47:57PM +0800, Yi Wang wrote:
> There are many functions invoke apic_debug(), which is defined
> 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 <wang.yi59@....com.cn>
> ---
> v2: change apic_dbg to bool and tag __read_mostly. Thanks to Sean.
> 
>  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..0827e7c 100644
> --- a/arch/x86/kvm/lapic.c
> +++ b/arch/x86/kvm/lapic.c
> @@ -54,8 +54,13 @@
>  #define PRIu64 "u"
>  #define PRIo64 "o"
>  
> +static bool apic_dbg __read_mostly;
> +module_param(apic_dbg, bool, 0644);

Probably don't need to shorten "debug".

> +
>  /* #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)

Pulling in your comment regarding sched_debug and noirqdebug...

On Thu, May 09, 2019 at 08:29:38AM +0800, wang.yi59@....com.cn wrote:
> Also, we have some similar parameters already, such like sched_debug,
> noirqdebug :)

The IRQ debug hook is a completely different beast than the APIC debug
messages.

sched_debug is a much better comparison.  The param only exists if
CONFIG_SCHED_DEBUG=y, which is "default y" but "depends on DEBUG_KERNEL".
That seems like the route to go if we want the ability to toggle APIC
debugging at runtime.  And if we go with an all encompassing config,
e.g. CONFIG_KVM_DEBUG, we can use it to wrap x86/mmu.c's debug param as
well (and rename it to mmu_debug).

>  
>  /* 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
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ