Skip to contentSkip to conversation

uml-patch-2.4.22-7 without CONFIG_MODE_TT failed

uml-devel Applied Jeff Chua 6 participants 8 messages Dec 18, 2003 – Dec 19, 2003 User-mode Linux (UML)

lore
Share & tools
lore

Jeff Chua

author
#0 lore raw

uml-patch-2.4.22-7 on linux 2.4.24-pre1

Can't compile without CONFIG_MODE_TT. 2.4.22-5 has no problem.

Command to compile (make linux ARCH=um)

Thanks,
Jeff
[ [email protected] ]

gcc -D__KERNEL__ -I/v6/src/2424p1/uml/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -fomit-frame-pointer -U__i386__ -Ui386 -DUM_FASTCALL -D__arch_um__ -DSUBARCH="i386" -D_LARGEFILE64_SOURCE -I/v6/src/2424p1/uml/arch/um/include -Derrno=kernel_errno -I/v6/src/2424p1/uml/arch/um/kernel/skas/include -nostdinc -iwithprefix include -DKBUILD_BASENAME=root -DEXPORT_SYMTAB -c root.c
In file included from /v6/src/2424p1/uml/arch/um/include/um_uaccess.h:17,

                 from /v6/src/2424p1/uml/include/asm/uaccess.h:31,
                 from root.c:9:

