Re: [PATCH -final] x86/clear_user: Make it faster

Alexey Dobriyan
2022-07-06T09:24:17Z

On Tue, Jul 05, 2022 at 07:01:06PM +0200, Borislav Petkov wrote:

> + asm volatile(
> + "1:\n\t"
> + ALTERNATIVE_3("rep stosb",
> + "call clear_user_erms", ALT_NOT(X86_FEATURE_FSRM),
> + "call clear_user_rep_good", ALT_NOT(X86_FEATURE_ERMS),
> + "call clear_user_original", ALT_NOT(X86_FEATURE_REP_GOOD))
> + "2:\n"
> + _ASM_EXTABLE_UA(1b, 2b)
> + : "+&c" (size), "+&D" (addr), ASM_CALL_CONSTRAINT
> + : "a" (0)
> + /* rep_good clobbers %rdx */
> + : "rdx");

"+c" and "+D" should be enough for 1 instruction assembly?