Skip to contentSkip to conversation

Does UML 2.6.14 work under x86-64?

uml-devel Rob Landley 8 participants 35 messages Nov 6, 2005 – Nov 16, 2005 User-mode Linux (UML)

lore
Share & tools
lore
#0 lore raw

David Lang is trying to get my firmware build working under x86-64, and when I upgraded him to 2.6.14 (to get around the memory leak in 2.6.13.2), he started getting this:

Quoted 9 lines
Quoted 9 lines

Checking PROT_EXEC mmap in /tmp...OK
Checking for the skas3 patch in the host:
   - /proc/mm...not found
   - PTRACE_FAULTINFO...not found
   - PTRACE_LDT...not found
UML running in SKAS0 mode

Kernel panic - not syncing: get_skas_faultinfo : failed to wait for

SIGUSR1/SIGTRAP, pid = 16411, n = 16411, errno
  0, status = 0xb7f

This is 2.6.14 configured like so:

make ARCH=um allnoconfig &&
cat >> .config << EOF &&
CONFIG_MODE_SKAS=y
CONFIG_BINFMT_ELF=y
CONFIG_HOSTFS=y
CONFIG_SYSCTL=y
CONFIG_STDERR_CONSOLE=y
CONFIG_UNIX98_PTYS=y
CONFIG_BLK_DEV_LOOP=y
CONFIG_BLK_DEV_UBD=y
CONFIG_TMPFS=y
CONFIG_SWAP=y
CONFIG_LBD=y
CONFIG_EXT2_FS=y
CONFIG_PROC_FS=y
EOF
yes "" | make ARCH=um oldconfig &&
make ARCH=um

And then run via:

tmpdir/linux rootfstype=hostfs rw quiet mem=64M ubd0=tmpdir/swap.img init=/bin/sh

He first tried with the LDT patch applied. Then he tried reverting it (and adding LD_ASSUME_KERNEL=2.4.1 to the kernel command line), but that didn't help.

Any clues? (Should I tell him to just try -tt mode? Or revert to 2.6.13 with the leak fix?)

Rob

-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

#1 lore raw
Quoted 3 lines · Rob Landley
Quoted 3 lines
Quoted 3 lines
Kernel panic - not syncing: get_skas_faultinfo : failed to wait for

SIGUSR1/SIGTRAP, pid = 16411, n = 16411, errno
? 0, status = 0xb7f

Can you apply the stub debugging patch (the first of the 10 patches I sent to Andrew last week) and show us the output and the disassembly of stub_segv_handler?

Jeff

-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

#2 lore raw
In reply to Rob Landley
Quoted 1 line · Rob Landley

David Lang is trying to get my firmware build working under x86-64,

proper x86-64 or a 32-bit binary?

Quoted 10 lines

and
when I upgraded him to 2.6.14 (to get around the memory leak in 2.6.13.2), he

started getting this:

Quoted 3 lines
Quoted 3 lines
Kernel panic - not syncing: get_skas_faultinfo : failed to wait for

SIGUSR1/SIGTRAP, pid = 16411, n = 16411, errno
  0, status = 0xb7f

Quoted 7 lines

This is 2.6.14 configured like so:

CONFIG_MODE_SKAS=y
EOF
yes "" | make ARCH=um oldconfig &&
make ARCH=um

Ok, this seems a 64-bit binary if built on x86-64.

Quoted 1 line

He first tried with the LDT patch applied.

When I last tried that patch doesn't compile on x86-64.

Quoted 7 lines

Then he tried reverting it (and
adding LD_ASSUME_KERNEL=2.4.1 to the kernel command line), but that didn't help.

Any clues? (Should I tell him to just try -tt mode? Or revert to 2.6.13
with the leak fix?)

For now, any of these workaround is good, if it works.

On the bug: there are some problems with the stub assembly code - it miscompiles on some GCC releases. I'm trying to fix that - and -bs1 may or may not help on this (for some people it refuses to compile on x86_64).

GCC version?

Signature · 20 lines
Inform me of my mistakes, so I can keep imitating Homer Simpson's "Doh!".
Paolo Giarrusso, aka Blaisorblade (Skype ID "PaoloGiarrusso", ICQ 215621894)
http://www.user-mode-linux.org/~blaisorblade

		
___________________________________ 
Yahoo! Messenger: chiamate gratuite in tutto il mondo 
http://it.messenger.yahoo.com



-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
User-mode-linux-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
#3 lore raw

Forgot one note - for at least one people, 2.6.14-bs1 binaries located at my site work better than the ones he built.

They are 32-bit (not yet had the time to build and upload 64-bit) - but if you need that, it's a nice bonus.

Signature · 23 lines
Inform me of my mistakes, so I can keep imitating Homer Simpson's "Doh!".
Paolo Giarrusso, aka Blaisorblade (Skype ID "PaoloGiarrusso", ICQ 215621894)
http://www.user-mode-linux.org/~blaisorblade

	

	
		
___________________________________ 
Yahoo! Mail: gratis 1GB per i messaggi e allegati da 10MB 
http://mail.yahoo.it



-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
User-mode-linux-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
#4 lore raw
In reply to Blaisorblade
Quoted 4 lines · Blaisorblade
Quoted 1 line · Rob Landley

David Lang is trying to get my firmware build working under x86-64,

proper x86-64 or a 32-bit binary?

64 bit. Trying to build 32 bit on x86-64 died for him.

Quoted 3 lines
Quoted 1 line

He first tried with the LDT patch applied.

When I last tried that patch doesn't compile on x86-64.

Apparently that was fixed. (I'm using the version that went to Andrew Morton.)

Quoted 5 lines

On the bug: there are some problems with the stub assembly code - it miscompiles on some GCC releases. I'm trying to fix that - and -bs1 may or may not help on this (for some people it refuses to compile on x86_64).

GCC version?

4.0.2, hacked to link against uClibc.

Rob

-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

#5 lore raw
Quoted 17 lines · Rob Landley

Subject: Re: [uml-devel] Does UML 2.6.14 work under x86-64?

Quoted 4 lines · Blaisorblade
Quoted 1 line · Rob Landley

David Lang is trying to get my firmware build working under x86-64,

proper x86-64 or a 32-bit binary?

64 bit. Trying to build 32 bit on x86-64 died for him.

Quoted 3 lines
Quoted 1 line

He first tried with the LDT patch applied.

When I last tried that patch doesn't compile on x86-64.

Apparently that was fixed. (I'm using the version that went to Andrew Morton.)

Quoted 7 lines
Quoted 5 lines

On the bug: there are some problems with the stub assembly code - it miscompiles on some GCC releases. I'm trying to fix that - and -bs1 may or may not help on this (for some people it refuses to compile on x86_64).

GCC version?

4.0.2, hacked to link against uClibc.

does it use the GCC you include for the first compile, or the base compiler on the host OS?

David Lang

-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

#6 lore raw
Quoted 5 lines · David Lang
Quoted 3 lines
Quoted 1 line

GCC version?

4.0.2, hacked to link against uClibc.

does it use the GCC you include for the first compile, or the base compiler on the host OS?

I added a gcc --version line to the build script and it's the host OS that builds the kernel

so on my system
gcc (GCC) 3.4.4 (Gentoo 3.4.4-r1, ssp-3.4.4-1.0, pie-8.7.8)

David Lang

-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

#7 lore raw
In reply to David Lang
Quoted 6 lines · David Lang
Quoted 3 lines
Quoted 1 line

GCC version?

4.0.2, hacked to link against uClibc.

does it use the GCC you include for the first compile, or the base compiler on the host OS?

You're right, building UML is the job of the base compiler in the host OS.

Quoted 1 line

David Lang

Rob

-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

#8 lore raw
In reply to Blaisorblade
Quoted 30 lines · Blaisorblade
Quoted 1 line · Rob Landley

David Lang is trying to get my firmware build working under x86-64,

proper x86-64 or a 32-bit binary?

Quoted 10 lines

and
when I upgraded him to 2.6.14 (to get around the memory leak in 2.6.13.2), he

started getting this:

Quoted 3 lines
Quoted 3 lines
Kernel panic - not syncing: get_skas_faultinfo : failed to wait for

SIGUSR1/SIGTRAP, pid = 16411, n = 16411, errno
  0, status = 0xb7f

Quoted 7 lines

This is 2.6.14 configured like so:

CONFIG_MODE_SKAS=y
EOF
yes "" | make ARCH=um oldconfig &&
make ARCH=um

Ok, this seems a 64-bit binary if built on x86-64.

Quoted 1 line

He first tried with the LDT patch applied.

When I last tried that patch doesn't compile on x86-64.

Quoted 7 lines

Then he tried reverting it (and
adding LD_ASSUME_KERNEL=2.4.1 to the kernel command line), but that didn't help.

Any clues? (Should I tell him to just try -tt mode? Or revert to 2.6.13
with the leak fix?)

Quoted 8 lines

For now, any of these workaround is good, if it works.

On the bug: there are some problems with the stub assembly code - it miscompiles on some GCC releases. I'm trying to fix that - and -bs1 may or may not help on this (for some people it refuses to compile on x86_64).

GCC version?

gcc --version
gcc (GCC) 3.4.4 (Gentoo 3.4.4-r1, ssp-3.4.4-1.0, pie-8.7.8)

David Lang

#9 lore raw

[uml-devel] Making UML Single Threader

In reply to Rob Landley

Hi,

I am trying to make a 1 thread version of UML that does not need to be able to support user level programs. So I don't care about systemcall interception or anything like that, I just want a copy of UML that gets a basic kernel environment running (where I could call some kernel functions like sys_read or sys_open and then exit) that never calls fork on the host. From looking at the various websites I am hoping that I can just rip out 3 of the 4 SKAS threads and only leave the kernel thread:
"The UML kernel thread, which runs in the separate kernel address space, executes kernel code, and does system call interception on UML processes." Do the other threads (particularly the user thread) ever do something else that would be important?
Furthermore is the actual kernel process multi threaded?

Sorry if this all sounds a bit weird, it's for a research project and we are trying to port UML to an environment that only supports single threaded operation.

Thanks,
Can Sar

-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

#10 lore raw

Re: [uml-devel] Making UML Single Threader

Quoted 4 lines · Can Sar

Hi,

I am trying to make a 1 thread version of UML that does not need to be able to support user level programs.

Why?

Did you ever read Rik van Reil's list of the dumbest patches he's ever seen? This is the first entry in the list:

http://www.surriel.com/potm/apr2001.shtml

Quoted 1 line

So I don't care about systemcall interception or anything like that,

*blink* *blink*

Ok, you want user mode linux, but you don't want it to actually run user processes, nor do want it to be able to intercept system calls.

Um... What's left?

Quoted 4 lines

I just want a copy of
UML that gets a basic kernel environment running (where I could call some kernel functions like sys_read or sys_open and then exit) that never calls fork on the host.

vfork, maybe?

Have you tried just loading a module into the existing User Mode Linux?

Quoted 3 lines

Sorry if this all sounds a bit weird, it's for a research project and we are trying to port UML to an environment that only supports single threaded operation.

Define "port". (Have you looked at mmu-less linux? Are you saying you haven't got a timer interrupt and can't fake up some kind of green-threads approach like people managed to do under _DOS_?)

Rob

-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

#11 lore raw

Re: [uml-devel] Making UML Single Threader

Quoted 8 lines · Rob Landley
Quoted 4 lines · Can Sar

Hi,

I am trying to make a 1 thread version of UML that does not need to be able to support user level programs.

Why?

Trust me, I wouldn't do this if it were not for a reason. I have no intention of marketing this as a general purpose alternative to Linux. It's to check Linux for errors.

Quoted 10 lines
Quoted 2 lines

So I don't care about systemcall interception or anything like that,

*blink* *blink*

Ok, you want user mode linux, but you don't want it to actually run user processes, nor do want it to be able to intercept system calls.

Um... What's left?

The ability to call the kernel implementation of some system calls and then halt the kernel.

Quoted 13 lines
Quoted 4 lines

I just want a copy of
UML that gets a basic kernel environment running (where I could call some kernel functions like sys_read or sys_open and then exit) that never calls fork on the host.

vfork, maybe?

Have you tried just loading a module into the existing User Mode Linux?

Quoted 3 lines

Sorry if this all sounds a bit weird, it's for a research project and we are trying to port UML to an environment that only supports single threaded operation.

Quoted 5 lines

Define "port". (Have you looked at mmu-less linux? Are you saying you haven't got a timer interrupt and can't fake up some kind of green-threads approach like people managed to do under _DOS_?)

Rob

Well, we are trying to check Linux for security holes/bugs with a system that does not support multithreaded programs. A former member of our group hacked this up for UML in 2.4.19 so that it would never use fork (it was doing it's own checkping and restore instead of context switches). Unfortunately he also added a lot of features that were necessary for other reasons so isolating the fork/threading code is a nightmare. I am trying to re-implement this for 2.6.14 but it seems UML has changed quite a bit since then.

My basic question is what the exact purpose of the 4 threads in skas are. SIGIO and async ubd one are pretty obvious. The other two are a bit ill-defined on the website:

"The UML kernel thread, which runs in the separate kernel address space, executes kernel code, and does system call interception on UML processes The UML userspace thread, which runs all UML process code and switches between host address spaces on each UML context switch"

If the kernel forks a new kernel thread (e.g. kswapd), which has no user space context associated with it, what host address space will this show up in? Is the userspace proccess strictly for threads that have a userspace context associated with them, or does it run every thread that is not the original thread of execution that UML linux was booted from.

Thank you,
Can Sar

-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

#12 lore raw

Re: [uml-devel] Making UML Single Threader

Quoted 5 lines · Can Sar
Quoted 1 line

Why?

Trust me, I wouldn't do this if it were not for a reason. I have no intention of marketing this as a general purpose alternative to Linux. It's to check Linux for errors.

I just don't understand your potential use case. (I've seen some really weird things done in embedded systems, and done a few myself, but I don't understand what the advantage is here...)

Quoted 4 lines
Quoted 4 lines
Quoted 1 line

So I don't care about systemcall interception or anything like that,

*blink* *blink*

Quoted 8 lines
Quoted 5 lines

Ok, you want user mode linux, but you don't want it to actually run user
processes, nor do want it to be able to intercept system calls.

Um... What's left?

The ability to call the kernel implementation of some system calls and then halt the kernel.

Ah! So you want the ability to test some kernel code, printf the result, and exit. Right. (And a kernel module doesn't do this because...?)

Jeff was going to split out the scheduler and filesystem into shared libraries or some such. He mentions it in his intermittent diary, among other places. (Check the April 22 entry, for example):
http://user-mode-linux.sourceforge.net/diary.html
Also projects mentions it towards the end:
http://user-mode-linux.sourceforge.net/projects.html

I haven't really followed that work because I never had a use for it. If I had to chop out kernel functions to run standalone, I'd guess your best bet is probably reading through starting from main() (in arch/um/kernel/main.c) and seeing at what point it's initialized enough stuff that you can do what you want. (Assuming you don't need to do I/O or handle interrupts, and are doing single processor, then your big worry is probably memory allocation? I'm guessing here.)

Rob

P.S. What on earth is CONFIG_CMDLINE_ON_HOST? It doesn't seem to ever be set anywhere, by anything...

-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

#13 lore raw

Re: [uml-devel] Making UML Single Threader

Quoted 4 lines · Rob Landley

On Tuesday 08 November 2005 01:44, Can Sar wrote:

P.S. What on earth is CONFIG_CMDLINE_ON_HOST? It doesn't seem to ever be set anywhere, by anything...

Totally unrelated. In short, it's TT-only, it implements the old behaviour (nice output on ps), but it requires UML to call exec() on itself (with a bigger arg list, so that enough space is allocated for argv); and I discovered gdb gets very confused on this.

So I allowed to disable it, and gdb started working like a charm!

Signature · 23 lines
Inform me of my mistakes, so I can keep imitating Homer Simpson's "Doh!".
Paolo Giarrusso, aka Blaisorblade (Skype ID "PaoloGiarrusso", ICQ 215621894)
http://www.user-mode-linux.org/~blaisorblade

	

	
		
___________________________________ 
Yahoo! Mail: gratis 1GB per i messaggi e allegati da 10MB 
http://mail.yahoo.it



-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
User-mode-linux-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
#14 lore raw

Re: [uml-devel] Making UML Single Threader

Quoted 6 lines · Blaisorblade
Quoted 4 lines · Rob Landley

On Tuesday 08 November 2005 01:44, Can Sar wrote:

P.S. What on earth is CONFIG_CMDLINE_ON_HOST? It doesn't seem to ever be set anywhere, by anything...

Quoted 6 lines

Totally unrelated. In short, it's TT-only, it implements the old behaviour (nice output on ps), but it requires UML to call exec() on itself (with a bigger arg list, so that enough space is allocated for argv); and I discovered gdb gets very confused on this.

So I allowed to disable it, and gdb started working like a charm!

Is there any easy way to get decent ps output in SKAS0 mode?

Rob

-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

#15 lore raw

Re: [uml-devel] Making UML Single Threader

Quoted 7 lines · Rob Landley
Quoted 6 lines · Blaisorblade
Quoted 4 lines · Rob Landley

On Tuesday 08 November 2005 01:44, Can Sar wrote:

P.S. What on earth is CONFIG_CMDLINE_ON_HOST? It doesn't seem to ever be set anywhere, by anything...

Quoted 8 lines
Quoted 6 lines

Totally unrelated. In short, it's TT-only, it implements the old behaviour (nice output on ps), but it requires UML to call exec() on itself (with a bigger arg list, so that enough space is allocated for argv); and I discovered gdb gets very confused on this.

So I allowed to disable it, and gdb started working like a charm!

Is there any easy way to get decent ps output in SKAS0 mode?

No code. And I don't know exactly what's going on, so I must concentrate on bugfixes (say "How do I explain to every GCC on the world it can't use the stack as it's usual to do, without going to plain ASM, which would make things even worse?").

Signature · 23 lines
Inform me of my mistakes, so I can keep imitating Homer Simpson's "Doh!".
Paolo Giarrusso, aka Blaisorblade (Skype ID "PaoloGiarrusso", ICQ 215621894)
http://www.user-mode-linux.org/~blaisorblade

	

	
		
___________________________________ 
Yahoo! Mail: gratis 1GB per i messaggi e allegati da 10MB 
http://mail.yahoo.it



-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
User-mode-linux-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
#16 lore raw

Re: [uml-devel] Making UML Single Threader

Quoted 6 lines
Quoted 1 line

Is there any easy way to get decent ps output in SKAS0 mode?

No code. And I don't know exactly what's going on, so I must concentrate on bugfixes (say "How do I explain to every GCC on the world it can't use the stack as it's usual to do, without going to plain ASM, which would make things even worse?").

I've been known to blow a weekend on cosmetic problems that annoy me, so:

1) Is there any documentation on SKAS0's design? (A couple things floated by, but it was piecemeal and I didn't have the necessary context.)

2) What's the memory layout of the various SKAS0 threads? (Or where in the code is it set up? I can work this out for myself if necessary, it'll just take a while...)

