Re: [PATCH] x86/asm: Use asm_inline() instead of asm() in amd_clear_divider()

From: Uros Bizjak
Date: Thu Mar 13 2025 - 16:16:54 EST


On Thu, Mar 13, 2025 at 9:07 PM Borislav Petkov <bp@xxxxxxxxx> wrote:

> >> > static __always_inline void amd_clear_divider(void)
> >> > {
> >> >- asm volatile(ALTERNATIVE("", "div %2\n\t", X86_BUG_DIV0)
> >> >+ asm_inline volatile(ALTERNATIVE("", "div %2", X86_BUG_DIV0)
> >> > :: "a" (0), "d" (0), "r" (1));
> >> > }
> >> >
> >>
> >> So there's no point for this one...
> >
> >Not at its current usage sites, but considering that
> >amd_clear_divider() and two levels of small functions that include it
> >( amd_clear_divider(), arch_exit_to_user_mode() and
> >exit_to_user_mode() ) all need to be decorated with __always_inline
> >indicates that the issue is not that benign.
> >
> >It also triggers my search scripts, so I thought I should convert this
> >one as well and put the issue at rest.
>
> Sorry but this doesn't justify this churn. There's nothing quantifyingly palpable here to warrant this.

OK. This is not a hill I'm willing to die on.

Thanks,
Uros.