Subject: Re: mmotm 2020-05-05-15-28 uploaded (objtool warning)

From: Josh Poimboeuf <[email-masked]>
Date: Fri, 8 May 2020 11:01:22 -0500

On Fri, May 08, 2020 at 12:38:30PM +0200, Peter Zijlstra wrote:
> Subject: objtool: Allow no-op CFI ops in alternatives
> From: Peter Zijlstra <[email-masked]>
> Date: Fri May 8 12:34:33 CEST 2020
> 
> Randy reported a false-positive: "alternative modifies stack".
> 
> What happens is that:
> 
> 	alternative_io("movl %0, %P1", "xchgl %0, %P1", X86_BUG_11AP,
>  13d:   89 9d 00 d0 7f ff       mov    %ebx,-0x803000(%rbp)
> 
> decodes to an instruction with CFI-ops because it modifies RBP.
> However, due to this being a !frame-pointer build, that should not in
> fact change the CFI state.
> 
> So instead of dis-allowing any CFI-op, verify the op would've actually
> changed the CFI state.
> 
> Fixes: 7117f16bf460 ("objtool: Fix ORC vs alternatives")
> Reported-by: Randy Dunlap <[email-masked]>
> Signed-off-by: Peter Zijlstra (Intel) <[email-masked]>

It helps to put an example of the fixed warning in the commit log, like:

This fixes the following warning:

  arch/x86/hyperv/hv_apic.o: warning: objtool: hv_apic_write()+0x25: alternative modifies stack

Otherwise it looks good.

Acked-by: Josh Poimboeuf <[email-masked]>

-- 
Josh