Re: [PATCHv6 03/16] x86/alternatives: Disable LASS when patching kernel alternatives

Dave Hansen
2025-06-20T15:33:59Z

On 6/20/25 06:53, Kirill A. Shutemov wrote:
> +/*
> + * poking_init() initializes the text poking address from the lower half of the
> + * address space. Relax LASS enforcement when accessing the poking address.
> + */

This does not read quite right. I think there's some unnecessary
confusiuon about initializing the address versus the contents. But
either way, how about:

/*
* Text poking creates and uses a mapping in the lower half of the
* address space. Relax LASS enforcement when accessing the poking
* address.
*/

> static void text_poke_memset(void *dst, const void *src, size_t len)
> {
> int c = *(const int *)src;
>
> - memset(dst, c, len);
> + lass_stac();
> + __inline_memset(dst, c, len);
> + lass_clac();
> }

Yeah, this patch small enough that lass_{stac,clac}() are definitely
misplaced in this series. Just move them into this patch.