3) What can -tt mode still do that -skas0 can't? (Something about running under gdb, was it?)

Rob

-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

#17 lore raw

Re: [uml-devel] Making UML Single Threader

Quoted 2 lines · Rob Landley

1) Is there any documentation on SKAS0's design? (A couple things floated by, but it was piecemeal and I didn't have the necessary context.)

There was a big message when I first announced it. Also, the changelog on that patch was fairly comprehensive, so you can dig that out of git or an LKML archive or somewhere.

Quoted 3 lines

2) What's the memory layout of the various SKAS0 threads? (Or where in the code is it set up? I can work this out for myself if necessary, it'll just take a while...)

On x86:

	0 - 0x7fffe000 - normal process address space
	7fffe000 - the stub data page - contains the segfault handler and

system call stub
7ffff000 - the stub data page - used as the segfault stack and for
passing page fault info back to UML

Quoted 2 lines

3) What can -tt mode still do that -skas0 can't? (Something about running under gdb, was it?)

SMP is about it.

On nice process names with skas0, that might not be too possible with stack randomization. Without that, it would be very similar to tt mode nice process names -
Find where the process name is on the stack for the main UML
thread - grep for argv1_begin and argv1_end to see how that's set up
Make sure that address range won't be used in any of the process
address spaces
Copy the process name there

Without stack randomization, the process name will be (for the main UML thread) at an address that corresponds to the stub data page in the processes. You can just copy the process name there. The one thing you need to be careful about is that you make the segfault stack end below that address range so the name doesn't get trashed.

With stack randomization, the process name could be almost anywhere in the high end of the address space. You'd have to map a page there, copy the process name to the right spot in it, and make sure that the process doesn't use any of its address space from there on up. That sounds pretty nasty to me.

The first case is fairly easy, if you want this to just work in the no stack randomization case.

Jeff

-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

#18 lore raw

Re: [uml-devel] Making UML Single Threader

Quoted 6 lines · Jeff Dike
Quoted 3 lines · Rob Landley

1) Is there any documentation on SKAS0's design? (A couple things floated by, but it was piecemeal and I didn't have the necessary context.)

There was a big message when I first announced it.

Rummage rummage rummage... January diary entry mentions that blaisorblade asked "a while back"...

This would appear to be your announcement:
http://sourceforge.net/mailarchive/message.php?msg_id=10171422

(Wow, sourceforge's mailing list archives are almost as difficult to use as their download mirror system. That takes _effort_.)

Quoted 3 lines

Also, the changelog on
that patch was fairly comprehensive, so you can dig that out of git or an LKML archive or somewhere.

Rummage rummage rummage...
http://seclists.org/lists/linux-kernel/2005/Jul/0182.html

Quoted 7 lines
Quoted 2 lines

3) What can -tt mode still do that -skas0 can't? (Something about running under gdb, was it?)

