Re: x86 copy performance regression

From: Eric Dumazet
Date: Fri May 26 2023 - 13:51:40 EST


On Fri, May 26, 2023 at 7:40 PM Linus Torvalds
<torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:
>
> On Fri, May 26, 2023 at 10:25 AM Eric Dumazet <edumazet@xxxxxxxxxx> wrote:
> >
> > arch/x86/lib/copy_user_64.S:34:2: error: invalid instruction mnemonic
> > 'alternative'
>
> Ok, that's just odd. For me, assembler mnemonics - very much including
> macros - are case-insensitive.
>
> It's actually documented that way, with the example given is for a
> macro that is declared as "sum" and then used as "SUM":
>
> https://sourceware.org/binutils/docs/as/Macro.html
>
> And if you want to use macros as pseudo-instructions, that's what you
> want, since typically assembler instructions are not case sensitive.
>
> But yeah, your build environment is clearly different, and yes, we
> declare the macro with all caps, and other places use it that way too.
>
> Clang?

Yes, we use clang here ...

Hmmm

[ 25.532236] RIP: 0010:0xffffffffa5a85134
[ 25.536173] Code: Unable to access opcode bytes at 0xffffffffa5a8510a.
[ 25.542720] RSP: 0000:ffff92f08159bcd8 EFLAGS: 00050206
[ 25.547960] RAX: 00007ffc3b16c318 RBX: 0000000000000000 RCX: 0000000000000170
[ 25.555118] RDX: 0000000000000170 RSI: ffff92f0944d4c28 RDI: 00007ffc3b16c1a8
[ 25.562275] RBP: ffff92f08159bce0 R08: fefefefefefefeff R09: 000000000000002c
[ 25.569432] R10: 000000000000002c R11: ffff92f0944d5bb0 R12: 00007ffc3b16cff2
[ 25.576588] R13: 00007ffc3b16c1a8 R14: 0000000000000001 R15: ffff92f0944d4ac0
[ 25.583746] FS: 0000000000000000(0000) GS:ffff934e404c0000(0000)
knlGS:0000000000000000
[ 25.591862] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 25.597624] CR2: ffffffffa5a8510a CR3: 000000010e33c003 CR4: 00000000003706e0
[ 25.604780] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[ 25.611936] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[ 25.619092] Call Trace:
[ 25.621545] <TASK>
[ 25.623648] ? _copy_to_user+0x20/0x30
[ 25.627409] create_elf_tables+0x528/0x5a0
[ 25.631520] load_elf_binary+0x9e7/0xce0
[ 25.635453] bprm_execve+0x2bf/0x5c0
[ 25.639040] kernel_execve+0x2ad/0x2d0
[ 25.642799] run_init_process+0xa9/0xb0
[ 25.646648] ? rest_init+0xc0/0xc0
[ 25.650059] kernel_init+0x82/0x1a0
[ 25.653558] ret_from
_fork+0x1f/0x30
[ 25.657145] </TASK>