Nicolas Iooss | 12 Oct 13:02 2014

[uml-user] [PATCH 1/3] um: Create asm/sections.h

arch/um/kernel/ and arch/um/kernel/ define some
UML-specific symbols.  These symbols are used in the kernel part of UML
with extern declarations.

Move these declarations to a new header, asm/sections.h, like other
architectures do.

Signed-off-by: Nicolas Iooss <nicolas.iooss_linux <at>>
 arch/um/include/asm/Kbuild     | 1 -
 arch/um/include/asm/sections.h | 9 +++++++++
 arch/um/kernel/physmem.c       | 3 +--
 arch/um/kernel/skas/mmu.c      | 3 +--
 arch/um/kernel/um_arch.c       | 2 --
 5 files changed, 11 insertions(+), 7 deletions(-)
 create mode 100644 arch/um/include/asm/sections.h

diff --git a/arch/um/include/asm/Kbuild b/arch/um/include/asm/Kbuild
index 244b12c8cb39..21fd5c647442 100644
--- a/arch/um/include/asm/Kbuild
+++ b/arch/um/include/asm/Kbuild
 <at>  <at>  -23,7 +23,6  <at>  <at>  generic-y += pci.h
 generic-y += percpu.h
 generic-y += preempt.h
 generic-y += scatterlist.h
-generic-y += sections.h
 generic-y += switch_to.h
 generic-y += topology.h
 generic-y += trace_clock.h
diff --git a/arch/um/include/asm/sections.h b/arch/um/include/asm/sections.h
(Continue reading)

Clemens Eisserer | 1 Sep 00:19 2014

[uml-user] Is the ARM9-architecture supported by UML?