SMP is about it.

On nice process names with skas0, that might not be too possible with stack randomization.

Randomization in the host, or randomization in UML?

Rob

-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

#19 lore raw

Re: [uml-devel] Making UML Single Threader

Quoted 2 lines · Rob Landley

(Wow, sourceforge's mailing list archives are almost as difficult to use as their download mirror system. That takes _effort_.)

There is other mirrors more easily navigated.. my preference is MARC:

http://marc.theaimsgroup.com/?l=user-mode-linux-devel&r=1&w=2

http://marc.theaimsgroup.com/?l=user-mode-linux-devel&m=110176058308224&w=4

Quoted 1 line

Randomization in the host, or randomization in UML?

host, when loading the UML binary.

Regards
Henrik

-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

#20 lore raw

Re: [uml-devel] Making UML Single Threader

In reply to Rob Landley
Quoted 2 lines · Rob Landley

Jeff was going to split out the scheduler and filesystem into shared libraries or some such. He mentions it in his intermittent diary, among other places.

This has nothing to do with that.

One of my other future projects is embedding UML into other things, as in a library, to give those other processes access to functionality like clustering. In this case, you may not want UML booting to userspace - you just want the kernel initialized enough that you can call into it.

Jeff

-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

#21 lore raw

Re: [uml-devel] Making UML Single Threader

Quoted 6 lines · Jeff Dike
Quoted 3 lines · Rob Landley

Jeff was going to split out the scheduler and filesystem into shared libraries or some such. He mentions it in his intermittent diary, among other places.

This has nothing to do with that.

Ok.

Quoted 3 lines

One of my other future projects is embedding UML into other things, as in a library, to give those other processes access to functionality like clustering.

You've mentioned this before. I've never quite been able to visualize what it is you want to do. (Embed UML to give processes access to functionality like clustering... Nope, I still don't get it. Can you give a more concrete example?)

Quoted 2 lines

In this case, you may not want UML booting to userspace - you just want the kernel initialized enough that you can call into it.

My normal use case for UML involves an init that's either a command shell or a shell script, so I'm used to there often only being one process on the system. (I even made a dumb little "oneit.c", attached, that runs one process and then shuts down when that process exits, and sets up everything so ctrl-c works in that process.)

I.E.

./linux rootfstype=hostfs rw init=/path/to/oneit /bin/sh

And then once you've got your command shell in UML, you can insmod a module that calls or prints out whatever you need, while the init process can block indefinitely and there are no other tasks running. So I've never had too much trouble accessing the sucker's internals when I wanted to do so, in an otherwise quiescent system. (Usually I just stick printfs into the sucker, though. It's just so easy...)

Rob

/* oneit.c, tiny one-process init replacement.
*
* Copyright 2005 by Rob Landley. Released under gpl v2. */
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <linux/reboot.h>

// World's most brain-dead init program. Does the minimum amount of work // necessary to get ctrl-c and such to work.
//
// Fork a child (PID 1 is special: it can't exit and has various signals // blocked). In the child, attach stdio to /dev/tty0 (so we have a controlling // tty, plus do a setsid()), then exec the rest of the command line. //
// PID 1 then reaps zombies until the child process it spawned exits, at which // point it calls sync() and reboot().

int main(int argc, char *argv[])
{
int a;
pid_t pid;

  // pid 1 just reaps zombies until it gets its child, then halts the system.
  pid=fork();
  if(pid) {
    while(pid!=wait());
    sync();
    reboot(LINUX_REBOOT_CMD_HALT);
  }
    
  // Redirect stdio to /dev/tty0, with new session ID, so ctrl-c works.
  setsid();
  for(a=0;a<3;a++) {
    close(a);
    open("/dev/tty0",O_RDWR);
  }

execvp(argv[1],argv+1);
}

#22 lore raw

Re: [uml-devel] Making UML Single Threader

In reply to Rob Landley
Quoted 8 lines · Rob Landley
Quoted 1 line

So I don't care about systemcall interception or anything like that,

*blink* *blink*

Ok, you want user mode linux, but you don't want it to actually run user processes, nor do want it to be able to intercept system calls.

Um... What's left?

Only all of Linux. It so happens that I want exactly the same thing for libUML, except I haven't had time to do anything about it.

Try to think a little before calling someone's project dumb.

Jeff

-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

#23 lore raw

Re: [uml-devel] Making UML Single Threader

Quoted 8 lines · Jeff Dike
Quoted 7 lines · Rob Landley
Quoted 1 line

So I don't care about systemcall interception or anything like that,

*blink* *blink*

Ok, you want user mode linux, but you don't want it to actually run user processes, nor do want it to be able to intercept system calls.

Quoted 6 lines
Quoted 1 line

Um... What's left?

Only all of Linux. It so happens that I want exactly the same thing for libUML, except I haven't had time to do anything about it.

Try to think a little before calling someone's project dumb.

Sorry, wasn't trying to call it dumb. (I linked to a similar patch for ripping out lots of "unnecessary" infrastructure, which Rik found dumb because there was really no advantage to removing it. I should have clarified that _my_ question was "Why?".)

I didn't understand what he was trying to do. (Hard to ponder implementing something if you don't know what it would do.) A test harness for isolated kernel functions is something I can at least imagine...

