* [uml-devel] Testing requested - [PATCH] Fixing SKAS0 compilation problem / TT mode bug report
@ 2005-11-27 20:59 Blaisorblade
2005-11-28 0:47 ` [uml-devel] Blaisorblade's UML binaries - MORE MORE... please give us an x86_64 UML UML
2005-11-28 4:23 ` [uml-devel] Testing requested - [PATCH] Fixing SKAS0 compilation problem / TT mode bug report Jeff Dike
0 siblings, 2 replies; 11+ messages in thread
From: Blaisorblade @ 2005-11-27 20:59 UTC (permalink / raw)
To: user-mode-linux-devel, Jeff Dike
[-- Attachment #1: Type: text/plain, Size: 1780 bytes --]
The attached patch is a (hacky) proposal, alternative to Jeff's
fix-stub-syscall6, to fix the SKAS0 compilation problem.
In fact, Jeff's patch makes the problem appear on my system (where I never
reproduced it).
I'm going to stick this in -bs2, as it makes kernels compiled for me work
better. So please test compiling -bs2.
As an aside, I saw this code crashing at shutdown in TT mode, from
fs/proc/array.c:do_task_stat() :
if (mm) {
vsize = task_vsize(mm);
eip = KSTK_EIP(task);
esp = KSTK_ESP(task);
}
Went looking and guess what? There is full crap (starting from 2.6.14, due to
the fixes for sysrq-t IIRC):
include/asm-um/processor-i386.h
#define KSTK_EIP(tsk) KSTK_REG(tsk, EIP)
#define KSTK_ESP(tsk) KSTK_REG(tsk, UESP)
#define KSTK_EBP(tsk) KSTK_REG(tsk, EBP)
include/asm-um/processor-generic.h
#ifdef CONFIG_MODE_SKAS
#define KSTK_REG(tsk, reg) \
({ union uml_pt_regs regs; \
get_thread_regs(®s, tsk->thread.mode.skas.switch_buf); \
UPT_REG(®s, reg); })
#else
#define KSTK_REG(tsk, reg) (0xbadbabe)
#endif
I didn't fully realize the amount of crap in the patch when I reviewed it at
that time (but I do remember complaining about 0xbadbabe rather than
0xdeadbeef, so I'm guilty too).
I'll restore for TT mode the 2.6.13 content (which is wrong and kills sysrq-t,
but is better than crap).
And there's no reason for letting TT mode bitrot so much, sorry. Making UML
work for everybody, plus having a SMP testing mode, still means keeping it
working.
--
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
[-- Attachment #2: uml-use-asm-preventing-ebp.diff --]
[-- Type: text/x-diff, Size: 738 bytes --]
Index: linux-2.6.14/arch/um/kernel/skas/clone.c
===================================================================
--- linux-2.6.14.orig/arch/um/kernel/skas/clone.c
+++ linux-2.6.14/arch/um/kernel/skas/clone.c
@@ -1,5 +1,6 @@
#include <sched.h>
#include <signal.h>
+#include <stddef.h>
#include <sys/mman.h>
#include <sys/time.h>
#include <asm/unistd.h>
@@ -39,6 +40,10 @@ stub_clone_handler(void)
from->fd, from->offset);
out:
/* save current result. Parent: pid; child: retcode of mmap */
+#if defined(UML_CONFIG_UML_X86) && !defined(UML_CONFIG_64BIT)
+ __asm__("movl %0, %1": : "r" (err), "g" (*(long*) (UML_CONFIG_STUB_DATA + offsetof(struct stub_data, err))));
+#else
from->err = err;
+#endif
trap_myself();
}
^ permalink raw reply [flat|nested] 11+ messages in thread* [uml-devel] Blaisorblade's UML binaries - MORE MORE... please give us an x86_64 UML 2005-11-27 20:59 [uml-devel] Testing requested - [PATCH] Fixing SKAS0 compilation problem / TT mode bug report Blaisorblade @ 2005-11-28 0:47 ` UML 2005-11-29 12:22 ` Phill Wombat 2005-11-28 4:23 ` [uml-devel] Testing requested - [PATCH] Fixing SKAS0 compilation problem / TT mode bug report Jeff Dike 1 sibling, 1 reply; 11+ messages in thread From: UML @ 2005-11-28 0:47 UTC (permalink / raw) To: user-mode-linux-devel Hi Paolo, Please create an x86_64 binary so I can play with different 64 bit distros. Thanks in advance (I know you have lots of spare time on your hands....) Cheers Phill. P.S. the 32 bit binary is wonderful! It does absolutely everything I need. ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_id=7637&alloc_id=16865&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] 11+ messages in thread
* Re: [uml-devel] Blaisorblade's UML binaries - MORE MORE... please give us an x86_64 UML 2005-11-28 0:47 ` [uml-devel] Blaisorblade's UML binaries - MORE MORE... please give us an x86_64 UML UML @ 2005-11-29 12:22 ` Phill Wombat 2005-11-29 16:52 ` Blaisorblade 0 siblings, 1 reply; 11+ messages in thread From: Phill Wombat @ 2005-11-29 12:22 UTC (permalink / raw) To: user-mode-linux-devel Hi Paolo, x86_64 binary. So far so good! I have managed to create an FC4/x86_64 rootfs from the very impressive (and amazingly simple) shell script on umlwiki where the entire distro is installed via yum. Had some trouble with gpg keys though. The rootfs starts up and hangs at the usual places to do with consoles etc. I'll get to doing some hacks on the rootfs to get things going. Thanks again Phill. On Mon, 2005-11-28 at 11:47 +1100, UML wrote: > Hi Paolo, > > Please create an x86_64 binary so I can play with different 64 bit distros. > > Thanks in advance (I know you have lots of spare time on your hands....) > > Cheers > Phill. > > P.S. the 32 bit binary is wonderful! It does absolutely everything I need. > ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_id=7637&alloc_id=16865&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] 11+ messages in thread
* Re: [uml-devel] Blaisorblade's UML binaries - MORE MORE... please give us an x86_64 UML 2005-11-29 12:22 ` Phill Wombat @ 2005-11-29 16:52 ` Blaisorblade 2005-11-30 20:32 ` Phill Wombat 0 siblings, 1 reply; 11+ messages in thread From: Blaisorblade @ 2005-11-29 16:52 UTC (permalink / raw) To: user-mode-linux-devel; +Cc: Phill Wombat On Tuesday 29 November 2005 13:22, Phill Wombat wrote: > Hi Paolo, > > x86_64 binary. > > So far so good! Thanks, I have no 64-bit FS to test it. Btw, there's also some other site with binaries: http://uml.harlowhill.com/index.php/PrecompiledKernels http://uml.nagafix.co.uk/ > I have managed to create an FC4/x86_64 rootfs from the very impressive > (and amazingly simple) shell script on umlwiki where the entire distro > is installed via yum. Had some trouble with gpg keys though. > The rootfs starts up and hangs at the usual places to do with consoles > etc. I'll get to doing some hacks on the rootfs to get things going. > Thanks again > Phill. -- 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 ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_id=7637&alloc_id=16865&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] 11+ messages in thread
* Re: [uml-devel] Blaisorblade's UML binaries - MORE MORE... please give us an x86_64 UML 2005-11-29 16:52 ` Blaisorblade @ 2005-11-30 20:32 ` Phill Wombat 2005-12-01 12:34 ` Blaisorblade 0 siblings, 1 reply; 11+ messages in thread From: Phill Wombat @ 2005-11-30 20:32 UTC (permalink / raw) To: Blaisorblade; +Cc: user-mode-linux-devel Hi Paolo, Use this to create a new FC4/x86_64 rootfs (modified from umlwiki post). #!/bin/bash RPM_INSTALL_CHR=./INSTALL echo " --> Setting up chroot env in $RPM_INSTALL_CHR" if [ `id -u` = "0" ] ; then mkdir -p \ $RPM_INSTALL_CHR/etc \ $RPM_INSTALL_CHR/dev \ $RPM_INSTALL_CHR/proc \ $RPM_INSTALL_CHR/sys \ $RPM_INSTALL_CHR/var/tmp \ $RPM_INSTALL_CHR/var/cache/yum touch $RPM_INSTALL_CHR/etc/fstab mknod $RPM_INSTALL_CHR/dev/null c 1 3 chmod 666 $RPM_INSTALL_CHR/dev/null mount --bind /proc $RPM_INSTALL_CHR/proc mount --bind /sys $RPM_INSTALL_CHR/sys # rpm \ # --root $PWD/$RPM_INSTALL_CHR \ # --import http://fedora.redhat.com/about/security/4F2A6FD2.txt rpm \ --root $PWD/$RPM_INSTALL_CHR \ -Uvh \ --nodeps \ --force \ http://download.fedora.redhat.com/pub/fedora/linux/core/4/x86_64/os/Fedora/RPMS/fedora-release-4-2.noarch.rpm yum \ -y \ -C \ --installroot=$PWD/$RPM_INSTALL_CHR \ groupinstall "Base" umount $RPM_INSTALL_CHR/proc umount $RPM_INSTALL_CHR/sys else echo " *** Sorry, you must be root to setup a chroot environment" exit 1 fi This is the gpg key installed instead of the commented lines (I couldn't find the right key on the fedora web site). It comes from the live FC4/x86_64 host with rpm -qa gpg-pubkeys*; rpm -qi gpg-pubkey-db42a60e Name : gpg-pubkey Relocations: (not relocatable) Version : db42a60e Vendor: (none) Release : 37ea5438 Build Date: Thu 25 Aug 2005 02:28:19 PM EST Install Date: Thu 25 Aug 2005 02:28:19 PM EST Build Host: localhost Group : Public Keys Source RPM: (none) Size : 0 License: pubkey Signature : (none) Summary : gpg(Red Hat, Inc <security@redhat.com>) Description : -----BEGIN PGP PUBLIC KEY BLOCK----- Version: rpm-4.4.1 (beecrypt-3.0.0) mQGiBDfqVDgRBADBKr3Bl6PO8BQ0H8sJoD6p9U7Yyl7pjtZqioviPwXP+DCWd4u8HQzcxAZ5 7m8ssA1LK1Fx93coJhDzM130+p5BG9mYSWShLabR3N1KXdXQYYcowTOMGxdwYRGr1Spw8Qyd LhjVfU1VSl4xt6bupPbWJbyjkg5Z3P7BlUOUJmrx3wCgobNVEDGaWYJcch5z5B1of/41G8kE AKii6q7Gu/vhXXnLS6m15oNnPVybyngiw/23dKjSZVG7rKANEK2mxg1VB+vc/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YFiA6fD10eB+BlIUqIw80Vgjs BKmCwvKkn4jg8kibXgj4/TzQSx77uYokw1EqQ2wkOZoaEtcubsNMquuLCMWijYhGBBgRAgAG BQI36lRyAAoJECGRgM3bQqYOhyYAnj7hVDY/FJAGqmtZpwVp9IlitW5tAJ4xQApr/jNFZCTk snI+4O1765F7tA== =3AHZ -----END PGP PUBLIC KEY BLOCK----- On Tue, 2005-11-29 at 17:52 +0100, Blaisorblade wrote: > On Tuesday 29 November 2005 13:22, Phill Wombat wrote: > > Hi Paolo, > > > > x86_64 binary. > > > > So far so good! > > Thanks, I have no 64-bit FS to test it. Btw, there's also some other site with > binaries: > > http://uml.harlowhill.com/index.php/PrecompiledKernels > > http://uml.nagafix.co.uk/ > > > I have managed to create an FC4/x86_64 rootfs from the very impressive > > (and amazingly simple) shell script on umlwiki where the entire distro > > is installed via yum. Had some trouble with gpg keys though. > > > The rootfs starts up and hangs at the usual places to do with consoles > > etc. I'll get to doing some hacks on the rootfs to get things going. > > > Thanks again > > Phill. > ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_id=7637&alloc_id=16865&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] 11+ messages in thread
* Re: [uml-devel] Blaisorblade's UML binaries - MORE MORE... please give us an x86_64 UML 2005-11-30 20:32 ` Phill Wombat @ 2005-12-01 12:34 ` Blaisorblade 0 siblings, 0 replies; 11+ messages in thread From: Blaisorblade @ 2005-12-01 12:34 UTC (permalink / raw) To: Phill Wombat; +Cc: user-mode-linux-devel On Wednesday 30 November 2005 21:32, Phill Wombat wrote: > Hi Paolo, > > Use this to create a new FC4/x86_64 rootfs (modified from umlwiki post). Can that be added there too? Doing collaborative editing is the Wiki purpose. > #!/bin/bash > > RPM_INSTALL_CHR=./INSTALL > > echo " --> Setting up chroot env in $RPM_INSTALL_CHR" > > if [ `id -u` = "0" ] ; then > mkdir -p \ > $RPM_INSTALL_CHR/etc \ > $RPM_INSTALL_CHR/dev \ > $RPM_INSTALL_CHR/proc \ > $RPM_INSTALL_CHR/sys \ > $RPM_INSTALL_CHR/var/tmp \ > $RPM_INSTALL_CHR/var/cache/yum > touch $RPM_INSTALL_CHR/etc/fstab > mknod $RPM_INSTALL_CHR/dev/null c 1 3 > chmod 666 $RPM_INSTALL_CHR/dev/null > mount --bind /proc $RPM_INSTALL_CHR/proc > mount --bind /sys $RPM_INSTALL_CHR/sys > # rpm \ > # --root $PWD/$RPM_INSTALL_CHR \ > # --import > http://fedora.redhat.com/about/security/4F2A6FD2.txt rpm \ > --root $PWD/$RPM_INSTALL_CHR \ > -Uvh \ > --nodeps \ > --force \ > > http://download.fedora.redhat.com/pub/fedora/linux/core/4/x86_64/os/Fedora/ >RPMS/fedora-release-4-2.noarch.rpm yum \ > -y \ > -C \ > --installroot=$PWD/$RPM_INSTALL_CHR \ > groupinstall "Base" > umount $RPM_INSTALL_CHR/proc > umount $RPM_INSTALL_CHR/sys > else > echo " *** Sorry, you must be root to setup a chroot environment" > exit 1 > fi > > This is the gpg key installed instead of the commented lines (I couldn't > find the right key on the fedora web site). It comes from the live > FC4/x86_64 host with rpm -qa gpg-pubkeys*; rpm -qi gpg-pubkey-db42a60e > > > Name : gpg-pubkey Relocations: (not relocatable) > Version : db42a60e Vendor: (none) > Release : 37ea5438 Build Date: Thu 25 Aug 2005 > 02:28:19 PM EST Install Date: Thu 25 Aug 2005 02:28:19 PM EST Build > Host: localhost Group : Public Keys Source RPM: > (none) > Size : 0 License: pubkey > Signature : (none) > Summary : gpg(Red Hat, Inc <security@redhat.com>) > Description : > -----BEGIN PGP PUBLIC KEY BLOCK----- > Version: rpm-4.4.1 (beecrypt-3.0.0) > > mQGiBDfqVDgRBADBKr3Bl6PO8BQ0H8sJoD6p9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ADBQf9E4SKCWRand8K0XloMYgmipxMhJNnWDMLkokvbMNTUoNpSfRoQJ9EheXDxwMpTPwK > ti/PYrrL2J11P2ed0x7zm8v3gLrY0cue1iSba+8glY+p31ZPOr5ogaJw7ZARgoS8BwjyRymX > Qp+8Dete0TELKOL2/itDOPGHW07SsVWOR6cmX4VlRRcWB5KejaNvdrE54XFtOd04NMgWI63u > qZc4zkRa+kwEZtmbz3tHSdRCCE+Y7YVP6IUf/w6YPQFQriWYFiA6fD10eB+BlIUqIw80Vgjs > BKmCwvKkn4jg8kibXgj4/TzQSx77uYokw1EqQ2wkOZoaEtcubsNMquuLCMWijYhGBBgRAgAG > BQI36lRyAAoJECGRgM3bQqYOhyYAnj7hVDY/FJAGqmtZpwVp9IlitW5tAJ4xQApr/jNFZCTk > snI+4O1765F7tA== > =3AHZ > -----END PGP PUBLIC KEY BLOCK----- > > On Tue, 2005-11-29 at 17:52 +0100, Blaisorblade wrote: > > On Tuesday 29 November 2005 13:22, Phill Wombat wrote: > > > Hi Paolo, > > > > > > x86_64 binary. > > > > > > So far so good! > > > > Thanks, I have no 64-bit FS to test it. Btw, there's also some other site > > with binaries: > > > > http://uml.harlowhill.com/index.php/PrecompiledKernels > > > > http://uml.nagafix.co.uk/ > > > > > I have managed to create an FC4/x86_64 rootfs from the very impressive > > > (and amazingly simple) shell script on umlwiki where the entire distro > > > is installed via yum. Had some trouble with gpg keys though. > > > > > > The rootfs starts up and hangs at the usual places to do with consoles > > > etc. I'll get to doing some hacks on the rootfs to get things going. > > > > > > Thanks again > > > Phill. -- 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 ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_id=7637&alloc_id=16865&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] 11+ messages in thread
* Re: [uml-devel] Testing requested - [PATCH] Fixing SKAS0 compilation problem / TT mode bug report 2005-11-27 20:59 [uml-devel] Testing requested - [PATCH] Fixing SKAS0 compilation problem / TT mode bug report Blaisorblade 2005-11-28 0:47 ` [uml-devel] Blaisorblade's UML binaries - MORE MORE... please give us an x86_64 UML UML @ 2005-11-28 4:23 ` Jeff Dike 2005-11-29 16:28 ` Blaisorblade 1 sibling, 1 reply; 11+ messages in thread From: Jeff Dike @ 2005-11-28 4:23 UTC (permalink / raw) To: Blaisorblade; +Cc: user-mode-linux-devel On Sun, Nov 27, 2005 at 09:59:37PM +0100, Blaisorblade wrote: > The attached patch is a (hacky) proposal, alternative to Jeff's > fix-stub-syscall6, to fix the SKAS0 compilation problem. Bleah :-) > In fact, Jeff's patch makes the problem appear on my system (where I never > reproduced it). What assembly did you end up with, with my patch? > As an aside, I saw this code crashing at shutdown in TT mode, from > fs/proc/array.c:do_task_stat() : > > if (mm) { > vsize = task_vsize(mm); > eip = KSTK_EIP(task); > esp = KSTK_ESP(task); > } > > Went looking and guess what? There is full crap (starting from 2.6.14, due to > the fixes for sysrq-t IIRC): > > include/asm-um/processor-i386.h > > #define KSTK_EIP(tsk) KSTK_REG(tsk, EIP) > #define KSTK_ESP(tsk) KSTK_REG(tsk, UESP) > #define KSTK_EBP(tsk) KSTK_REG(tsk, EBP) > > include/asm-um/processor-generic.h > > #ifdef CONFIG_MODE_SKAS > #define KSTK_REG(tsk, reg) \ > ({ union uml_pt_regs regs; \ > get_thread_regs(®s, tsk->thread.mode.skas.switch_buf); \ > UPT_REG(®s, reg); }) > #else > #define KSTK_REG(tsk, reg) (0xbadbabe) > #endif Oops, needs fixing. Jeff ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_id=7637&alloc_id=16865&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] 11+ messages in thread
* Re: [uml-devel] Testing requested - [PATCH] Fixing SKAS0 compilation problem / TT mode bug report 2005-11-28 4:23 ` [uml-devel] Testing requested - [PATCH] Fixing SKAS0 compilation problem / TT mode bug report Jeff Dike @ 2005-11-29 16:28 ` Blaisorblade 2005-11-29 17:55 ` Jeff Dike 0 siblings, 1 reply; 11+ messages in thread From: Blaisorblade @ 2005-11-29 16:28 UTC (permalink / raw) To: Jeff Dike; +Cc: user-mode-linux-devel On Monday 28 November 2005 05:23, Jeff Dike wrote: > On Sun, Nov 27, 2005 at 09:59:37PM +0100, Blaisorblade wrote: > > The attached patch is a (hacky) proposal, alternative to Jeff's > > fix-stub-syscall6, to fix the SKAS0 compilation problem. > Bleah :-) Yep :-). > > In fact, Jeff's patch makes the problem appear on my system (where I > > never reproduced it). > What assembly did you end up with, with my patch? Actually, looking at it today, it's a different story than the usual one: ====working (from the .s output rather than disassembly): #APP push %ebp ; movl %eax,%ebp ; movl $192,%eax ; int $0x80 ; pop %ebp #NO_APP movl %eax, %edi .L4: movl %edi, -1073745896 #APP int3 ====not-working: #APP push %ebp ; movl %eax,%ebp ; movl $192,%eax ; int $0x80 ; pop %ebp #NO_APP movl %eax, -16(%ebp) .L4: movl -16(%ebp), %eax movl %eax, -1073745896 #APP int3 Command line for GCC: gcc -Wp,-MD,arch/um/kernel/skas/.clone.s.d -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -ffreestanding -O2 -fno-omit-frame-pointer -fno-optimize-sibling-calls -D__arch_um__ -DSUBARCH=\"i386\" -Dvmap=kernel_vmap -Din6addr_loopback=kernel_in6addr_loopback -Iarch/um/include -I/home/paolo/Admin/kernel/6/VCS/linux-2.6.14/arch/um/include -I/home/paolo/Admin/kernel/6/VCS/linux-2.6.14/arch/um/kernel/tt/include -I/home/paolo/Admin/kernel/6/VCS/linux-2.6.14/arch/um/kernel/skas/include -D_FILE_OFFSET_BITS=64 -m32 -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -S -o arch/um/kernel/skas/clone.s /home/paolo/Admin/kernel/6/VCS/linux-2.6.14/arch/um/kernel/skas/clone.c As you see, what's moved is the scratch pid location, put in %edi register normally and in the stack on the faulty assembly (btw, I'm puzzled why GCC should do this puzzling around). So, indeed, with your patch GCC understands that the variable is at a known location, but becomes silly for other reasons. So, again: can we finally rewrite clone.c in assembly? Or, otherwise, to use a unique assembly macro joining mmap, the return and trap_myself? It could be nicer to have it in C, but hey, GCC won, we lost. So let gcc suck and work without it. It's fundamentally hacky to get GCC not to use the stack, it's not written for that. Either you say "ok, let's copy the whole stack content when remapping" a-la switcheroo() or we agree on ASM. > > #ifdef CONFIG_MODE_SKAS > > #define KSTK_REG(tsk, reg) \ > > ({ union uml_pt_regs regs; \ > > get_thread_regs(®s, tsk->thread.mode.skas.switch_buf); \ > > UPT_REG(®s, reg); }) > > #else > > #define KSTK_REG(tsk, reg) (0xbadbabe) > > #endif > Oops, needs fixing. Btw, the old code was probably uncorrect but didn't crash except for sysrq-t. Actually, in TT mode we possibly don't have the right location (do we save the stack pointer before entering the kernel)? Let's just use the old code as fallback for that, it's not worth implementing such a feature for TT mode. -- 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 ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_id=7637&alloc_id=16865&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] 11+ messages in thread
* Re: [uml-devel] Testing requested - [PATCH] Fixing SKAS0 compilation problem / TT mode bug report 2005-11-29 16:28 ` Blaisorblade @ 2005-11-29 17:55 ` Jeff Dike 2005-12-02 0:18 ` Blaisorblade 0 siblings, 1 reply; 11+ messages in thread From: Jeff Dike @ 2005-11-29 17:55 UTC (permalink / raw) To: Blaisorblade; +Cc: user-mode-linux-devel On Tue, Nov 29, 2005 at 05:28:56PM +0100, Blaisorblade wrote: > So, again: can we finally rewrite clone.c in assembly? Or, otherwise, to use a > unique assembly macro joining mmap, the return and trap_myself? I would favor the second, although I would just join the mmap and storing of the error value. The stack switching is at the heart of our recent problems here, so some asm which hides that should be OK. I think the rest is OK with the pseudo-C, right? Jeff ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_id=7637&alloc_id=16865&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] 11+ messages in thread
* Re: [uml-devel] Testing requested - [PATCH] Fixing SKAS0 compilation problem / TT mode bug report 2005-11-29 17:55 ` Jeff Dike @ 2005-12-02 0:18 ` Blaisorblade 2005-12-03 5:54 ` Jeff Dike 0 siblings, 1 reply; 11+ messages in thread From: Blaisorblade @ 2005-12-02 0:18 UTC (permalink / raw) To: user-mode-linux-devel; +Cc: Jeff Dike On Tuesday 29 November 2005 18:55, Jeff Dike wrote: > On Tue, Nov 29, 2005 at 05:28:56PM +0100, Blaisorblade wrote: > > So, again: can we finally rewrite clone.c in assembly? Or, otherwise, to > > use a unique assembly macro joining mmap, the return and trap_myself? > > I would favor the second, although I would just join the mmap and storing > of the error value. I want to add the int3 too - that's the only way to be deterministically sure that GCC doesn't use %ebp after the unmap. > The stack switching is at the heart of our recent > problems here, so some asm which hides that should be OK. I think the rest > is OK with the pseudo-C, right? Yes, mostly.... there is also the problem with hardened toolchains (two different reports), which makes inline syscalls bleach (hardened toolchains use PIE code and need to have %EBX reserved for GOT/PLT handling), but I currently I do not consider fixing it before I can reproduce 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! Messenger: chiamate gratuite in tutto il mondo http://it.messenger.yahoo.com ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_id=7637&alloc_id=16865&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] 11+ messages in thread
* Re: [uml-devel] Testing requested - [PATCH] Fixing SKAS0 compilation problem / TT mode bug report 2005-12-02 0:18 ` Blaisorblade @ 2005-12-03 5:54 ` Jeff Dike 0 siblings, 0 replies; 11+ messages in thread From: Jeff Dike @ 2005-12-03 5:54 UTC (permalink / raw) To: Blaisorblade; +Cc: user-mode-linux-devel On Fri, Dec 02, 2005 at 01:18:27AM +0100, Blaisorblade wrote: > I want to add the int3 too - that's the only way to be deterministically > sure that GCC doesn't use %ebp after the unmap. Well, my current patch branches to the int3. gcc will have to be pretty imaginative to involve ebp in a branch. > Yes, mostly.... there is also the problem with hardened toolchains (two > different reports), which makes inline syscalls bleach (hardened toolchains > use PIE code and need to have %EBX reserved for GOT/PLT handling), but I > currently I do not consider fixing it before I can reproduce it. Yeah, I encountered this in a different context. Jeff ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_id=7637&alloc_id=16865&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] 11+ messages in thread
end of thread, other threads:[~2005-12-03 5:02 UTC | newest] Thread overview: 11+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2005-11-27 20:59 [uml-devel] Testing requested - [PATCH] Fixing SKAS0 compilation problem / TT mode bug report Blaisorblade 2005-11-28 0:47 ` [uml-devel] Blaisorblade's UML binaries - MORE MORE... please give us an x86_64 UML UML 2005-11-29 12:22 ` Phill Wombat 2005-11-29 16:52 ` Blaisorblade 2005-11-30 20:32 ` Phill Wombat 2005-12-01 12:34 ` Blaisorblade 2005-11-28 4:23 ` [uml-devel] Testing requested - [PATCH] Fixing SKAS0 compilation problem / TT mode bug report Jeff Dike 2005-11-29 16:28 ` Blaisorblade 2005-11-29 17:55 ` Jeff Dike 2005-12-02 0:18 ` Blaisorblade 2005-12-03 5:54 ` Jeff Dike
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox