live-patching.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: linux-kernel@vger.kernel.org, Ingo Molnar <mingo@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Miroslav Benes <mbenes@suse.cz>,
	Thomas Gleixner <tglx@linutronix.de>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Josh Poimboeuf <jpoimboe@redhat.com>,
	Jiri Kosina <jikos@kernel.org>,
	live-patching@vger.kernel.org
Subject: Re: [PATCH 3/3 v5] livepatch: Use the default ftrace_ops instead of REGS when ARGS is available
Date: Thu, 12 Nov 2020 12:39:39 +0100	[thread overview]
Message-ID: <20201112113939.GU2651@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <20201112082144.GS2628@hirez.programming.kicks-ass.net>

On Thu, Nov 12, 2020 at 09:21:44AM +0100, Peter Zijlstra wrote:
> Also, do you want something like:
> 
> unsigned long ftrace_regs_get_register(struct ftrace_regs *regs, unsigned int offset)
> {

I forgot the full regs case:

	if (regs->regs.cs)
		return regs_get_register(regs->regs, offset);

> 	switch (offset / sizeof(long)) {
> 	case  4: /* RBP */
> 
> 	case  8: /* R9  */
> 	case  9: /* R8  */
> 	case 10: /* RAX */
> 	case 11: /* RCX */
> 	case 12: /* RDX */
> 	case 13: /* RSI */
> 	case 14: /* RDI */
> 	case 15: /* ORIG_RAX */
> 	case 16: /* RIP */
> 		return *(unsigned long *)regs->regs + offset;
> 
> 	default:
> 		WARN_ON_ONCE(1);
> 	}
> 	return 0;
> }

  reply	other threads:[~2020-11-12 11:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20201112011516.589846126@goodmis.org>
2020-11-12  1:15 ` [PATCH 3/3 v5] livepatch: Use the default ftrace_ops instead of REGS when ARGS is available Steven Rostedt
2020-11-12  8:21   ` Peter Zijlstra
2020-11-12 11:39     ` Peter Zijlstra [this message]
2020-11-12 14:59     ` Steven Rostedt

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=20201112113939.GU2651@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=jikos@kernel.org \
    --cc=jpoimboe@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=live-patching@vger.kernel.org \
    --cc=mbenes@suse.cz \
    --cc=mhiramat@kernel.org \
    --cc=mingo@kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    /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;
as well as URLs for NNTP newsgroup(s).