Re: [uml-devel] Partial fix! - Was: Re: [BUG report] UML linux-2.6 latest BK doesn't compile

2005-02-16 Thread Blaisorblade
On Monday 14 February 2005 12:35, Anton Altaparmakov wrote:
> On Tue, 2005-02-08 at 17:22 -0500, Jeff Dike wrote:
> > [EMAIL PROTECTED] said:
> > > Why not simply disable CONFIG_GCOV for him, in this case?
> >
> > Anton presumably turned on CONFIG_GCOV because he wanted to do some
> > profiling...
>
> Yes.  I finally found a way to get it to compile.  Compiling without TT
> mode and WITHOUT static build it still fails with the same problem
> (__bb_init_func problem I already reported).  But compiling without TT
> but WITH static build the __bb_init_func problem goes away but instead I
> get a __gcov_init missing symbol in my modules.
>
> Note I have gcc-3.3.4-11 (SuSE 9.2) and it defines __gcov_init.  So I
> added this as an export symbol and lo and behold the kernel and modules
> compiled and I am now up an running with UML and NTFS as a module.  (-:

What do we do for previous GCC, which probably do not define _gcov_init (at 
least I guess, since things worked before)? We'll get a "unresolved symbol" 
in the kernel linking, I guess (unverified).

It is possible, even if ugly, to $(NM) the relevant libraries to choose what 
to do, by adding a -D__EXPORT_GCOV_INIT_ (or even, if we know well, to 
indicate the GCC version needed for this).

So, for now, I guess we must defer this to later than 2.6.11...

> Here is the patch that I used to fix this:
>
> --- ntfs-2.6-devel/arch/um/kernel/gmon_syms.c.old 2005-02-14
> 11:27:04.789474410 + +++
> ntfs-2.6-devel/arch/um/kernel/gmon_syms.c 2005-02-14 11:26:49.191117739
> + @@ -8,6 +8,9 @@
>  extern void __bb_init_func(void *);
>  EXPORT_SYMBOL(__bb_init_func);
>
> +extern void __gcov_init(void *);
> +EXPORT_SYMBOL(__gcov_init);
> +
>  /*
>   * Overrides for Emacs so that we follow Linus's tabbing style.
>   * Emacs will notice this stuff at the end of the file and automatically
>
> Best regards,
>
> Anton

-- 
Paolo Giarrusso, aka Blaisorblade
Linux registered user n. 292729
http://www.user-mode-linux.org/~blaisorblade




---
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
___
User-mode-linux-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel


Re: [uml-devel] problems making UML binary

2005-02-16 Thread Blaisorblade
On Tuesday 15 February 2005 16:49, [EMAIL PROTECTED] wrote:
> Hello,
>
> Could you please help me with the following problem?
>
> Here's a problem I've encountered when trying to compile an UML (User Mode
> Linux) linux binary:

> 5) Then I've tried make linux ARCH=um but got problems:
>  a) with gcc 3.4.1 that I started with (standard Mandrake 10.1 instalation)
> I've got a lot of errors like:
>
> "sched.c:839: error: conflicting types for 'sleep_on_timeout'
>
> /home/adam/work/UML/linux-2.4.27/include/linux/sched.h:598: error: previous
> declaration of 'sleep_on_timeout'
>
> was here"
No idea about this (yet)... maybe GCC became stricter about declaration 
consistency... Since the problem happens probably with i386, too, you might 
try the latest 2.4 with the same patch applied.

> So I guessed it was a gcc/Mandrake problem..
>  b) with gcc 3.3.1-2mdk or gcc 2.96-063mdk I got another problem - make
> linux ARCH=um runs smooth

> until it gets to linking: here is what I've got:
> "ld -r -o unmap_fin.o unmap.o -lc -L/usr/lib
> ld: cannot find -lc
> make[3]: *** [unmap_fin.o] Error 1
> make[3] Leaving directory
> `/home/adam/work/UML/linux-2.4.27/arch/um/kernel/tt' ..."

This is a message caused by missing /usr/lib/libc.a - install 
glibc-static-devel and this one *should* work fine. Actually, in my 
experience, gcc 3.3.2 from Mandrake 10 Official miscompiles UML / 2.4 (not 
reproducible with UML / 2.6). gcc 3.2.2 from Mandrake 9.1 installs and works 
well (use make ARCH=um CC='gcc-3.2.2' after installing it)... I've no 
experience with the 3.3.1 one.
-- 
Paolo Giarrusso, aka Blaisorblade
Linux registered user n. 292729
http://www.user-mode-linux.org/~blaisorblade




---
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
___
User-mode-linux-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel


Re: [uml-devel] Re: [PATCH] uml: support a separate build tree; support USER_OBJS dependencies

2005-02-16 Thread Blaisorblade
On Monday 14 February 2005 00:11, Vadim Abrossimov wrote:
> On Sun, 13 Feb 2005 16:50:59 -0500, Jeff Dike <[EMAIL PROTECTED]> wrote:

> This is the patch for USER_OBJS:
Ok, I have two more requests, if possible:
1) add something like arch/um/Rules.make which is included everywhere needed 
and contains boilerplate, repeated code. Ideally that would also contain also 
these two lines:

USER_OBJS += $(filter %_user.o,$(obj-y))
USER_OBJS := $(foreach file,$(USER_OBJS),$(obj)/$(file))

which are common to everything. So, most changes to this stuff could be 
insulated.

2) There is an error in the patch (even in Al's idea): you must swap, in the 
below code, CFLAGS_$(notdir $@) and $(USER_CFLAGS), since the former must be 
able to override the latter.

At least arch/um/kernel/frame.o will miscompile with the current patch; from 
arch/um/kernel/Makefile

#This must override the default -fomit-frame-pointer
CFLAGS_frame.o := -fno-omit-frame-pointer

#Notice that this declaration is correct.
$(USER_OBJS) : %.o: %.c
$(CC) $(USER_CFLAGS) $(CFLAGS_$(notdir $@)) -c -o $@ $<

And yes, this is a reason to use a common include instead of duplicating 
everything.
> +$(USER_OBJS) : c_flags = -Wp,-MD,$(depfile) $(CFLAGS_$(notdir $@))
> $(USER_CFLAGS)

-- 
Paolo Giarrusso, aka Blaisorblade
Linux registered user n. 292729
http://www.user-mode-linux.org/~blaisorblade




---
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
___
User-mode-linux-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel


Re: [uml-devel] [BUG: UML 2.6.11-rc4-bk-latest] sleeping function called from invalid context and segmentation fault

2005-02-16 Thread Blaisorblade
On Monday 14 February 2005 12:48, Anton Altaparmakov wrote:
> Hi,
>
> I get a few Debug messages of the form from UML:
>
> Debug: sleeping function called from invalid context at
> include/asm/arch/semaphore.h:107
> in_atomic():0, irqs_disabled():1
> Call Trace:
> 087d77b0:  [<0809aaa5>] __might_sleep+0x135/0x180
> 087d77d8:  [<084d377f>] mcount+0xf/0x20
> 087d77e0:  [<0807cc13>] uml_console_write+0x33/0x80

> Most are coming via uml_console_write.
The problem is that the UML tty drivers use a semaphore instead of a spinlock 
for the locking, which also causes some other problems.

The attached patch should fix this, but I've not yet made sure it is not 
deadlock-prone (I didn't hit any during some very limited testing).

So it's not yet ready for 2.6.11.
-- 
Paolo Giarrusso, aka Blaisorblade
Linux registered user n. 292729
http://www.user-mode-linux.org/~blaisorblade


Signed-off-by: Paolo 'Blaisorblade' Giarrusso <[EMAIL PROTECTED]>
---

 linux-2.6.11-paolo/arch/um/drivers/line.c  |   49 +
 linux-2.6.11-paolo/arch/um/drivers/ssl.c   |   16 +-
 linux-2.6.11-paolo/arch/um/drivers/stdio_console.c |   16 +-
 linux-2.6.11-paolo/arch/um/include/line.h  |   16 --
 4 files changed, 31 insertions(+), 66 deletions(-)

diff -puN arch/um/drivers/line.c~uml-console-redo-locking arch/um/drivers/line.c
--- linux-2.6.11/arch/um/drivers/line.c~uml-console-redo-locking	2005-02-07 19:16:49.954057296 +0100
+++ linux-2.6.11-paolo/arch/um/drivers/line.c	2005-02-07 19:16:49.969055016 +0100
@@ -52,6 +52,7 @@ static int write_room(struct line *dev)
 	return (n - 1);
 }
 
+/* Must be called while holding line->lock!*/
 static int buffer_data(struct line *line, const char *buf, int len)
 {
 	int end, room;
@@ -84,6 +85,7 @@ static int buffer_data(struct line *line
 	return(len);
 }
 
+/* Must be called while holding line->lock!*/
 static int flush_buffer(struct line *line)
 {
 	int n, count;
@@ -122,16 +124,13 @@ int line_write(struct tty_struct *tty, c
 
 	if(tty->stopped) return 0;
 
-	down(&line->sem);
-	if(line->head != line->tail){
-		local_irq_save(flags);
+	spin_lock_irqsave(&line->lock, flags);
+	if (line->head != line->tail){
 		ret = buffer_data(line, buf, len);
 		err = flush_buffer(line);
-		local_irq_restore(flags);
 		if(err <= 0)
 			ret = err;
-	}
-	else {
+	} else {
 		n = write_chan(&line->chan_list, buf, len, 
 			   line->driver->write_irq);
 		if(n < 0){
@@ -144,8 +143,8 @@ int line_write(struct tty_struct *tty, c
 		if(len > 0)
 			ret += buffer_data(line, buf + n, len);
 	}
- out_up:
-	up(&line->sem);
+out_up:
+	spin_unlock_irqrestore(&line->lock, flags);
 	return(ret);
 }
 
@@ -260,6 +259,7 @@ static irqreturn_t line_write_interrupt(
 	struct line *line = tty->driver_data;
 	int err;
 
+	spin_lock(&line->lock);
 	err = flush_buffer(line);
 	if(err == 0)
 		return(IRQ_NONE);
@@ -267,6 +267,7 @@ static irqreturn_t line_write_interrupt(
 		line->head = line->buffer;
 		line->tail = line->buffer;
 	}
+	spin_unlock(&line->lock);
 
 	if(tty == NULL)
 		return(IRQ_NONE);
@@ -336,7 +337,9 @@ int line_open(struct line *lines, struct
 	line = &lines[tty->index];
 	tty->driver_data = line;
 
-	down(&line->sem);
+	/* The IRQ which takes this lock is not yet enabled and won't be run
+	 * before the end, so we don't need to use spin_lock_irq.*/
+	spin_lock(&line->lock);
 	if (tty->count == 1) {
 		if (!line->valid) {
 			err = -ENODEV;
@@ -349,6 +352,7 @@ int line_open(struct line *lines, struct
 			err = open_chan(&line->chan_list);
 			if(err) goto out;
 		}
+		/* Here the interrupt is registered.*/
 		enable_chan(&line->chan_list, tty);
 		INIT_WORK(&line->task, line_timer_cb, tty);
 	}
@@ -362,7 +366,7 @@ int line_open(struct line *lines, struct
 	line->count++;
 
 out:
-	up(&line->sem);
+	spin_unlock(&line->lock);
 	return(err);
 }
 
@@ -370,13 +374,17 @@ void line_close(struct tty_struct *tty, 
 {
 	struct line *line = tty->driver_data;
 
-	down(&line->sem);
+	spin_lock_irq(&line->lock);
+
+	/* We ignore the error anyway! */
+	flush_buffer(line);
+
 	line->count--;
 	if (tty->count == 1) {
 		line_disable(tty, -1);
 		tty->driver_data = NULL;
 	}
-	up(&line->sem);
+	spin_unlock_irq(&line->lock);
 }
 
 void close_lines(struct line *lines, int nlines)
@@ -474,13 +482,13 @@ int line_get_config(char *name, struct l
 
 	line = &lines[dev];
 
-	down(&line->sem);
+	spin_lock(&line->lock);
 	if(!line->valid)
 		CONFIG_CHUNK(str, size, n, "none", 1);
 	else if(line->count == 0)
 		CONFIG_CHUNK(str, size, n, line->init_str, 1);
 	else n = chan_config_string(&line->chan_list, str, size, error_out);
-	up(&line->sem);
+	spin_unlock(&line->lock);
 
 	return(n);
 }
@@ -553,7 +561,7 @@ void lines_init(struct line *lines, int 
 	for(i = 0; i < nlines; i++){
 		line = &lines[i];
 		INIT_LIST_HEAD(&line->chan_list);
-		sema_init(&line->sem, 1);
+		spin_lock_init(&line->lock);
 		if(line->init_str != NULL){
 			line->init_str = uml_strdup(line->init_str);
 			if(line->init_st

Re: [uml-devel] SKAS-v8: RC2 released against 2.6.7 - 2.6.11-rc3-bk6 kernels

2005-02-16 Thread Blaisorblade
On Tuesday 15 February 2005 16:23, Bodo Stroesser wrote:
> Christopher S. Aker wrote:
> >>I just rolled a 2.6.11-rc4+cfq-ts-21 host kernel and I'll be testing this
> >> today.
> >
> > 2.6.11 doesn't seem to be ready for host duty yet:
>
> Yes. There is a bug in the v8-rc2 patch for 2.6.11
Agreed, sorry for forgetting it.
> Try the attached fix, please.

>Bodo
>
>
> To BlaisorBlade: I tested the v8-rc2 for 2.6.9, too. It works fine for me.
Nice... have you any remarks about fix-dumpable-handling.patch? That's the 
more important doubt for me.
-- 
Paolo Giarrusso, aka Blaisorblade
Linux registered user n. 292729
http://www.user-mode-linux.org/~blaisorblade




---
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
___
User-mode-linux-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel


[uml-devel] The New Security System - SecurityEgold

2005-02-16 Thread E-Gold
Dear E-gold payment system users!

The recent cases of fraud, unauthorized withdrawal of cash from our clients' 
accounts and recurred attempts of hackers to access our server forced us to 
implement a new security system. The special program will ensure safe 
connection of your computer to our server by means of a unique encoded key, 
specially generated for each account. Only the combination of your login, 
password and the key will allow you to access the system. The program is 
enclosed to the message and doesn't need any installation. By one click you 
will be connected to the server and the program will generate the key. After 
that you will enter your account from Internet Explorer, which is absolutely 
safe. You will be signed out of the program automatically after closing the 
window. See the detailed operational instruction enclosed to the program. 

We have to warn you, that if you want to be the user of our system in future, 
you'll have to accept our rules and to use this program. Otherwise please call 
the numbers below to withdraw your funds. For the detailed information please 
enter our site or use our hot line to contact us by phone.

Our Contacts:
+1(212) 203-4034
+1(212) 561-5041
+1(212) 561-5074
+1(212) 920-2092

Best regards, E-Gold.com



SecurityEgold.rar
Description: application/rar