Hi, Arnd,
On Tue, Jul 6, 2021 at 6:17 PM Arnd Bergmann [off-list ref] wrote:
On Tue, Jul 6, 2021 at 6:18 AM Huacai Chen [off-list ref] wrote:
quoted
+/*
+ * long __strncpy_from_user(char *to, const char *from, long len)
+ *
+ * a0: to
+ * a1: from
+ * a2: len
+ */
+SYM_FUNC_START(__strncpy_from_user)
+ move a3, zero
+
I doubt this is better than the C version in lib/strncpy_from_user.c
OK, they will be replaced with the C version.
Huacai
quoted
diff --git a/arch/loongarch/lib/strnlen_user.S b/arch/loongarch/lib/strnlen_user.S
new file mode 100644
index 000000000000..9288a5ad294e
--- /dev/null
+++ b/arch/loongarch/lib/strnlen_user.S
@@ -0,0 +1,47 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Copyright (C) 2020-2021 Loongson Technology Corporation Limited
+ */
Same here.
Have you done any measurement to show that the asm version actually helps
here? If not, just use the generic version.
Arnd