mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
To: David Miller <davem@davemloft.net>
Cc: a.p.zijlstra@chello.nl, paulus@samba.org, mingo@elte.hu,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] perf: Properly align symbol_conf.priv_size
Date: Tue, 29 Mar 2011 00:07:24 -0300	[thread overview]
Message-ID: <20110329030723.GC19510@ghostprotocols.net> (raw)
In-Reply-To: <20110328.175849.112593455.davem@davemloft.net>

Em Mon, Mar 28, 2011 at 05:58:49PM -0700, David Miller escreveu:
> 
> If symbol_conf.priv_size is not a multiple of "sizeof(u64)" we'll bus
> error on sparc64 in symbol__new because the "struct symbol *" pointer
> is computed by adding symbol_conf.priv_size to the memory allocated.
> 
> We cannot isloate the fix to symbol__new and symbol__delete since the
> private area is computed by subtracting the priv_size value from a
> "struct symbol" pointer, so then the private area can still be
> potentially unaligned.

That is a clever area, aka something that needs some sanitization,
container_of use possibilities...
attempt-possible-to-become-some-sort-of-progress. :-\

Rusty willing, vowel-optmz+=blts words to trow at that...
 
> So, simply align the symbol_conf.priv_size value in symbol__init()
> 
> Signed-off-by: David S. Miller <davem@davemloft.net>
> 
> diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
> index 17df793..76c09099 100644
> --- a/tools/perf/util/symbol.c
> +++ b/tools/perf/util/symbol.c
> @@ -2403,6 +2403,8 @@ int symbol__init(void)
>  	if (symbol_conf.initialized)
>  		return 0;
>  
> +	symbol_conf.priv_size = ALIGN(symbol_conf.priv_size, sizeof(u64));
> +
>  	elf_version(EV_CURRENT);
>  	if (symbol_conf.sort_by_name)
>  		symbol_conf.priv_size += (sizeof(struct symbol_name_rb_node) -

  reply	other threads:[~2011-03-29  3:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-29  0:58 David Miller
2011-03-29  3:07 ` Arnaldo Carvalho de Melo [this message]
2011-03-30  7:17 ` [tip:perf/urgent] perf symbols: " tip-bot for David S. Miller

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=20110329030723.GC19510@ghostprotocols.net \
    --to=acme@ghostprotocols.net \
    --cc=a.p.zijlstra@chello.nl \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=paulus@samba.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

Powered by JetHome