All of lore.kernel.org
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@alien8.de>
To: Joe Perches <joe@perches.com>
Cc: Jiri Kosina <trivial@kernel.org>, Tony Luck <tony.luck@intel.com>,
	Jeff Dike <jdike@addtoit.com>,
	Richard Weinberger <richard@nod.at>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
	x86@kernel.org, linux-edac@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	user-mode-linux-devel@lists.sourceforge.net,
	user-mode-linux-user@lists.sourceforge.net
Subject: Re: [TRIVIAL PATCH 16/26] x86: Convert print_symbol to %pSR
Date: Wed, 12 Dec 2012 22:48:58 +0100	[thread overview]
Message-ID: <20121212214858.GI8760@liondog.tnic> (raw)
In-Reply-To: <1355347803.8538.16.camel@joe-AO722>

On Wed, Dec 12, 2012 at 01:30:03PM -0800, Joe Perches wrote:
> > I think I'd go ahead and ACK this unless Tony has some comments. I'm
> > not happy about the two pr_emerg calls based on the conditional.
>
> It was done to avoid interleaving.

Right.

> > Or, Tony, what do you think, could we get away if we printed empty
> > string for when m->cs != __KERNEL_CS? I'm thinking of not breaking any
> > userspace which is parsing that output and seeing "... {}" in that case.
> > 
> > This assumes that vsprintf can print (void *)0 when passed as an
> > argument through %pSR. Joe?
> 
> Definitely yes when not #defined CONFIG_KALLSYMS
> 
> I believe no object exists at address 0 for all
> arches so I believe yes for CONFIG_KALLSYMS too,

Ok, here's what I'm thinking more specifically. Have single call like this:

	pr_emerg(HW_ERR "RIP%s %02x:<%016Lx> {%pSR}\n",
			!(m->mcgstatus & MCG_STATUS_EIPV) ? " !INEXACT!" : "",
			m->cs, m->ip,
			(m->cs == __KERNEL_CS) ? (void *)m->ip : (void *)0);

and when vsprintf gets to it, it recognizes the special case of
(void *)0 and dumps the empty string "" for that argument.

Hmm.

> My preference is to eventually do away with all the
> 	"[%0(size)lx] %pSR", addr, (void *)addr
> uses and create another %pSx that emits the pointer
> address and the function/offset in one go in a
> standardized style without caring about the pointer
> size.
> 
> Something like:
> 
> 	"%pSp", (void *)addr
> 
> would emit
> 
> 	[<7def0123>] function_name+offset/size

Right, this is another way of looking it. And in order to make it more
robust, it should be able to handle the (void *)0 case so that callers
don't have to check the arg.

Thanks.

-- 
Regards/Gruss,
    Boris.

Sent from a fat crate under my desk. Formatting is fine.
--

  reply	other threads:[~2012-12-12 21:48 UTC|newest]

Thread overview: 86+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-12 18:18 [Cluster-devel] [TRIVIAL PATCH 00/26] treewide: Add and use vsprintf extension %pSR Joe Perches
2012-12-12 18:18 ` Joe Perches
2012-12-12 18:18 ` Joe Perches
2012-12-12 18:18 ` Joe Perches
2012-12-12 18:18 ` Joe Perches
2012-12-12 18:18 ` Joe Perches
2012-12-12 18:18 ` Joe Perches
2012-12-12 18:18 ` [TRIVIAL PATCH 01/26] vsprintf: Add extension %pSR - print_symbol replacement Joe Perches
2012-12-12 18:18 ` [TRIVIAL PATCH 02/26] alpha: Convert print_symbol to %pSR Joe Perches
2012-12-12 18:18 ` [TRIVIAL PATCH 03/26] arm: " Joe Perches
2012-12-12 18:18   ` Joe Perches
2012-12-12 18:18 ` [TRIVIAL PATCH 04/26] arm64: " Joe Perches
2012-12-12 18:18   ` Joe Perches
2012-12-13 18:03   ` Catalin Marinas
2012-12-13 18:03     ` Catalin Marinas
2012-12-12 18:18 ` [TRIVIAL PATCH 05/26] avr32: " Joe Perches
2012-12-12 18:18 ` [TRIVIAL PATCH 06/26] c6x: " Joe Perches
2012-12-12 18:18 ` [TRIVIAL PATCH 07/26] ia64: " Joe Perches
2012-12-12 18:18   ` Joe Perches
2012-12-12 18:18 ` [TRIVIAL PATCH 08/26] m32r: " Joe Perches
2012-12-13  3:06   ` Hirokazu Takata
2013-04-29 13:21     ` Jiri Kosina
2013-04-30 12:56       ` Joe Perches
2013-04-30 21:11         ` Jiri Kosina
2012-12-12 18:18 ` [TRIVIAL PATCH 09/26] mn10300: " Joe Perches
2012-12-12 18:18 ` [TRIVIAL PATCH 10/26] openrisc: " Joe Perches
2012-12-12 18:19 ` [TRIVIAL PATCH 11/26] powerpc: " Joe Perches
2012-12-12 18:19   ` Joe Perches
2012-12-13 11:58   ` Arnd Bergmann
2012-12-13 11:58     ` Arnd Bergmann
2013-01-10  5:48     ` Benjamin Herrenschmidt
2013-01-10  5:48       ` Benjamin Herrenschmidt
2013-01-10 17:00       ` Joe Perches
2013-01-10 17:00         ` Joe Perches
2012-12-12 18:19 ` [TRIVIAL PATCH 12/26] s390: " Joe Perches
2012-12-13  1:22   ` Joe Perches
2012-12-12 18:19 ` [TRIVIAL PATCH 13/26] sh: " Joe Perches
2012-12-12 18:19   ` Joe Perches
2012-12-12 18:19 ` [TRIVIAL PATCH 14/26] um: " Joe Perches
2012-12-12 18:19 ` [TRIVIAL PATCH 15/26] unicore32: " Joe Perches
     [not found]   ` <001d01cdd8cd$371dfd60$a559f820$@mprc.pku.edu.cn>
