lkml.org 
[lkml]   [2021]   [Jan]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] KVM: x86/mmu: improve robustness of some functions
From
Date
On 25/01/21 10:54, Vitaly Kuznetsov wrote:
>
> What if we do something like (completely untested):
>
> diff --git a/arch/x86/kvm/mmu/mmu_internal.h b/arch/x86/kvm/mmu/mmu_internal.h
> index bfc6389edc28..5ec15e4160b1 100644
> --- a/arch/x86/kvm/mmu/mmu_internal.h
> +++ b/arch/x86/kvm/mmu/mmu_internal.h
> @@ -12,7 +12,7 @@
> extern bool dbg;
>
> #define pgprintk(x...) do { if (dbg) printk(x); } while (0)
> -#define rmap_printk(x...) do { if (dbg) printk(x); } while (0)
> +#define rmap_printk(fmt, args...) do { if (dbg) printk("%s: " fmt, __func__, ## args); } while (0)
> #define MMU_WARN_ON(x) WARN_ON(x)
> #else
> #define pgprintk(x...) do { } while (0)
>
> and eliminate the need to pass '__func__,' explicitly? We can probably
> do the same to pgprintk().

Nice indeed. Though I wonder if anybody has ever used these. For those
that I actually needed in the past I created tracepoints instead.

Paolo

\
 
 \ /
  Last update: 2021-01-25 11:04    [W:0.075 / U:1.344 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site