mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@alien8.de>
To: Chen Yucong <slaoub@gmail.com>
Cc: mingo@kernel.org, tglx@linutronix.de, hpa@zytor.com,
	x86@kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] x86/kernel: use pr_<level>() and dev_<level>
Date: Sun, 14 Feb 2016 15:08:08 +0100	[thread overview]
Message-ID: <20160214140808.GB32622@pd.tnic> (raw)
In-Reply-To: <1455423047-8571-1-git-send-email-slaoub@gmail.com>

On Sun, Feb 14, 2016 at 12:10:47PM +0800, Chen Yucong wrote:
> arch/x86/kernel/* use a mixture of printk(KERN_<level> ) and pr_<level>().
> This patch converts the bulk of printk(KERN_<level> ) to pr_<level>() and
> uses dev_dbg() instead of the dev_printk(KERN_DEBUG,). All pr_warning()
> calls have been replaced with pr_warn().
> 
> Not sure what to do about the printk(KERN_DEFAULT) and printk() without a
> log level.

...

> diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c
> index 25f9093..0ecb579 100644
> --- a/arch/x86/kernel/alternative.c
> +++ b/arch/x86/kernel/alternative.c
> @@ -59,7 +59,7 @@ __setup("noreplace-paravirt", setup_noreplace_paravirt);
>  #define DPRINTK(fmt, args...)						\
>  do {									\
>  	if (debug_alternative)						\
> -		printk(KERN_DEBUG "%s: " fmt "\n", __func__, ##args);	\
> +		pr_debug("%s: " fmt "\n", __func__, ##args);	\
>  } while (0)
>  
>  #define DUMP_BYTES(buf, len, fmt, args...)				\
> @@ -70,10 +70,10 @@ do {									\
>  		if (!(len))						\
>  			break;						\
>  									\
> -		printk(KERN_DEBUG fmt, ##args);				\
> +		pr_debug(fmt, ##args);				\
>  		for (j = 0; j < (len) - 1; j++)				\
> -			printk(KERN_CONT "%02hhx ", buf[j]);		\
> -		printk(KERN_CONT "%02hhx\n", buf[j]);			\
> +			pr_cont("%02hhx ", buf[j]);		\
> +		pr_cont("%02hhx\n", buf[j]);			\
>  	}								\
>  } while (0)
>  

NAK the hell out of that hunk!

Did you actually look at how pr_debug() is defined?

Yeah, I don't think so. With your change, when I boot with
"debug-alternative" I get:

...
[    0.064005] Last level dTLB entries: 4KB 512, 2MB 255, 4MB 127, 1GB 0
[    0.068005] e9 d5 3e d3 00
[    0.072004] e9 e8 92 21 ff
[    0.075003] eb 11 0f 1f 00
[    0.077906] e8 c5 b6 30 00
[    0.084009] f3 48 0f b8 c7
[    0.091241] f3 48 0f b8 c7
[    0.094259] e8 d9 b5 30 00
[    0.097611] f3 48 0f b8 c7
[    0.100004] f3 48 0f b8 c7
[    0.103067] 90 90 90
[    0.105575] 0f ae f0
[    0.108004] 0f ae f0
[    0.112007] 90 90 90
[    0.114331] 0f ae f0
[    0.116004] 0f ae f0
[    0.118365] e8 07 21 62 ff

How is that useful?!

Please stop for a second with those senseless conversions and think
first. Try the change you're doing in kvm, take a look at what it
affects and think hard whether it makes any sense at all. Only if it
does, *then* send out the patch.

I'm willing to bet that *all* pr_debug* conversions below are wrong too.

Geez :(

-- 
Regards/Gruss,
    Boris.

ECO tip #101: Trim your mails when you reply.

  parent reply	other threads:[~2016-02-14 14:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-14  4:10 Chen Yucong
2016-02-14  4:22 ` kbuild test robot
2016-02-14  5:07 ` kbuild test robot
2016-02-14 14:08 ` Borislav Petkov [this message]
2016-02-16  8:24   ` Ingo Molnar
2016-02-16  9:01     ` Borislav Petkov

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=20160214140808.GB32622@pd.tnic \
    --to=bp@alien8.de \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=slaoub@gmail.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /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®