Skip to contentSkip to conversation

um: x86: unbreak build by reintroducing this_cpu_cmpxchg16b_emu

RFC PATCH In review Sergei Trofimovich 2 participants 2 messages Apr 6, 2011 User-mode Linux (UML)

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 um: x86: unbreak build by reintroducing this_cpu_cmpxchg16b_emu

I'm sure fix can be nices, but initial patch should express an idea.

The main offender is privileged 'cli'.

Thanks!

Signature · 1 line
  Sergei

From 59c59c76b0238ff2469bb7f4201b9b88ec436df4 Mon Sep 17 00:00:00 2001
From: Sergei Trofimovich <[email protected]>
Date: Thu, 7 Apr 2011 00:09:37 +0300
Subject: [PATCH] [RFC] um: x86: unbreak build by reintroducing this_cpu_cmpxchg16b_emu

LD .tmp_vmlinux1
mm/built-in.o: In function `slab_free':
/home/slyfox/linux-2.6/mm/slub.c:2148: undefined reference to this_cpu_cmpxchg16b_emu' /home/slyfox/linux-2.6/mm/slub.c:2148: undefined reference to this_cpu_cmpxchg16b_emu' mm/built-in.o: In function `slab_alloc':
/home/slyfox/linux-2.6/mm/slub.c:1943: undefined reference to this_cpu_cmpxchg16b_emu' /home/slyfox/linux-2.6/mm/slub.c:1943: undefined reference to this_cpu_cmpxchg16b_emu' /home/slyfox/linux-2.6/mm/slub.c:1943: undefined reference to `this_cpu_cmpxchg16b_emu'

Original implementation of this_cpu_cmpxchg16b_emu contained privileged 'cli' instruction so copied implementation to private um/ space. Tested on x86_64, untested on i386.

---
 arch/um/sys-i386/Makefile              |    2 +-
 arch/um/sys-i386/cmpxchg8b_emu_um.S    |   56 ++++++++++++++++++++++++++++
 arch/um/sys-x86_64/Makefile            |    2 +-
 arch/um/sys-x86_64/cmpxchg16b_emu_um.S |   64 ++++++++++++++++++++++++++++++++
 4 files changed, 122 insertions(+), 2 deletions(-)
 create mode 100644 arch/um/sys-i386/cmpxchg8b_emu_um.S
 create mode 100644 arch/um/sys-x86_64/cmpxchg16b_emu_um.S
arch/um/sys-i386/Makefile +1 -1
index 804b28d..40d7940 100644
@@ -4,7 +4,7 @@
 
 obj-y = bug.o bugs.o checksum.o delay.o fault.o ksyms.o ldt.o ptrace.o \
 	ptrace_user.o setjmp.o signal.o stub.o stub_segv.o syscalls.o sysrq.o \
-	sys_call_table.o tls.o
+	sys_call_table.o tls.o cmpxchg8b_emu_um.o
 
 obj-$(CONFIG_BINFMT_ELF) += elfcore.o
 
arch/um/sys-i386/cmpxchg8b_emu_um.S new file +56 -0

56 lines not on this page · raw message

arch/um/sys-x86_64/Makefile +1 -1
index c1ea9eb..3259f54 100644
@@ -6,7 +6,7 @@
 
 obj-y = bug.o bugs.o delay.o fault.o ldt.o mem.o ptrace.o ptrace_user.o \
 	setjmp.o signal.o stub.o stub_segv.o syscalls.o syscall_table.o \
-	sysrq.o ksyms.o tls.o
+	sysrq.o ksyms.o tls.o cmpxchg16b_emu_um.o
 
 subarch-obj-y = lib/csum-partial_64.o lib/memcpy_64.o lib/thunk_64.o \
 		lib/rwsem_64.o
arch/um/sys-x86_64/cmpxchg16b_emu_um.S new file +64 -0

64 lines not on this page · raw message

Signature · 1 line
1.7.3.4
#1 lore raw

Sergei,

Am Mittwoch 06 April 2011, 23:18:37 schrieb Sergei Trofimovich:

Quoted 1 line

I'm sure fix can be nices, but initial patch should express an idea.

Please send patches not as attachment.

I think this patch is only needed on x86_64. Um builds fine on my main machine (i386).
It seems to fail on x86_64 when using CONFIG_SLUB=y.

Quoted 3 lines

The main offender is privileged 'cli'.

Thanks!

Thanks,
//richard