linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sedat Dilek <sedat.dilek@gmail.com>
To: Nick Desaulniers <nick.desaulniers@gmail.com>
Cc: Matthias Kaehlcke <mka@chromium.org>,
	lkml <linux-kernel@vger.kernel.org>,
	Arnd Bergmann <arnd@arndb.de>,
	Manoj Gupta <manojgupta@chromium.org>,
	AlistairStrachan <astrachan@google.com>,
	"Steven Rostedt (VMware)" <rostedt@goodmis.org>
Subject: Re: Clang patch stacks for LTS kernels (v4.4 and v4.9) and status update
Date: Tue, 22 May 2018 16:55:01 +0200	[thread overview]
Message-ID: <CA+icZUXfx+asP_-2Weuqoms4bFUXvZRfE5QvnCg-qQ-8pn7dfw@mail.gmail.com> (raw)
In-Reply-To: <CA+icZUW14BygHdBC8Ktx1d9Cm3eTcGmmoHH_L1690tjmwATHDA@mail.gmail.com>

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

Just for the records...

[ OBJDUMP irq_work_tick() ]

$ objdump -d -S --start-address=0x$(grep irq_work_tick System.map |
sed -e "s/ \+.*//") vmlinux | less

[ OBJDUMP native_save_fl() ]

$ objdump -d -S --start-address=0x$(grep native_save_fl System.map |
sed -e "s/ \+.*//") vmlinux | less

- sedat -

[-- Attachment #2: objdump_irq_work_tick.txt --]
[-- Type: text/plain, Size: 8437 bytes --]

[ OBJDUMP irq_work_tick() ]

$ objdump -d -S --start-address=0x$(grep irq_work_tick System.map | sed -e "s/ \+.*//") vmlinux | less

vmlinux:     file format elf64-x86-64


Disassembly of section .text:

ffffffff811982f0 <irq_work_tick>:
        irq_work_run_list(this_cpu_ptr(&lazy_list));
}
EXPORT_SYMBOL_GPL(irq_work_run);

