kraxel's 2.6.8 uml patch kit
Hi,
I've just uploaded a bunch of uml kernel patches to
http://www.suse.de/~kraxel/uml/patches/
This basically is the current state of the suse kernel for the next suse linux release. The patches create one source tree for both i386 and uml kernels. Some of these patches have been mailed to this list in the past. The README for the patch kit is attached below for convenience.
What is the status of the amd64 port? The 2.6.4 patch on sf.net produces lots of rejects when I try to apply it on top of the 2.6.7 uml patch. Is a newer version available somewhere? Or can I just ignore all the rejects (guess not)?
What is the status if the umlfb/x11/pthread issue, i.e. uml kernel crashing as soon as one tries to link against libpthread (which is needed for libX11)? Any progress here?
Gerd
==============================[ cut here ]==============================
kraxel's 2.6.8 uml patch kit [2004-08-20]
=========================================
The patches must be applied in the order listed here. Patch descriptions:
host-skas3-2.6.7-v1.patch
blaisorblade's skas patch -- as-is
uml-patch-2.6.7-2
jeff's uml patch -- with some stuff removed which is already in the skas patch.
uml-fix-skas
some fixes needed to make the resulting tree build for both i386 and um archs.
uml-fixes-for-2.6.8
some updates to make uml build on 2.6.8
uml-extraversion
don't change the EXTRAVERSION
uml-raise-tty-limit
use 16 instead of 8 ttys.
uml-pretend-to-be-i586
make the uml virtual machine claim to be a i586 machine. At least suse's yast2 installer will pick the glibc version without tls/nptl support then, thus this avoids trouble due to the the not-yet implemented tls/nptl syscalls in uml kernels. Maybe useful for other distros as well.
uml-core-on-panic
Make the uml kernel dump core on kernel panics for later analysis.
Default: off, there is a kernel cmd line arg to enable that.
uml-fix-umldir-order
fold the tree setup functions in umid.c into one, fixes some init call ordering issue I had some time ago. Also makes the error messages more verbose.
uml-fix-export-symbol
exports one missing symbol (needed for xfs).
uml-general-protection-fault
attempt to handle general protection faults more correctly.
uml-net-flush-on-ifup
flush incoming packets on ifup -- fixes networks stalls which happen in case the unix socket buffer is already full when the interface is up'ed (due to SIGIO never signaling arrived data).
uml-fix-mconsole-proc
fix kernel crash triggered by running "uml_mconsole <umid> proc <some-file>" multipole times.
uml-terminal-cleanup
tty / console handling cleanups. The patchfile itself has a long description.
-------------------------------------------------------
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media 100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33 Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
Quoted 3 lines · Gerd Knorr
What is the status if the umlfb/x11/pthread issue, i.e. uml kernel crashing as soon as one tries to link against libpthread (which is needed for libX11)? Any progress here?
Use SKAS mode, not TT, so UML is dynamically linked and libpthread is not needed. But no further progress since my last mail on August 2 (which you may have missed due to being abroad, check the archives).
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 Shop4tech.com-Lowest price on Blank Media 100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33 Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
Quoted 7 lines · Geert Uytterhoeven
Quoted 3 lines · Gerd Knorr
What is the status if the umlfb/x11/pthread issue, i.e. uml kernel crashing as soon as one tries to link against libpthread (which is needed for libX11)? Any progress here?
Use SKAS mode, not TT, so UML is dynamically linked and libpthread is not needed.
Ah, ok, thats the trick. Now I have a X11 window. I've build kernels with both skas+tt until now ...
Quoted 2 lines
But no further progress since my last mail on August 2 (which you may have missed due to being abroad, check the archives).
Yep, was offline at that time due to holidays.
Gerd
Signature · 12 lines
return -ENOSIG; ------------------------------------------------------- SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media 100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33 Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift. http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285 _______________________________________________ User-mode-linux-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
Jeff Dike
AppliedQuoted 3 lines · [email protected] said:
uml-core-on-panic
Make the uml kernel dump core on kernel panics for later analysis.
Default: off, there is a kernel cmd line arg to enable that.
I like this, but I think it would be better done in a panic_notifier.
Quoted 4 lines
uml-fix-mconsole-proc
fix kernel crash triggered by running "uml_mconsole<umid> proc
<some-file>"
multipole times.
I didn't do it this way on purpose. I create an internal procfs mount in case the UML root user has mounted something else on /proc. I don't want the mconsole on the host to be faked out by that.
Quoted 6 lines
uml-net-flush-on-ifup
flush incoming packets on ifup -- fixes networks stalls which happen
in
case the unix socket buffer is already full when the interface is
up'ed
(due to SIGIO never signaling arrived data).
Applied, BTW, this one is mangled on your site:
@@ -129,6 +129,7 @@ static int uml_net_open(struct net_devic
It's in my 2.4 tree and will get moved over to 2.6 in due course.
Quoted 3 lines
uml-terminal-cleanup
tty / console handling cleanups. The patchfile itself has a long description.
I like this one, but it's big and I'm going to have to take a good look at it. I'm somewhat unhappy about the command line change, where you need to specify a console or UML doesn't boot. That'll break everyone's scripts. Is it possible to provide a default console if there isn't one on the command line?
Quoted 4 lines
What is the status of the amd64 port? The 2.6.4 patch on sf.net produces lots of rejects when I try to apply it on top of the 2.6.7 uml patch. Is a newer version available somewhere? Or can I just ignore all the rejects (guess not)?
It's stuck on 2.6.4 for now. I'm going to get it caught up, but haven't decided when yet.
Jeff
-------------------------------------------------------
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media 100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33 Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
Quoted 9 lines · Jeff Dike
Quoted 3 lines · [email protected] said:
uml-terminal-cleanup
tty / console handling cleanups. The patchfile itself has a long description.I like this one, but it's big and I'm going to have to take a good look at it. I'm somewhat unhappy about the command line change, where you need to specify a console or UML doesn't boot. That'll break everyone's scripts. Is it possible to provide a default console if there isn't one on the command line?
IIRC, the default console is the one that gets registered first. So by reordering the code (in source files) and/or objects (in Makefiles) you can make sure the correct one is the default.
BTW, what do you think of putting the stderr console in its own source file with its own CONFIG_* option?
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 Shop4tech.com-Lowest price on Blank Media 100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33 Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
Quoted 7 lines · Geert Uytterhoeven
Quoted 4 lines · Jeff Dike
I like this one, but it's big and I'm going to have to take a good look at it. I'm somewhat unhappy about the command line change, where you need to specify a console or UML doesn't boot. That'll break everyone's scripts. Is it possible to provide a default console if there isn't one on the command line?
IIRC, the default console is the one that gets registered first.
Yes.
Quoted 2 lines
So by reordering the code (in source files) and/or objects (in Makefiles) you can make sure the correct one is the default.
No. The stderr console is registered _much_ earlier in the boot process than the stdio console. And I don't want to change that as having printk work early is a cool debugging feature. The stdio_console can't be registered that early as it needs -- unlike stderr console -- several kernel subsystems being initialized already.
Quoted 2 lines
BTW, what do you think of putting the stderr console in its own source file with its own CONFIG_* option?
Thats IMHO a good idea in any case as one can turn on/off stderr console and stdio console independant of each other. That simplifies things for both backward compatibility (make the kernel with stderr console disabled behave like older versions should be easy, even without dirty tricks like silently appending console=tty0) and fbcon (disable stdio_console to get it out of the way but have stderr console for printk-debugging it).
Gerd
Signature · 12 lines
return -ENOSIG; ------------------------------------------------------- SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media 100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33 Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift. http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285 _______________________________________________ User-mode-linux-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
Quoted 6 lines · Jeff Dike
Quoted 3 lines · [email protected] said:
uml-core-on-panic
Make the uml kernel dump core on kernel panics for later analysis.
Default: off, there is a kernel cmd line arg to enable that.I like this, but I think it would be better done in a
panic_notifier.
I'll have a look.
Quoted 8 lines
Quoted 4 lines
uml-fix-mconsole-proc
fix kernel crash triggered by running "uml_mconsole<umid> proc
<some-file>"
multipole times.I didn't do it this way on purpose. I create an internal procfs mount in case the UML root user has mounted something else on /proc. I don't want the mconsole on the host to be faked out by that.
I guessed that from reading the code already ;)
I'm happy with any other fix for the kernel crash as well. I'm no VFS expert through and don't know what exactly is wrong in the original code. I know that my version has the drawback that it depends on procfs actually being mounted on /proc, but it's better that than being able to kill the kernel by calling "uml_mconsole proc <file>" a few timers ;)
Quoted 6 lines
Quoted 1 line
uml-terminal-cleanup
I like this one, but it's big and I'm going to have to take a good look at it. I'm somewhat unhappy about the command line change, where you need to specify a console or UML doesn't boot. That'll break everyone's scripts. Is it possible to provide a default console if there isn't one on the command line?
See Geert's and my other mail.
Gerd
Signature · 12 lines
return -ENOSIG; ------------------------------------------------------- SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media 100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33 Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift. http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285 _______________________________________________ User-mode-linux-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
Quoted 2 lines · Gerd Knorr
And I don't want to change that as having printk work early is a cool debugging feature.
Yeah ! I had a quick look at the code, and it seems that you could still occasionally lose printk data in non-catastrophic situations, e.g. when writing to a pipe. I've made a (less nice) patch a while ago that doesn't loses data unless it really really has to:
http://marc.theaimsgroup.com/?l=user-mode-linux-devel&m=108093851702249&w=2
BTW, do the console changes also remove the requirement that stdin must be a tty, e.g. so that one could do ./linux </dev/null and that UML doesn't alter terminal settings ? (I've just worked around the latter problem in umlsim, but it's rather messy.)
- Werner
Signature · 14 lines
_________________________________________________________________________ / Werner Almesberger, Buenos Aires, Argentina [email protected] / /_http://www.almesberger.net/____________________________________________/ ------------------------------------------------------- SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media 100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33 Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift. http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285 _______________________________________________ User-mode-linux-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
Quoted 5 lines
BTW, do the console changes also remove the requirement that stdin must be a tty, e.g. so that one could do ./linux <
/dev/nulland that UML doesn't alter terminal settings ? (I've just worked around the latter problem in umlsim, but it's rather messy.)
I think so, but havn't actually tried. I usually use the host terminal as serial console for the uml machine (i.e. "ssl0=fd:0,fd:1 console=ttyS0").
Gerd
Signature · 12 lines
return -ENOSIG; ------------------------------------------------------- SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media 100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33 Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift. http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285 _______________________________________________ User-mode-linux-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
Quoted 4 lines · Gerd Knorr
Quoted 2 lines · Jeff Dike
[email protected] said:
Quoted 9 lines
Quoted 5 lines
Quoted 3 lines
uml-core-on-panic
Make the uml kernel dump core on kernel panics for later analysis.
Default: off, there is a kernel cmd line arg to enable that.I like this, but I think it would be better done in a
panic_notifier.I'll have a look.
I liked this too. Here's a pass at it if you like (attached).
Signature · 1 line
db
arch/um/kernel/reboot.c +5 -5
@@ -38,21 +38,19 @@void uml_cleanup (void ) { -kill_off_processes ();do_uml_exitcalls (); +kill_off_processes (); }void machine_restart (char * __unused) { -do_uml_exitcalls (); -kill_off_processes (); +uml_cleanup ();CHOOSE_MODE (reboot_tt (),reboot_skas ()); }void machine_power_off (void ) { -do_uml_exitcalls (); -kill_off_processes (); +uml_cleanup ();CHOOSE_MODE (halt_tt (),halt_skas ()); }
@@ -69,5 +67,7 @@* --------------------------------------------------------------------------- * Local variables: * c-file-style: "linux" +* indent-tabs-mode: t +* tab-width: 8 * End: */
arch/um/kernel/um_arch.c +36 -0
@@ -412,9 +412,43 @@ .priority = 0 }; +static int uml_coreonpanic =0 ; + +static int coreonpanic_setup (char *str) { +printf ("coreonpanic : Kernel will core on panic.\n" ); + uml_coreonpanic =1 ; +return (0 ); +} + +__setup ("coreonpanic" , coreonpanic_setup); +__uml_help (coreonpanic_setup, +"coreonpanic\n" +" This flag make it so that UML will dump core on a kernel panic or segfault.\n" +" Shell environment restrictions on cores (limit or ulimit) still apply.\n\n" +" Beware that your UML will not reboot with this flag.\n" +); + +static int panic_coreonpanic (struct notifier_block *self,unsigned long unused1, +void *unused2) +{ +if (uml_coreonpanic){ +uml_cleanup (); +block_signals (); +abort (); + } +return (0 );/* never get here */ +} + +static struct notifier_block panic_coreonpanic_notifier = { + .notifier_call = panic_coreonpanic, + .next =NULL , + .priority =1 +}; +void __init setup_arch (char **cmdline_p) {notifier_chain_register (&panic_notifier_list, &panic_exit_notifier); +notifier_chain_register (&panic_notifier_list, &panic_coreonpanic_notifier);paging_init ();strcpy (command_line, saved_command_line); *cmdline_p = command_line;
@@ -436,5 +470,7 @@* --------------------------------------------------------------------------- * Local variables: * c-file-style: "linux" +* indent-tabs-mode: t +* tab-width: 8 * End: */
Quoted 1 line
I liked this too. Here's a pass at it if you like (attached).
Sorry for the delay, going over this while being busy updating my patches right now ...
arch/um/kernel/um_arch.c line 437
Quoted 7 lines
arch/um/kernel/um_arch.c +7
-0+static int panic_coreonpanic (struct notifier_block *self,unsigned long unused1, +void *unused2) +{ +if (uml_coreonpanic){ +uml_cleanup (); +block_signals (); +abort ();
What is the point of doing that? I'd just let it dump core without any cleanups, to get the state of the uml kernel dumped to the disk with few modifications as possible. Any changes might make the analysis of the crash harder or even impossible.
Gerd
Signature · 12 lines
return -ENOSIG; ------------------------------------------------------- This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170 Project Admins to receive an Apple iPod Mini FREE for your judgement on who ports your project to Linux PPC the best. Sponsored by IBM. Deadline: Sept. 13. Go here: http://sf.net/ppc_contest.php _______________________________________________ User-mode-linux-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
actually it's worse than that in my current implementation:
static int panic_coreonpanic(struct notifier_block *self, unsigned long unused1,
void *unused2)
{
if ( uml_coreonpanic ) {
/* cleanup so we have less to cleanup [linux] on the host */
/* could panic in uml_cleanup though so we need a check */
if ( uml_exitcode++ < 1 ) {
uml_cleanup();
}
/* to prevent keyboard from causing terminal to spew during dump */
block_signals();
abort(); }
return(0);
}
Quoted 28 lines · Gerd Knorr
Quoted 3 lines
I liked this too. Here's a pass at it if you like (attached).
Sorry for the delay, going over this while being busy updating my patches right now ...
arch/um/kernel/um_arch.c line 437
Quoted 9 lines
arch/um/kernel/um_arch.c +7
-0+static int panic_coreonpanic (struct notifier_block *self,unsigned long unused1, +void *unused2) +{ +if (uml_coreonpanic){ +uml_cleanup (); +block_signals (); +abort ();What is the point of doing that? I'd just let it dump core without any cleanups, to get the state of the uml kernel dumped to the disk with few modifications as possible. Any changes might make the analysis of the crash harder or even impossible.
Gerd
Signature · 1 line
db
PATCH 1/1 core-on-panic next take ;)
Quoted 1 line · D. Bahi
actually it's worse than that in my current implementation:
Thanks for the comments, merged that into my current version. Attached below.
I've also moved it all into a single source file, so it is nicely separated and also can be trivialy made a compile time option if someone wants this.
Gerd
arch/um/kernel/Makefile +1 -1
@@ -11,7 +11,7 @@ obj-y = checksum.o config.o exec_kern.o sigio_user.o sigio_kern.o signal_kern.o signal_user.o smp.o \ syscall_kern.o syscall_user.o sysrq.o sys_call_table.o tempfile.o \ time.o time_kern.o tlb.o trap_kern.o trap_user.o uaccess_user.o \ - um_arch.o umid.o user_util.o + um_arch.o umid.o user_util.o core-on-panic.o obj-$(CONFIG_BLK_DEV_INITRD) += initrd_kern.o initrd_user.o obj-$(CONFIG_GPROF) += gprof_syms.o
arch/um/kernel/core-on-panic.c +63 -0
63 lines not on this page · raw message
-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170 Project Admins to receive an Apple iPod Mini FREE for your judgement on who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel