live-patching.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mark Rutland <mark.rutland@arm.com>
To: Jiri Kosina <jikos@kernel.org>
Cc: Arnd Bergmann <arnd@arndb.de>,
	Julien Thierry <julien.thierry@arm.com>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Ard Biesheuvel <ard.biesheuvel@linaro.org>,
	Will Deacon <will.deacon@arm.com>,
	linux-kernel@vger.kernel.org,
	Steven Rostedt <rostedt@goodmis.org>,
	AKASHI Takahiro <takahiro.akashi@linaro.org>,
	Ingo Molnar <mingo@redhat.com>, Torsten Duwe <duwe@lst.de>,
	Ruslan Bilovol <ruslan.bilovol@gmail.com>,
	Josh Poimboeuf <jpoimboe@redhat.com>,
	Amit Daniel Kachhap <amit.kachhap@arm.com>,
	live-patching@vger.kernel.org,
	linux-arm-kernel <linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH v8 0/5] arm64: ftrace with regs
Date: Fri, 18 Oct 2019 18:41:02 +0100	[thread overview]
Message-ID: <20191018174100.GC18838@lakrids.cambridge.arm.com> (raw)
In-Reply-To: <20191016175841.GF46264@lakrids.cambridge.arm.com>

On Wed, Oct 16, 2019 at 06:58:42PM +0100, Mark Rutland wrote:
> I've just done the core (non-arm64) bits today, and pushed that out:
> 
>   https://git.kernel.org/pub/scm/linux/kernel/git/mark/linux.git/log/?h=arm64/ftrace-with-regs
> 
> ... I'll fold the remainging bits of patches 4 and 5 together tomorrow
> atop of that.

I've just force-pushed an updated version with the actual arm64
FTRACE_WITH_REGS bits. There are a couple of bits I still need to
verify, but I'm hoping that I can send this out for real next week.

In the process of reworking this I spotted some issues that will get in
the way of livepatching. Notably:

* When modules can be loaded far away from the kernel, we'll potentially
  need a PLT for each function within a module, if each can be patched
  to a unique function. Currently we have a fixed number, which is only
  sufficient for the two ftrace entry trampolines.

  IIUC, the new code being patched in is itself a module, in which case
  we'd need a PLT for each function in the main kernel image.

  We have a few options here, e.g. changing which memory size model we
  use, or reserving space for a PLT before each function using
  -f patchable-function-entry=N,M.

* There are windows where backtracing will miss the callsite's caller,
  as its address is not live in the LR or existing chain of frame
  records. Thus we cannot claim to have a reliable stacktrace.

  I suspect we'll have to teach the stacktrace code to handle this as a
  special-case.

  I'll try to write these up, as similar probably applies to other
  architectures with a link register.

Thanks,
Mark.

  reply	other threads:[~2019-10-18 17:41 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20190208150826.44EBC68DD2@newverein.lst.de>
     [not found] ` <0f8d2e77-7e51-fba8-b179-102318d9ff84@arm.com>
     [not found]   ` <20190311114945.GA5625@lst.de>
     [not found]     ` <20190408153628.GL6139@lakrids.cambridge.arm.com>
     [not found]       ` <20190409175238.GE9255@fuggles.cambridge.arm.com>
2019-07-10 12:27         ` [PATCH v8 0/5] arm64: ftrace with regs Ruslan Bilovol
2019-07-24 16:15           ` Mark Rutland
2019-10-16 11:42             ` Jiri Kosina
2019-10-16 17:58               ` Mark Rutland
2019-10-18 17:41                 ` Mark Rutland [this message]
2019-10-19 11:01                   ` Torsten Duwe
2019-10-21 11:37                     ` Mark Rutland
2019-10-21 13:20                     ` 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=20191018174100.GC18838@lakrids.cambridge.arm.com \
    --to=mark.rutland@arm.com \
    --cc=amit.kachhap@arm.com \
    --cc=ard.biesheuvel@linaro.org \
    --cc=arnd@arndb.de \
    --cc=catalin.marinas@arm.com \
    --cc=duwe@lst.de \
    --cc=jikos@kernel.org \
    --cc=jpoimboe@redhat.com \
    --cc=julien.thierry@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=live-patching@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=rostedt@goodmis.org \
    --cc=ruslan.bilovol@gmail.com \
    --cc=takahiro.akashi@linaro.org \
    --cc=will.deacon@arm.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 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).