On Thu, Nov 6, 2025, at 10:40, Yeoreum Yun wrote:
apply FEAT_LSUI instruction to emulate deprecated swpX instruction.
Can you explain in the changrelog why you do this?
In particular, is this a performance optimization or is this required for correctness in some scenario?
I would have expected that there is very little benefit in changing the swp/swpb emulation here if the existing code has to remain compiled into the kernel and the overhead of the trap is so much larger than the uaccess_enable_privileged() overhead.
curval.var = newval.var = oldval;newval.raw[idx] = *data;asm volatile("// __lsui_user_swpb_asm\n"__LSUI_PREAMBLE"1: cast %x2, %x3, %1\n""2:\n"_ASM_EXTABLE_UACCESS_ERR(1b, 2b, %w0): "+r" (err), "+Q" (*addr_al), "+r" (curval.var): "r" (newval.var): "memory");
I see that you fixed the race now. I had written an email about it earlier when I saw the same mistake you found as well, but it got stuck in my drafts folder. The new version looks correct to me, I'm just not sure we need the added complexity.
Arnd