All of lore.kernel.org
 help / color / mirror / Atom feed
From: Josh Poimboeuf <jpoimboe@redhat.com>
To: Sathvika Vasireddy <sv@linux.ibm.com>
Cc: peterz@infradead.org, linux-kernel@vger.kernel.org,
	rostedt@goodmis.org, aik@ozlabs.ru,
	naveen.n.rao@linux.vnet.ibm.com, linuxppc-dev@lists.ozlabs.org
Subject: Re: [RFC PATCH 0/3] objtool: Add mcount sub-command
Date: Fri, 18 Mar 2022 18:35:36 -0700	[thread overview]
Message-ID: <20220319013536.v2syx2ru7ijuvw23@treble> (raw)
In-Reply-To: <20220318105140.43914-1-sv@linux.ibm.com>

On Fri, Mar 18, 2022 at 04:21:37PM +0530, Sathvika Vasireddy wrote:
> This patchset adds support to implement 'objtool mcount' command.
> 
> Right now, objtool is built if CONFIG_STACK_VALIDATION is enabled.
> And, '__mcount_loc' section is generated by objtool when --mcount 
> option is passed to check sub-command. 
> 
> For architectures to be able to generate '__mcount_loc' section
> without having to do stack validation, introduce 'mcount' as
> a sub-command to objtool. This way, objtool is built for mcount 
> if CONFIG_FTRACE_MCOUNT_USE_OBJTOOL is enabled. Additionally, 
> architectures can select HAVE_NOP_MCOUNT to be able to nop out
> mcount call sites.  
> 
> TODO: Enable "objtool mcount" for clang LTO builds.
> 
> Sathvika Vasireddy (3):
>   objtool: Move common code to utils.c
>   objtool: Enable and implement 'mcount' subcommand
>   objtool/mcount: Add powerpc specific functions

Hi Sathvika,

Thanks for the patches!

I have some other patches in progress which will rework the objtool
interface by modularizing the cmdline options, so that each option can
be specified either individually or in combination.  Even stack
validation itself will be its own separate option.

I think it will help your situation as well: "objtool run --mcount" will
only do '__mcount_loc' generation and nothing else.

Something like so:

$ ./objtool run --help

 Usage: objtool run [<options>] file.o

Commands (at least one required):
    -a, --uaccess         validate uaccess
    -c, --static-call     annotate static calls
    -i, --ibt             validate and annotate IBT
    -m, --mcount          generate '__mcount_loc' section
    -n, --noinstr         validate noinstr
    -o, --orc             generate ORC metadata
    -r, --retpoline       validate retpoline usage
    -S, --sls             validate straight-line-speculation mitigation
    -s, --stack-val       validate stack metadata

Options:
        --backtrace       unwind on error
        --backup          create .orig files before modification
        --dry-run         don't write the modifications
        --fp              object uses frame pointers
        --module          object will be part of a kernel module
        --no-unreachable  skip 'unreachable instruction' warnings
        --stats           print statistics
        --vmlinux         object is vmlinux.o


Hopefully I'll have the patches ready soon.

-- 
Josh


WARNING: multiple messages have this Message-ID (diff)
From: Josh Poimboeuf <jpoimboe@redhat.com>
To: Sathvika Vasireddy <sv@linux.ibm.com>
Cc: linuxppc-dev@lists.ozlabs.org, peterz@infradead.org,
	linux-kernel@vger.kernel.org, aik@ozlabs.ru, mpe@ellerman.id.au,
	rostedt@goodmis.org, naveen.n.rao@linux.vnet.ibm.com
Subject: Re: [RFC PATCH 0/3] objtool: Add mcount sub-command
Date: Fri, 18 Mar 2022 18:35:36 -0700	[thread overview]
Message-ID: <20220319013536.v2syx2ru7ijuvw23@treble> (raw)
In-Reply-To: <20220318105140.43914-1-sv@linux.ibm.com>

On Fri, Mar 18, 2022 at 04:21:37PM +0530, Sathvika Vasireddy wrote:
> This patchset adds support to implement 'objtool mcount' command.
> 
> Right now, objtool is built if CONFIG_STACK_VALIDATION is enabled.
> And, '__mcount_loc' section is generated by objtool when --mcount 
> option is passed to check sub-command. 
> 
> For architectures to be able to generate '__mcount_loc' section
> without having to do stack validation, introduce 'mcount' as
> a sub-command to objtool. This way, objtool is built for mcount 
> if CONFIG_FTRACE_MCOUNT_USE_OBJTOOL is enabled. Additionally, 
> architectures can select HAVE_NOP_MCOUNT to be able to nop out
> mcount call sites.  
> 
> TODO: Enable "objtool mcount" for clang LTO builds.
> 
> Sathvika Vasireddy (3):
>   objtool: Move common code to utils.c
>   objtool: Enable and implement 'mcount' subcommand
>   objtool/mcount: Add powerpc specific functions

Hi Sathvika,

Thanks for the patches!

I have some other patches in progress which will rework the objtool
interface by modularizing the cmdline options, so that each option can
be specified either individually or in combination.  Even stack
validation itself will be its own separate option.

