Re: [PATCH v4] x86/entry_32: Use stack segment selector for VERW operand

From: Pawan Gupta
Date: Thu Jul 11 2024 - 14:34:38 EST


On Thu, Jul 11, 2024 at 07:49:25AM +0200, Jiri Slaby wrote:
> > > Why not simply:
> > >
> > > .macro CLEAR_CPU_BUFFERS_SAFE
> > > ALTERNATIVE "", __stringify(verw %ss:_ASM_RIP(mds_verw_sel)),
> > > X86_FEATURE_CLEAR_CPU_BUF
> > > .endm
> >
> > We can do it this way as well. But, there are stable kernels that don't
> > support relocations in ALTERNATIVEs. The way it is done in current patch
> > can be backported without worrying about which kernels support relocations.
>
> This sounds weird. There are code bases without ALTERNATIVE support at all.
> Will you expand ALTERNATIVE into some cmp & jmp here due to that? No.

Agree, will change it to the way Uros and Peter suggested.

> Instead, you can send this "backport" to stable for older kernels later,
> once a proper patch is merged.

Ok, will take care of the differences in the backports.