Re: WARNING with LBR + precise_ip=2 + bpf_get_stackid()

From: Andi Kleen
Date: Thu Jun 18 2020 - 18:35:58 EST


> We noticed that this only happens with precise_ip >= 2. This is caused by
> setup_pebs_fixed_sample_data() using pens->real_ip:
>
> set_linear_ip(regs, pebs->real_ip);

With precise_ip == 1 the IP will be one instruction behind.
That's the only difference to 2 or 3.

So something about the actual instruction confuses the unwinder.

I would check if there is anything special about these IPs:

> 0xfffffe00004d1f78 entry_SYSCALL_64
> 0xfffffe00004d1fa0 entry_SYSCALL_64
> 0xfffffe00004d1fd8 entry_SYSCALL_64

>
> For our use case, we do need precise_ip=2. So we would like suggestions to fix the
> warning and/or to avoid double fault.

As a minimum, I would just add an && !in_nmi() to the warning. Clearly
it doesn't make sense to print a warning that overflows the stack.

-Andi