mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Borislav Petkov <bp@alien8.de>
Cc: Juergen Gross <jgross@suse.com>,
	linux-kernel@vger.kernel.org, x86@kernel.org,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	"H. Peter Anvin" <hpa@zytor.com>
Subject: Re: [PATCH v4 2/5] x86/alternative: add indirect call patching
Date: Tue, 14 Nov 2023 15:18:33 +0100	[thread overview]
Message-ID: <20231114141833.GX8262@noisy.programming.kicks-ass.net> (raw)
In-Reply-To: <20231114134715.GBZVN6Y97XrLQ4cbSL@fat_crate.local>

On Tue, Nov 14, 2023 at 02:47:15PM +0100, Borislav Petkov wrote:
> On Tue, Nov 14, 2023 at 01:50:28PM +0100, Peter Zijlstra wrote:
> > This loads the function target from the pv_ops table. We can't otherwise
> > do this.
> 
> On Tue, Nov 14, 2023 at 01:56:37PM +0100, Juergen Gross wrote:
> > It is replacing an _indirect_ call with a _direct_ one, taking the
> > call target from the pointer used by the indirect call.
> 
> Then this is not just a ALT_FLAG_CALL. This is something special. The
> flag definition needs a better name along with an explanation what it
> does, perhaps best with an example from the final vmlinux - not from the
> object file:
> 
> call   *0x0(%rip)
> 
> ==>
> 
> call   *0x0
> 
> where the offsets haven't been linked in yet.

Well, a random absolute address isn't going to be any better or worse
than 0. But perhaps adding the relocation as a comment helps?


   ff 15 00 00 00 00       call   *0x0(%rip)  #  R_X86_64_PC32    pv_ops+0x4
into:
   e8 00 00 00 00 90	   call   +0          #  R_X86_64_PC32 *(pv_ops+0x04)


> If this is going into the generic infrastructure, then it better be
> explained properly so that other stuff can potentially use it too.

ALT_FLAG_DEREFERENCE_INDIRECT_CALL ?

I'm going to already raise my hand and say that's too long ;-)

  reply	other threads:[~2023-11-14 14:18 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-30 14:25 [PATCH v4 0/5] x86/paravirt: Get rid of paravirt patching Juergen Gross
2023-10-30 14:25 ` [PATCH v4 1/5] x86/paravirt: move some functions and defines to alternative Juergen Gross
2023-10-30 14:25 ` [PATCH v4 2/5] x86/alternative: add indirect call patching Juergen Gross
2023-11-14 12:37   ` Borislav Petkov
2023-11-14 12:50     ` Peter Zijlstra
2023-11-14 13:47       ` Borislav Petkov
2023-11-14 14:18         ` Peter Zijlstra [this message]
2023-11-14 14:27           ` Borislav Petkov
2023-11-14 14:35           ` Juergen Gross
2023-11-14 12:56     ` Juergen Gross
2023-11-14 15:06   ` Borislav Petkov
2023-11-14 16:16     ` Juergen Gross
2023-10-30 14:25 ` [PATCH v4 3/5] x86/paravirt: introduce ALT_NOT_XEN Juergen Gross
2023-11-14 15:09   ` Borislav Petkov
2023-11-14 16:17     ` Juergen Gross
2023-10-30 14:25 ` [PATCH v4 4/5] x86/paravirt: switch mixed paravirt/alternative calls to alternative_2 Juergen Gross
2023-11-21 18:45   ` Borislav Petkov
2023-11-29 10:08     ` Juergen Gross
2023-10-30 14:25 ` [PATCH v4 5/5] x86/paravirt: remove no longer needed paravirt patching code Juergen Gross

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=20231114141833.GX8262@noisy.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=jgross@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.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

all inboxes | Powered by JetHome®