Alexandre Chartre <alexandre.char...@oracle.com> writes:
> On 5/5/20 3:53 PM, Thomas Gleixner wrote:
>> +    __this_cpu_add(irq_count, 1);                                   \
>> +    asm volatile(                                                   \
>> +            "pushq  %%rbp                                   \n"     \
>> +            "movq   %%rsp, %%rbp                            \n"     \
>> +            "movq   %%rsp, (%[ts])                          \n"     \
>> +            "movq   %[ts], %%rsp                            \n"     \
>> +            "1:                                             \n"     \
>> +            "       .pushsection .discard.instr_begin       \n"     \
>> +            "       .long 1b - .                            \n"     \
>> +            "       .popsection                             \n"     \
>> +            "call   " __ASM_FORM(func) "                    \n"     \
>> +            "2:                                             \n"     \
>> +            "       .pushsection .discard.instr_end         \n"     \
>> +            "       .long 2b - .                            \n"     \
>> +            "       .popsection                             \n"     \
>> +            "popq   %%rsp                                   \n"     \
>> +            "leaveq                                         \n"     \
>> +            :                                                       \
>> +            : [ts] "r" (tos)                                        \
>> +            : "memory"                                              \
>> +            );                                                      \
>> +    __this_cpu_sub(irq_count, 1);                                   \
>> +}
>
> The pushsection/popsection discard.instr_begin/end sequences are used several
> times in asm() statement at different places, so I wonder if it might be worth
> having a macro.

As discussed elsewhere this is going to move to ASM partially and the
various variants are not longer necessary.

Thanks,

        tglx

Reply via email to