From: Peter Zijlstra <peterz@infradead.org>
To: Christophe Leroy <christophe.leroy@csgroup.eu>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>,
Jiri Kosina <jikos@kernel.org>, Miroslav Benes <mbenes@suse.cz>,
Petr Mladek <pmladek@suse.com>,
Joe Lawrence <joe.lawrence@redhat.com>,
Michael Ellerman <mpe@ellerman.id.au>,
Benjamin Herrenschmidt <benh@kernel.crashing.org>,
Paul Mackerras <paulus@samba.org>,
Heiko Carstens <hca@linux.ibm.com>,
Vasily Gorbik <gor@linux.ibm.com>,
Alexander Gordeev <agordeev@linux.ibm.com>,
Christian Borntraeger <borntraeger@linux.ibm.com>,
Sven Schnelle <svens@linux.ibm.com>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
Dave Hansen <dave.hansen@linux.intel.com>,
"H. Peter Anvin" <hpa@zytor.com>,
linux-kernel@vger.kernel.org, live-patching@vger.kernel.org,
linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org,
x86@kernel.org, Steven Rostedt <rostedt@goodmis.org>
Subject: Re: [PATCH] livepatch: Remove klp_arch_set_pc() and asm/livepatch.h
Date: Mon, 28 Mar 2022 12:23:42 +0200 [thread overview]
Message-ID: <20220328102342.GW8939@worktop.programming.kicks-ass.net> (raw)
In-Reply-To: <e029c7cfde436f6bbf99148ab14dc2da99add503.1648447981.git.christophe.leroy@csgroup.eu>
On Mon, Mar 28, 2022 at 08:26:48AM +0200, Christophe Leroy wrote:
> All three versions of klp_arch_set_pc() do exactly the same: they
> call ftrace_instruction_pointer_set().
>
> Call ftrace_instruction_pointer_set() directly and remove
> klp_arch_set_pc().
>
> As klp_arch_set_pc() was the only thing remaining in asm/livepatch.h
> on x86 and s390, remove asm/livepatch.h
>
> livepatch.h remains on powerpc but its content is exclusively used
> by powerpc specific code.
The only remaining thing seems to be a klp_init_thread_info() for ppc64,
but yeah..
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
> diff --git a/kernel/livepatch/patch.c b/kernel/livepatch/patch.c
> index c172bf92b576..4c4f5a776d80 100644
> --- a/kernel/livepatch/patch.c
> +++ b/kernel/livepatch/patch.c
> @@ -118,7 +118,7 @@ static void notrace klp_ftrace_handler(unsigned long ip,
> if (func->nop)
> goto unlock;
>
> - klp_arch_set_pc(fregs, (unsigned long)func->new_func);
> + ftrace_instruction_pointer_set(fregs, (unsigned long)func->new_func);
>
> unlock:
> ftrace_test_recursion_unlock(bit);
So ptrace has instruction_pointer_set(), I'm not sure why we have yet
another variant in the ftrace_ namespace. Perhaps also delete that?
next prev parent reply other threads:[~2022-03-28 10:24 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-28 6:26 [PATCH] livepatch: Remove klp_arch_set_pc() and asm/livepatch.h Christophe Leroy
2022-03-28 10:23 ` Peter Zijlstra [this message]
2022-03-29 10:46 ` Miroslav Benes
2022-03-29 11:22 ` Petr Mladek
2022-05-23 6:51 ` Christophe Leroy
2022-05-23 15:15 ` Petr Mladek
2022-06-02 12:50 ` Christophe Leroy
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=20220328102342.GW8939@worktop.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=agordeev@linux.ibm.com \
--cc=benh@kernel.crashing.org \
--cc=borntraeger@linux.ibm.com \
--cc=bp@alien8.de \
--cc=christophe.leroy@csgroup.eu \
--cc=dave.hansen@linux.intel.com \
--cc=gor@linux.ibm.com \
--cc=hca@linux.ibm.com \
--cc=hpa@zytor.com \
--cc=jikos@kernel.org \
--cc=joe.lawrence@redhat.com \
--cc=jpoimboe@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=live-patching@vger.kernel.org \
--cc=mbenes@suse.cz \
--cc=mingo@redhat.com \
--cc=mpe@ellerman.id.au \
--cc=paulus@samba.org \
--cc=pmladek@suse.com \
--cc=rostedt@goodmis.org \
--cc=svens@linux.ibm.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