Rob

-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

#24 lore raw

Re: [uml-devel] Making UML Single Threader

In reply to Jeff Dike

On Tue, 8 Nov 2005, Jeff Dike prattled cheerily:

Quoted 5 lines · Rob Landley
Quoted 4 lines
Quoted 1 line

So I don't care about systemcall interception or anything like that,

*blink* *blink*

Quoted 7 lines
Quoted 4 lines

Ok, you want user mode linux, but you don't want it to actually run user processes, nor do want it to be able to intercept system calls.

Um... What's left?

Only all of Linux. It so happens that I want exactly the same thing for libUML, except I haven't had time to do anything about it.

I've long wanted to do the same sort of thing, to do with a UML the same sort of thing you can do with a real Linux box: that is, set up networking and a bridging firewall, then halt it: the kernel keeps processing network packets and firewalling and bridging them perfectly well, but attackers now have *real* trouble changing the configuration. You stop it with kill() on the host, or mconsole; as it's halted and all fsen are unmounted and so on, you're safe from filesystem corruption.

When combined with CONFIG_NETCONSOLE, you can even keep an eye on it. :)

The necessary hack looks quite simple: I just haven't got around to it.

Signature · 12 lines
`Holy Google, pray for us sinners now and in the hour of our job interview.'


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
User-mode-linux-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
#25 lore raw

Re: [uml-devel] Making UML Single Threader

Quoted 9 lines · Nix

On Tue, 8 Nov 2005, Jeff Dike prattled cheerily:

Quoted 8 lines · Rob Landley
Quoted 7 lines
Quoted 1 line

So I don't care about systemcall interception or anything like that,

*blink* *blink*

Ok, you want user mode linux, but you don't want it to actually run user processes, nor do want it to be able to intercept system calls.

Quoted 6 lines
Quoted 4 lines
Quoted 1 line

Um... What's left?

Only all of Linux. It so happens that I want exactly the same thing for libUML, except I haven't had time to do anything about it.

I've long wanted to do the same sort of thing,

I guess you would like to run userspace processes or at least to call libUML to configure something (but I don't think you can ask a kernel to do so much, without allowing it to run userspace processes)...

Quoted 5 lines

to do with a UML the same
sort of thing you can do with a real Linux box: that is, set up networking and a bridging firewall,

then halt it:

I.e. "shutdown now" without -h? Halt without poweroff?

Quoted 3 lines

the kernel keeps
processing network packets and firewalling and bridging them perfectly well, but attackers now have *real* trouble changing the configuration.

_BLINK_ _BLINK_

Is this a _documented_ feature 8-() ?

Quoted 6 lines

You stop it with kill() on the host, or mconsole; as it's halted and all fsen are unmounted and so on, you're safe from filesystem corruption.

When combined with CONFIG_NETCONSOLE, you can even keep an eye on it. :)

The necessary hack looks quite simple: I just haven't got around to it.

Signature · 23 lines
Inform me of my mistakes, so I can keep imitating Homer Simpson's "Doh!".
Paolo Giarrusso, aka Blaisorblade (Skype ID "PaoloGiarrusso", ICQ 215621894)
http://www.user-mode-linux.org/~blaisorblade

	

	
		
___________________________________ 
Yahoo! Mail: gratis 1GB per i messaggi e allegati da 10MB 
http://mail.yahoo.it



-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
User-mode-linux-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
#26 lore raw

Re: [uml-devel] Making UML Single Threader

On Mon, 14 Nov 2005, [email protected] moaned:

Quoted 6 lines · Nix
Quoted 1 line

I've long wanted to do the same sort of thing,

I guess you would like to run userspace processes or at least to call libUML to configure something (but I don't think you can ask a kernel to do so much, without allowing it to run userspace processes)...

Yeah: the idea is that you run all that's needed to configure things, but then halt it and let routing et al continue. :)

Quoted 7 lines
Quoted 5 lines

to do with a UML the same
sort of thing you can do with a real Linux box: that is, set up networking and a bridging firewall,

then halt it:

I.e. "shutdown now" without -h? Halt without poweroff?

i.e. `shutdown -h now' without poweroff-on-shutdown built into the kernel. Shutdown and halt without poweroff (or tearing the network down, obviously).

