The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	LKML <linux-kernel@vger.kernel.org>,
	Nick Desaulniers <ndesaulniers@google.com>,
	Nathan Chancellor <natechancellor@gmail.com>,
	clang-built-linux <clang-built-linux@googlegroups.com>,
	x86@kernel.org, Arnd Bergmann <arnd@arndb.de>,
	Sedat Dilek <sedat.dilek@gmail.com>,
	Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: x86 - clang / objtool status
Date: Wed, 24 Jul 2019 16:10:40 +0200	[thread overview]
Message-ID: <20190724141040.GA31425@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <20190724133516.GB31381@hirez.programming.kicks-ass.net>

On Wed, Jul 24, 2019 at 03:35:16PM +0200, Peter Zijlstra wrote:
> On Wed, Jul 24, 2019 at 07:55:25AM -0500, Josh Poimboeuf wrote:

> > b) why doesn't objtool detect the case I found?
> 
> With GCC you mean? Yes, that is really really weird.
> 
> Let me go stare at objdump output for this file (which doesn't build
> with:
> 
>    make O=defconfig-build/ drivers/gpu/drm/i915/gem/i915_gem_execbuffer.o
> )

0000 0000000000000240 <eb_copy_relocations.isra.34>:
0000      240:	41 57                	push   %r15
0002      242:	41 56                	push   %r14
0004      244:	41 55                	push   %r13
0006      246:	41 54                	push   %r12
0008      248:	55                   	push   %rbp
0009      249:	53                   	push   %rbx
000a      24a:	48 83 ec 20          	sub    $0x20,%rsp
000e      24e:	85 f6                	test   %esi,%esi
0010      250:	74 39                	je     28b <eb_copy_relocations.isra.34+0x4b>
0012      252:	89 74 24 14          	mov    %esi,0x14(%rsp)
0016      256:	45 31 f6             	xor    %r14d,%r14d
0019      259:	48 c7 04 24 00 00 00 	movq   $0x0,(%rsp)
0020      260:	00 
0021      261:	48 89 7c 24 08       	mov    %rdi,0x8(%rsp)
0026      266:	48 8b 44 24 08       	mov    0x8(%rsp),%rax
002b      26b:	48 8b 34 24          	mov    (%rsp),%rsi
002f      26f:	48 03 30             	add    (%rax),%rsi
0032      272:	44 8b 46 04          	mov    0x4(%rsi),%r8d
0036      276:	45 85 c0             	test   %r8d,%r8d
0039      279:	75 23                	jne    29e <eb_copy_relocations.isra.34+0x5e>
003b      27b:	41 83 c6 01          	add    $0x1,%r14d
003f      27f:	48 83 04 24 38       	addq   $0x38,(%rsp)
0044      284:	44 3b 74 24 14       	cmp    0x14(%rsp),%r14d
0049      289:	75 db                	jne    266 <eb_copy_relocations.isra.34+0x26>
004b      28b:	31 db                	xor    %ebx,%ebx
004d      28d:	48 83 c4 20          	add    $0x20,%rsp
0051      291:	89 d8                	mov    %ebx,%eax
0053      293:	5b                   	pop    %rbx
0054      294:	5d                   	pop    %rbp
0055      295:	41 5c                	pop    %r12
0057      297:	41 5d                	pop    %r13
0059      299:	41 5e                	pop    %r14
005b      29b:	41 5f                	pop    %r15
005d      29d:	c3                   	retq   

(<- from +39)

005e      29e:	48 83 c6 08          	add    $0x8,%rsi
0062      2a2:	44 89 c7             	mov    %r8d,%edi
0065      2a5:	e8 26 ff ff ff       	callq  1d0 <check_relocations.isra.32>
006a      2aa:	85 c0                	test   %eax,%eax
006c      2ac:	0f 85 35 01 00 00    	jne    3e7 <eb_copy_relocations.isra.34+0x1a7>
0072      2b2:	48 8b 44 24 08       	mov    0x8(%rsp),%rax
0077      2b7:	48 8b 0c 24          	mov    (%rsp),%rcx
007b      2bb:	ba ff ff ff ff       	mov    $0xffffffff,%edx
0080      2c0:	be c0 0c 00 00       	mov    $0xcc0,%esi
0085      2c5:	48 8b 00             	mov    (%rax),%rax
0088      2c8:	4c 8b 6c 08 08       	mov    0x8(%rax,%rcx,1),%r13
008d      2cd:	44 89 c0             	mov    %r8d,%eax
0090      2d0:	49 89 c4             	mov    %rax,%r12
0093      2d3:	48 89 44 24 18       	mov    %rax,0x18(%rsp)
0098      2d8:	49 c1 e4 05          	shl    $0x5,%r12
009c      2dc:	4c 89 e7             	mov    %r12,%rdi
009f      2df:	e8 00 00 00 00       	callq  2e4 <eb_copy_relocations.isra.34+0xa4>
00a0 			2e0: R_X86_64_PLT32	kvmalloc_node-0x4
00a4      2e4:	49 89 c7             	mov    %rax,%r15
00a7      2e7:	48 85 c0             	test   %rax,%rax
00aa      2ea:	0f 84 e8 00 00 00    	je     3d8 <eb_copy_relocations.isra.34+0x198>
00b0      2f0:	31 ed                	xor    %ebp,%ebp
00b2      2f2:	eb 08                	jmp    2fc <eb_copy_relocations.isra.34+0xbc>