/v6/src/2424p1/uml/arch/um/include/../kernel/skas/include/uaccess.h: In function `verify_area_skas':
/v6/src/2424p1/uml/arch/um/include/../kernel/skas/include/uaccess.h:17:
`current' undeclared (first use in this function) /v6/src/2424p1/uml/arch/um/include/../kernel/skas/include/uaccess.h:17:
(Each undeclared identifier is reported only once /v6/src/2424p1/uml/arch/um/include/../kernel/skas/include/uaccess.h:17:
for each function it appears in.) /v6/src/2424p1/uml/arch/um/include/../kernel/skas/include/uaccess.h:17:
`mm_segment_t' undeclared (first use in this function) /v6/src/2424p1/uml/arch/um/include/../kernel/skas/include/uaccess.h:17:
parse error before `{' /v6/src/2424p1/uml/arch/um/include/../kernel/skas/include/uaccess.h:17:
`TASK_SIZE' undeclared (first use in this function) /v6/src/2424p1/uml/arch/um/include/../kernel/skas/include/uaccess.h:17:
`EFAULT' undeclared (first use in this function) /v6/src/2424p1/uml/arch/um/include/../kernel/skas/include/uaccess.h:17:
parse error before `)' /v6/src/2424p1/uml/arch/um/include/../kernel/skas/include/uaccess.h:18:
warning: control reaches end of non-void function
In file included from /v6/src/2424p1/uml/include/asm/processor.h:22,

                 from /v6/src/2424p1/uml/include/linux/prefetch.h:13,
                 from /v6/src/2424p1/uml/include/linux/list.h:6,
                 from /v6/src/2424p1/uml/include/linux/wait.h:14,
                 from /v6/src/2424p1/uml/include/linux/fs.h:12,
                 from /v6/src/2424p1/uml/include/linux/capability.h:17,
                 from /v6/src/2424p1/uml/include/linux/binfmts.h:5,
                 from /v6/src/2424p1/uml/include/linux/sched.h:9,
                 from root.c:12:

/v6/src/2424p1/uml/include/asm/processor-generic.h: At top level:
/v6/src/2424p1/uml/include/asm/processor-generic.h:95: `mm_segment_t' used prior to declaration
make[3]: *** [root.o] Error 1
make[3]: Leaving directory `/v6/src/2424p1/uml/fs/proc' make[2]: *** [first_rule] Error 2
make[2]: Leaving directory `/v6/src/2424p1/uml/fs/proc' make[1]: *** [_subdir_proc] Error 2
make[1]: Leaving directory `/v6/src/2424p1/uml/fs'
make: *** [_dir_fs] Error 2

-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials. Become an expert in LINUX or just sharpen your skills. Sign up for IBM's Free Linux Tutorials. Learn everything from the bash shell to sys admin. Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

#1 lore raw

PATCH 1/1 - fix for 2.4.22-7um RTC on CPUs faster than 2.1 GHz

Enabling the RTC in 2.4.22-7um produced a hang very soon after INIT at boot time.

I discovered host_hz as an int overflows past 2.1 Ghz (2147483647 hz). An unsigned int/long would only work for up to ~ 4.3 Ghz (4294967295 hz) or so, which isn't that far off, imo... So -- Below is a patch that changes the type of host_hz to unsigned long long. Also, I believe some casting was taking place with the return value of get_host_hz, so mhz is also redefined as an unsigned long long.

-Chris

arch/um/kernel/time.c 2003-12-18 02:32:38.000000000 -0500 renamed from arch/um/kernel/time.c 2003-12-18 02:30:20.000000000 -0500 +4 -3
diff -Naur orig/arch/um/kernel/time.c mine/arch/um/kernel/time.c
@@ -79,10 +79,11 @@
        set_interval(ITIMER_REAL);
 }
 
-static long get_host_hz(void)
+static unsigned long long get_host_hz(void)
 {
        char mhzline[16], *end;
-       int ret, mult, mhz, rest, len;
+       int ret, mult, rest, len;
+       unsigned long long mhz;
 
        ret = cpu_feature("cpu MHz", mhzline,
                          sizeof(mhzline) / sizeof(mhzline[0]));
@@ -112,7 +113,7 @@
        return(1000000 * mhz + rest);
 }
 
-int host_hz = 0;
+unsigned long long host_hz = 0;
 
 void time_init(void)
 {
arch/um/kernel/time_kern.c 2003-12-18 02:34:58.000000000 -0500 renamed from arch/um/kernel/time_kern.c 2003-12-18 02:30:20.000000000 -0500 +1 -1
diff -Naur orig/arch/um/kernel/time_kern.c mine/arch/um/kernel/time_kern.c
@@ -39,7 +39,7 @@
 static unsigned long long prev_tsc;
 static long long delta;                /* Deviation per interval */
 
-extern int host_hz;
+extern unsigned long long host_hz;
 
 void timer_irq(union uml_pt_regs *regs)
 {

-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials. Become an expert in LINUX or just sharpen your skills. Sign up for IBM's Free Linux Tutorials. Learn everything from the bash shell to sys admin. Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

Applied
#2 lore raw

Re: [uml-devel] [PATCH] - fix for 2.4.22-7um RTC on CPUs faster than 2.1 GHz

Quoted 2 lines · Christopher S. Aker

So -- Below is a patch that changes the type of
host_hz to unsigned long long.

Sigh, some people's machines are too fast...

Applied, thanks.

Jeff

-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials. Become an expert in LINUX or just sharpen your skills. Sign up for IBM's Free Linux Tutorials. Learn everything from the bash shell to sys admin. Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

#3 lore raw

Re: [uml-devel] [PATCH] - fix for 2.4.22-7um RTC on CPUs faster than 2.1 GHz

Does this mean this fix is included in the 2.4.22-7 patch on your website, a new -7 will be released shortly with this fix, or -8 will be released shortly with this (and other) fixes?

Quoted 20 lines · Jeff Dike
Quoted 2 lines · Christopher S. Aker

So -- Below is a patch that changes the type of
host_hz to unsigned long long.

Sigh, some people's machines are too fast...

Applied, thanks.

Jeff

-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials. Become an expert in LINUX or just sharpen your skills. Sign up for IBM's Free Linux Tutorials. Learn everything from the bash shell to sys admin. Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

Signature · 14 lines
Matt Ayres <[email protected]>
TekTonic



-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
_______________________________________________
User-mode-linux-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
#4 lore raw

Re: [uml-devel] [PATCH] - fix for 2.4.22-7um RTC on CPUs faster than 2.1 GHz

Quoted 3 lines · Matt Ayres

Does this mean this fix is included in the 2.4.22-7 patch on your website, a new -7 will be released shortly with this fix, or -8 will be released shortly with this (and other) fixes?

It'll be in -8. I don't reuse patch numbers.

Jeff

-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials. Become an expert in LINUX or just sharpen your skills. Sign up for IBM's Free Linux Tutorials. Learn everything from the bash shell to sys admin. Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

#5 lore raw

Re: [uml-devel] [PATCH] - fix for 2.4.22-7um RTC on CPUs faster than 2.1 GHz

In reply to Christopher S. Aker
Quoted 4 lines · Christopher S. Aker

Enabling the RTC in 2.4.22-7um produced a hang very soon after INIT at boot time.

I discovered host_hz as an int overflows past 2.1 Ghz (2147483647 hz).

Ah, I've been wondering why I couldn't get 2.4.22-7um to work - this fixes it for me!

BTW the patch appeared to be whitespace mangled - I had to apply it with patch --ignore-whitespace

Thanks

Nick

Signature · 13 lines
Nick Craig-Wood
[email protected]


-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
_______________________________________________
User-mode-linux-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
#6 lore raw
In reply to Jeff Chua
Quoted 1 line · Jeff Chua

Can't compile without CONFIG_MODE_TT. 2.4.22-5 has no problem.

Fixed, thanks.

Jeff

-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials. Become an expert in LINUX or just sharpen your skills. Sign up for IBM's Free Linux Tutorials. Learn everything from the bash shell to sys admin. Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

#7 lore raw

Alle 20:21, giovedì 18 dicembre 2003, Jeff Dike ha scritto:

Quoted 4 lines · Jeff Chua
Quoted 1 line

Can't compile without CONFIG_MODE_TT. 2.4.22-5 has no problem.

Fixed, thanks.

Would you either post the fix or release -8? Or maybe it's on CVS(but you post a release for each CVS commit, right?)

In general:
Maybe before than on the site you should announce the release here providing the file as a link, get the silly compile errors and release on the site the patched version. Since -6 to -7 hostaudio needed that silly fix for modules... it's so unpleasant.

Or just build or use a compilation test-suite...

Signature · 16 lines
cat <<EOSIGN
Paolo Giarrusso, aka Blaisorblade
Linux Kernel 2.4.21/2.6.0-test on an i686; Linux registered user n. 292729
EOSIGN



-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id78&alloc_id371&opÌk
_______________________________________________
User-mode-linux-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel