Re: [PATCH bpf-next v2 1/2] bpf: Support private stack for bpf progs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.






[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux