linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: peterz@infradead.org
To: Andy Lutomirski <luto@amacapital.net>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	mbenes@suse.de, LKML <linux-kernel@vger.kernel.org>,
	X86 ML <x86@kernel.org>, Juergen Gross <jgross@suse.com>
Subject: Re: [RFC][PATCH] objtool,x86_64,paravirt: Add pv_ops[] support
Date: Mon, 3 Aug 2020 17:59:25 +0200	[thread overview]
Message-ID: <20200803155925.GF2674@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <CALCETrXhgmkRNaZq9QFWjVVYiX+t=ML_e-oDw2PPEFxQdoA+6Q@mail.gmail.com>

On Mon, Aug 03, 2020 at 08:15:02AM -0700, Andy Lutomirski wrote:
> On Mon, Aug 3, 2020 at 7:33 AM <peterz@infradead.org> wrote:
> >
> >
> > Thomas wanted paramuck vs noinstr, here goes. Very rough, very nasty,
> > mostly works.
> >
> > It requires call sites are the normal indirect call, and not mangled
> > retpoison (slow_down_io() had those), it also requires pv_ops[]
> > assignments are single instructions and not laundered through some
> > pointless intermediate helper (hyperv).
> >
> > It doesn't warn when you get any of that wrong.
> >
> > But if you have it all lined up right, it will warn about noinstr
> > violations due to paramuck:
> 
> I certainly agree that pv_ops is mucky, but could you expound on
> precisely what this patch actually does?  On a very quick
> read-through, I'm guessing you're complaining about any call to pv_ops
> in a noinstr section?  But maybe this is only calls to pv_ops that
> aren't themselves noinstr?

Yeah, it makes sure that any pv_op called from noinstr are to a noinstr
function.

The example here:

../../defconfig-build/vmlinux.o: warning: objtool: exc_double_fault()+0x15: call pv_ops[48] from noinstr
../../defconfig-build/vmlinux.o: warning: objtool: pv_op[48]: xen_read_cr2
../../defconfig-build/vmlinux.o: warning: objtool: exc_double_fault()+0x15: call to {dynamic}() leaves .noinstr.text section

complains about exc_double_fault(), a noinstr function, calling to
xen_read_cr2(), a regular function.

Basically, for every pv_ops[] entry, it compiles a list of assigned
functions, and when there's a noinstr call, it makes sure all functions
assigned to that pv_op are noinstr.

  reply	other threads:[~2020-08-03 15:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-03 14:32 [RFC][PATCH] objtool,x86_64,paravirt: Add pv_ops[] support peterz
2020-08-03 15:15 ` Andy Lutomirski
2020-08-03 15:59   ` peterz [this message]
2020-08-03 15:18 ` Michael Kelley
2020-08-03 16:19   ` peterz

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=20200803155925.GF2674@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=jgross@suse.com \
    --cc=jpoimboe@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@amacapital.net \
    --cc=mbenes@suse.de \
    --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;
as well as URLs for NNTP newsgroup(s).