(<- from +e0)

00b4      2f4:	48 01 dd             	add    %rbx,%rbp
00b7      2f7:	49 39 ec             	cmp    %rbp,%r12
00ba      2fa:	76 73                	jbe    36f <eb_copy_relocations.isra.34+0x12f>

(<- from +b2)

00bc      2fc:	4c 89 e3             	mov    %r12,%rbx
00bf      2ff:	b8 00 00 00 80       	mov    $0x80000000,%eax
00c4      304:	49 8d 3c 2f          	lea    (%r15,%rbp,1),%rdi
00c8      308:	48 29 eb             	sub    %rbp,%rbx
00cb      30b:	49 8d 74 2d 00       	lea    0x0(%r13,%rbp,1),%rsi
00d0      310:	48 39 c3             	cmp    %rax,%rbx
00d3      313:	48 0f 47 d8          	cmova  %rax,%rbx
00d7      317:	89 da                	mov    %ebx,%edx
00d9      319:	e8 00 00 00 00       	callq  31e <eb_copy_relocations.isra.34+0xde>
00da 			31a: R_X86_64_PLT32	copy_user_generic_unrolled-0x4
00de      31e:	85 c0                	test   %eax,%eax
00e0      320:	74 d2                	je     2f4 <eb_copy_relocations.isra.34+0xb4>
00e2      322:	4c 89 f8             	mov    %r15,%rax
00e5      325:	4c 8b 7c 24 08       	mov    0x8(%rsp),%r15
00ea      32a:	90                   	nop
00eb      32b:	90                   	nop
00ec      32c:	90                   	nop

					^^^ CLAC

And that most certainly should trigger...

Let me gdb that objtool thing.

  parent reply	other threads:[~2019-07-24 14:11 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-18 20:40 x86 - clang / objtool status Thomas Gleixner
2019-07-18 20:58 ` Nathan Chancellor
2019-07-19  6:39   ` Thomas Gleixner
2019-07-19  7:00     ` Arnd Bergmann
2019-07-19  7:03     ` Nathan Chancellor
2019-07-24 16:57     ` Nick Desaulniers
2019-07-18 22:42 ` Nick Desaulniers
2019-07-19  6:44   ` Thomas Gleixner
2019-07-19 11:37 ` Sedat Dilek
2019-07-19 13:48   ` Sedat Dilek
2019-07-22 15:40     ` Sedat Dilek
2019-07-25  6:17       ` Sedat Dilek
2019-07-24  2:43 ` Josh Poimboeuf
2019-07-24  7:47   ` Peter Zijlstra
2019-07-24 12:37     ` Josh Poimboeuf
2019-07-24 12:55     ` Josh Poimboeuf
2019-07-24 13:35       ` Peter Zijlstra
2019-07-24 14:05         ` Josh Poimboeuf
2019-07-24 14:10         ` Peter Zijlstra [this message]
2019-07-24 16:48           ` [PATCH] objtool: Improve UACCESS coverage Peter Zijlstra
2019-07-24 16:54             ` Nathan Chancellor
2019-07-24 16:55             ` Nick Desaulniers
2019-07-24 18:30             ` Sedat Dilek
2019-07-24 18:32               ` Sedat Dilek
2019-07-24 16:52   ` x86 - clang / objtool status Peter Zijlstra
2019-07-24 17:22   ` Nick Desaulniers

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=20190724141040.GA31425@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=arnd@arndb.de \
    --cc=clang-built-linux@googlegroups.com \
    --cc=jpoimboe@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=natechancellor@gmail.com \
    --cc=ndesaulniers@google.com \
    --cc=sedat.dilek@gmail.com \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --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