void irq_work_tick(void)
{
ffffffff811982f0:       41 57                   push   %r15
ffffffff811982f2:       41 56                   push   %r14
ffffffff811982f4:       41 54                   push   %r12
ffffffff811982f6:       53                      push   %rbx
        struct llist_head *raised = this_cpu_ptr(&raised_list);
ffffffff811982f7:       48 c7 c1 80 e5 01 00    mov    $0x1e580,%rcx
ffffffff811982fe:       65 48 03 0c 25 d8 f1    add    %gs:0xf1d8,%rcx
ffffffff81198305:       00 00 
 * test whether the list is empty without deleting something from the
 * list.
 */
static inline bool llist_empty(const struct llist_head *head)
{
        return ACCESS_ONCE(head->first) == NULL;
ffffffff81198307:       48 83 39 00             cmpq   $0x0,(%rcx)

        if (!llist_empty(raised) && !arch_irq_work_has_interrupt())
ffffffff8119830b:       74 6a                   je     ffffffff81198377 <irq_work_tick+0x87>
}

static __always_inline bool constant_test_bit(long nr, const volatile unsigned long *addr)
{
        return ((1UL << (nr & (BITS_PER_LONG-1))) &
                (addr[nr >> _BITOPS_LONG_SHIFT])) != 0;
ffffffff8119830d:       48 8b 04 25 44 3c 0f    mov    0xffffffff820f3c44,%rax
ffffffff81198314:       82 
ffffffff81198315:       a9 00 02 00 00          test   $0x200,%eax
ffffffff8119831a:       75 5b                   jne    ffffffff81198377 <irq_work_tick+0x87>
#define __PV_IS_CALLEE_SAVE(func)                       \
        ((struct paravirt_callee_save) { func })

static inline notrace unsigned long arch_local_save_flags(void)
{
        return PVOP_CALLEE0(unsigned long, pv_irq_ops.save_fl);
ffffffff8119831c:       ff 14 25 d0 28 02 82    callq  *0xffffffff820228d0
        BUG_ON(!irqs_disabled());
ffffffff81198323:       a9 00 02 00 00          test   $0x200,%eax
ffffffff81198328:       0f 85 d4 00 00 00       jne    ffffffff81198402 <irq_work_tick+0x112>
ffffffff8119832e:       48 83 39 00             cmpq   $0x0,(%rcx)
        if (llist_empty(list))
ffffffff81198332:       74 43                   je     ffffffff81198377 <irq_work_tick+0x87>
ffffffff81198334:       31 db                   xor    %ebx,%ebx
 * return the pointer to the first entry.  The order of entries
 * deleted is from the newest to the oldest added one.
 */
static inline struct llist_node *llist_del_all(struct llist_head *head)
{
        return xchg(&head->first, NULL);
ffffffff81198336:       48 87 19                xchg   %rbx,(%rcx)
        while (llnode != NULL) {
ffffffff81198339:       48 85 db                test   %rbx,%rbx
ffffffff8119833c:       74 39                   je     ffffffff81198377 <irq_work_tick+0x87>
ffffffff8119833e:       66 90                   xchg   %ax,%ax
                work = llist_entry(llnode, struct irq_work, llnode);
ffffffff81198340:       48 8d 7b f8             lea    -0x8(%rbx),%rdi
                flags = work->flags & ~IRQ_WORK_PENDING;
ffffffff81198344:       4c 8b 7b f8             mov    -0x8(%rbx),%r15
        return node->next;
ffffffff81198348:       4c 8b 23                mov    (%rbx),%r12
ffffffff8119834b:       4d 89 fe                mov    %r15,%r14
ffffffff8119834e:       49 83 e6 fe             and    $0xfffffffffffffffe,%r14
                xchg(&work->flags, flags);
ffffffff81198352:       4c 89 f0                mov    %r14,%rax
ffffffff81198355:       48 87 43 f8             xchg   %rax,-0x8(%rbx)
                work->func(work);
ffffffff81198359:       4c 8b 5b 08             mov    0x8(%rbx),%r11
ffffffff8119835d:       e8 de ad 86 00          callq  ffffffff81a03140 <__x86_indirect_thunk_r11>
                (void)cmpxchg(&work->flags, flags, flags & ~IRQ_WORK_BUSY);
ffffffff81198362:       49 83 e7 fc             and    $0xfffffffffffffffc,%r15
ffffffff81198366:       4c 89 f0                mov    %r14,%rax
ffffffff81198369:       f0 4c 0f b1 7b f8       lock cmpxchg %r15,-0x8(%rbx)
ffffffff8119836f:       4c 89 e3                mov    %r12,%rbx
        while (llnode != NULL) {
ffffffff81198372:       4d 85 e4                test   %r12,%r12
ffffffff81198375:       75 c9                   jne    ffffffff81198340 <irq_work_tick+0x50>
                irq_work_run_list(raised);
        irq_work_run_list(this_cpu_ptr(&lazy_list));
ffffffff81198377:       48 c7 c1 88 e5 01 00    mov    $0x1e588,%rcx
ffffffff8119837e:       65 48 03 0c 25 d8 f1    add    %gs:0xf1d8,%rcx
ffffffff81198385:       00 00 
ffffffff81198387:       ff 14 25 d0 28 02 82    callq  *0xffffffff820228d0
        BUG_ON(!irqs_disabled());
ffffffff8119838e:       a9 00 02 00 00          test   $0x200,%eax
ffffffff81198393:       75 5a                   jne    ffffffff811983ef <irq_work_tick+0xff>
        return ACCESS_ONCE(head->first) == NULL;
ffffffff81198395:       48 83 39 00             cmpq   $0x0,(%rcx)
        if (llist_empty(list))
ffffffff81198399:       74 4c                   je     ffffffff811983e7 <irq_work_tick+0xf7>
ffffffff8119839b:       31 db                   xor    %ebx,%ebx
        return xchg(&head->first, NULL);
ffffffff8119839d:       48 87 19                xchg   %rbx,(%rcx)
        while (llnode != NULL) {
ffffffff811983a0:       48 85 db                test   %rbx,%rbx
ffffffff811983a3:       74 42                   je     ffffffff811983e7 <irq_work_tick+0xf7>
ffffffff811983a5:       90                      nop
ffffffff811983a6:       66 2e 0f 1f 84 00 00    nopw   %cs:0x0(%rax,%rax,1)
ffffffff811983ad:       00 00 00 
                work = llist_entry(llnode, struct irq_work, llnode);
ffffffff811983b0:       48 8d 7b f8             lea    -0x8(%rbx),%rdi
                flags = work->flags & ~IRQ_WORK_PENDING;
ffffffff811983b4:       4c 8b 7b f8             mov    -0x8(%rbx),%r15
        return node->next;
ffffffff811983b8:       4c 8b 23                mov    (%rbx),%r12
ffffffff811983bb:       4d 89 fe                mov    %r15,%r14
ffffffff811983be:       49 83 e6 fe             and    $0xfffffffffffffffe,%r14
                xchg(&work->flags, flags);
ffffffff811983c2:       4c 89 f0                mov    %r14,%rax
ffffffff811983c5:       48 87 43 f8             xchg   %rax,-0x8(%rbx)
                work->func(work);
ffffffff811983c9:       4c 8b 5b 08             mov    0x8(%rbx),%r11
ffffffff811983cd:       e8 6e ad 86 00          callq  ffffffff81a03140 <__x86_indirect_thunk_r11>
                (void)cmpxchg(&work->flags, flags, flags & ~IRQ_WORK_BUSY);
ffffffff811983d2:       49 83 e7 fc             and    $0xfffffffffffffffc,%r15
ffffffff811983d6:       4c 89 f0                mov    %r14,%rax
ffffffff811983d9:       f0 4c 0f b1 7b f8       lock cmpxchg %r15,-0x8(%rbx)
ffffffff811983df:       4c 89 e3                mov    %r12,%rbx
        while (llnode != NULL) {
ffffffff811983e2:       4d 85 e4                test   %r12,%r12
ffffffff811983e5:       75 c9                   jne    ffffffff811983b0 <irq_work_tick+0xc0>
}
ffffffff811983e7:       5b                      pop    %rbx
ffffffff811983e8:       41 5c                   pop    %r12
ffffffff811983ea:       41 5e                   pop    %r14
ffffffff811983ec:       41 5f                   pop    %r15
ffffffff811983ee:       c3                      retq   
ffffffff811983ef:       0f 0b                   ud2    
        BUG_ON(!irqs_disabled());
ffffffff811983f1:       0f 1f 44 00 00          nopl   0x0(%rax,%rax,1)
ffffffff811983f6:       66 2e 0f 1f 84 00 00    nopw   %cs:0x0(%rax,%rax,1)
ffffffff811983fd:       00 00 00 
ffffffff81198400:       eb fe                   jmp    ffffffff81198400 <irq_work_tick+0x110>
ffffffff81198402:       0f 0b                   ud2    
ffffffff81198404:       66 90                   xchg   %ax,%ax
ffffffff81198406:       66 2e 0f 1f 84 00 00    nopw   %cs:0x0(%rax,%rax,1)
ffffffff8119840d:       00 00 00 
ffffffff81198410:       eb fe                   jmp    ffffffff81198410 <irq_work_tick+0x120>
ffffffff81198412:       0f 1f 40 00             nopl   0x0(%rax)
ffffffff81198416:       66 2e 0f 1f 84 00 00    nopw   %cs:0x0(%rax,%rax,1)
ffffffff8119841d:       00 00 00 

ffffffff81198420 <irq_work_sync>:
...

[-- Attachment #3: objdump_native_save_fl.txt --]
[-- Type: text/plain, Size: 1609 bytes --]

[ OBJDUMP native_save_fl() ]

$ objdump -d -S --start-address=0x$(grep native_save_fl System.map | sed -e "s/ \+.*//") vmlinux | less

vmlinux:     file format elf64-x86-64


Disassembly of section .text:

ffffffff810633a0 <native_save_fl>:
/*
 * Interrupt control:
 */

static inline __nostackprotector unsigned long native_save_fl(void)
{
ffffffff810633a0:       55                      push   %rbp
ffffffff810633a1:       48 89 e5                mov    %rsp,%rbp
ffffffff810633a4:       50                      push   %rax
        /*
         * "=rm" is safe here, because "pop" adjusts the stack before
         * it evaluates its effective address -- this is part of the
         * documented behavior of the "pop" instruction.
         */
        asm volatile("# __raw_save_flags\n\t"
ffffffff810633a5:       9c                      pushfq
ffffffff810633a6:       8f 45 f8                popq   -0x8(%rbp)
                     "pushf ; pop %0"
                     : "=rm" (flags)
                     : /* no input */
                     : "memory");

        return flags;
ffffffff810633a9:       48 8b 45 f8             mov    -0x8(%rbp),%rax
ffffffff810633ad:       48 83 c4 08             add    $0x8,%rsp
ffffffff810633b1:       5d                      pop    %rbp
ffffffff810633b2:       c3                      retq
ffffffff810633b3:       0f 1f 00                nopl   (%rax)
ffffffff810633b6:       66 2e 0f 1f 84 00 00    nopw   %cs:0x0(%rax,%rax,1)
ffffffff810633bd:       00 00 00

ffffffff810633c0 <native_restore_fl>:
}

static inline void native_restore_fl(unsigned long flags)
{
...


  reply	other threads:[~2018-05-22 14:55 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-23 13:56 Clang patch stacks for LTS kernels (v4.4 and v4.9) and status update Sedat Dilek
2018-04-23 17:42 ` Matthias Kaehlcke
2018-04-24 11:54   ` Sedat Dilek
2018-04-24 23:06     ` Matthias Kaehlcke
2018-05-06  7:42       ` Sedat Dilek
2018-05-06  8:16         ` Sedat Dilek
2018-05-07 17:49         ` Matthias Kaehlcke
2018-05-07 19:37           ` Sedat Dilek
2018-05-11 11:52           ` Sedat Dilek
2018-05-18 22:54             ` Nick Desaulniers
2018-05-22  7:11               ` Sedat Dilek
2018-05-22  7:39               ` Sedat Dilek
2018-05-22  8:04                 ` Sedat Dilek
2018-05-22  8:49                   ` Sedat Dilek
2018-05-22 10:16                     ` Sedat Dilek
2018-05-22 12:05                       ` Sedat Dilek
2018-05-22 12:17                         ` Sedat Dilek
2018-05-22 14:55                           ` Sedat Dilek [this message]
2018-05-06  6:35   ` Sedat Dilek
2018-05-06  7:41     ` Dmitry Vyukov
2018-05-06  7:58       ` Sedat Dilek
  -- strict thread matches above, loose matches on Subject: below --
2017-08-22 23:13 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=CA+icZUXfx+asP_-2Weuqoms4bFUXvZRfE5QvnCg-qQ-8pn7dfw@mail.gmail.com \
    --to=sedat.dilek@gmail.com \
    --cc=arnd@arndb.de \
    --cc=astrachan@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=manojgupta@chromium.org \
    --cc=mka@chromium.org \
    --cc=nick.desaulniers@gmail.com \
    --cc=rostedt@goodmis.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).