All of lore.kernel.org
 help / color / mirror / Atom feed
* Updated performance patch series
@ 2020-12-14 18:14 anton.ivanov
  2020-12-14 18:14 ` [PATCH v5 1/4] um: Add support for host CPU flags and alignment anton.ivanov
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: anton.ivanov @ 2020-12-14 18:14 UTC (permalink / raw)
  To: linux-um; +Cc: richard

1. I have revised the patches to fallback to x86 throughout instead
of falling back to generics.
2. Symlinks have been dropped in favour of direct references for the
x86 includes where applicable.
3. We use x86 CPU Feature flags now so anyone who wants to try their
luck doing the alternatives replacement can reuse some of the x86 code.
4. The perf gap between using kernel functions and using glibc has
narrowed a bit, but it is still there.



_______________________________________________
linux-um mailing list
linux-um@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-um


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH v5 1/4] um: Add support for host CPU flags and alignment
  2020-12-14 18:14 Updated performance patch series anton.ivanov
@ 2020-12-14 18:14 ` anton.ivanov
  2020-12-14 18:14 ` [PATCH v5 2/4] um: enable the use of optimized xor routines in UML anton.ivanov
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 8+ messages in thread
From: anton.ivanov @ 2020-12-14 18:14 UTC (permalink / raw)
  To: linux-um; +Cc: richard, Anton Ivanov

From: Anton Ivanov <anton.ivanov@cambridgegreys.com>

1. Reflect host cpu flags into the UML instance so they can
be used to select the correct implementations for xor, crypto, etc.

2. Reflect host cache alignment into UML instance. This is
important when running 32 bit on a 64 bit host as 32 bit by
default aligns to 32 while the actual alignment should be 64.
Ditto for some Xeons which align at 128.

Signed-off-by: Anton Ivanov <anton.ivanov@cambridgegreys.com>
---
 arch/um/Kconfig                         |  3 ++
 arch/um/include/asm/processor-generic.h |  8 +++++
 arch/um/include/shared/os.h             |  3 ++
 arch/um/kernel/Makefile                 | 13 +++++--
 arch/um/kernel/um_arch.c                | 48 ++++++++++++++++++++++---
 arch/um/os-Linux/start_up.c             | 32 +++++++++++++++++
 6 files changed, 101 insertions(+), 6 deletions(-)

diff --git a/arch/um/Kconfig b/arch/um/Kconfig
index 4b799fad8b48..6d707122e8d8 100644
--- a/arch/um/Kconfig
+++ b/arch/um/Kconfig
@@ -61,6 +61,9 @@ config NR_CPUS
 	range 1 1
 	default 1
 
+config ARCH_HAS_CACHE_LINE_SIZE
+	def_bool y
+
 source "arch/$(HEADER_ARCH)/um/Kconfig"
 
 config MAY_HAVE_RUNTIME_DEPS
diff --git a/arch/um/include/asm/processor-generic.h b/arch/um/include/asm/processor-generic.h
index afd9b267cf81..b5cf0ed116d9 100644
--- a/arch/um/include/asm/processor-generic.h
+++ b/arch/um/include/asm/processor-generic.h
@@ -16,6 +16,8 @@ struct task_struct;
 
 #include <linux/prefetch.h>
 
+#include <asm/cpufeatures.h>
+
 struct mm_struct;
 
 struct thread_struct {
@@ -90,12 +92,18 @@ extern void start_thread(struct pt_regs *regs, unsigned long entry,
 struct cpuinfo_um {
 	unsigned long loops_per_jiffy;
 	int ipi_pipe[2];
+	int cache_alignment;
+	union {
+		__u32		x86_capability[NCAPINTS + NBUGINTS];
+		unsigned long	x86_capability_alignment;
+	};
 };
 
 extern struct cpuinfo_um boot_cpu_data;
 
 #define cpu_data (&boot_cpu_data)
 #define current_cpu_data boot_cpu_data
+#define cache_line_size()	(boot_cpu_data.cache_alignment)
 
 #define KSTK_REG(tsk, reg) get_thread_reg(reg, &tsk->thread.switch_buf)
 extern unsigned long get_wchan(struct task_struct *p);
diff --git a/arch/um/include/shared/os.h b/arch/um/include/shared/os.h
index f467d28fc0b4..c73be207fbe5 100644
--- a/arch/um/include/shared/os.h
+++ b/arch/um/include/shared/os.h
@@ -187,6 +187,9 @@ int os_poll(unsigned int n, const int *fds);
 extern void os_early_checks(void);
 extern void os_check_bugs(void);
 extern void check_host_supports_tls(int *supports_tls, int *tls_min);
+extern void get_host_cpu_features(
+	void (*flags_helper_func)(char *line),
+	void (*cache_helper_func)(char *line));
 
 /* mem.c */
 extern int create_mem_file(unsigned long long len);
diff --git a/arch/um/kernel/Makefile b/arch/um/kernel/Makefile
index 5aa882011e04..64f82652db2e 100644
--- a/arch/um/kernel/Makefile
+++ b/arch/um/kernel/Makefile
@@ -17,7 +17,7 @@ extra-y := vmlinux.lds
 obj-y = config.o exec.o exitcode.o irq.o ksyms.o mem.o \
 	physmem.o process.o ptrace.o reboot.o sigio.o \
 	signal.o syscall.o sysrq.o time.o tlb.o trap.o \
-	um_arch.o umid.o maccess.o kmsg_dump.o skas/
+	um_arch.o umid.o maccess.o kmsg_dump.o capflags.o skas/
 
 obj-$(CONFIG_BLK_DEV_INITRD) += initrd.o
 obj-$(CONFIG_GPROF)	+= gprof_syms.o
@@ -29,7 +29,7 @@ USER_OBJS := config.o
 
 include arch/um/scripts/Makefile.rules
 
-targets := config.c config.tmp
+targets := config.c config.tmp capflags.c
 
 # Be careful with the below Sed code - sed is pitfall-rich!
 # We use sed to lower build requirements, for "embedded" builders for instance.
@@ -44,6 +44,15 @@ quiet_cmd_quote1 = QUOTE   $@
 $(obj)/config.c: $(src)/config.c.in $(obj)/config.tmp FORCE
 	$(call if_changed,quote2)
 
+quiet_cmd_mkcapflags = MKCAP   $@
+      cmd_mkcapflags = $(CONFIG_SHELL) $(srctree)/$(src)/../../x86/kernel/cpu/mkcapflags.sh $@ $^
+
+cpufeature = $(src)/../../x86/include/asm/cpufeatures.h
+vmxfeature = $(src)/../../x86/include/asm/vmxfeatures.h
+
+$(obj)/capflags.c: $(cpufeature) $(vmxfeature) $(src)/../../x86/kernel/cpu/mkcapflags.sh FORCE
+	$(call if_changed,mkcapflags)
+
 quiet_cmd_quote2 = QUOTE   $@
       cmd_quote2 = sed -e '/CONFIG/{'          \
 		  -e 's/"CONFIG"//'            \
diff --git a/arch/um/kernel/um_arch.c b/arch/um/kernel/um_arch.c
index 76b37297b7d4..d6bcaa01633d 100644
--- a/arch/um/kernel/um_arch.c
+++ b/arch/um/kernel/um_arch.c
@@ -6,6 +6,7 @@
 #include <linux/delay.h>
 #include <linux/init.h>
 #include <linux/mm.h>
+#include <linux/ctype.h>
 #include <linux/module.h>
 #include <linux/seq_file.h>
 #include <linux/string.h>
@@ -15,6 +16,7 @@
 #include <linux/kmsg_dump.h>
 
 #include <asm/processor.h>
+#include <asm/cpufeature.h>
 #include <asm/sections.h>
 #include <asm/setup.h>
 #include <as-layout.h>
@@ -48,9 +50,13 @@ static void __init add_arg(char *arg)
  */
 struct cpuinfo_um boot_cpu_data = {
 	.loops_per_jiffy	= 0,
-	.ipi_pipe		= { -1, -1 }
+	.ipi_pipe		= { -1, -1 },
+	.cache_alignment	= L1_CACHE_BYTES,
+	.x86_capability		= { 0 }
 };
 
+EXPORT_SYMBOL(boot_cpu_data);
+
 union thread_union cpu0_irqstack
 	__section(".data..init_irqstack") =
 		{ .thread_info = INIT_THREAD_INFO(init_task) };
@@ -60,17 +66,25 @@ static char host_info[(__NEW_UTS_LEN + 1) * 5];
 
 static int show_cpuinfo(struct seq_file *m, void *v)
 {
-	int index = 0;
+	int i = 0;
 
-	seq_printf(m, "processor\t: %d\n", index);
+	seq_printf(m, "processor\t: %d\n", i);
 	seq_printf(m, "vendor_id\t: User Mode Linux\n");
 	seq_printf(m, "model name\t: UML\n");
 	seq_printf(m, "mode\t\t: skas\n");
 	seq_printf(m, "host\t\t: %s\n", host_info);
-	seq_printf(m, "bogomips\t: %lu.%02lu\n\n",
+	seq_printf(m, "fpu\t\t: %s\n", cpu_has(&boot_cpu_data, X86_FEATURE_FPU) ? "yes" : "no");
+	seq_printf(m, "flags\t\t:");
+	for (i = 0; i < 32*NCAPINTS; i++)
+		if (cpu_has(&boot_cpu_data, i) && (x86_cap_flags[i] != NULL))
+			seq_printf(m, " %s", x86_cap_flags[i]);
+	seq_printf(m, "\n");
+	seq_printf(m, "cache_alignment\t: %d\n", boot_cpu_data.cache_alignment);
+	seq_printf(m, "bogomips\t: %lu.%02lu\n",
 		   loops_per_jiffy/(500000/HZ),
 		   (loops_per_jiffy/(5000/HZ)) % 100);
 
+
 	return 0;
 }
 
@@ -246,6 +260,30 @@ EXPORT_SYMBOL(end_iomem);
 
 #define MIN_VMALLOC (32 * 1024 * 1024)
 
+static void parse_host_cpu_flags(char *line)
+{
+	int i;
+	for (i = 0; i < 32*NCAPINTS; i++) {
+		if ((x86_cap_flags[i] != NULL) && strstr(line, x86_cap_flags[i]))
+			set_cpu_cap(&boot_cpu_data, i);;
+	}
+}
+static void parse_cache_line(char *line)
+{
+	long res;
+	char *to_parse = strstr(line, ":");
+	if (to_parse) {
+		to_parse++;
+		while (*to_parse != 0 && isspace(*to_parse)) {
+			to_parse++;
+		}
+		if (kstrtoul(to_parse, 10, &res) == 0 && is_power_of_2(res))
+			boot_cpu_data.cache_alignment = res;
+		else
+			boot_cpu_data.cache_alignment = L1_CACHE_BYTES;
+	}
+}
+
 int __init linux_main(int argc, char **argv)
 {
 	unsigned long avail, diff;
@@ -275,6 +313,8 @@ int __init linux_main(int argc, char **argv)
 	/* OS sanity checks that need to happen before the kernel runs */
 	os_early_checks();
 
+	get_host_cpu_features(parse_host_cpu_flags, parse_cache_line);
+
 	brk_start = (unsigned long) sbrk(0);
 
 	/*
diff --git a/arch/um/os-Linux/start_up.c b/arch/um/os-Linux/start_up.c
index f79dc338279e..8a72c99994eb 100644
--- a/arch/um/os-Linux/start_up.c
+++ b/arch/um/os-Linux/start_up.c
@@ -321,6 +321,38 @@ static void __init check_coredump_limit(void)
 		os_info("%llu\n", (unsigned long long)lim.rlim_max);
 }
 
+void  __init get_host_cpu_features(
+		void (*flags_helper_func)(char *line),
+		void (*cache_helper_func)(char *line))
+{
+	FILE *cpuinfo;
+	char *line = NULL;
+	size_t len = 0;
+	int done_parsing = 0;
+
+	cpuinfo = fopen("/proc/cpuinfo", "r");
+	if (cpuinfo == NULL) {
+		os_info("Failed to get host CPU features\n");
+	} else {
+		while ((getline(&line, &len, cpuinfo)) != -1) {
+			if (strstr(line, "flags")) {
+				flags_helper_func(line);
+				done_parsing++;
+			}
+			if (strstr(line, "cache_alignment")) {
+				cache_helper_func(line);
+				done_parsing++;
+			}
+			free(line);
+			line = NULL;
+			if (done_parsing > 1)
+				break;
+		}
+		fclose(cpuinfo);
+	}
+}
+
+
 void __init os_early_checks(void)
 {
 	int pid;
-- 
2.20.1


_______________________________________________
linux-um mailing list
linux-um@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-um


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH v5 2/4] um: enable the use of optimized xor routines in UML
  2020-12-14 18:14 Updated performance patch series anton.ivanov
  2020-12-14 18:14 ` [PATCH v5 1/4] um: Add support for host CPU flags and alignment anton.ivanov