I think it will help your situation as well: "objtool run --mcount" will
only do '__mcount_loc' generation and nothing else.

Something like so:

$ ./objtool run --help

 Usage: objtool run [<options>] file.o

Commands (at least one required):
    -a, --uaccess         validate uaccess
    -c, --static-call     annotate static calls
    -i, --ibt             validate and annotate IBT
    -m, --mcount          generate '__mcount_loc' section
    -n, --noinstr         validate noinstr
    -o, --orc             generate ORC metadata
    -r, --retpoline       validate retpoline usage
    -S, --sls             validate straight-line-speculation mitigation
    -s, --stack-val       validate stack metadata

Options:
        --backtrace       unwind on error
        --backup          create .orig files before modification
        --dry-run         don't write the modifications
        --fp              object uses frame pointers
        --module          object will be part of a kernel module
        --no-unreachable  skip 'unreachable instruction' warnings
        --stats           print statistics
        --vmlinux         object is vmlinux.o


Hopefully I'll have the patches ready soon.

-- 
Josh


  parent reply	other threads:[~2022-03-19  1:37 UTC|newest]

Thread overview: 60+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-18 10:51 [RFC PATCH 0/3] objtool: Add mcount sub-command Sathvika Vasireddy
2022-03-18 10:51 ` Sathvika Vasireddy
2022-03-18 10:51 ` [RFC PATCH 1/3] objtool: Move common code to utils.c Sathvika Vasireddy
2022-03-18 10:51   ` Sathvika Vasireddy
2022-03-23 18:02   ` Miroslav Benes
2022-03-23 18:02     ` Miroslav Benes
2022-03-18 10:51 ` [RFC PATCH 2/3] objtool: Enable and implement 'mcount' subcommand Sathvika Vasireddy
2022-03-18 10:51   ` Sathvika Vasireddy
2022-03-21  7:06   ` Christophe Leroy
2022-03-21  8:19     ` Naveen N. Rao
2022-03-21  8:19       ` Naveen N. Rao
2022-03-21  8:26       ` Christophe Leroy
2022-03-21  8:26         ` Christophe Leroy
2022-03-21  9:48         ` Naveen N. Rao
2022-03-21  9:48           ` Naveen N. Rao
2022-03-18 10:51 ` [RFC PATCH 3/3] objtool/mcount: Add powerpc specific functions Sathvika Vasireddy
2022-03-18 10:51   ` Sathvika Vasireddy
2022-03-18 12:26   ` Peter Zijlstra
2022-03-18 12:26     ` Peter Zijlstra
2022-03-18 13:59     ` Christophe Leroy
2022-03-18 13:59       ` Christophe Leroy
2022-03-21  2:27       ` Michael Ellerman
2022-03-21  6:47         ` Christophe Leroy
2022-03-21  7:46         ` Christophe Leroy
2022-03-21  7:56         ` Christophe Leroy
2022-03-21  8:30           ` Christophe Leroy
2022-03-21  8:59             ` Christophe Leroy
2022-03-26  7:58           ` Christophe Leroy
2022-03-26  7:58             ` Christophe Leroy
2022-03-21  6:25     ` Naveen N. Rao
2022-03-21  6:25       ` Naveen N. Rao
2022-03-27  9:09     ` Christophe Leroy
2022-03-27  9:09       ` Christophe Leroy
2022-03-28 19:59       ` Josh Poimboeuf
2022-03-28 19:59         ` Josh Poimboeuf
2022-03-28 20:14         ` Peter Zijlstra
2022-03-28 20:14           ` Peter Zijlstra
2022-03-28 20:15           ` Peter Zijlstra
2022-03-28 20:15             ` Peter Zijlstra
2022-03-28 20:21           ` Josh Poimboeuf
2022-03-28 20:21             ` Josh Poimboeuf
2022-03-29 12:01         ` Michael Ellerman
2022-03-29 12:01           ` Michael Ellerman
2022-03-29 17:32           ` Christophe Leroy
2022-03-30  4:26             ` Josh Poimboeuf
2022-03-30  4:26               ` Josh Poimboeuf
2022-03-30 18:40             ` Naveen N. Rao
2022-03-30 18:40               ` Naveen N. Rao
2022-05-12 14:52         ` Christophe Leroy
2022-05-12 14:52           ` Christophe Leroy
2022-05-12 15:12           ` Josh Poimboeuf
2022-05-12 15:12             ` Josh Poimboeuf
2022-05-21  9:38             ` Christophe Leroy
2022-05-21  9:38               ` Christophe Leroy
2022-05-21 10:57               ` Peter Zijlstra
2022-05-21 10:57                 ` Peter Zijlstra
2022-05-23  5:39                 ` Naveen N. Rao
2022-05-23  5:39                   ` Naveen N. Rao
2022-03-19  1:35 ` Josh Poimboeuf [this message]
2022-03-19  1:35   ` [RFC PATCH 0/3] objtool: Add mcount sub-command Josh Poimboeuf

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=20220319013536.v2syx2ru7ijuvw23@treble \
    --to=jpoimboe@redhat.com \
    --cc=aik@ozlabs.ru \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=naveen.n.rao@linux.vnet.ibm.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=sv@linux.ibm.com \
    /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.