* [uml-devel] Does UML 2.6.14 work under x86-64?
@ 2005-11-06 23:23 Rob Landley
2005-11-07 16:25 ` Jeff Dike
` (2 more replies)
0 siblings, 3 replies; 35+ messages in thread
From: Rob Landley @ 2005-11-06 23:23 UTC (permalink / raw)
To: David Lang, user-mode-linux-devel
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:
>> 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
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [uml-devel] Does UML 2.6.14 work under x86-64?
2005-11-07 19:32 ` Blaisorblade
@ 2005-11-07 14:38 ` David Lang
2005-11-07 19:44 ` Blaisorblade
2005-11-08 0:53 ` Rob Landley
2 siblings, 0 replies; 35+ messages in thread
From: David Lang @ 2005-11-07 14:38 UTC (permalink / raw)
To: Blaisorblade; +Cc: user-mode-linux-devel, Rob Landley
[-- Attachment #1: Type: TEXT/PLAIN, Size: 1415 bytes --]
On Mon, 7 Nov 2005, Blaisorblade wrote:
> On Monday 07 November 2005 00:23, Rob Landley wrote:
>> David Lang is trying to get my firmware build working under x86-64,
> proper x86-64 or a 32-bit binary?
>> and
>> when I upgraded him to 2.6.14 (to get around the memory leak in 2.6.13.2),
>> he
>
>> started getting this:
>
>>>> 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:
>>
>
>> 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.
>> He first tried with the LDT patch applied.
> When I last tried that patch doesn't compile on x86-64.
>> 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?
>
gcc --version
gcc (GCC) 3.4.4 (Gentoo 3.4.4-r1, ssp-3.4.4-1.0, pie-8.7.8)
David Lang
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [uml-devel] Does UML 2.6.14 work under x86-64?
2005-11-08 0:53 ` Rob Landley
@ 2005-11-07 14:47 ` David Lang
2005-11-07 15:30 ` David Lang
2005-11-08 3:39 ` Rob Landley
0 siblings, 2 replies; 35+ messages in thread
From: David Lang @ 2005-11-07 14:47 UTC (permalink / raw)
To: Rob Landley; +Cc: Blaisorblade, user-mode-linux-devel
On Mon, 7 Nov 2005, Rob Landley wrote:
> Subject: Re: [uml-devel] Does UML 2.6.14 work under x86-64?
>
> On Monday 07 November 2005 13:32, Blaisorblade wrote:
>> On Monday 07 November 2005 00:23, Rob Landley wrote:
>>> 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.
>
>>> 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.)
>
>> 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
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [uml-devel] Does UML 2.6.14 work under x86-64?
2005-11-07 14:47 ` David Lang
@ 2005-11-07 15:30 ` David Lang
2005-11-08 3:39 ` Rob Landley
1 sibling, 0 replies; 35+ messages in thread
From: David Lang @ 2005-11-07 15:30 UTC (permalink / raw)
To: Rob Landley; +Cc: Blaisorblade, user-mode-linux-devel
On Mon, 7 Nov 2005, David Lang wrote:
>>> 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
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [uml-devel] Does UML 2.6.14 work under x86-64?
2005-11-06 23:23 [uml-devel] Does UML 2.6.14 work under x86-64? Rob Landley
@ 2005-11-07 16:25 ` Jeff Dike
2005-11-07 19:32 ` Blaisorblade
2005-11-08 5:13 ` [uml-devel] Making UML Single Threader Can Sar
2 siblings, 0 replies; 35+ messages in thread
From: Jeff Dike @ 2005-11-07 16:25 UTC (permalink / raw)
To: Rob Landley; +Cc: David Lang, user-mode-linux-devel
On Sun, Nov 06, 2005 at 05:23:32PM -0600, Rob Landley wrote:
> >> 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
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [uml-devel] Does UML 2.6.14 work under x86-64?
2005-11-06 23:23 [uml-devel] Does UML 2.6.14 work under x86-64? Rob Landley
2005-11-07 16:25 ` Jeff Dike
@ 2005-11-07 19:32 ` Blaisorblade
2005-11-07 14:38 ` David Lang
` (2 more replies)
2005-11-08 5:13 ` [uml-devel] Making UML Single Threader Can Sar
2 siblings, 3 replies; 35+ messages in thread
From: Blaisorblade @ 2005-11-07 19:32 UTC (permalink / raw)
To: user-mode-linux-devel; +Cc: Rob Landley, David Lang
On Monday 07 November 2005 00:23, Rob Landley wrote:
> David Lang is trying to get my firmware build working under x86-64,
proper x86-64 or a 32-bit binary?
> and
> when I upgraded him to 2.6.14 (to get around the memory leak in 2.6.13.2),
> he
> started getting this:
> >> 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:
>
> 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.
> He first tried with the LDT patch applied.
When I last tried that patch doesn't compile on x86-64.
> 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?
--
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
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [uml-devel] Does UML 2.6.14 work under x86-64?
2005-11-07 19:32 ` Blaisorblade
2005-11-07 14:38 ` David Lang
@ 2005-11-07 19:44 ` Blaisorblade
2005-11-08 0:53 ` Rob Landley
2 siblings, 0 replies; 35+ messages in thread
From: Blaisorblade @ 2005-11-07 19:44 UTC (permalink / raw)
To: user-mode-linux-devel; +Cc: Rob Landley, David Lang
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.
--
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
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [uml-devel] Does UML 2.6.14 work under x86-64?
2005-11-07 19:32 ` Blaisorblade
2005-11-07 14:38 ` David Lang
2005-11-07 19:44 ` Blaisorblade
@ 2005-11-08 0:53 ` Rob Landley
2005-11-07 14:47 ` David Lang
2 siblings, 1 reply; 35+ messages in thread
From: Rob Landley @ 2005-11-08 0:53 UTC (permalink / raw)
To: Blaisorblade; +Cc: user-mode-linux-devel, David Lang
On Monday 07 November 2005 13:32, Blaisorblade wrote:
> On Monday 07 November 2005 00:23, Rob Landley wrote:
> > 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.
> > 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.)
> 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
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [uml-devel] Does UML 2.6.14 work under x86-64?
2005-11-07 14:47 ` David Lang
2005-11-07 15:30 ` David Lang
@ 2005-11-08 3:39 ` Rob Landley
1 sibling, 0 replies; 35+ messages in thread
From: Rob Landley @ 2005-11-08 3:39 UTC (permalink / raw)
To: David Lang; +Cc: Blaisorblade, user-mode-linux-devel
On Monday 07 November 2005 08:47, David Lang wrote:
> >> 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.
> 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
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
^ permalink raw reply [flat|nested] 35+ messages in thread
* [uml-devel] Making UML Single Threader
2005-11-06 23:23 [uml-devel] Does UML 2.6.14 work under x86-64? Rob Landley
2005-11-07 16:25 ` Jeff Dike
2005-11-07 19:32 ` Blaisorblade
@ 2005-11-08 5:13 ` Can Sar
2005-11-08 7:09 ` Rob Landley
2005-11-08 15:43 ` Jeff Dike
2 siblings, 2 replies; 35+ messages in thread
From: Can Sar @ 2005-11-08 5:13 UTC (permalink / raw)
To: user-mode-linux-devel
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
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [uml-devel] Making UML Single Threader
2005-11-08 5:13 ` [uml-devel] Making UML Single Threader Can Sar
@ 2005-11-08 7:09 ` Rob Landley
2005-11-08 7:44 ` Can Sar
` (2 more replies)
2005-11-08 15:43 ` Jeff Dike
1 sibling, 3 replies; 35+ messages in thread
From: Rob Landley @ 2005-11-08 7:09 UTC (permalink / raw)
To: user-mode-linux-devel; +Cc: Can Sar
On Monday 07 November 2005 23:13, Can Sar wrote:
> 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
> 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?
> 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?
> 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
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [uml-devel] Making UML Single Threader
2005-11-08 7:09 ` Rob Landley
@ 2005-11-08 7:44 ` Can Sar
2005-11-09 0:35 ` Rob Landley
2005-11-08 15:46 ` Jeff Dike
2005-11-08 16:13 ` Blaisorblade
2 siblings, 1 reply; 35+ messages in thread
From: Can Sar @ 2005-11-08 7:44 UTC (permalink / raw)
To: Rob Landley, user-mode-linux-devel
On Nov 7, 2005, at 11:09 PM, Rob Landley wrote:
> On Monday 07 November 2005 23:13, Can Sar wrote:
>> 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.
>
>> 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.
>> 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?
>
>> 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
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
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [uml-devel] Making UML Single Threader
2005-11-08 5:13 ` [uml-devel] Making UML Single Threader Can Sar
2005-11-08 7:09 ` Rob Landley
@ 2005-11-08 15:43 ` Jeff Dike
2005-11-08 16:10 ` Blaisorblade
2005-11-08 19:11 ` Can Sar
1 sibling, 2 replies; 35+ messages in thread
From: Jeff Dike @ 2005-11-08 15:43 UTC (permalink / raw)
To: Can Sar; +Cc: user-mode-linux-devel
On Mon, Nov 07, 2005 at 09:13:19PM -0800, Can Sar wrote:
> 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.
> 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
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [uml-devel] Making UML Single Threader
2005-11-08 7:09 ` Rob Landley
2005-11-08 7:44 ` Can Sar
@ 2005-11-08 15:46 ` Jeff Dike
2005-11-09 0:27 ` Rob Landley
2005-11-14 13:59 ` Nix
2005-11-08 16:13 ` Blaisorblade
2 siblings, 2 replies; 35+ messages in thread
From: Jeff Dike @ 2005-11-08 15:46 UTC (permalink / raw)
To: Rob Landley; +Cc: user-mode-linux-devel, Can Sar
On Tue, Nov 08, 2005 at 01:09:06AM -0600, Rob Landley wrote:
> > 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
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [uml-devel] Making UML Single Threader
2005-11-08 15:43 ` Jeff Dike
@ 2005-11-08 16:10 ` Blaisorblade
2005-11-08 19:11 ` Can Sar
1 sibling, 0 replies; 35+ messages in thread
From: Blaisorblade @ 2005-11-08 16:10 UTC (permalink / raw)
To: user-mode-linux-devel; +Cc: Jeff Dike, Can Sar
On Tuesday 08 November 2005 16:43, Jeff Dike wrote:
> On Mon, Nov 07, 2005 at 09:13:19PM -0800, Can Sar wrote:
> > 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.
> And you can easily dispense with the sigio emulation thread.
> > 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.
--
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
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [uml-devel] Making UML Single Threader
2005-11-08 7:09 ` Rob Landley
2005-11-08 7:44 ` Can Sar
2005-11-08 15:46 ` Jeff Dike
@ 2005-11-08 16:13 ` Blaisorblade
2005-11-09 0:51 ` Rob Landley
2 siblings, 1 reply; 35+ messages in thread
From: Blaisorblade @ 2005-11-08 16:13 UTC (permalink / raw)
To: user-mode-linux-devel; +Cc: Rob Landley, Can Sar
On Tuesday 08 November 2005 08:09, Rob Landley wrote:
> On Monday 07 November 2005 23:13, Can Sar wrote:
> > 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.
> 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.
> 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_?)
--
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
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [uml-devel] Making UML Single Threader
2005-11-08 15:43 ` Jeff Dike
2005-11-08 16:10 ` Blaisorblade
@ 2005-11-08 19:11 ` Can Sar
1 sibling, 0 replies; 35+ messages in thread
From: Can Sar @ 2005-11-08 19:11 UTC (permalink / raw)
To: Jeff Dike; +Cc: user-mode-linux-devel
On Nov 8, 2005, at 7:43 AM, Jeff Dike wrote:
> On Mon, Nov 07, 2005 at 09:13:19PM -0800, Can Sar wrote:
>> 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.
>
>> 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
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [uml-devel] Making UML Single Threader
2005-11-08 15:46 ` Jeff Dike
@ 2005-11-09 0:27 ` Rob Landley
2005-11-14 13:59 ` Nix
1 sibling, 0 replies; 35+ messages in thread
From: Rob Landley @ 2005-11-09 0:27 UTC (permalink / raw)
To: Jeff Dike; +Cc: user-mode-linux-devel, Can Sar
On Tuesday 08 November 2005 09:46, Jeff Dike wrote:
> On Tue, Nov 08, 2005 at 01:09:06AM -0600, Rob Landley wrote:
> > > 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.
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
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [uml-devel] Making UML Single Threader
2005-11-08 7:44 ` Can Sar
@ 2005-11-09 0:35 ` Rob Landley
2005-11-09 0:48 ` Blaisorblade
2005-11-10 4:07 ` Jeff Dike
0 siblings, 2 replies; 35+ messages in thread
From: Rob Landley @ 2005-11-09 0:35 UTC (permalink / raw)
To: Can Sar; +Cc: user-mode-linux-devel
On Tuesday 08 November 2005 01:44, Can Sar wrote:
> > 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...)
> >> 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.
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
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [uml-devel] Making UML Single Threader
2005-11-09 0:35 ` Rob Landley
@ 2005-11-09 0:48 ` Blaisorblade
2005-11-09 1:17 ` Rob Landley
2005-11-10 4:07 ` Jeff Dike
1 sibling, 1 reply; 35+ messages in thread
From: Blaisorblade @ 2005-11-09 0:48 UTC (permalink / raw)
To: user-mode-linux-devel; +Cc: Rob Landley
On Wednesday 09 November 2005 01:35, Rob Landley wrote:
> 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!
--
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
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [uml-devel] Making UML Single Threader
2005-11-08 16:13 ` Blaisorblade
@ 2005-11-09 0:51 ` Rob Landley
0 siblings, 0 replies; 35+ messages in thread
From: Rob Landley @ 2005-11-09 0:51 UTC (permalink / raw)
To: user-mode-linux-devel; +Cc: Blaisorblade, Can Sar
On Tuesday 08 November 2005 10:13, Blaisorblade wrote:
> > 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
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [uml-devel] Making UML Single Threader
2005-11-09 0:48 ` Blaisorblade
@ 2005-11-09 1:17 ` Rob Landley
2005-11-09 1:31 ` Blaisorblade
0 siblings, 1 reply; 35+ messages in thread
From: Rob Landley @ 2005-11-09 1:17 UTC (permalink / raw)
To: Blaisorblade; +Cc: user-mode-linux-devel
On Tuesday 08 November 2005 18:48, Blaisorblade wrote:
> On Wednesday 09 November 2005 01:35, Rob Landley wrote:
> > 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!
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
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [uml-devel] Making UML Single Threader
2005-11-09 1:17 ` Rob Landley
@ 2005-11-09 1:31 ` Blaisorblade
2005-11-09 3:18 ` Rob Landley
0 siblings, 1 reply; 35+ messages in thread
From: Blaisorblade @ 2005-11-09 1:31 UTC (permalink / raw)
To: user-mode-linux-devel; +Cc: Rob Landley
On Wednesday 09 November 2005 02:17, Rob Landley wrote:
> On Tuesday 08 November 2005 18:48, Blaisorblade wrote:
> > On Wednesday 09 November 2005 01:35, Rob Landley wrote:
> > > 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!
>
> 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?").
--
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
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [uml-devel] Making UML Single Threader
2005-11-09 1:31 ` Blaisorblade
@ 2005-11-09 3:18 ` Rob Landley
2005-11-10 4:18 ` Jeff Dike
0 siblings, 1 reply; 35+ messages in thread
From: Rob Landley @ 2005-11-09 3:18 UTC (permalink / raw)
To: Blaisorblade; +Cc: user-mode-linux-devel
> > 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
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [uml-devel] Making UML Single Threader
2005-11-10 4:07 ` Jeff Dike
@ 2005-11-10 3:55 ` Rob Landley
0 siblings, 0 replies; 35+ messages in thread
From: Rob Landley @ 2005-11-10 3:55 UTC (permalink / raw)
To: Jeff Dike; +Cc: Can Sar, user-mode-linux-devel
[-- Attachment #1: Type: text/plain, Size: 1691 bytes --]
On Wednesday 09 November 2005 22:07, Jeff Dike wrote:
> On Tue, Nov 08, 2005 at 06:35:47PM -0600, Rob Landley wrote:
> > 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.
> 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?)
> 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
[-- Attachment #2: oneit.c --]
[-- Type: text/x-csrc, Size: 1117 bytes --]
/* 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);
}
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [uml-devel] Making UML Single Threader
2005-11-09 0:35 ` Rob Landley
2005-11-09 0:48 ` Blaisorblade
@ 2005-11-10 4:07 ` Jeff Dike
2005-11-10 3:55 ` Rob Landley
1 sibling, 1 reply; 35+ messages in thread
From: Jeff Dike @ 2005-11-10 4:07 UTC (permalink / raw)
To: Rob Landley; +Cc: Can Sar, user-mode-linux-devel
On Tue, Nov 08, 2005 at 06:35:47PM -0600, Rob Landley wrote:
> 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
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [uml-devel] Making UML Single Threader
2005-11-09 3:18 ` Rob Landley
@ 2005-11-10 4:18 ` Jeff Dike
2005-11-10 4:58 ` Rob Landley
0 siblings, 1 reply; 35+ messages in thread
From: Jeff Dike @ 2005-11-10 4:18 UTC (permalink / raw)
To: Rob Landley; +Cc: Blaisorblade, user-mode-linux-devel
On Tue, Nov 08, 2005 at 09:18:58PM -0600, Rob Landley wrote:
> 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.
> 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
> 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
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [uml-devel] Making UML Single Threader
2005-11-10 4:18 ` Jeff Dike
@ 2005-11-10 4:58 ` Rob Landley
2005-11-10 6:23 ` Henrik Nordstrom
0 siblings, 1 reply; 35+ messages in thread
From: Rob Landley @ 2005-11-10 4:58 UTC (permalink / raw)
To: Jeff Dike; +Cc: Blaisorblade, user-mode-linux-devel
On Wednesday 09 November 2005 22:18, Jeff Dike wrote:
> On Tue, Nov 08, 2005 at 09:18:58PM -0600, Rob Landley wrote:
> > 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_.)
> 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
> > 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
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [uml-devel] Making UML Single Threader
2005-11-10 4:58 ` Rob Landley
@ 2005-11-10 6:23 ` Henrik Nordstrom
0 siblings, 0 replies; 35+ messages in thread
From: Henrik Nordstrom @ 2005-11-10 6:23 UTC (permalink / raw)
To: Rob Landley; +Cc: Jeff Dike, Blaisorblade, user-mode-linux-devel
On Wed, 9 Nov 2005, Rob Landley wrote:
> (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
> 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
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [uml-devel] Making UML Single Threader
2005-11-08 15:46 ` Jeff Dike
2005-11-09 0:27 ` Rob Landley
@ 2005-11-14 13:59 ` Nix
2005-11-14 19:37 ` Blaisorblade
1 sibling, 1 reply; 35+ messages in thread
From: Nix @ 2005-11-14 13:59 UTC (permalink / raw)
To: Jeff Dike; +Cc: Rob Landley, user-mode-linux-devel, Can Sar
On Tue, 8 Nov 2005, Jeff Dike prattled cheerily:
> On Tue, Nov 08, 2005 at 01:09:06AM -0600, Rob Landley wrote:
>> > 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.
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.
--
`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
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [uml-devel] Making UML Single Threader
2005-11-14 13:59 ` Nix
@ 2005-11-14 19:37 ` Blaisorblade
2005-11-14 20:00 ` Nix
2005-11-15 11:39 ` Henrik Nordstrom
0 siblings, 2 replies; 35+ messages in thread
From: Blaisorblade @ 2005-11-14 19:37 UTC (permalink / raw)
To: user-mode-linux-devel; +Cc: Nix, Jeff Dike, Rob Landley, Can Sar
On Monday 14 November 2005 14:59, Nix wrote:
> On Tue, 8 Nov 2005, Jeff Dike prattled cheerily:
> > On Tue, Nov 08, 2005 at 01:09:06AM -0600, Rob Landley wrote:
> >> > 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.
> 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)...
> 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?
> 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-() ?
> 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.
--
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
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [uml-devel] Making UML Single Threader
2005-11-14 19:37 ` Blaisorblade
@ 2005-11-14 20:00 ` Nix
2005-11-14 20:05 ` Geert Uytterhoeven
2005-11-15 11:39 ` Henrik Nordstrom
1 sibling, 1 reply; 35+ messages in thread
From: Nix @ 2005-11-14 20:00 UTC (permalink / raw)
To: Blaisorblade; +Cc: user-mode-linux-devel, Jeff Dike, Rob Landley, Can Sar
On Mon, 14 Nov 2005, blaisorblade@yahoo.it moaned:
> On Monday 14 November 2005 14:59, Nix wrote:
>> 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. :)
>> 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).
>> 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 :)
> 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. )
--
`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
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [uml-devel] Making UML Single Threader
2005-11-14 20:00 ` Nix
@ 2005-11-14 20:05 ` Geert Uytterhoeven
0 siblings, 0 replies; 35+ messages in thread
From: Geert Uytterhoeven @ 2005-11-14 20:05 UTC (permalink / raw)
To: Nix
Cc: Blaisorblade, User-mode Linux Kernel Development, Jeff Dike,
Rob Landley, Can Sar
On Mon, 14 Nov 2005, Nix wrote:
> On Mon, 14 Nov 2005, blaisorblade@yahoo.it moaned:
> > On Monday 14 November 2005 14:59, Nix wrote:
> >> 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 :)
>
> > 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. )
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 -- geert@linux-m68k.org
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
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [uml-devel] Making UML Single Threader
2005-11-14 19:37 ` Blaisorblade
2005-11-14 20:00 ` Nix
@ 2005-11-15 11:39 ` Henrik Nordstrom
2005-11-16 1:23 ` Rob Landley
1 sibling, 1 reply; 35+ messages in thread
From: Henrik Nordstrom @ 2005-11-15 11:39 UTC (permalink / raw)
To: Blaisorblade; +Cc: user-mode-linux-devel, Jeff Dike
On Mon, 14 Nov 2005, Blaisorblade wrote:
> 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.
> 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
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [uml-devel] Making UML Single Threader
2005-11-15 11:39 ` Henrik Nordstrom
@ 2005-11-16 1:23 ` Rob Landley
0 siblings, 0 replies; 35+ messages in thread
From: Rob Landley @ 2005-11-16 1:23 UTC (permalink / raw)
To: user-mode-linux-devel; +Cc: Henrik Nordstrom, Blaisorblade, Jeff Dike
On Tuesday 15 November 2005 05:39, Henrik Nordstrom wrote:
> On Mon, 14 Nov 2005, Blaisorblade wrote:
> > 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.
>
> > 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
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
^ permalink raw reply [flat|nested] 35+ messages in thread
end of thread, other threads:[~2005-11-16 1:23 UTC | newest]
Thread overview: 35+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-06 23:23 [uml-devel] Does UML 2.6.14 work under x86-64? Rob Landley
2005-11-07 16:25 ` Jeff Dike
2005-11-07 19:32 ` Blaisorblade
2005-11-07 14:38 ` David Lang
2005-11-07 19:44 ` Blaisorblade
2005-11-08 0:53 ` Rob Landley
2005-11-07 14:47 ` David Lang
2005-11-07 15:30 ` David Lang
2005-11-08 3:39 ` Rob Landley
2005-11-08 5:13 ` [uml-devel] Making UML Single Threader Can Sar
2005-11-08 7:09 ` Rob Landley
2005-11-08 7:44 ` Can Sar
2005-11-09 0:35 ` Rob Landley
2005-11-09 0:48 ` Blaisorblade
2005-11-09 1:17 ` Rob Landley
2005-11-09 1:31 ` Blaisorblade
2005-11-09 3:18 ` Rob Landley
2005-11-10 4:18 ` Jeff Dike
2005-11-10 4:58 ` Rob Landley
2005-11-10 6:23 ` Henrik Nordstrom
2005-11-10 4:07 ` Jeff Dike
2005-11-10 3:55 ` Rob Landley
2005-11-08 15:46 ` Jeff Dike
2005-11-09 0:27 ` Rob Landley
2005-11-14 13:59 ` Nix
2005-11-14 19:37 ` Blaisorblade
2005-11-14 20:00 ` Nix
2005-11-14 20:05 ` Geert Uytterhoeven
2005-11-15 11:39 ` Henrik Nordstrom
2005-11-16 1:23 ` Rob Landley
2005-11-08 16:13 ` Blaisorblade
2005-11-09 0:51 ` Rob Landley
2005-11-08 15:43 ` Jeff Dike
2005-11-08 16:10 ` Blaisorblade
2005-11-08 19:11 ` Can Sar
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.