@ 2020-12-14 18:14 ` anton.ivanov
  2020-12-14 18:14 ` [PATCH v5 3/4] um: add a UML specific futex implementation anton.ivanov
  2020-12-14 18:14 ` [PATCH v5 4/4] um: allow the use of glibc functions instead of builtins anton.ivanov
  3 siblings, 0 replies; 8+ messages in thread
From: anton.ivanov @ 2020-12-14 18:14 UTC (permalink / raw)
  To: linux-um; +Cc: richard, Anton Ivanov

From: Anton Ivanov <anton.ivanov@cambridgegreys.com>

This patch enables the use of optimized xor routines from the x86
tree as well as the necessary fpu api shims so they can work on
UML.

Signed-off-by: Anton Ivanov <anton.ivanov@cambridgegreys.com>
---
 arch/um/include/asm/fpu/api.h | 14 ++++++++++++++
 arch/um/include/asm/xor.h     | 17 ++++++++++++++++-
 2 files changed, 30 insertions(+), 1 deletion(-)
 create mode 100644 arch/um/include/asm/fpu/api.h

diff --git a/arch/um/include/asm/fpu/api.h b/arch/um/include/asm/fpu/api.h
new file mode 100644
index 000000000000..2873a6f0105d
--- /dev/null
+++ b/arch/um/include/asm/fpu/api.h
@@ -0,0 +1,14 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+#ifndef _ASM_UM_FPU_API_H
+#define _ASM_UM_FPU_API_H
+
+/* Copyright (c) 2020 Cambridge Greys Ltd
+ * Copyright (c) 2020 Red Hat Inc.
+ * A set of "dummy" defines to allow the direct inclusion
+ * of x86 optimized copy, xor, etc routines into the
+ * UML code tree. */
+
+#define kernel_fpu_begin() (void)0
+#define kernel_fpu_end() (void)0
+
+#endif
diff --git a/arch/um/include/asm/xor.h b/arch/um/include/asm/xor.h
index 36b33d62a35d..f512704a9ec7 100644
--- a/arch/um/include/asm/xor.h
+++ b/arch/um/include/asm/xor.h
@@ -1,7 +1,22 @@
 /* SPDX-License-Identifier: GPL-2.0 */
-#include <asm-generic/xor.h>
+#ifndef _ASM_UM_XOR_H
+#define _ASM_UM_XOR_H
+
+#ifdef CONFIG_64BIT
+#undef CONFIG_X86_32
+#else
+#define CONFIG_X86_32 1
+#endif
+
+#include <asm/cpufeature.h>
+#include <../../x86/include/asm/xor.h>
 #include <linux/time-internal.h>
 
+#ifdef CONFIG_UML_TIME_TRAVEL_SUPPORT
+#undef XOR_SELECT_TEMPLATE
 /* pick an arbitrary one - measuring isn't possible with inf-cpu */
 #define XOR_SELECT_TEMPLATE(x)	\
 	(time_travel_mode == TT_MODE_INFCPU ? &xor_block_8regs : NULL)
+#endif
+
+#endif
-- 
2.20.1


_______________________________________________
linux-um mailing list
linux-um@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-um


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH v5 3/4] um: add a UML specific futex implementation
  2020-12-14 18:14 Updated performance patch series anton.ivanov
  2020-12-14 18:14 ` [PATCH v5 1/4] um: Add support for host CPU flags and alignment anton.ivanov
  2020-12-14 18:14 ` [PATCH v5 2/4] um: enable the use of optimized xor routines in UML anton.ivanov
@ 2020-12-14 18:14 ` anton.ivanov
  2020-12-15  9:43   ` Anton Ivanov
  2020-12-14 18:14 ` [PATCH v5 4/4] um: allow the use of glibc functions instead of builtins anton.ivanov
  3 siblings, 1 reply; 8+ messages in thread
From: anton.ivanov @ 2020-12-14 18:14 UTC (permalink / raw)
  To: linux-um; +Cc: richard, Anton Ivanov

From: Anton Ivanov <anton.ivanov@cambridgegreys.com>

The generic asm futex implementation emulates atomic access to
memory by doing a get_user followed by put_user. These translate
to two mapping operations on UML with paging enabled in the
meantime. This, in turn may end up changing interrupts,
invoking the signal loop, etc.

This replaces the generic implementation by a mapping followed
by an operation on the mapped segment.

Signed-off-by: Anton Ivanov <anton.ivanov@cambridgegreys.com>
---
 arch/um/include/asm/Kbuild    |   1 -
 arch/um/include/asm/futex.h   |  14 ++++
 arch/um/kernel/skas/uaccess.c | 130 ++++++++++++++++++++++++++++++++++
 3 files changed, 144 insertions(+), 1 deletion(-)
 create mode 100644 arch/um/include/asm/futex.h

diff --git a/arch/um/include/asm/Kbuild b/arch/um/include/asm/Kbuild
index 1c63b260ecc4..873e6815bc50 100644
--- a/arch/um/include/asm/Kbuild
+++ b/arch/um/include/asm/Kbuild
@@ -8,7 +8,6 @@ generic-y += emergency-restart.h
 generic-y += exec.h
 generic-y += extable.h
 generic-y += ftrace.h
-generic-y += futex.h
 generic-y += hw_irq.h
 generic-y += irq_regs.h
 generic-y += irq_work.h
diff --git a/arch/um/include/asm/futex.h b/arch/um/include/asm/futex.h
new file mode 100644
index 000000000000..0a01f1f60de0
--- /dev/null
+++ b/arch/um/include/asm/futex.h
@@ -0,0 +1,14 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef _ASM_GENERIC_FUTEX_H
+#define _ASM_GENERIC_FUTEX_H
+
+#include <linux/futex.h>
+#include <linux/uaccess.h>
+#include <asm/errno.h>
+
+
+extern int arch_futex_atomic_op_inuser(int op, u32 oparg, int *oval, u32 __user *uaddr);
+extern int futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr,
+			      u32 oldval, u32 newval);
+
+#endif
diff --git a/arch/um/kernel/skas/uaccess.c b/arch/um/kernel/skas/uaccess.c
index 2dec915abe6f..85022e91bf53 100644
--- a/arch/um/kernel/skas/uaccess.c
+++ b/arch/um/kernel/skas/uaccess.c
@@ -11,6 +11,7 @@
 #include <asm/current.h>
 #include <asm/page.h>
 #include <kern_util.h>
+#include <asm/futex.h>
 #include <os.h>
 
 pte_t *virt_to_pte(struct mm_struct *mm, unsigned long addr)
@@ -248,3 +249,132 @@ long __strnlen_user(const void __user *str, long len)
 	return 0;
 }
 EXPORT_SYMBOL(__strnlen_user);
+
+/**
+ * arch_futex_atomic_op_inuser() - Atomic arithmetic operation with constant
+ *			  argument and comparison of the previous
+ *			  futex value with another constant.
+ *
+ * @encoded_op:	encoded operation to execute
+ * @uaddr:	pointer to user space address
+ *
+ * Return:
+ * 0 - On success
+ * -EFAULT - User access resulted in a page fault
+ * -EAGAIN - Atomic operation was unable to complete due to contention
+ * -ENOSYS - Operation not supported
+ */
+
+int arch_futex_atomic_op_inuser(int op, u32 oparg, int *oval, u32 __user *uaddr)
+{
+	int oldval, ret;
+	struct page *page;
+	unsigned long addr = (unsigned long) uaddr;
+	pte_t *pte;
+
+	ret = -EFAULT;
+	if (!access_ok(uaddr, sizeof(*uaddr)))
+		return -EFAULT;
+	preempt_disable();
+	pte = maybe_map(addr, 1);
+	if (pte == NULL)
+		goto out_inuser;
+
+	page = pte_page(*pte);
+#ifdef CONFIG_64BIT
+	pagefault_disable();
+	addr = (unsigned long) page_address(page) +
+			(((unsigned long) addr) & ~PAGE_MASK);
+#else
+	addr = (unsigned long) kmap_atomic(page) +
+		((unsigned long) addr & ~PAGE_MASK);
+#endif
+	uaddr = (u32 *) addr;
+	oldval = *uaddr;
+
+	ret = 0;
+
+	switch (op) {
+	case FUTEX_OP_SET:
+		*uaddr = oparg;
+		break;
+	case FUTEX_OP_ADD:
+		*uaddr += oparg;
+		break;
+	case FUTEX_OP_OR:
+		*uaddr |= oparg;
+		break;
+	case FUTEX_OP_ANDN:
+		*uaddr &= ~oparg;
+		break;
+	case FUTEX_OP_XOR:
+		*uaddr ^= oparg;
+		break;
+	default:
+		ret = -ENOSYS;
+	}
+#ifdef CONFIG_64BIT
+	pagefault_enable();
+#else
+	kunmap_atomic((void *)addr);
+#endif
+
+out_inuser:
+	preempt_enable();
+
+	if (ret == 0)
+		*oval = oldval;
+
+	return ret;
+}
+EXPORT_SYMBOL(arch_futex_atomic_op_inuser);
+
+/**
+ * futex_atomic_cmpxchg_inatomic() - Compare and exchange the content of the
+ *				uaddr with newval if the current value is
+ *				oldval.
+ * @uval:	pointer to store content of @uaddr
+ * @uaddr:	pointer to user space address
+ * @oldval:	old value
+ * @newval:	new value to store to @uaddr
+ *
+ * Return:
+ * 0 - On success
+ * -EFAULT - User access resulted in a page fault
+ * -EAGAIN - Atomic operation was unable to complete due to contention
+ * -ENOSYS - Function not implemented (only if !HAVE_FUTEX_CMPXCHG)
+ */
+
+int futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr,
+			      u32 oldval, u32 newval)
+{
+	u32 val;
+	struct page *page;
+	pte_t *pte;
+	int ret = -EFAULT;
+
+	if (!access_ok(uaddr, sizeof(*uaddr)))
+		return -EFAULT;
+
+	preempt_disable();
+	pte = maybe_map((unsigned long) uaddr, 1);
+	if (pte == NULL)
+		goto out_inatomic;
+
+	page = pte_page(*pte);
+	pagefault_disable();
+	uaddr = page_address(page) + (((unsigned long) uaddr) & ~PAGE_MASK);
+
+	val = *uaddr;
+
+	ret = cmpxchg(uaddr, oldval, newval);
+
+	*uval = val;
+	pagefault_enable();
+	ret = 0;
+
+out_inatomic:
+	preempt_enable();
+	return ret;
+}
+EXPORT_SYMBOL(futex_atomic_cmpxchg_inatomic);
-- 
2.20.1


_______________________________________________
linux-um mailing list
linux-um@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-um


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH v5 4/4] um: allow the use of glibc functions instead of builtins
  2020-12-14 18:14 Updated performance patch series anton.ivanov
                   ` (2 preceding siblings ...)
  2020-12-14 18:14 ` [PATCH v5 3/4] um: add a UML specific futex implementation anton.ivanov
@ 2020-12-14 18:14 ` anton.ivanov
  3 siblings, 0 replies; 8+ messages in thread
From: anton.ivanov @ 2020-12-14 18:14 UTC (permalink / raw)
  To: linux-um; +Cc: richard, Anton Ivanov

From: Anton Ivanov <anton.ivanov@cambridgegreys.com>

The UML kernel runs as a normal userspace process and can use most
of glibc string.h functionality instead of built-ins. At present,
when using built-ins, it is also limited to their unoptimized
versions, because it does not have the runtime code patching present
on x86 via apply_alternatives()

Allowing the use of glibc for memcpy, memmove, etc provides 1-5%
boost on common file io as measured by cat and dd. The size of
the linux executable is also reduced by ~10KBytes.

It is possible to turn this on/off via the kernel configuration.

Signed-off-by: Anton Ivanov <anton.ivanov@cambridgegreys.com>
---
 arch/um/Kconfig              | 10 ++++++
 arch/um/include/asm/string.h | 70 ++++++++++++++++++++++++++++++++++++
 arch/um/os-Linux/user_syms.c | 29 ++++++++++++---
 arch/x86/um/Makefile         |  6 ++--
 4 files changed, 109 insertions(+), 6 deletions(-)
 create mode 100644 arch/um/include/asm/string.h

diff --git a/arch/um/Kconfig b/arch/um/Kconfig
index 6d707122e8d8..9e4503066552 100644
--- a/arch/um/Kconfig
+++ b/arch/um/Kconfig
@@ -192,6 +192,16 @@ config UML_TIME_TRAVEL_SUPPORT
 
 	  It is safe to say Y, but you probably don't need this.
 
+config UML_USE_BUILT_IN_STRINGS
+	bool
+	default N
+	prompt "Use kernel memcpy, memmove, etc"
+	help
+	  UML can use the kernel built in memcpy, memmove, etc functions
+	  or use the glibc equivalents instead.
+	  The glibc equivalents are slightly faster and will result in a
+	  slightly smaller executable when linking UML dynamically.
+
 endmenu
 
 source "arch/um/drivers/Kconfig"
diff --git a/arch/um/include/asm/string.h b/arch/um/include/asm/string.h
new file mode 100644
index 000000000000..a65bbbe83083
--- /dev/null
+++ b/arch/um/include/asm/string.h
@@ -0,0 +1,70 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+
+/*
+ * Copyright (C) 2020 Cambridge Greys Ltd.
+ * Copyright (C) 2020 Red Hat Inc.
+ */
+
+#ifndef __ASM_UM_STRING_H
+#define __ASM_UM_STRING_H
+
+#ifndef CONFIG_UML_USE_BUILT_IN_STRINGS
+
+#include <stddef.h>
+
+#define __HAVE_ARCH_STRCPY
+extern char *strcpy(char *dest, const char *src);
+#define __HAVE_ARCH_STRNCPY
+extern char *strncpy(char *dest, const char *src, size_t n);
+#define __HAVE_ARCH_STRCAT
+extern char *strcat(char *dest, const char *src);
+#define __HAVE_ARCH_STRNCAT
+extern char *strncat(char *dest, const char *src, size_t n);
+#define __HAVE_ARCH_STRCMP
+extern int strcmp(const char *s1, const char *s2);
+#define __HAVE_ARCH_STRNCMP
+extern int strncmp(const char *s1, const char *s2, size_t n);
+#define __HAVE_ARCH_STRCHR
+extern char *strchr(const char *s, int c);
+#define __HAVE_ARCH_STRLEN
+extern size_t strlen(const char *s);
+#define __HAVE_ARCH_MEMCPY
+extern void *memcpy(void *dest, const void *src, size_t n);
+#define __HAVE_ARCH_MEMMOVE
+extern void *memmove(void *dest, const void *src, size_t n);
+#define __HAVE_ARCH_MEMCHR
+extern void *memchr(const void *s, int c, size_t n);
+#define __HAVE_ARCH_STRNLEN
+extern size_t strnlen(const char *s, size_t maxlen);
+#define __HAVE_ARCH_STRSTR
+extern char *strstr(const char *haystack, const char *needle);
+#define __HAVE_ARCH_MEMSET
+extern void *memset(void *s, int c, size_t n);
+#define __HAVE_ARCH_STRNCASECMP
+extern int strncasecmp(const char *s1, const char *s2, size_t n);
+#define __HAVE_ARCH_STRCASECMP
+extern int strcasecmp(const char *s1, const char *s2);
+#define __HAVE_ARCH_STRCHRNUL
+extern char *strchrnul(const char *s, int c);
+#define __HAVE_ARCH_STRRCH
+extern char *strchrnul(const char *s, int c);
+#define __HAVE_ARCH_STRSPN
+extern size_t strspn(const char *s, const char *accept);
+#define __HAVE_ARCH_STRCSPN
+extern size_t strcspn(const char *s, const char *reject);
+#define __HAVE_ARCH_STRPBRK
+extern char *strpbrk(const char *s, const char *accept);
+#define __HAVE_ARCH_STRSEP
+extern char *strsep(char **stringp, const char *delim);
+#define __HAVE_ARCH_MEMCMP
+extern int memcmp(const void *s1, const void *s2, size_t n);
+#define __HAVE_ARCH_BCMP
+extern int bcmp(const void *s1, const void *s2, size_t n);
+
+#else
+
+#include <../../x86/include/asm/string.h>
+
+#endif
+
+#endif /* __ASM_UM_STRING_H */
diff --git a/arch/um/os-Linux/user_syms.c b/arch/um/os-Linux/user_syms.c
index 715594fe5719..2e24c9000316 100644
--- a/arch/um/os-Linux/user_syms.c
+++ b/arch/um/os-Linux/user_syms.c
@@ -9,6 +9,7 @@
  * add an EXPORT for the glibc one.
  */
 
+#ifdef CONFIG_UML_USE_BUILT_IN_STRINGS
 #undef strlen
 #undef strstr
 #undef memcpy
@@ -17,6 +18,7 @@
 extern size_t strlen(const char *);
 extern void *memmove(void *, const void *, size_t);
 extern void *memset(void *, int, size_t);
+#endif
 extern int printf(const char *, ...);
 
 /* If it's not defined, the export is included in lib/string.c.*/
@@ -24,14 +26,33 @@ extern int printf(const char *, ...);
 EXPORT_SYMBOL(strstr);
 #endif
 
-#ifndef __x86_64__
-extern void *memcpy(void *, const void *, size_t);
-EXPORT_SYMBOL(memcpy);
+#ifndef CONFIG_UML_USE_BUILT_IN_STRINGS
+/* These all come from glibc */
+EXPORT_SYMBOL(printf);
+EXPORT_SYMBOL(strcpy);
+EXPORT_SYMBOL(strncpy);
+EXPORT_SYMBOL(strcat);
+EXPORT_SYMBOL(strncat);
+EXPORT_SYMBOL(strcmp);
+EXPORT_SYMBOL(strncmp);
+EXPORT_SYMBOL(strchr);
+EXPORT_SYMBOL(strlen);
+EXPORT_SYMBOL(memchr);
+EXPORT_SYMBOL(strnlen);
+EXPORT_SYMBOL(strncasecmp);
+EXPORT_SYMBOL(strcasecmp);
+EXPORT_SYMBOL(strchrnul);
+EXPORT_SYMBOL(strcspn);
+EXPORT_SYMBOL(strpbrk);
+EXPORT_SYMBOL(strsep);
+EXPORT_SYMBOL(memcmp);
+EXPORT_SYMBOL(bcmp);
+
 #endif
 
+EXPORT_SYMBOL(memcpy);
 EXPORT_SYMBOL(memmove);
 EXPORT_SYMBOL(memset);
-EXPORT_SYMBOL(printf);
 
 /* Here, instead, I can provide a fake prototype. Yes, someone cares: genksyms.
  * However, the modules will use the CRC defined *here*, no matter if it is
diff --git a/arch/x86/um/Makefile b/arch/x86/um/Makefile
index 77f70b969d14..453ea23a9770 100644
--- a/arch/x86/um/Makefile
+++ b/arch/x86/um/Makefile
@@ -20,14 +20,16 @@ ifeq ($(CONFIG_X86_32),y)
 obj-y += checksum_32.o syscalls_32.o
 obj-$(CONFIG_ELF_CORE) += elfcore.o
 
-subarch-y = ../lib/string_32.o ../lib/atomic64_32.o ../lib/atomic64_cx8_32.o
+subarch-y = ../lib/atomic64_32.o ../lib/atomic64_cx8_32.o
 subarch-y += ../kernel/sys_ia32.o
+subarch-$(CONFIG_UML_USE_BUILT_IN_STRINGS) += ../lib/string_32.o
 
 else
 
 obj-y += syscalls_64.o vdso/
 
-subarch-y = ../lib/csum-partial_64.o ../lib/memcpy_64.o ../entry/thunk_64.o
+subarch-y = ../lib/csum-partial_64.o ../entry/thunk_64.o
+subarch-$(CONFIG_UML_USE_BUILT_IN_STRINGS) += ../lib/memcpy_64.o
 
 endif
 
-- 
2.20.1


_______________________________________________
linux-um mailing list
linux-um@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-um


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH v5 3/4] um: add a UML specific futex implementation
  2020-12-14 18:14 ` [PATCH v5 3/4] um: add a UML specific futex implementation anton.ivanov
@ 2020-12-15  9:43   ` Anton Ivanov
  2020-12-15  9:46     ` Richard Weinberger
  0 siblings, 1 reply; 8+ messages in thread
From: Anton Ivanov @ 2020-12-15  9:43 UTC (permalink / raw)
  To: linux-um; +Cc: richard


On 14/12/2020 18:14, anton.ivanov@cambridgegreys.com wrote:
> From: Anton Ivanov <anton.ivanov@cambridgegreys.com>
>
> The generic asm futex implementation emulates atomic access to
> memory by doing a get_user followed by put_user. These translate
> to two mapping operations on UML with paging enabled in the
> meantime. This, in turn may end up changing interrupts,
> invoking the signal loop, etc.
>
> This replaces the generic implementation by a mapping followed
> by an operation on the mapped segment.
>
> Signed-off-by: Anton Ivanov <anton.ivanov@cambridgegreys.com>
> ---
>   arch/um/include/asm/Kbuild    |   1 -
>   arch/um/include/asm/futex.h   |  14 ++++
>   arch/um/kernel/skas/uaccess.c | 130 ++++++++++++++++++++++++++++++++++
>   3 files changed, 144 insertions(+), 1 deletion(-)
>   create mode 100644 arch/um/include/asm/futex.h
>
> diff --git a/arch/um/include/asm/Kbuild b/arch/um/include/asm/Kbuild
> index 1c63b260ecc4..873e6815bc50 100644
> --- a/arch/um/include/asm/Kbuild
> +++ b/arch/um/include/asm/Kbuild
> @@ -8,7 +8,6 @@ generic-y += emergency-restart.h
>   generic-y += exec.h
>   generic-y += extable.h
>   generic-y += ftrace.h
> -generic-y += futex.h
>   generic-y += hw_irq.h
>   generic-y += irq_regs.h
>   generic-y += irq_work.h
> diff --git a/arch/um/include/asm/futex.h b/arch/um/include/asm/futex.h
> new file mode 100644
> index 000000000000..0a01f1f60de0
> --- /dev/null
> +++ b/arch/um/include/asm/futex.h
> @@ -0,0 +1,14 @@
> +/* SPDX-License-Identifier: GPL-2.0 */
> +#ifndef _ASM_GENERIC_FUTEX_H
> +#define _ASM_GENERIC_FUTEX_H

^^^^ Uggghhh

> +
> +#include <linux/futex.h>
> +#include <linux/uaccess.h>
> +#include <asm/errno.h>
> +
> +
> +extern int arch_futex_atomic_op_inuser(int op, u32 oparg, int *oval, u32 __user *uaddr);
> +extern int futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr,
> +			      u32 oldval, u32 newval);
^^^^ Did not address Johannes comments, will do in v6
> +
> +#endif
> diff --git a/arch/um/kernel/skas/uaccess.c b/arch/um/kernel/skas/uaccess.c
> index 2dec915abe6f..85022e91bf53 100644
> --- a/arch/um/kernel/skas/uaccess.c
> +++ b/arch/um/kernel/skas/uaccess.c
> @@ -11,6 +11,7 @@
>   #include <asm/current.h>
>   #include <asm/page.h>
>   #include <kern_util.h>
> +#include <asm/futex.h>
>   #include <os.h>
>   
>   pte_t *virt_to_pte(struct mm_struct *mm, unsigned long addr)
> @@ -248,3 +249,132 @@ long __strnlen_user(const void __user *str, long len)
>   	return 0;
>   }
>   EXPORT_SYMBOL(__strnlen_user);
> +
> +/**
> + * arch_futex_atomic_op_inuser() - Atomic arithmetic operation with constant
> + *			  argument and comparison of the previous
> + *			  futex value with another constant.
> + *
> + * @encoded_op:	encoded operation to execute
> + * @uaddr:	pointer to user space address
> + *
> + * Return:
> + * 0 - On success
> + * -EFAULT - User access resulted in a page fault
> + * -EAGAIN - Atomic operation was unable to complete due to contention
> + * -ENOSYS - Operation not supported
> + */
> +
> +int arch_futex_atomic_op_inuser(int op, u32 oparg, int *oval, u32 __user *uaddr)
> +{
> +	int oldval, ret;
> +	struct page *page;
> +	unsigned long addr = (unsigned long) uaddr;
> +	pte_t *pte;
> +
> +	ret = -EFAULT;
> +	if (!access_ok(uaddr, sizeof(*uaddr)))
> +		return -EFAULT;
> +	preempt_disable();
> +	pte = maybe_map(addr, 1);
> +	if (pte == NULL)
> +		goto out_inuser;
> +
> +	page = pte_page(*pte);
> +#ifdef CONFIG_64BIT
> +	pagefault_disable();
> +	addr = (unsigned long) page_address(page) +
> +			(((unsigned long) addr) & ~PAGE_MASK);
> +#else
> +	addr = (unsigned long) kmap_atomic(page) +
> +		((unsigned long) addr & ~PAGE_MASK);
> +#endif
> +	uaddr = (u32 *) addr;
> +	oldval = *uaddr;
> +
> +	ret = 0;
> +
> +	switch (op) {
> +	case FUTEX_OP_SET:
> +		*uaddr = oparg;
> +		break;
> +	case FUTEX_OP_ADD:
> +		*uaddr += oparg;
> +		break;
> +	case FUTEX_OP_OR:
> +		*uaddr |= oparg;
> +		break;
> +	case FUTEX_OP_ANDN:
> +		*uaddr &= ~oparg;
> +		break;
> +	case FUTEX_OP_XOR:
> +		*uaddr ^= oparg;
> +		break;
> +	default:
> +		ret = -ENOSYS;
> +	}
> +#ifdef CONFIG_64BIT
> +	pagefault_enable();
> +#else
> +	kunmap_atomic((void *)addr);
> +#endif
> +
> +out_inuser:
> +	preempt_enable();
> +
> +	if (ret == 0)
> +		*oval = oldval;
> +
> +	return ret;
> +}
> +EXPORT_SYMBOL(arch_futex_atomic_op_inuser);
> +
> +/**
> + * futex_atomic_cmpxchg_inatomic() - Compare and exchange the content of the
> + *				uaddr with newval if the current value is
> + *				oldval.
> + * @uval:	pointer to store content of @uaddr
> + * @uaddr:	pointer to user space address
> + * @oldval:	old value
> + * @newval:	new value to store to @uaddr
> + *
> + * Return:
> + * 0 - On success
> + * -EFAULT - User access resulted in a page fault
> + * -EAGAIN - Atomic operation was unable to complete due to contention
> + * -ENOSYS - Function not implemented (only if !HAVE_FUTEX_CMPXCHG)
> + */
> +
> +int futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr,
> +			      u32 oldval, u32 newval)
> +{
> +	u32 val;
> +	struct page *page;
> +	pte_t *pte;
> +	int ret = -EFAULT;
> +
> +	if (!access_ok(uaddr, sizeof(*uaddr)))
> +		return -EFAULT;
> +
> +	preempt_disable();
> +	pte = maybe_map((unsigned long) uaddr, 1);
> +	if (pte == NULL)
> +		goto out_inatomic;
> +
> +	page = pte_page(*pte);
> +	pagefault_disable();
> +	uaddr = page_address(page) + (((unsigned long) uaddr) & ~PAGE_MASK);
^^^ missing 32 bit case, sending v6 with fix shortly.
> +
> +	val = *uaddr;
> +
> +	ret = cmpxchg(uaddr, oldval, newval);
> +
> +	*uval = val;
> +	pagefault_enable();
> +	ret = 0;
> +
> +out_inatomic:
> +	preempt_enable();
> +	return ret;
> +}
> +EXPORT_SYMBOL(futex_atomic_cmpxchg_inatomic);

-- 
Anton R. Ivanov
Cambridgegreys Limited. Registered in England. Company Number 10273661
https://www.cambridgegreys.com/


_______________________________________________
linux-um mailing list
linux-um@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-um


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v5 3/4] um: add a UML specific futex implementation
  2020-12-15  9:43   ` Anton Ivanov
@ 2020-12-15  9:46     ` Richard Weinberger
  2020-12-15  9:56       ` Anton Ivanov
  0 siblings, 1 reply; 8+ messages in thread
From: Richard Weinberger @ 2020-12-15  9:46 UTC (permalink / raw)
  To: anton ivanov; +Cc: linux-um

Anton,

----- Ursprüngliche Mail -----
> Von: "anton ivanov" <anton.ivanov@cambridgegreys.com>
> An: "linux-um" <linux-um@lists.infradead.org>
> CC: "richard" <richard@nod.at>
> Gesendet: Dienstag, 15. Dezember 2020 10:43:48
> Betreff: Re: [PATCH v5 3/4] um: add a UML specific futex implementation

> On 14/12/2020 18:14, anton.ivanov@cambridgegreys.com wrote:
>> From: Anton Ivanov <anton.ivanov@cambridgegreys.com>
>>
>> The generic asm futex implementation emulates atomic access to
>> memory by doing a get_user followed by put_user. These translate
>> to two mapping operations on UML with paging enabled in the
>> meantime. This, in turn may end up changing interrupts,
>> invoking the signal loop, etc.
>>
>> This replaces the generic implementation by a mapping followed
>> by an operation on the mapped segment.
>>
>> Signed-off-by: Anton Ivanov <anton.ivanov@cambridgegreys.com>
>> ---
>>   arch/um/include/asm/Kbuild    |   1 -
>>   arch/um/include/asm/futex.h   |  14 ++++
>>   arch/um/kernel/skas/uaccess.c | 130 ++++++++++++++++++++++++++++++++++
>>   3 files changed, 144 insertions(+), 1 deletion(-)
>>   create mode 100644 arch/um/include/asm/futex.h
>>
>> diff --git a/arch/um/include/asm/Kbuild b/arch/um/include/asm/Kbuild
>> index 1c63b260ecc4..873e6815bc50 100644
>> --- a/arch/um/include/asm/Kbuild
>> +++ b/arch/um/include/asm/Kbuild
>> @@ -8,7 +8,6 @@ generic-y += emergency-restart.h
>>   generic-y += exec.h
>>   generic-y += extable.h
>>   generic-y += ftrace.h
>> -generic-y += futex.h
>>   generic-y += hw_irq.h
>>   generic-y += irq_regs.h
>>   generic-y += irq_work.h
>> diff --git a/arch/um/include/asm/futex.h b/arch/um/include/asm/futex.h
>> new file mode 100644
>> index 000000000000..0a01f1f60de0
>> --- /dev/null
>> +++ b/arch/um/include/asm/futex.h
>> @@ -0,0 +1,14 @@
>> +/* SPDX-License-Identifier: GPL-2.0 */
>> +#ifndef _ASM_GENERIC_FUTEX_H
>> +#define _ASM_GENERIC_FUTEX_H
> 
> ^^^^ Uggghhh
> 
>> +
>> +#include <linux/futex.h>
>> +#include <linux/uaccess.h>
>> +#include <asm/errno.h>
>> +
>> +
>> +extern int arch_futex_atomic_op_inuser(int op, u32 oparg, int *oval, u32 __user
>> *uaddr);
>> +extern int futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr,
>> +			      u32 oldval, u32 newval);
> ^^^^ Did not address Johannes comments, will do in v6

No need to hurry. This has to wait anyway for 5.12. :-)

Thanks,
//richard

_______________________________________________
linux-um mailing list
linux-um@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-um

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v5 3/4] um: add a UML specific futex implementation
  2020-12-15  9:46     ` Richard Weinberger
@ 2020-12-15  9:56       ` Anton Ivanov
  0 siblings, 0 replies; 8+ messages in thread
From: Anton Ivanov @ 2020-12-15  9:56 UTC (permalink / raw)
  To: Richard Weinberger; +Cc: linux-um


On 15/12/2020 09:46, Richard Weinberger wrote:
> Anton,
>
> ----- Ursprüngliche Mail -----
>> Von: "anton ivanov" <anton.ivanov@cambridgegreys.com>
>> An: "linux-um" <linux-um@lists.infradead.org>
>> CC: "richard" <richard@nod.at>
>> Gesendet: Dienstag, 15. Dezember 2020 10:43:48
>> Betreff: Re: [PATCH v5 3/4] um: add a UML specific futex implementation
>> On 14/12/2020 18:14, anton.ivanov@cambridgegreys.com wrote:
>>> From: Anton Ivanov <anton.ivanov@cambridgegreys.com>
>>>
>>> The generic asm futex implementation emulates atomic access to
>>> memory by doing a get_user followed by put_user. These translate
>>> to two mapping operations on UML with paging enabled in the
>>> meantime. This, in turn may end up changing interrupts,
>>> invoking the signal loop, etc.
>>>
>>> This replaces the generic implementation by a mapping followed
>>> by an operation on the mapped segment.
>>>
>>> Signed-off-by: Anton Ivanov <anton.ivanov@cambridgegreys.com>
>>> ---
>>>    arch/um/include/asm/Kbuild    |   1 -
>>>    arch/um/include/asm/futex.h   |  14 ++++
>>>    arch/um/kernel/skas/uaccess.c | 130 ++++++++++++++++++++++++++++++++++
>>>    3 files changed, 144 insertions(+), 1 deletion(-)
>>>    create mode 100644 arch/um/include/asm/futex.h
>>>
>>> diff --git a/arch/um/include/asm/Kbuild b/arch/um/include/asm/Kbuild
>>> index 1c63b260ecc4..873e6815bc50 100644
>>> --- a/arch/um/include/asm/Kbuild
>>> +++ b/arch/um/include/asm/Kbuild
>>> @@ -8,7 +8,6 @@ generic-y += emergency-restart.h
>>>    generic-y += exec.h
>>>    generic-y += extable.h
>>>    generic-y += ftrace.h
>>> -generic-y += futex.h
>>>    generic-y += hw_irq.h
>>>    generic-y += irq_regs.h
>>>    generic-y += irq_work.h
>>> diff --git a/arch/um/include/asm/futex.h b/arch/um/include/asm/futex.h
>>> new file mode 100644
>>> index 000000000000..0a01f1f60de0
>>> --- /dev/null
>>> +++ b/arch/um/include/asm/futex.h
>>> @@ -0,0 +1,14 @@
>>> +/* SPDX-License-Identifier: GPL-2.0 */
>>> +#ifndef _ASM_GENERIC_FUTEX_H
>>> +#define _ASM_GENERIC_FUTEX_H
>> ^^^^ Uggghhh
>>
>>> +
>>> +#include <linux/futex.h>
>>> +#include <linux/uaccess.h>
>>> +#include <asm/errno.h>
>>> +
>>> +
>>> +extern int arch_futex_atomic_op_inuser(int op, u32 oparg, int *oval, u32 __user
>>> *uaddr);
>>> +extern int futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr,
>>> +			      u32 oldval, u32 newval);
>> ^^^^ Did not address Johannes comments, will do in v6
> No need to hurry. This has to wait anyway for 5.12. :-)

That's fine :)

I wanted to get it out of the way and get back to eBPF.

I am trying to get my head around on how to reuse as much as possible from the vector code to build an AF_XDP multi-port netdev and a switchdev on top of that. Some of it is like pulling teeth without anesthetic. The documentation leaves a lot to be desired :)

Compared to that some performance polishing was a nice (and fairly pleasant) distraction.

I think it is close to where it should be now. It passes all benchmarks including multi-threaded userspace ones on both 32 and 64.

One thing which we should probably consider is on/off-ing the display of the CPU flags acquired from the host via a kernel command line switch. At present they are reflected 1:1 into the UML instance.

>
> Thanks,
> //richard
>
-- 
Anton R. Ivanov
Cambridgegreys Limited. Registered in England. Company Number 10273661
https://www.cambridgegreys.com/


_______________________________________________
linux-um mailing list
linux-um@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-um

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-12-15  9:56 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-14 18:14 Updated performance patch series anton.ivanov
2020-12-14 18:14 ` [PATCH v5 1/4] um: Add support for host CPU flags and alignment anton.ivanov
2020-12-14 18:14 ` [PATCH v5 2/4] um: enable the use of optimized xor routines in UML anton.ivanov
2020-12-14 18:14 ` [PATCH v5 3/4] um: add a UML specific futex implementation anton.ivanov
2020-12-15  9:43   ` Anton Ivanov
2020-12-15  9:46     ` Richard Weinberger
2020-12-15  9:56       ` Anton Ivanov
2020-12-14 18:14 ` [PATCH v5 4/4] um: allow the use of glibc functions instead of builtins anton.ivanov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.