2012-12-13  1:21     ` 答复: " Joe Perches
2012-12-13  2:00       ` Chen Gang
2012-12-13  2:26     ` Joe Perches
     [not found]   ` <19e6ea369e4455fc447c48f72bd433921bd0a703.1355335228.git.joe@perches.c om>
2012-12-13  5:05     ` guanxuetao
2012-12-12 18:19 ` [TRIVIAL PATCH 16/26] x86: " Joe Perches
2012-12-12 21:09   ` Borislav Petkov
2012-12-12 21:30     ` Joe Perches
2012-12-12 21:48       ` Borislav Petkov [this message]
2012-12-12 21:49       ` Luck, Tony
2012-12-12 22:23         ` Joe Perches
2012-12-12 22:45           ` Borislav Petkov
2012-12-13 18:23             ` Joe Perches
2012-12-13 18:23               ` Joe Perches
2012-12-13 18:37               ` Borislav Petkov
2012-12-13 18:37                 ` Borislav Petkov
2012-12-13 18:42                 ` H. Peter Anvin
2012-12-13 19:05                   ` Borislav Petkov
2012-12-13 21:35                     ` H. Peter Anvin
2012-12-13 18:57                 ` Joe Perches
2012-12-13 18:57                   ` Joe Perches
2012-12-12 18:19 ` [TRIVIAL PATCH 17/26] xtensa: " Joe Perches
2012-12-12 18:19 ` [TRIVIAL PATCH 18/26] drivers: base: " Joe Perches
2012-12-12 18:19 ` [Cluster-devel] [TRIVIAL PATCH 19/26] gfs2: " Joe Perches
2012-12-12 18:19   ` Joe Perches
2012-12-13 10:57   ` [Cluster-devel] " Steven Whitehouse
2012-12-13 10:57     ` Steven Whitehouse
2013-04-29 13:23     ` [Cluster-devel] " Jiri Kosina
2013-04-29 13:23       ` Jiri Kosina
2012-12-12 18:19 ` [TRIVIAL PATCH 20/26] sysfs: " Joe Perches
2012-12-12 18:19 ` [TRIVIAL PATCH 21/26] irq: " Joe Perches
2012-12-12 18:19 ` [TRIVIAL PATCH 22/26] smp_processor_id: " Joe Perches
2012-12-12 18:19 ` [TRIVIAL PATCH 23/26] mm: " Joe Perches
2012-12-12 18:19   ` Joe Perches
2012-12-12 20:08   ` Christoph Lameter
2012-12-12 20:08     ` Christoph Lameter
2013-04-29 13:24     ` Jiri Kosina
2013-04-29 13:24       ` Jiri Kosina
2012-12-12 18:19 ` [TRIVIAL PATCH 24/26] xtensa: " Joe Perches
2012-12-12 18:19 ` [TRIVIAL PATCH 25/26] x86: head_64.S: Use vsprintf extension %pSR not print_symbol Joe Perches
2012-12-12 18:19 ` [TRIVIAL PATCH 26/26] kallsyms: Remove print_symbol Joe Perches
2012-12-12 19:30 ` [TRIVIAL PATCH V2 24/26] Documentation: Convert print_symbol to %pSR Joe Perches
2012-12-13  1:43 ` [TRIVIAL PATCH V2 12/26] s390: " Joe Perches
2012-12-13 19:13 ` [TRIVIAL PATCH V2 16/26] x86: " Joe Perches
2013-01-08  5:52 ` [TRIVIAL PATCH 00/26] treewide: Add and use vsprintf extension %pSR Joe Perches
2013-01-08 20:33   ` Jiri Kosina
2013-02-20  6:00     ` Joe Perches

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=20121212214858.GI8760@liondog.tnic \
    --to=bp@alien8.de \
    --cc=hpa@zytor.com \
    --cc=jdike@addtoit.com \
    --cc=joe@perches.com \
    --cc=linux-edac@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=richard@nod.at \
    --cc=tglx@linutronix.de \
    --cc=tony.luck@intel.com \
    --cc=trivial@kernel.org \
    --cc=user-mode-linux-devel@lists.sourceforge.net \
    --cc=user-mode-linux-user@lists.sourceforge.net \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.