I would like to use a current version of debian on my Nokia-770 (linux in a chroot-environment, however everything past lenny (5.0, unsupported since mid 2012) requires a newer kernel - which can't be easily upgraded due to proprietary wlan drivers and other specific patches.

Does user mode linux support the ARM9 architecture with as host?

Thanks, Clemens
Slashdot TV.  
Video for Nerds.  Stuff that matters.
User-mode-linux-user mailing list
User-mode-linux-user <at>
Thomas Meyer | 23 Aug 14:14 2014

[uml-user] Long loop in __getnsdayoftime() after resume from ram


in UML kernel 3.16.1 I get a long loop in __getnstimeofday()
(kernel/time/timekeeping.c:315) in the call of timespec_add_ns(),
because it seems like the tk->xtime_sec wasn't updated yet, but the
nsecs were. nsecs can be as high as 8111000111000111000l when left the
host kernel suspended to ram over night.

then the function timespec_add_ns() (include/linux/time.h:266)
will call __iter_div_u64_rem() which has an optimized loop for the case
that the dividend is not much bigger as the divisior.
but this isn't the case for resume from ram on the host kernel.

any ideas how to fix this? is it possible to intercept the resume from
ram and update the timekeeper->xtime_sec somehow?
or can the um arch somehow overwrite timespec_add_ns() to always use
div_u64_rem() instead?

how does the host kernel deal with this? are there some .suspend/.resume
callbacks missing in the um "itimer" clocksource?

with kind regards

Slashdot TV.  
Video for Nerds.  Stuff that matters.
Thomas Meyer | 19 Aug 20:53 2014

[uml-user] 3.16 build without optimization fails


the build with -O0 fails with:

make -f scripts/ obj=init
  gcc -Wp,-MD,init/.main.o.d  -nostdinc -isystem /usr/lib/gcc/x86_64-redhat-linux/4.8.3/include
-I./arch/um/include -Iarch/um/include/generated  -Iinclude -I./arch/um/include/uapi
-Iarch/um/include/generated/uapi -I./include/uapi -Iinclude/generated/uapi -include
./include/linux/kconfig.h -D__KERNEL__ -m64 -I./arch/x86/um -I./arch/x86/include
-I./arch/x86/include/uapi -Iarch/x86/include/generated -Iarch/x86/include/generated/uapi
-Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common
-Werror-implicit-function-declaration -Wno-format-security -mcmodel=large -fno-builtin -m64
-funit-at-a-time -D__arch_um__ -I./arch/um/include/shared -I./arch/x86/um/shared
-I./arch/um/include/shared/skas -Dvmap=kernel_vmap
-Din6addr_loopback=kernel_in6addr_loopback -Din6addr_any=ker
 nel_in6addr_any -Dstrrchr=kernel_strrchr -D_LARGEFILE64_SOURCE -Derrno=kernel_errno
-Dsigprocmask=kernel_sigprocmask -Dmktime=kernel_mktime -fno-delete-null-pointer-checks -O0
-Wframe-larger-than=1024 -fno-stack-protector -Wno-unused-but-set-variable
-fno-omit-frame-pointer -fno-optimize-sibling-calls -fno-var-tracking-assignments -g
-Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fconserve-stack
-Werror=implicit-int -Werror=strict-prototypes -DCC_HAVE_ASM_GOTO    -D"KBUILD_STR(s)=#s"
-D"KBUILD_BASENAME=KBUILD_STR(main)"  -D"KBUILD_MODNAME=KBUILD_STR(main)" -c -o init/main.o init/main.c
In file included from ./arch/um/include/asm/fixmap.h:58:0,
                 from ./arch/um/include/asm/pgtable.h:11,
                 from include/linux/mm.h:51,
                 from include/linux/ring_buffer.h:5,
                 from include/linux/ftrace_event.h:5,
                 from include/trace/syscall.h:6,
                 from include/linux/syscalls.h:80,
                 from init/main.c:18:
include/asm-generic/fixmap.h: In function 'fix_to_virt':
include/asm-generic/fixmap.h:31:2: error: size of unnamed array is negative
  BUILD_BUG_ON(idx >= __end_of_fixed_addresses);
make[1]: *** [init/main.o] Error 1
make: *** [init] Error 2

bug or feature?

any ideas?

switching BUILD_BUG_ON unconditionally to BUILD_BUG_ON_MSG - which uses compiletime_assert() -
breaks the build a bit later here:

  gcc -Wp,-MD,arch/um/kernel/skas/.uaccess.o.d  -nostdinc -isystem
/usr/lib/gcc/x86_64-redhat-linux/4.8.3/include -I./arch/um/include
-Iarch/um/include/generated  -Iinclude -I./arch/um/include/uapi
-Iarch/um/include/generated/uapi -I./include/uapi -Iinclude/generated/uapi -include
./include/linux/kconfig.h -D__KERNEL__ -m64 -I./arch/x86/um -I./arch/x86/include
-I./arch/x86/include/uapi -Iarch/x86/include/generated -Iarch/x86/include/generated/uapi
-Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common
-Werror-implicit-function-declaration -Wno-format-security -mcmodel=large -fno-builtin -m64
-funit-at-a-time -D__arch_um__ -I./arch/um/include/shared -I./arch/x86/um/shared
-I./arch/um/include/shared/skas -Dvmap=kernel_vmap -Din6addr_loopback=kernel_in6addr_loopback
  -Din6addr_any=kernel_in6addr_any -Dstrrchr=kernel_strrchr -D_LARGEFILE64_SOURCE
-Derrno=kernel_errno -Dsigprocmask=kernel_sigprocmask -Dmktime=kernel_mktime
-fno-delete-null-pointer-checks -O0 -Wframe-larger-than=1024 -fno-stack-protector
-Wno-unused-but-set-variable -fno-omit-frame-pointer -fno-optimize-sibling-calls
-fno-var-tracking-assignments -g -Wdeclaration-after-statement -Wno-pointer-sign
-fno-strict-overflow -fconserve-stack -Werror=implicit-int -Werror=strict-prototypes
-D"KBUILD_MODNAME=KBUILD_STR(uaccess)" -c -o arch/um/kernel/skas/uaccess.o arch/um/kernel/skas/uaccess.c
In file included from include/linux/err.h:4:0,
                 from arch/um/kernel/skas/uaccess.c:6:
arch/um/kernel/skas/uaccess.c: In function 'do_op_one_page':
include/linux/compiler.h:346:20: error: call to '__compiletime_assert_85' declared with attribute
error: BUILD_BUG_ON failed: __same_type(((void *)addr), struct page *)
    prefix ## suffix();    \
include/linux/compiler.h:351:2: note: in expansion of macro '__compiletime_assert'
  __compiletime_assert(condition, msg, prefix, suffix)
include/linux/compiler.h:363:2: note: in expansion of macro '_compiletime_assert'
  _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
include/linux/bug.h:50:37: note: in expansion of macro 'compiletime_assert'
 #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
include/linux/bug.h:74:1: note: in expansion of macro 'BUILD_BUG_ON_MSG'
 BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
include/linux/highmem.h:125:2: note: in expansion of macro 'BUILD_BUG_ON'
  BUILD_BUG_ON(__same_type((addr), struct page *));       \
arch/um/kernel/skas/uaccess.c:85:2: note: in expansion of macro 'kunmap_atomic'
  kunmap_atomic((void *)addr);
make[2]: *** [arch/um/kernel/skas/uaccess.o] Error 1
make[1]: *** [arch/um/kernel/skas] Error 2
make: *** [arch/um/kernel] Error 2

Real Name | 16 Aug 17:27 2014

[uml-user] can't trace kmem_cache_init with gdb


 I can't trace kmem_cache_init function with GDB, because gdb jump to wrong source line. Is there anyone
know how to fix this issue?

[real <at> name tmp]$ tar -Jxf linux-3.12.6.tar.xz 
[real <at> name tmp]$ cd linux-3.12.6/
[real <at> name linux-3.12.6]$ make ARCH=um defconfig
  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/kconfig/conf.o
  SHIPPED scripts/kconfig/
  SHIPPED scripts/kconfig/zconf.lex.c
  SHIPPED scripts/kconfig/zconf.hash.c
  HOSTCC  scripts/kconfig/
  HOSTLD  scripts/kconfig/conf
scripts/kconfig/conf --defconfig arch/x86/um/Kconfig
# configuration written to .config
[real <at> name linux-3.12.6]$ make ARCH=um linux 1>log.txt
arch/um/kernel/ptrace.c: In function ‘syscall_trace_enter’:
arch/um/kernel/ptrace.c:178:32: warning: ignoring return value of
‘tracehook_report_syscall_entry’, declared with attribute warn_unused_result [-Wunused-result]

[real <at> name linux-3.12.6]$ 
[real <at> name linux-3.12.6]$ cat gdb.txt 
file linux
handle SIGSEGV pass nostop noprint
handle SIGUSR1 pass nostop noprint

b kmem_cache_init
b create_boot_cache

r ubda=/home/real/uml/linux-3.12.6/Fedora20-x86-root_fs mem=256m
[real <at> name linux-3.12.6]$ 

[real <at> name linux-3.12.6]$ gdb -q  -x gdb.txt
Breakpoint 1 at 0x8050a57: file mm/slab.c, line 1512.
Breakpoint 2 at 0x804f7c5: file mm/slab_common.c, line 296.
Locating the bottom of the address space ... 0x10000
Locating the top of the address space ... 0xffffd000
Core dump limits :
	soft - 0
	hard - NONE
Checking that ptrace can change system call numbers...Detaching after fork from child process 16850.
Checking syscall emulation patch for ptrace...Detaching after fork from child process 16851.
Checking advanced syscall emulation patch for ptrace...Detaching after fork from child process 16852.
Checking for tmpfs mount on /dev/shm.../dev/shm...nothing mounted on /dev/shm
Checking PROT_EXEC mmap in /tmp/...OK
Detaching after fork from child process 16853.
Checking for the skas3 patch in the host:
  - /proc/mm...not found: No such file or directory
  - PTRACE_FAULTINFO...Detaching after fork from child process 16854.
not found
  - PTRACE_LDT...Detaching after fork from child process 16855.
not found
UML running in SKAS0 mode

Breakpoint 1, kmem_cache_init () at mm/slab.c:1512
1512	{
Missing separate debuginfos, use: debuginfo-install glibc-2.17-20.fc19.i686
(gdb) c

Breakpoint 2, create_boot_cache (s=0x82bdaf8 <kmem_cache_boot>, name=0x82650f5 "kmem_cache",
    flags=8192) at mm/slab_common.c:296
296	{
(gdb) n
299		s->name = name;
296	{
299		s->name = name;
300		s->size = s->object_size = size;
301		s->align = calculate_alignment(flags, ARCH_KMALLOC_MINALIGN, size);
302		err = __kmem_cache_create(s, flags);
(gdb) s
__kmem_cache_create (cachep=0x82bdaf8 <kmem_cache_boot>, flags=8192) at mm/slab.c:2222
2222	{
(gdb) n
2226		size_t size = cachep->size;
2251		if (size & (BYTES_PER_WORD - 1)) {
2264		if (flags & SLAB_RED_ZONE) {
2273		if (ralign < cachep->align) {
2278			flags &= ~(SLAB_RED_ZONE | SLAB_STORE_USER);
2282		cachep->align = ralign;
2284		if (slab_is_available())
(gdb) p slab_state
$1 = DOWN
(gdb) where
#0  __kmem_cache_create (cachep=0x82bdaf8 <kmem_cache_boot>, flags=8192) at mm/slab.c:2284
#1  0x0804f7f6 in create_boot_cache (s=0x82bdaf8 <kmem_cache_boot>, name=0x82650f5 "kmem_cache", 
    size=92, flags=8192) at mm/slab_common.c:302
#2  0x08050b1b in kmem_cache_init () at mm/slab.c:1559
#3  0x08049486 in mm_init () at init/main.c:468
#4  start_kernel () at init/main.c:532
#5  0x0804a6d8 in start_kernel_proc (unused=0x0) at arch/um/kernel/skas/process.c:46
#6  0x08059323 in new_thread_handler () at arch/um/kernel/process.c:140
#7  0x00000000 in ?? ()
(gdb) l mm/slab.c:2284
2279		/*
2280		 * 4) Store it.
2281		 */
2282		cachep->align = ralign;
2284		if (slab_is_available())
2285			gfp = GFP_KERNEL;
2286		else
2287			gfp = GFP_NOWAIT;

(gdb) p slab_state
$2 = DOWN
(gdb) n
2285			gfp = GFP_KERNEL;
(gdb) n
2289		setup_node_pointer(cachep);
(gdb) n
2285			gfp = GFP_KERNEL;

Start from 2289, gdb start jump to wrong source line. GDB should jump to 
"2287			gfp = GFP_NOWAIT;"
But it never hit it. And from here, gdb can't match the execuable UML kernel with source.

(gdb) n
2327		if ((size >= (PAGE_SIZE >> 3)) && !slab_early_init &&

And I found that "file" command says the file format is different.
[real <at> name mm]$ pwd
[real <at> name mm]$ file *.c | sort -k 2
percpu-vm.c:          ASCII text
filemap.c:            assembler source, ASCII text
memcontrol.c:         assembler source, ASCII text
ksm.c:                C source, ASCII text
mmap.c:               C source, ASCII text
rmap.c:               C source, ASCII text
slab.c:               C source, ASCII text
slob.c:               C source, ASCII text
slub.c:               C source, ASCII text

Why percpu-vm.c, filemap.c and memcontrol.c has different format?


User-mode-linux-user mailing list
User-mode-linux-user <at>
Real Name | 4 Jun 10:26 2014

[uml-user] How to run UML with valgrind and GDB?

  I tried to run UML (linux-3.12.6-x86) kernel with valgrind and GDB. 
But valgrind always terminated because SIGSEGV signal. I searched with 
google, just got some very old resource about run linux-2.6.xx with valgrind.

 So, is it possible to run linux (>3.12) with valgrind? If yes, how to do it?


Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their 
applications. Written by three acclaimed leaders in the field, 
this first edition is now available. Download your free book today!
enjoy mindful | 30 May 09:29 2014

[uml-user] how to find out which functions have been record in exception table?

Hi, all
  I build linux-3.12.6 uml with default configure.

tar -jxf linux-3.12.6.tar.bz2
cd linux-3.12.6
make ARCH=um defconfig
make ARCH=um linux

I'm confused about the exception table of the uml kernel.

$ objdump --full-contents --section=__ex_table linux

linux:     file format elf32-i386

Contents of section __ex_table:
 82a5048 3e6fdcff bcbaf6ff 396fdcff b4baf6ff  >o......9o......
 82a5058 336fdcff acbaf6ff 306fdcff bfbaf6ff  3o......0o......
 82a5068 2b6fdcff 9cbaf6ff 286fdcff afbaf6ff  +o......(o......
 82a5078 236fdcff 8cbaf6ff 206fdcff 9fbaf6ff  #o...... o......
 82a5088 1b6fdcff 7cbaf6ff 186fdcff 8fbaf6ff  .o..|....o......
 82a5098 136fdcff 6cbaf6ff 106fdcff 7fbaf6ff  .o..l....o......
 82a50a8 0b6fdcff 5cbaf6ff 086fdcff 6fbaf6ff  .o..\....o..o...
 82a50b8 036fdcff 4cbaf6ff 006fdcff 5fbaf6ff  .o..L....o.._...
 82a50c8 fb6edcff 3cbaf6ff f86edcff 4fbaf6ff  .n..<....n..O...
 82a50d8 f36edcff 2cbaf6ff f06edcff 3fbaf6ff  .n..,....n..?...
 82a50e8 eb6edcff 1cbaf6ff e86edcff 2fbaf6ff  .n.......n../...
 82a50f8 e36edcff 0cbaf6ff e06edcff 1fbaf6ff  .n.......n......
 82a5108 db6edcff fcb9f6ff d86edcff 0fbaf6ff  .n.......n......
 82a5118 d36edcff ecb9f6ff d06edcff ffb9f6ff  .n.......n......
 82a5128 cb6edcff dcb9f6ff c86edcff efb9f6ff  .n.......n......
 82a5138 c36edcff ccb9f6ff c06edcff dfb9f6ff  .n.......n......
 82a5148 bb6edcff bcb9f6ff b86edcff cfb9f6ff  .n.......n......
 82a5158 ce6edcff acb9f6ff cc6edcff bfb9f6ff  .n.......n......
 82a5168 cf6edcff 9cb9f6ff c96edcff afb9f6ff  .n.......n......

Let pick the first instruction location '3e6fdcff' (in human readable
is 0xffdc6f3e). My question is how to find which function in UML
kernel has an instruction in location 0xffdc6f3e?

In i386 platform, the kernel address greater than the __PAGE_OFFSET
(0xC0000000). However, as skas0 sperate the uml kernel and user
process address space, it dose work by search address greater than the


Time is money. Stop wasting it! Get your web API in 5 minutes.
Nalli, Sanketh | 30 May 03:22 2014

[uml-user] invalid /proc/PID/exe in UML processes


So I start UML with the cmdline

./linux rootfstype=hostfs rw mem=1G init=/bin/bash


When the bash shell comes up, I run my prog : ./my_prog


6173 pts/8    00:00:00 linux

6180 pts/8    00:00:00 linux

6181 pts/8    00:00:00 linux

6182 pts/8    00:00:00 linux

6183 pts/8    00:00:00 linux

6188 pts/8    00:00:13 linux



The last item in the list with PID is 6188 is my program.

I can tell because my_prog increments a counter in an infinite loop

And consumes CPU cycles. It shows up on “top” as the dominant process.


My question:

1.       /proc/6188/exe is invalid. Why ??

I mean, it doesn’t point to anything.

Shouldn’t it point to my_prog or something ?


2.       What do the 4 UML processes 6173, 6180, 6181, 6182 do ? (6183 is /bin/bash whos “exe” symlink is also doesn’t point to anything !!)

3.       When a UML process, say my_prog (PID 6188) makes a system call, where is the system call executed – is it within the addr space of 6173 (the UML kernel process) or 6188 (my_prog running in UML ??)





Time is money. Stop wasting it! Get your web API in 5 minutes.
User-mode-linux-user mailing list
User-mode-linux-user <at>
Nalli, Sanketh | 28 May 22:39 2014

[uml-user] UML with PIN


Has anyone successfully tried running UML with PIN attached to it ?


Also, can you explain the output of ps –e, after I run UML :

1256 pts/7    00:00:00 linux

1266 pts/7    00:00:00 linux

1267 pts/7    00:00:00 linux

1268 pts/7    00:00:00 linux

1269 pts/7    00:00:00 linux


Why are there these many processes ?

What is a good resource to understand UML better ?

Time is money. Stop wasting it! Get your web API in 5 minutes.
User-mode-linux-user mailing list
User-mode-linux-user <at>
Richard Weinberger | 26 May 16:36 2014

Re: [uml-user] UML: Get's stuck

Am 20.05.2014 16:32, schrieb Jonathan Rudenberg:
> On 2014-03-16, 11:09 AM, Richard Weinberger wrote:
>> Am 14.03.2014 15:57, schrieb Thomas Meyer:
>>> only some processes get stuck.
>>> After enabling hung task detection in the kernel I see this in the logs:
>>> [ 8040.100000] INFO: task jbd2/ubda-8:308 blocked for more than 120
>>> seconds.
> ...
>>> any ideas? some synchronisation error in ext4?
>> Hmm, maybe you suffer from the same issue this patch tries to address:
> I'm running into a very similar issue on vanilla 3.14.4 and 3.15-rc5, both appear to have that patch
already applied.
> I've tested ext4, ext3, btrfs, all with the same issue: processes writing to disk in the guest randomly
hang permanently after a few minutes of uptime. The guest reports 100%
> iowait, the host has no load and is totally fine.

Can you share your UML disk image?
Maybe your userspace triggers some odds.
What distro is it?

Does it only happen with ubd disks?
IOW does NFS or hostfs work?


The best possible search technologies are now affordable for all companies.
Download your FREE open source Enterprise Search Engine today!
Our experts will assist you in its installation for $59/mo, no commitment.
Test it for FREE on our Cloud platform anytime!
Luis Henriques | 10 Dec 15:29 2013

[3.5.y.z extended stable] Patch "um: add missing declaration of 'getrlimit()' and friends" has been added to staging queue

This is a note to let you know that I have just added a patch titled

    um: add missing declaration of 'getrlimit()' and friends

to the linux-3.5.y-queue branch of the 3.5.y.z extended stable tree 
which can be found at:;a=shortlog;h=refs/heads/linux-3.5.y-queue

If you, or anyone else, feels it should not be added to this tree, please 
reply to this email.

For more information about the 3.5.y.z tree, see



From e79e33d9a4e1a528efc11b7cc3d5eba0871451f8 Mon Sep 17 00:00:00 2001
From: Sergei Trofimovich <slyfox <at>>
Date: Sun, 30 Dec 2012 01:37:30 +0300
Subject: um: add missing declaration of 'getrlimit()' and friends

commit fdfa4c952844fce881df8c76de9c7180cbe913ab upstream.

arch/um/os-Linux/start_up.c: In function 'check_coredump_limit':
arch/um/os-Linux/start_up.c:338:16: error: storage size of 'lim' isn't known
arch/um/os-Linux/start_up.c:339:2: error: implicit declaration of function 'getrlimit' [-Werror=implicit-function-declaration]

Signed-off-by: Sergei Trofimovich <slyfox <at>>
CC: Jeff Dike <jdike <at>>
CC: Richard Weinberger <richard <at>>
CC: Al Viro <viro <at>>
CC: user-mode-linux-devel <at>
CC: user-mode-linux-user <at>
CC: linux-kernel <at>
Signed-off-by: Richard Weinberger <richard <at>>
Signed-off-by: Luis Henriques <luis.henriques <at>>
 arch/um/os-Linux/start_up.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/um/os-Linux/start_up.c b/arch/um/os-Linux/start_up.c
index 425162e..2f53b89 100644
--- a/arch/um/os-Linux/start_up.c
+++ b/arch/um/os-Linux/start_up.c
 <at>  <at>  -15,6 +15,8  <at>  <at> 
 #include <sys/mman.h>
 #include <sys/stat.h>
 #include <sys/wait.h>
+#include <sys/time.h>
+#include <sys/resource.h>
 #include <asm/unistd.h>
 #include "init.h"
 #include "os.h"