On Mon, 2024-07-22 at 10:51 -0700, Alexei Starovoitov wrote: [...] > It's not that simple. > Above sequence violates -mno-red-zone. > The part of the fix may look like: > movabs .., rax > add %gs.., rax > mov rbp, qword ptr [rax - ...] > > mov rax, rsp > mox rax, rbp > sub rsp, ... > > it's probably correct from mno-red-zone pov and > end result is maybe correct for stack unwind, > but if irq happens in the middle it won't crash, > but unwind will not work. > The main reason to use r9 is to have valid unwind > at any point of the prog. Oh, I see, bad things would happen if this sequence: movabs $0x...,%rsp add %gs:0x...,%rsp Would be split by an interrupt. However, I don't understand why 'push %rbp' violates red zone. In any case, the interrupt argument is sufficient, thank you for explaining.