linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matthias Kaehlcke <mka@chromium.org>
To: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Ingo Molnar <mingo@kernel.org>,
	linux-kernel@vger.kernel.org, torvalds@linux-foundation.org,
	peterz@infradead.org, hpa@zytor.com, tglx@linutronix.de
Subject: Re: [PATCH 2/2] x86/unwind: Make CONFIG_UNWINDER_ORC=y the default in kconfig for 64-bit
Date: Mon, 19 Mar 2018 16:22:55 -0700	[thread overview]
Message-ID: <20180319232255.GF37438@google.com> (raw)
In-Reply-To: <20180319212053.e77dc3vmemfazt3b@treble>

[-- Attachment #1: Type: text/plain, Size: 2554 bytes --]

El Mon, Mar 19, 2018 at 04:20:53PM -0500 Josh Poimboeuf ha dit:

> On Mon, Mar 19, 2018 at 01:31:30PM -0700, Matthias Kaehlcke wrote:
> > > The ORC unwinder relies on objtool, which reverse engineers the compiled
> > > code.  This is objtool's first exposure to clang, so I'm not at all
> > > surprised if it's getting confused.
> > > 
> > > Send me one of the .o files and I can take a quick look to see how bad
> > > it is, but I'm guessing it's going to be a lot of work to make objtool
> > > compatible with clang (and unfortunately I won't have the bandwidth to
> > > work on that in the near term.)
> > > 
> > > In the meantime I'd recommend that you use frame pointers (and
> > > CONFIG_STACK_VALIDATION=n) for clang-compiled kernels.
> > 
> > Thanks for your assessment!
> > 
> > dvo_ch7017.o is attached.
> 
> Here's a (surprisingly easy) fix for this particular issue, though I'd
> be shocked if there weren't a bunch more issues lurking elsewhere.  Let
> me know how it goes.

Thanks for having a look, this fixes the vast majority of warnings in
a defconfig build!

The remaining warnings are:

arch/x86/mm/pti.o: warning: objtool: pti_init() falls through to next
function pti_user_pagetable_walk_pmd()
s/debugfs/file.o: warning: objtool: full_proxy_llseek() falls through to next function full_proxy_read()
fs/debugfs/file.o: warning: objtool: full_proxy_read() falls through to next function full_proxy_write()
fs/debugfs/file.o: warning: objtool: full_proxy_write() falls through to next function full_proxy_poll()
fs/debugfs/file.o: warning: objtool: full_proxy_poll() falls through to next function full_proxy_unlocked_ioctl()
fs/debugfs/file.o: warning: objtool: full_proxy_unlocked_ioctl() falls
through to next function fops_u8_open()

In all these functions it's an 'early' return that 'causes' the
warning.

Obviously I don't expect you to spend large amounts of time
investigating this, but should there be a similarily easy fix it would
be certainly welcome :)

> BTW, one thing I noticed in the .o file is that most of the functions'
> stacks are aligned to 16 bytes.  It might be worth checking if the clang
> -mstack-alignment=8 option is getting set, and if so, if it's working
> properly.  Otherwise, with aligned stacks, the frame pointer is forced,
> which defeats most of the benefits of ORC.

Thanks for pointing this out. I verified that -mstack-alignment=8 is
set. Do the "and $0xfffffffffffffff0,%rsp" instructions indicate the
stack alignment of 16 bytes? These are also present in the object file
generated by gcc.

[-- Attachment #2: pti.o --]
[-- Type: application/x-object, Size: 9176 bytes --]

[-- Attachment #3: file.o --]
[-- Type: application/x-object, Size: 65376 bytes --]

  reply	other threads:[~2018-03-19 23:23 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20171013052544.euk7yawni47lhmdq@gmail.com>
2017-10-13 20:02 ` [PATCH 1/2] x86/unwind: Rename unwinder config options to 'CONFIG_UNWINDER_*' Josh Poimboeuf
2017-10-14 10:49   ` [tip:x86/asm] " tip-bot for Josh Poimboeuf
2017-10-13 20:02 ` [PATCH 2/2] x86/unwind: Make CONFIG_UNWINDER_ORC=y the default in kconfig for 64-bit Josh Poimboeuf
2017-10-14 10:50   ` [tip:x86/asm] " tip-bot for Josh Poimboeuf
2017-10-19 16:51   ` [2/2] " Andrei Vagin
2017-10-19 18:16     ` Josh Poimboeuf
2017-10-19 22:35       ` Andrei Vagin
2017-10-20  0:38         ` Andrei Vagin
2017-10-20  1:28         ` Josh Poimboeuf
2017-10-20  6:54           ` Andrei Vagin
2018-03-19 18:57   ` [PATCH 2/2] " Matthias Kaehlcke
2018-03-19 19:29     ` Josh Poimboeuf
2018-03-19 20:31       ` Matthias Kaehlcke
2018-03-19 21:20         ` Josh Poimboeuf
2018-03-19 23:22           ` Matthias Kaehlcke [this message]
2018-03-20  2:28             ` Josh Poimboeuf
2018-03-20 19:39               ` Matthias Kaehlcke
2018-03-21  2:45             ` Josh Poimboeuf
2018-03-21 21:19               ` Matthias Kaehlcke

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=20180319232255.GF37438@google.com \
    --to=mka@chromium.org \
    --cc=hpa@zytor.com \
    --cc=jpoimboe@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.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).