Quoted 5 lines
Quoted 3 lines

the kernel keeps
processing network packets and firewalling and bridging them perfectly well, but attackers now have *real* trouble changing the configuration.

_BLINK_ _BLINK_

That's what I thought when I first heard of it :)

Quoted 1 line

Is this a _documented_ feature 8-() ?

Not that I know of, but it's been true for a long, long time: before my firewall ran UML it used to rely on it, and it's the only feature that old firewall had that I'd still like to have back.

It's been true for longer than I've used Linux: Rogier Wolff describes it in
<http://www.redhat.com/archives/linux-security/1997-April/msg00019.html>.
The top of that thread has someone calling it a problem, and Alan Cox promptly follows up and calls it a feature. If Alan says that a feature of networking of that vintage is intentional I guess it counts as sort of documented. )

Signature · 12 lines
`Holy Google, pray for us sinners now and in the hour of our job interview.'


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
User-mode-linux-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
#27 lore raw

Re: [uml-devel] Making UML Single Threader

Quoted 17 lines · Nix

On Mon, 14 Nov 2005, [email protected] moaned:

Quoted 7 lines · Nix
Quoted 4 lines

I've long wanted to do the same sort of thing,
the kernel keeps
processing network packets and firewalling and bridging them perfectly well, but attackers now have *real* trouble changing the configuration.

_BLINK_ _BLINK_

That's what I thought when I first heard of it :)

Quoted 1 line

Is this a _documented_ feature 8-() ?

Not that I know of, but it's been true for a long, long time: before my firewall ran UML it used to rely on it, and it's the only feature that old firewall had that I'd still like to have back.

Quoted 7 lines

It's been true for longer than I've used Linux: Rogier Wolff describes it in
<http://www.redhat.com/archives/linux-security/1997-April/msg00019.html>.
The top of that thread has someone calling it a problem, and Alan Cox promptly follows up and calls it a feature. If Alan says that a feature of networking of that vintage is intentional I guess it counts as sort of documented. )

Yep, as long as interrupts are alife, networking keeps on working.

That's also the reason why sometimes you can still ping crashed boxes: as long as interrupts are working, ping will work.

IIRC I read about the above scenario as an actually recommendation for a safe firewall a long time ago...

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

#28 lore raw

Re: [uml-devel] Making UML Single Threader

In reply to Blaisorblade
Quoted 1 line · Blaisorblade

I.e. "shutdown now" without -h? Halt without poweroff?

halt without poweroff.

stops the scheduler, but interrupts etc continues running.

but it's not something I'd recommend relying upon. Better to leave the scheduler running but only have an init process sleeping indefinitely.

Quoted 1 line

Is this a _documented_ feature 8-() ?

Not really, no.

Regards
Henrik

-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc. Get Certified Today Register for a JBoss Training Course. Free Certification Exam for All Training Attendees Through End of 2005. For more info visit:
http://ads.osdn.com/?ad_id=7628&alloc_id=16845&op=click
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

#29 lore raw

Re: [uml-devel] Making UML Single Threader

Quoted 5 lines · Henrik Nordstrom
Quoted 1 line · Blaisorblade

I.e. "shutdown now" without -h? Halt without poweroff?

halt without poweroff.

Quoted 8 lines

stops the scheduler, but interrupts etc continues running.

but it's not something I'd recommend relying upon. Better to leave the scheduler running but only have an init process sleeping indefinitely.

Quoted 1 line

Is this a _documented_ feature 8-() ?

Not really, no.

It's a "well known" feature. Every once in a while, somebody twiddling APM, ACPI or the power management code makes halt unconditionally power down the system (or just the devices) so it stops routing packets, then somebody complains, and they fix it. My google-fu isn't quite up to finding these just now, but here's a couple references to this behavior in 1997 and 1998:

http://www.ussg.iu.edu/hypermail/linux/kernel/9706.0/0121.html
http://groups.google.com/group/fa.linux.kernel/browse_thread/thread/9e0bb63143ecc8e0/28da0c720d092430%2328da0c720d092430

Rob

-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc. Get Certified Today Register for a JBoss Training Course. Free Certification Exam for All Training Attendees Through End of 2005. For more info visit:
http://ads.osdn.com/?ad_id=7628&alloc_id=16845&op=click
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

#30 lore raw

Re: [uml-devel] Making UML Single Threader

In reply to Rob Landley
Quoted 7 lines · Rob Landley
Quoted 4 lines · Can Sar

Hi,

I am trying to make a 1 thread version of UML that does not need to be able to support user level programs.

Why?

He may well be running Valgrind or something similar (Valgrind doesn't like us using clone(), even if it accepts fork()).

Ah, btw, given his address, I wonder if he's related at all with some project like "Stanford Checker" or a relative of it.

Quoted 4 lines

Did you ever read Rik van Reil's list of the dumbest patches he's ever seen? This is the first entry in the list:

http://www.surriel.com/potm/apr2001.shtml

Sorry I don't see your point, Rob - it's a really different thing.

Quoted 3 lines

Define "port". (Have you looked at mmu-less linux? Are you saying you haven't got a timer interrupt and can't fake up some kind of green-threads approach like people managed to do under _DOS_?)

Signature · 20 lines
Inform me of my mistakes, so I can keep imitating Homer Simpson's "Doh!".
Paolo Giarrusso, aka Blaisorblade (Skype ID "PaoloGiarrusso", ICQ 215621894)
http://www.user-mode-linux.org/~blaisorblade

		
___________________________________ 
Yahoo! Messenger: chiamate gratuite in tutto il mondo 
http://it.messenger.yahoo.com



-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
User-mode-linux-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
#31 lore raw

Re: [uml-devel] Making UML Single Threader

Quoted 6 lines · Blaisorblade
Quoted 4 lines

Did you ever read Rik van Reil's list of the dumbest patches he's ever seen? This is the first entry in the list:

http://www.surriel.com/potm/apr2001.shtml

Sorry I don't see your point, Rob - it's a really different thing.

As has been pointed out to me by Jeff. I didn't understand the potential use case.

Rob

-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

#32 lore raw

Re: [uml-devel] Making UML Single Threader

In reply to Can Sar
Quoted 2 lines · Can Sar

Do the other threads (particularly the user thread) ever do something else that would be important?

The user thread doesn't. The IO thread does, if you wish to do IO. And you can easily dispense with the sigio emulation thread.

Quoted 1 line

Furthermore is the actual kernel process multi threaded?

It does what amounts to user-level threads - i.e. there are multiple execution contexts in it, implemented with setjmp/longjmp, but that's not visible from the outside.

Jeff

-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

#33 lore raw

Re: [uml-devel] Making UML Single Threader

Quoted 5 lines · Jeff Dike
Quoted 2 lines · Can Sar

Do the other threads (particularly the user thread) ever do something else that would be important?

The user thread doesn't. The IO thread does, if you wish to do IO.

Since he needs to be _really_ single-threaded (and he may very possibly be trying to run something like Valgrind on UML) he may even run UBD without the I/O thread.

The code still exists, even if some bugs may have crept in since 2.6.9 (guess not, there has been no major rework). Basically, if io_thread_pid == -1, the code instead to to asynchronous I/O via this separate thread, does directly I/O by itself.

For normal usage, it's a bad idea - UML won't be able to schedule another thread until completion of that I/O request (much like green-threads do when implemented the simple way). Btw, usage of sigjmp()/longjmp() (between kernel threads) is actually green-threads said another way (like Jeff said below).

Btw, even userspace programs have a "stub" in the kernelspace thread.

In that case, through, it's just userspace(): an infinite loop running ptrace to intercept and nullify syscalls and segfaults, basically.

Quoted 7 lines

And you can easily dispense with the sigio emulation thread.

Quoted 1 line

Furthermore is the actual kernel process multi threaded?

It does what amounts to user-level threads - i.e. there are multiple execution contexts in it, implemented with setjmp/longjmp, but that's not visible from the outside.

Signature · 23 lines
Inform me of my mistakes, so I can keep imitating Homer Simpson's "Doh!".
Paolo Giarrusso, aka Blaisorblade (Skype ID "PaoloGiarrusso", ICQ 215621894)
http://www.user-mode-linux.org/~blaisorblade

	

	
		
___________________________________ 
Yahoo! Mail: gratis 1GB per i messaggi e allegati da 10MB 
http://mail.yahoo.it



-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
User-mode-linux-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
#34 lore raw

Re: [uml-devel] Making UML Single Threader

In reply to Jeff Dike
Quoted 4 lines · Jeff Dike
Quoted 2 lines · Can Sar

Do the other threads (particularly the user thread) ever do something else that would be important?

Quoted 8 lines

The user thread doesn't. The IO thread does, if you wish to do IO. And you can easily dispense with the sigio emulation thread.

Quoted 1 line

Furthermore is the actual kernel process multi threaded?

It does what amounts to user-level threads - i.e. there are multiple execution contexts in it, implemented with setjmp/longjmp, but that's not visible from the outside.

Thank you, that was all really helpful.
Can

-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel