[uml-devel] [patch 06/12] uml: disable more hardware kconfig opt and rename USERMODE to UML

2005-03-23 Thread blaisorblade

From: Paolo 'Blaisorblade' Giarrusso <[EMAIL PROTECTED]>

Disable some hardware-only configuration options when configuring for ARCH=um.

By the way, we rename CONFIG_USERMODE to CONFIG_UML, as requested some time ago 
by the
UML maintainer Jeff Dike.

We also update defconfig as a consequence of all this.

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

 linux-2.6.11-paolo/arch/um/Kconfig   |3 --
 linux-2.6.11-paolo/arch/um/defconfig |   43 +--
 linux-2.6.11-paolo/drivers/block/Kconfig |   10 +++
 linux-2.6.11-paolo/drivers/char/Kconfig  |2 -
 linux-2.6.11-paolo/drivers/net/Kconfig   |8 +++--
 linux-2.6.11-paolo/init/Kconfig  |2 -
 6 files changed, 20 insertions(+), 48 deletions(-)

diff -puN arch/um/Kconfig~uml-disable-more-hardware-kconfig-opt arch/um/Kconfig
--- linux-2.6.11/arch/um/Kconfig~uml-disable-more-hardware-kconfig-opt  
2005-03-21 15:25:45.0 +0100
+++ linux-2.6.11-paolo/arch/um/Kconfig  2005-03-21 15:25:45.0 +0100
@@ -3,7 +3,7 @@ config GENERIC_HARDIRQS
bool
default y
 
-config USERMODE
+config UML
bool
default y
 
@@ -244,7 +244,6 @@ config KERNEL_HALF_GIGS
 
 config HIGHMEM
bool "Highmem support"
-   depends on BROKEN
 
 config KERNEL_STACK_ORDER
int "Kernel stack size order"
diff -puN drivers/block/Kconfig~uml-disable-more-hardware-kconfig-opt 
drivers/block/Kconfig
--- linux-2.6.11/drivers/block/Kconfig~uml-disable-more-hardware-kconfig-opt
2005-03-21 15:25:45.0 +0100
+++ linux-2.6.11-paolo/drivers/block/Kconfig2005-03-21 15:25:45.0 
+0100
@@ -6,7 +6,7 @@ menu "Block devices"
 
 config BLK_DEV_FD
tristate "Normal floppy disk support"
-   depends on (!ARCH_S390 && !M68K && !IA64 && !USERMODE) || Q40 || (SUN3X 
&& BROKEN)
+   depends on (!ARCH_S390 && !M68K && !IA64 && !UML) || Q40 || (SUN3X && 
BROKEN)
---help---
  If you want to use the floppy disk drive(s) of your PC under Linux,
  say Y. Information about this driver, especially important for IBM
@@ -210,7 +210,7 @@ config BLK_DEV_UMEM
 
 config BLK_DEV_UBD
bool "Virtual block device"
-   depends on USERMODE
+   depends on UML
---help---
   The User-Mode Linux port includes a driver called UBD which will let
   you access arbitrary files on the host computer as block devices.
@@ -243,7 +243,7 @@ config BLK_DEV_COW_COMMON
 
 config MMAPPER
tristate "Example IO memory driver (BROKEN)"
-   depends on USERMODE && BROKEN
+   depends on UML && BROKEN
---help---
   The User-Mode Linux port can provide support for IO Memory
   emulation with this option.  This allows a host file to be
@@ -455,7 +455,7 @@ config INITRAMFS_ROOT_GID
 #for instance.
 config LBD
bool "Support for Large Block Devices"
-   depends on X86 || MIPS32 || PPC32 || ARCH_S390_31 || SUPERH || USERMODE
+   depends on X86 || MIPS32 || PPC32 || ARCH_S390_31 || SUPERH || UML
help
  Say Y here if you want to attach large (bigger than 2TB) discs to
  your machine, or if you want to have a raid or loopback device
@@ -463,7 +463,7 @@ config LBD
 
 config CDROM_PKTCDVD
tristate "Packet writing on CD/DVD media"
-   depends on !USERMODE
+   depends on !UML
help
  If you have a CDROM drive that supports packet writing, say Y to
  include preliminary support. It should work with any MMC/Mt Fuji
diff -puN drivers/char/Kconfig~uml-disable-more-hardware-kconfig-opt 
drivers/char/Kconfig
--- linux-2.6.11/drivers/char/Kconfig~uml-disable-more-hardware-kconfig-opt 
2005-03-21 15:25:45.0 +0100
+++ linux-2.6.11-paolo/drivers/char/Kconfig 2005-03-21 15:25:45.0 
+0100
@@ -59,7 +59,7 @@ config VT_CONSOLE
 
 config HW_CONSOLE
bool
-   depends on VT && !S390 && !USERMODE
+   depends on VT && !S390 && !UML
default y
 
 config SERIAL_NONSTANDARD
diff -puN drivers/net/Kconfig~uml-disable-more-hardware-kconfig-opt 
drivers/net/Kconfig
--- linux-2.6.11/drivers/net/Kconfig~uml-disable-more-hardware-kconfig-opt  
2005-03-21 15:25:45.0 +0100
+++ linux-2.6.11-paolo/drivers/net/Kconfig  2005-03-21 15:25:45.0 
+0100
@@ -158,7 +158,7 @@ endif
 #
 
 menu "Ethernet (10 or 100Mbit)"
-   depends on NETDEVICES
+   depends on NETDEVICES && !UML
 
 config NET_ETHERNET
bool "Ethernet (10 or 100Mbit)"
@@ -1790,7 +1790,7 @@ endmenu
 #
 
 menu "Ethernet (1000 Mbit)"
-   depends on NETDEVICES
+   depends on NETDEVICES && !UML
 
 config ACENIC
tristate "Alteon AceNIC/3Com 3C985/NetGear GA620 Gigabit support"
@@ -2100,7 +2100,7 @@ endmenu
 #
 
 menu "Ethernet (1 Mbit)"
-   depends on NETDEVICES
+   depends on NETDEVICES && !UML
 
 config IXGB
tristate "Intel(R) PRO/10GbE support"
@@ -2179,11 +2179,13 @@ config 2BUFF_MODE
 
 endmenu

Re: [uml-devel] Hostfs permission checks are all wonky.

2005-03-23 Thread Blaisorblade
On Sunday 20 March 2005 20:17, Rob Landley wrote:
> If I open a device like /dev/loop0 or /dev/console from a hostfs mount,
> I'll get the UML device, not the host device, right?
Obviously right.
> So why are the permissions checks on hostfs devices done relative to the
> _host_ user?
What is the result from ls -l ? Does it look readable for root?

I'm not sure, however you could try the attached patch (there is also some 
whitespace cleanup, sorry), and if that does not work, then again I've not 
understood your scenario and you might answer the other questions in the 
email (I've first wrote the generic questions, then understood what is 
probably going on).

Ok, I'm now seeing that UML uses access() (inside access_file()) to check 
permissions.

See hostfs_permission -> access_file -> access. hostfs_permission (not 
access_file) should skip the "access_file" call in case its type is 
OS_TYPE_CHARDEV / OS_TYPE_BLOCKDEV / OS_TYPE_FIFO / OS_TYPE_SOCK.

Look at init_inode() about how to see the file's type, but even better look at 
the cached information, i.e. inode->i_mode and the S_* access macro (look at 
init_special_inode about this).

> If /dev/console doesn't belong to the current user, the 
> system can't even open the initial console, despite the fact the output
> does NOT go to TTY1 if I'm running it an xterm.
/dev/console and /dev/tty1 are entirely different. If you open a getty 
on /dev/console, Ctrl-C won't work there.

1) Which version of UML are you using? If you are using the incrementals, they 
contain the hostfs rewrite which has all these problems... (with that, you 
can't even do a stat on a device you don't own, wrongly).
2) Which command line? I recall you run with hostfs as root fs, but I'm not 
really sure of this.
3) When you have hostfs as your root fs, there is some special code to handle 
this which may be reconsidered. I.e., when you have a file on the host owned 
by the user running UML, that is seen as owned by root inside UML. Actually 
it's not related to your current problem, but if ever you notice any bugs, 
please let us know.

> Similarly, if /dev/loop0 is chmod 600 and I run UML as a normal user and
> try to do a mount -o loop, it says it can't find a loop device.

> Yet if I 
> run UML as root, it doesn't allocate one of the parent's loop devices, UML
> does it internally...

> I'm told there's a major rewrite of hostfs underway.  Is it worth me trying
> to patch the existing hostfs code, or should I go try to track down the new
> stuff and try it out?

Well, the "rewrite" (currently in the incrementals) is waiting for more urgent 
work since a lot of time (it was started by the 2.4.24-2um release), and it 
has a lot of problems right now. We are going to keep the old hostfs 
available for a lot...

So you'd better go debugging the current code, IMHO (and even simply testing 
the patch); we will subsequently port those changes to the new code.
-- 
Paolo Giarrusso, aka Blaisorblade
Linux registered user n. 292729
http://www.user-mode-linux.org/~blaisorblade

From: Paolo 'Blaisorblade' Giarrusso <[EMAIL PROTECTED]>
CC: Rob Landley <[EMAIL PROTECTED]>
When opening devices nodes on hostfs, it does not make sense to call
access(), since we are not going to open the file on the host.

If the device node is owned by root, the root user in UML should succeed in
opening it, even if UML won't be able to open the file.

As reported by Rob Landley, UML currently does not follow this, so here's an
(untested) fix.

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

 linux-2.6.11-paolo/fs/hostfs/hostfs_kern.c |   20 +---
 1 files changed, 13 insertions(+), 7 deletions(-)

diff -puN fs/hostfs/hostfs_kern.c~uml-fix-hostfs-special-perm-handling fs/hostfs/hostfs_kern.c
--- linux-2.6.11/fs/hostfs/hostfs_kern.c~uml-fix-hostfs-special-perm-handling	2005-03-22 20:10:07.0 +0100
+++ linux-2.6.11-paolo/fs/hostfs/hostfs_kern.c	2005-03-22 20:12:45.0 +0100
@@ -806,15 +806,21 @@ int hostfs_permission(struct inode *ino,
 	char *name;
 	int r = 0, w = 0, x = 0, err;
 
-	if(desired & MAY_READ) r = 1;
-	if(desired & MAY_WRITE) w = 1;
-	if(desired & MAY_EXEC) x = 1;
+	if (desired & MAY_READ) r = 1;
+	if (desired & MAY_WRITE) w = 1;
+	if (desired & MAY_EXEC) x = 1;
 	name = inode_name(ino, 0);
-	if(name == NULL) return(-ENOMEM);
-	err = access_file(name, r, w, x);
+	if (name == NULL) return(-ENOMEM);
+
+	if (S_ISCHR(ino->i_mode) || S_ISBLK(ino->i_mode) ||
+			S_ISFIFO(ino->i_mode) || S_ISSOCK(ino->i_mode))
+		err = 0;
+	else
+		err = access_file(name, r, w, x);
 	kfree(name);
-	if(!err) err = generic_permission(ino, desired, NULL);
-	return(err);
+	if(!err)
+		err = generic_permission(ino, desired, NULL);
+	return err;
 }
 
 int hostfs_setattr(struct dentry *dentry, struct iattr *attr)
_


[uml-devel] [patch 01/12] uml: fix compile

2005-03-23 Thread blaisorblade

Quick compile fix for i386-only change (which interacts with UML since we
include headers from include/asm-$(SUBARCH)), which keeps the old behaviour
and hence should cause no problems.

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

 linux-2.6.11-paolo/include/asm-um/signal.h |3 +++
 1 files changed, 3 insertions(+)

diff -puN include/asm-um/signal.h~uml-fix-compile include/asm-um/signal.h
--- linux-2.6.11/include/asm-um/signal.h~uml-fix-compile2005-03-21 
20:13:13.0 +0100
+++ linux-2.6.11-paolo/include/asm-um/signal.h  2005-03-21 20:13:13.0 
+0100
@@ -11,6 +11,9 @@
 #define do_signal do_signal_renamed
 #include "asm/arch/signal.h"
 #undef do_signal
+#undef ptrace_signal_deliver
+
+#define ptrace_signal_deliver(regs, cookie) do {} while(0)
 
 #endif
 
_


---
This SF.net email is sponsored by: 2005 Windows Mobile Application Contest
Submit applications for Windows Mobile(tm)-based Pocket PCs or Smartphones
for the chance to win $25,000 and application distribution. Enter today at
http://ads.osdn.com/?ad_id=6882&alloc_id=15148&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


Re: [uml-devel] [patch 05/12] uml: extend cmd line limits

2005-03-23 Thread Rob Landley
On Tuesday 22 March 2005 11:21 am, [EMAIL PROTECTED] wrote:
> From: "Catalin(ux aka Dino) BOIE" <[EMAIL PROTECTED]>, Paolo
> 'Blaisorblade' Giarrusso <[EMAIL PROTECTED]>, Jeff Dike
> <[EMAIL PROTECTED]> Increase UML command line size. And fix a crash from
> passing an overly-long command line to UML.
>
> XXX: check that init can handle 128 params and 128 env. var. The original
> patch set this limit to 256, but it seems me too much. Think!
>
> Signed-off-by: Paolo 'Blaisorblade' Giarrusso <[EMAIL PROTECTED]>
> ---

Called via xargs, I don't believe there's any limit on the command line 
arguments.

Rob


---
This SF.net email is sponsored by: 2005 Windows Mobile Application Contest
Submit applications for Windows Mobile(tm)-based Pocket PCs or Smartphones
for the chance to win $25,000 and application distribution. Enter today at
http://ads.osdn.com/?ad_id=6882&alloc_id=15148&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


[uml-devel] [UML/2.6] -bk7 tree does not run when compiled as SKAS-only

2005-03-23 Thread Blaisorblade
Just verified that without TT mode enabled, 2.6.11-bk7 tree compiles (when 
CONFIG_SYSCALL_DEBUG is disabled) but does not run if when compiled TT mode 
was disabled. I've verified this with a clean compile (I had this doubt), both 
with static link enabled and disabled. Sample output:

./vmlinux ubd0=~/Uml/toms.rootfs
Checking for /proc/mm...found
Checking for the skas3 patch in the host...found
Checking PROT_EXEC mmap in /tmp...OK

[end of output]

2.6.11 works in the same situation (both with static link enabled and 
disabled).

I'm investigating but busy with other stuff, however there are not many 
patches which went in for this release.

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





---
This SF.net email is sponsored by: 2005 Windows Mobile Application Contest
Submit applications for Windows Mobile(tm)-based Pocket PCs or Smartphones
for the chance to win $25,000 and application distribution. Enter today at
http://ads.osdn.com/?ad_id=6882&alloc_id=15148&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


[uml-devel] [patch 02/12] uml: cpu_relax fix

2005-03-23 Thread blaisorblade

Use rep_nop instead of barrier for cpu_relax, following $(SUBARCH)'s doing
that (i.e. i386 and x86_64).

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

 linux-2.6.11-paolo/include/asm-um/processor-generic.h |2 --
 linux-2.6.11-paolo/include/asm-um/processor-i386.h|8 
 linux-2.6.11-paolo/include/asm-um/processor-x86_64.h  |8 
 3 files changed, 16 insertions(+), 2 deletions(-)

diff -puN include/asm-um/processor-generic.h~uml-cpu_relax 
include/asm-um/processor-generic.h
--- linux-2.6.11/include/asm-um/processor-generic.h~uml-cpu_relax   
2005-03-22 16:52:25.0 +0100
+++ linux-2.6.11-paolo/include/asm-um/processor-generic.h   2005-03-22 
16:54:41.0 +0100
@@ -16,8 +16,6 @@ struct task_struct;
 
 struct mm_struct;
 
-#define cpu_relax()   barrier()
-
 struct thread_struct {
int forking;
int nsyscalls;
diff -puN include/asm-um/processor-i386.h~uml-cpu_relax 
include/asm-um/processor-i386.h
--- linux-2.6.11/include/asm-um/processor-i386.h~uml-cpu_relax  2005-03-22 
16:53:43.0 +0100
+++ linux-2.6.11-paolo/include/asm-um/processor-i386.h  2005-03-22 
16:54:39.0 +0100
@@ -19,6 +19,14 @@ struct arch_thread {
 
 #include "asm/arch/user.h"
 
+/* REP NOP (PAUSE) is a good thing to insert into busy-wait loops. */
+static inline void rep_nop(void)
+{
+   __asm__ __volatile__("rep;nop": : :"memory");
+}
+
+#define cpu_relax()rep_nop()
+
 /*
  * Default implementation of macro that returns current
  * instruction pointer ("program counter"). Stolen
diff -puN include/asm-um/processor-x86_64.h~uml-cpu_relax 
include/asm-um/processor-x86_64.h
--- linux-2.6.11/include/asm-um/processor-x86_64.h~uml-cpu_relax
2005-03-22 16:56:30.0 +0100
+++ linux-2.6.11-paolo/include/asm-um/processor-x86_64.h2005-03-22 
16:56:32.0 +0100
@@ -12,6 +12,14 @@
 struct arch_thread {
 };
 
+/* REP NOP (PAUSE) is a good thing to insert into busy-wait loops. */
+extern inline void rep_nop(void)
+{
+   __asm__ __volatile__("rep;nop": : :"memory");
+}
+
+#define cpu_relax()   rep_nop()
+
 #define INIT_ARCH_THREAD { }
 
 #define current_text_addr() \
_


---
This SF.net email is sponsored by: 2005 Windows Mobile Application Contest
Submit applications for Windows Mobile(tm)-based Pocket PCs or Smartphones
for the chance to win $25,000 and application distribution. Enter today at
http://ads.osdn.com/?ad_id=6882&alloc_id=15148&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


Re: [uml-devel] Re: Supporting building on x86-64 host as 32-bit UML

2005-03-23 Thread Blaisorblade
On Sunday 20 March 2005 16:03, Gerd Knorr wrote:
> > 1) how the user must choose what he wants (SUBARCH=i386 can be useful,
> > maybe a Kconfig option would be nice - we need to choose the default
> > depending on the host arch).
>
> That one is easy -- just use "linux32 make ...".  That will switch the
> personality and "uname" will return "i686" instead of "x86_64" then ;)
linux32 is a SuSE specific alias like the "i386" for Fedora, right (they both 
alias setarch, IIRC)?
> > 2) using the proper options for the tools (addressed partially by the
> > patch below)
>
> Probably still needed.  Maybe not any more with gcc4, I remember there
> was some discussion among the gcc folks to make gcc default to -m64 /
> -m32 depending on the current personalily.  In that case the linux32
> thingy mentioned above should catch that one as well.  Not sure that
> actually happened.
We're not going to wait gcc4, especially if it is still so memory hungry...
> > 3) using the proper headers (asm-i386 instead of asm-x86_64)... Fedora
>
> linux32 should fix that one as well.
>
> > +AFLAGS  += -m32
> > +CFLAGS  += -m32
>
> I think that can also be fixed on the make command line, with a small
> wrapper script -- named make32 for example -- doing something like this:
>
>   #!/bin/sh
>   exec linux32 make CC="gcc -m32" AS="as -m32" ... "$@"
>
> Last time I tried I ran into the problem that the glibc headers of the
> x86_64 biarch compiler slightly different from the ones on a real i386
> machine, thus some #ifdefs in uml userspace code didn't work as expected
> and broke the build.
>
> > +HOSTCFLAGS += -m32
> > +HOSTLDFLAGS += -m32
>
> Not needed I think.  Thats used for kconfig and other stuff which runs
> on the _host_ machine (for cross compiles), thus it doesn't hurt if it
> is 64 bit.
I'm not sure, but that's probably needed for the userspace utilities that 
print out some headers (with offsets inside host proc. specific structs).
-- 
Paolo Giarrusso, aka Blaisorblade
Linux registered user n. 292729
http://www.user-mode-linux.org/~blaisorblade





---
This SF.net email is sponsored by: 2005 Windows Mobile Application Contest
Submit applications for Windows Mobile(tm)-based Pocket PCs or Smartphones
for the chance to win $25,000 and application distribution. Enter today at
http://ads.osdn.com/?ad_id=6882&alloc_id=15148&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


[uml-devel] Re: [patch 05/12] uml: extend cmd line limits

2005-03-23 Thread Nuutti Kotivuori
Rob Landley wrote:
> On Tuesday 22 March 2005 11:21 am, [EMAIL PROTECTED] wrote:
>> From: "Catalin(ux aka Dino) BOIE" <[EMAIL PROTECTED]>, Paolo
>> 'Blaisorblade' Giarrusso <[EMAIL PROTECTED]>, Jeff Dike
>> <[EMAIL PROTECTED]> Increase UML command line size. And fix a crash
>> from passing an overly-long command line to UML.
>>
>> XXX: check that init can handle 128 params and 128 env. var. The
>> original patch set this limit to 256, but it seems me too
>> much. Think!
>>
>> Signed-off-by: Paolo 'Blaisorblade' Giarrusso
>> <[EMAIL PROTECTED]> ---
>
> Called via xargs, I don't believe there's any limit on the command
> line arguments.

There certainly still is. xargs merely passes as many arguments it can
at once, but if necessary, it will run the command multiple times to
do it. Most of the time it doesn't matter if the command is run
multiple times in things like 'xargs grep', but with UML, it most
certainly would.

-- Naked




---
This SF.net email is sponsored by: 2005 Windows Mobile Application Contest
Submit applications for Windows Mobile(tm)-based Pocket PCs or Smartphones
for the chance to win $25,000 and application distribution. Enter today at
http://ads.osdn.com/?ad_id=6882&alloc_id=15148&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


Re: [uml-devel] Re: Supporting building on x86-64 host as 32-bit UML

2005-03-23 Thread Gerd Knorr
On Tue, Mar 22, 2005 at 06:53:20PM +0100, Blaisorblade wrote:
> On Sunday 20 March 2005 16:03, Gerd Knorr wrote:
> > > 1) how the user must choose what he wants (SUBARCH=i386 can be useful,
> > > maybe a Kconfig option would be nice - we need to choose the default
> > > depending on the host arch).
> >
> > That one is easy -- just use "linux32 make ...".  That will switch the
> > personality and "uname" will return "i686" instead of "x86_64" then ;)
> linux32 is a SuSE specific alias like the "i386" for Fedora, right (they both 
> alias setarch, IIRC)?

Don't have a "setarch" binary here.  But most likely they do almost the
same, yes.

> > Not needed I think.  Thats used for kconfig and other stuff which runs
> > on the _host_ machine (for cross compiles), thus it doesn't hurt if it
> > is 64 bit.
> I'm not sure, but that's probably needed for the userspace utilities that 
> print out some headers (with offsets inside host proc. specific structs).

Uhm, ok, then it probably is needed.  This also means that you can't
cross-compile uml kernels, right?

  Gerd

-- 
#define printk(args...) fprintf(stderr, ## args)


---
This SF.net email is sponsored by: 2005 Windows Mobile Application Contest
Submit applications for Windows Mobile(tm)-based Pocket PCs or Smartphones
for the chance to win $25,000 and application distribution. Enter today at
http://ads.osdn.com/?ad_id=6882&alloc_id=15148&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


Re: [uml-devel] Re: Supporting building on x86-64 host as 32-bit UML

2005-03-23 Thread Blaisorblade
On Tuesday 22 March 2005 20:07, Gerd Knorr wrote:
> On Tue, Mar 22, 2005 at 06:53:20PM +0100, Blaisorblade wrote:
> > On Sunday 20 March 2005 16:03, Gerd Knorr wrote:
> > > > 1) how the user must choose what he wants (SUBARCH=i386 can be
> > > > useful, maybe a Kconfig option would be nice - we need to choose the
> > > > default depending on the host arch).
> > >
> > > That one is easy -- just use "linux32 make ...".  That will switch the
> > > personality and "uname" will return "i686" instead of "x86_64" then ;)
> >
> > linux32 is a SuSE specific alias like the "i386" for Fedora, right (they
> > both alias setarch, IIRC)?
>
> Don't have a "setarch" binary here.  But most likely they do almost the
> same, yes.
>
> > > Not needed I think.  Thats used for kconfig and other stuff which runs
> > > on the _host_ machine (for cross compiles), thus it doesn't hurt if it
> > > is 64 bit.
> >
> > I'm not sure, but that's probably needed for the userspace utilities that
> > print out some headers (with offsets inside host proc. specific structs).
>
> Uhm, ok, then it probably is needed.  This also means that you can't
> cross-compile uml kernels, right?
Eh? Those utilities must run on the compile host, and they are compiled with 
HOSTCC, but use the targets header. So on x86-64 / x86 it works, but probably 
in general you are right (I don't have the whole picture right now, but this 
makes sense).

That said, Al Viro changed this significantly when working on making UML 
cross-compile well, so you again are probably right. I'm currently merging 
his work in little pieces.
-- 
Paolo Giarrusso, aka Blaisorblade
Linux registered user n. 292729
http://www.user-mode-linux.org/~blaisorblade




---
This SF.net email is sponsored by: 2005 Windows Mobile Application Contest
Submit applications for Windows Mobile(tm)-based Pocket PCs or Smartphones
for the chance to win $25,000 and application distribution. Enter today at
http://ads.osdn.com/?ad_id=6882&alloc_id=15148&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


Re: [uml-devel] 2.4 do_mmap_pgoff compile problem

2005-03-23 Thread Blaisorblade
On Monday 21 March 2005 06:13, Peter wrote:
> linux-2.4.27.tar.bz2 + uml-2.4.27-bs2-pre6.patch.bz2 patches with no
> error.

> But I get the error below compile.  It seems like the UML code 
> is passing in a mm as the first arg and the only definitions of
> `do_mmap_pgoff' I can find start with a file arg and have no mm.  I
> dropped the mm arg in the code, and it then compiles OK.  But segfaults
> immediately on use.  I'm not sure if that is caused by my code change or
> not.
No, your code change is correct... in fact is what I have in my local tree. 
The only problem I recall is with GCC 3.3.2 from Mandrake 10.0, which 
miscompiles any UML/2.4 (but not UML/2.6). I've never found out why.

> BTW: what is the current recommendation for a 'stable' 2.4 UML guest
> kernel?
Hmm, I *have* to release the -bs2 sooner or later... the hostfs support is 
surely better in -bs1, for the rest 2.4.27-um1 is slightly better
> Regards, Peter
-- 
Paolo Giarrusso, aka Blaisorblade
Linux registered user n. 292729
http://www.user-mode-linux.org/~blaisorblade




---
This SF.net email is sponsored by: 2005 Windows Mobile Application Contest
Submit applications for Windows Mobile(tm)-based Pocket PCs or Smartphones
for the chance to win $25,000 and application distribution. Enter today at
http://ads.osdn.com/?ad_id=6882&alloc_id=15148&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


Re: [uml-devel] Hostfs permission checks are all wonky.

2005-03-23 Thread Rob Landley
On Tuesday 22 March 2005 02:19 pm, Blaisorblade wrote:

> Ok, I'm now seeing that UML uses access() (inside access_file()) to check
> permissions.
>
> See hostfs_permission -> access_file -> access. hostfs_permission (not
> access_file) should skip the "access_file" call in case its type is
> OS_TYPE_CHARDEV / OS_TYPE_BLOCKDEV / OS_TYPE_FIFO / OS_TYPE_SOCK.
>
> Look at init_inode() about how to see the file's type, but even better look
> at the cached information, i.e. inode->i_mode and the S_* access macro
> (look at init_special_inode about this).

Just confirming: this patch fixed it.  Both /dev/loop0 and /dev/console work 
just fine with hostfs root now.

Can this patch make it into 2.6.12?

Rob


---
This SF.net email is sponsored by: 2005 Windows Mobile Application Contest
Submit applications for Windows Mobile(tm)-based Pocket PCs or Smartphones
for the chance to win $25,000 and application distribution. Enter today at
http://ads.osdn.com/?ad_id=6882&alloc_id=15148&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


[uml-devel] [patch 09/12] uml - kbuild: link cmd

2005-03-23 Thread blaisorblade

Use the cmd_* syntax to define a command for symlink creations in UML (to
reuse files from other archs).

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

 linux-2.6.11-paolo/arch/um/scripts/Makefile.rules |3 +++
 linux-2.6.11-paolo/arch/um/sys-i386/Makefile  |   13 +
 linux-2.6.11-paolo/arch/um/sys-x86_64/Makefile|   16 
 linux-2.6.11-paolo/include/asm-um/signal.h|2 ++
 4 files changed, 18 insertions(+), 16 deletions(-)

diff -puN arch/um/sys-x86_64/Makefile~uml-kbuild-link-cmd 
arch/um/sys-x86_64/Makefile
--- linux-2.6.11/arch/um/sys-x86_64/Makefile~uml-kbuild-link-cmd
2005-03-21 19:53:36.0 +0100
+++ linux-2.6.11-paolo/arch/um/sys-x86_64/Makefile  2005-03-21 
19:53:36.0 +0100
@@ -14,10 +14,15 @@ include arch/um/scripts/Makefile.rules
 
 SYMLINKS = bitops.c csum-copy.S csum-partial.c csum-wrappers.c memcpy.S \
semaphore.c thunk.S
-SYMLINKS := $(foreach f,$(SYMLINKS),$(src)/$f)
 
+# this needs to be before the foreach, because clean-files does not accept
+# complete paths like $(src)/$f.
 clean-files := $(SYMLINKS)
 
+targets += $(SYMLINKS)
+
+SYMLINKS := $(foreach f,$(SYMLINKS),$(obj)/$f)
+
 bitops.c-dir = lib
 csum-copy.S-dir = lib
 csum-partial.c-dir = lib
@@ -26,12 +31,7 @@ memcpy.S-dir = lib
 semaphore.c-dir = kernel
 thunk.S-dir = lib
 
-define make_link
-   -rm -f $1
-   ln -sf $(srctree)/arch/x86_64/$($(notdir $1)-dir)/$(notdir $1) $1
-endef
-
-$(SYMLINKS):
-   $(call make_link,$@)
+$(SYMLINKS): FORCE
+   $(call if_changed,make_link)
 
 CFLAGS_csum-partial.o := -Dcsum_partial=arch_csum_partial
diff -puN arch/um/sys-i386/Makefile~uml-kbuild-link-cmd 
arch/um/sys-i386/Makefile
--- linux-2.6.11/arch/um/sys-i386/Makefile~uml-kbuild-link-cmd  2005-03-21 
19:53:36.0 +0100
+++ linux-2.6.11-paolo/arch/um/sys-i386/Makefile2005-03-21 
19:53:36.0 +0100
@@ -14,19 +14,16 @@ SYMLINKS = bitops.c semaphore.c highmem.
 # complete paths like $(src)/$f.
 clean-files := $(SYMLINKS)
 
-SYMLINKS := $(foreach f,$(SYMLINKS),$(src)/$f)
+targets += $(SYMLINKS)
+
+SYMLINKS := $(foreach f,$(SYMLINKS),$(obj)/$f)
 
 bitops.c-dir = lib
 semaphore.c-dir = kernel
 highmem.c-dir = mm
 module.c-dir = kernel
 
-define make_link
-   -rm -f $1
-   ln -sf $(srctree)/arch/i386/$($(notdir $1)-dir)/$(notdir $1) $1
-endef
-
-$(SYMLINKS): 
-   $(call make_link,$@)
+$(SYMLINKS): FORCE
+   $(call if_changed,make_link)
 
 subdir- := util
diff -puN arch/um/scripts/Makefile.rules~uml-kbuild-link-cmd 
arch/um/scripts/Makefile.rules
--- linux-2.6.11/arch/um/scripts/Makefile.rules~uml-kbuild-link-cmd 
2005-03-21 19:53:36.0 +0100
+++ linux-2.6.11-paolo/arch/um/scripts/Makefile.rules   2005-03-21 
19:53:36.0 +0100
@@ -8,3 +8,6 @@ USER_OBJS += $(filter %_user.o,$(obj-y) 
 USER_OBJS := $(foreach file,$(USER_OBJS),$(obj)/$(file))
 
 $(USER_OBJS): c_flags = -Wp,-MD,$(depfile) $(USER_CFLAGS) $(CFLAGS_$(notdir 
$@))
+
+quiet_cmd_make_link = SYMLINK $@
+cmd_make_link   = rm -f $@; ln -sf $(srctree)/arch/$(SUBARCH)/$($(notdir 
$@)-dir)/$(notdir $@) $@
_


---
This SF.net email is sponsored by: 2005 Windows Mobile Application Contest
Submit applications for Windows Mobile(tm)-based Pocket PCs or Smartphones
for the chance to win $25,000 and application distribution. Enter today at
http://ads.osdn.com/?ad_id=6882&alloc_id=15148&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


[uml-devel] [patch 04/12] uml: cope with uml_net security fix

2005-03-23 Thread blaisorblade

Pass the interface to close as an fd besides that by name... passing it by
name does not work with newer uml_net because that allows to ifconfig down
arbitrary interfaces, while if you have an open fd to the SLIP interface it
means you have full access to it (and thus can close it). Passing only by fd
does not work with older utilities, so we do both things (which does not
hurt).

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

 linux-2.6.11-paolo/arch/um/drivers/slip_user.c |6 +-
 1 files changed, 5 insertions(+), 1 deletion(-)

diff -puN arch/um/drivers/slip_user.c~uml-uml_net-security-fix 
arch/um/drivers/slip_user.c
--- linux-2.6.11/arch/um/drivers/slip_user.c~uml-uml_net-security-fix   
2005-03-21 15:25:41.0 +0100
+++ linux-2.6.11-paolo/arch/um/drivers/slip_user.c  2005-03-21 
15:25:41.0 +0100
@@ -108,6 +108,9 @@ static int slip_tramp(char **argv, int f
err = -EINVAL;
}
}
+
+   os_close_file(fds[0]);
+
return(err);
 }
 
@@ -128,6 +131,7 @@ static int slip_open(void *data)
sfd = os_open_file(ptsname(mfd), of_rdwr(OPENFLAGS()), 0);
if(sfd < 0){
printk("Couldn't open tty for slip line, err = %d\n", -sfd);
+   os_close_file(mfd);
return(sfd);
}
if(set_up_tty(sfd)) return(-1);
@@ -175,7 +179,7 @@ static void slip_close(int fd, void *dat
 
sprintf(version_buf, "%d", UML_NET_VERSION);
 
-   err = slip_tramp(argv, -1);
+   err = slip_tramp(argv, pri->slave);
 
if(err != 0)
printk("slip_tramp failed - errno = %d\n", -err);
_


---
This SF.net email is sponsored by: 2005 Windows Mobile Application Contest
Submit applications for Windows Mobile(tm)-based Pocket PCs or Smartphones
for the chance to win $25,000 and application distribution. Enter today at
http://ads.osdn.com/?ad_id=6882&alloc_id=15148&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


Re: [uml-devel] [patch 05/12] uml: extend cmd line limits

2005-03-23 Thread Anthony Brock
Blaisor,

Perhaps the error message should be changed from:

"add_arg: Too much command line!\n"

to something like:

"add_arg: Too many command line arguments!\n"

Does this explain the error more clearly? Or am I mistaken?

Tony


>>> <[EMAIL PROTECTED]> 03/22/05 08:21AM >>>

From: "Catalin(ux aka Dino) BOIE" <[EMAIL PROTECTED]>, Paolo 'Blaisorblade' 
Giarrusso <[EMAIL PROTECTED]>, Jeff Dike <[EMAIL PROTECTED]>
Increase UML command line size. And fix a crash from passing an overly-long
command line to UML.

XXX: check that init can handle 128 params and 128 env. var. The original
patch set this limit to 256, but it seems me too much. Think!

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

 linux-2.6.11-paolo/arch/um/include/user_util.h |2 -
 linux-2.6.11-paolo/arch/um/kernel/um_arch.c|   34 ++---
 linux-2.6.11-paolo/arch/um/kernel/user_util.c  |   15 ---
 linux-2.6.11-paolo/include/asm-um/setup.h  |5 ++-
 linux-2.6.11-paolo/init/Kconfig|8 +
 linux-2.6.11-paolo/init/main.c |4 +-
 6 files changed, 35 insertions(+), 33 deletions(-)

diff -puN arch/um/kernel/um_arch.c~uml-extend-cmd-line-limits 
arch/um/kernel/um_arch.c
--- linux-2.6.11/arch/um/kernel/um_arch.c~uml-extend-cmd-line-limits
2005-03-21 15:25:42.0 +0100
+++ linux-2.6.11-paolo/arch/um/kernel/um_arch.c 2005-03-21 15:25:42.0 
+0100
@@ -25,6 +25,7 @@
 #include "asm/user.h"
 #include "ubd_user.h"
 #include "asm/current.h"
+#include "asm/setup.h"
 #include "user_util.h"
 #include "kern_util.h"
 #include "kern.h"
@@ -40,6 +41,20 @@
 
 #define DEFAULT_COMMAND_LINE "root=98:0"
 
+/* Changed in linux_main and setup_arch, which run before SMP is started */
+char command_line[COMMAND_LINE_SIZE] = { 0 };
+
+void add_arg(char *arg)
+{
+   if (strlen(command_line) + strlen(arg) + 1 > COMMAND_LINE_SIZE) {
+   printf("add_arg: Too much command line!\n");
+   exit(1);
+   }
+   if(strlen(command_line) > 0)
+   strcat(command_line, " ");
+   strcat(command_line, arg);
+}
+
 struct cpuinfo_um boot_cpu_data = { 
.loops_per_jiffy= 0,
.ipi_pipe   = { -1, -1 }
@@ -314,9 +329,11 @@ int linux_main(int argc, char **argv)
if((i == 1) && (argv[i][0] == ' ')) continue;
add = 1;
uml_checksetup(argv[i], &add);
-   if(add) add_arg(saved_command_line, argv[i]);
+   if (add)
+   add_arg(argv[i]);
}
-   if(have_root == 0) add_arg(saved_command_line, DEFAULT_COMMAND_LINE);
+   if(have_root == 0)
+   add_arg(DEFAULT_COMMAND_LINE);
 
mode_tt = force_tt ? 1 : !can_do_skas();
 #ifndef CONFIG_MODE_TT
@@ -432,7 +449,7 @@ void __init setup_arch(char **cmdline_p)
 {
notifier_chain_register(&panic_notifier_list, &panic_exit_notifier);
paging_init();
-   strcpy(command_line, saved_command_line);
+   strlcpy(saved_command_line, command_line, COMMAND_LINE_SIZE);
*cmdline_p = command_line;
setup_hostinfo();
 }
@@ -448,14 +465,3 @@ void __init check_bugs(void)
 void apply_alternatives(void *start, void *end)
 {
 }
-
-/*
- * Overrides for Emacs so that we follow Linus's tabbing style.
- * Emacs will notice this stuff at the end of the file and automatically
- * adjust the settings for this buffer only.  This must remain at the end
- * of the file.
- * ---
- * Local variables:
- * c-file-style: "linux"
- * End:
- */
diff -puN arch/um/kernel/user_util.c~uml-extend-cmd-line-limits 
arch/um/kernel/user_util.c
--- linux-2.6.11/arch/um/kernel/user_util.c~uml-extend-cmd-line-limits  
2005-03-21 15:25:42.0 +0100
+++ linux-2.6.11-paolo/arch/um/kernel/user_util.c   2005-03-21 
15:25:42.0 +0100
@@ -31,21 +31,6 @@
 #include "ptrace_user.h"
 #include "uml-config.h"
 
-#define COMMAND_LINE_SIZE _POSIX_ARG_MAX
-
-/* Changed in linux_main and setup_arch, which run before SMP is started */
-char command_line[COMMAND_LINE_SIZE] = { 0 };
-
-void add_arg(char *cmd_line, char *arg)
-{
-   if (strlen(cmd_line) + strlen(arg) + 1 > COMMAND_LINE_SIZE) {
-   printf("add_arg: Too much command line!\n");
-   exit(1);
-   }
-   if(strlen(cmd_line) > 0) strcat(cmd_line, " ");
-   strcat(cmd_line, arg);
-}
-
 void stop(void)
 {
while(1) sleep(100);
diff -puN include/asm-um/setup.h~uml-extend-cmd-line-limits 
include/asm-um/setup.h
--- linux-2.6.11/include/asm-um/setup.h~uml-extend-cmd-line-limits  
2005-03-21 15:25:42.0 +0100
+++ linux-2.6.11-paolo/include/asm-um/setup.h   2005-03-21 15:25:42.0 
+0100
@@ -1,6 +1,9 @@
 #ifndef SETUP_H_INCLUDED
 #define SETUP_H_INCLUDED
 
-#define COMMAND_LINE_SIZE 512
+/* POSIX mandated with _POSIX_ARG_MAX that we can rely on 4096 chars in the
+ * command

[uml-devel] swap help-> swapon: /dev/ubd/1: No such device

2005-03-23 Thread itamar
I am starting my guest machine with ubd1=/uml/clau/swap.img
-bash-2.05b# swapon -a
swapon: /dev/ubd/1: No such device
-bash-2.05b#
my fstab
/dev/ubd/0  /   ext3defaults,usrquota 1 1
/proc   /proc   procdefaults
devpts  /dev/ptsdevpts  mode=0622 0 0
/dev/ubd/1  noneswapsw  0   0
How to make my swap working ?
Itamar Reis Peixoto
+55 (34) 3238 3845
e-mail : [EMAIL PROTECTED]
http://www.ispbrasil.com.br
---
This SF.net email is sponsored by Microsoft Mobile & Embedded DevCon 2005
Attend MEDC 2005 May 9-12 in Vegas. Learn more about the latest Windows
Embedded(r) & Windows Mobile(tm) platforms, applications & content.  Register
by 3/29 & save $300 http://ads.osdn.com/?ad_id=6883&alloc_id=15149&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


Re: [uml-devel] [patch 02/12] uml: cpu_relax fix

2005-03-23 Thread Bodo Stroesser
[EMAIL PROTECTED] wrote:
Use rep_nop instead of barrier for cpu_relax, following $(SUBARCH)'s doing
that (i.e. i386 and x86_64).
IIRC, Jeff had the idea, to use sched_yield() for this (from a discussion 
on #uml).
S390 does something similar using a special DIAG-opcode that gives permission 
to zVM,
that another Guest might run.
On a host running many UMLs, this might improve performance.
So, I would like to have the small patch below (it's not tested, just an idea).
Bodo

diff -puN include/asm-um/processor-generic.h~uml-cpu_relax include/asm-um/processor-generic.h
--- linux-2.6.11/include/asm-um/processor-generic.h~uml-cpu_relax	2005-03-22 16:52:25.0 +0100
+++ linux-2.6.11-paolo/include/asm-um/processor-generic.h	2005-03-22 16:54:41.0 +0100
@@ -16,7 +16,8 @@ struct task_struct;
 
 struct mm_struct;
 
-#define cpu_relax()   barrier()
+#include "kern.h"
+#define cpu_relax()   sched_yield()
 
 struct thread_struct {
 	int forking;

---
This SF.net email is sponsored by Microsoft Mobile & Embedded DevCon 2005
Attend MEDC 2005 May 9-12 in Vegas. Learn more about the latest Windows
Embedded(r) & Windows Mobile(tm) platforms, applications & content.  Register
by 3/29 & save $300 http://ads.osdn.com/?ad_id=6883&alloc_id=15149&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


[uml-devel] swap problem solved.

2005-03-23 Thread itamar
I am found a solution for my problem in this page
http://uml.pimb.org/howto/uml-debian-install.html#SWAP
You only need to run the following commands the first time you use a copy of 
the installer. They are needed to configure the ubd device nodes correctly, 
as the presupplied ones have got the wrong minor numbers

# cd /dev
# rm ubd*
# mknod ubd0 b 98 0
# mknod ubd1 b 98 16
# mknod ubd2 b 98 32
# mknod ubd3 b 98 48
# mknod ubd4 b 98 64
# mknod ubd5 b 98 80
# mknod ubd6 b 98 96
# mknod ubd7 b 98 112
Itamar Reis Peixoto
+55 (34) 3238 3845
e-mail : [EMAIL PROTECTED]
http://www.ispbrasil.com.br
I am starting my guest machine with ubd1=/uml/clau/swap.img
-bash-2.05b# swapon -a
swapon: /dev/ubd/1: No such device
-bash-2.05b#
my fstab
/dev/ubd/0  /   ext3defaults,usrquota 1 1
/proc   /proc   procdefaults
devpts  /dev/ptsdevpts  mode=0622 0 0
/dev/ubd/1  noneswapsw  0   0
How to make my swap working ?

---
This SF.net email is sponsored by Microsoft Mobile & Embedded DevCon 2005
Attend MEDC 2005 May 9-12 in Vegas. Learn more about the latest Windows
Embedded(r) & Windows Mobile(tm) platforms, applications & content.  Register
by 3/29 & save $300 http://ads.osdn.com/?ad_id=6883&alloc_id=15149&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


Re: [uml-devel] [patch 02/12] uml: cpu_relax fix

2005-03-23 Thread Blaisorblade
On Wednesday 23 March 2005 18:09, Bodo Stroesser wrote:
> [EMAIL PROTECTED] wrote:
> > Use rep_nop instead of barrier for cpu_relax, following $(SUBARCH)'s
> > doing that (i.e. i386 and x86_64).
>
> IIRC, Jeff had the idea, to use sched_yield() for this (from a discussion
> on #uml).
Hmm, makes sense, but this is to benchmark well... I remember from early 
discussions on 2.6 scheduler that using sched_yield might decrease 
performance (IIRC starve the calling application).

Also, that call should be put inside the idle loop, not for cpu_relax, which 
is very different, since it is used (for instance) in kernel/spinlock.c for 
spinlocks, and in such things. The "Pause" opcode is explicitly recommended 
(by Intel manuals, I don't recall why) for things like spinlock loops, and 
using yield there would be bad.

> S390 does something similar using a special DIAG-opcode that 
> gives permission to zVM, that another Guest might run.

> On a host running many UMLs, this might improve performance.
>
> So, I would like to have the small patch below (it's not tested, just an
> idea).

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




---
This SF.net email is sponsored by Microsoft Mobile & Embedded DevCon 2005
Attend MEDC 2005 May 9-12 in Vegas. Learn more about the latest Windows
Embedded(r) & Windows Mobile(tm) platforms, applications & content.  Register
by 3/29 & save $300 http://ads.osdn.com/?ad_id=6883&alloc_id=15149&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


Re: [uml-devel] Hostfs permission checks are all wonky.

2005-03-23 Thread Blaisorblade
On Wednesday 23 March 2005 09:13, Rob Landley wrote:
> On Tuesday 22 March 2005 02:19 pm, Blaisorblade wrote:
> > Ok, I'm now seeing that UML uses access() (inside access_file()) to check
> > permissions.
> >
> > See hostfs_permission -> access_file -> access. hostfs_permission (not
> > access_file) should skip the "access_file" call in case its type is
> > OS_TYPE_CHARDEV / OS_TYPE_BLOCKDEV / OS_TYPE_FIFO / OS_TYPE_SOCK.
> >
> > Look at init_inode() about how to see the file's type, but even better
> > look at the cached information, i.e. inode->i_mode and the S_* access
> > macro (look at init_special_inode about this).
>
> Just confirming: this patch fixed it.  Both /dev/loop0 and /dev/console
> work just fine with hostfs root now.
>
> Can this patch make it into 2.6.12?
Yes, it's on his way (in next group of merges however).
-- 
Paolo Giarrusso, aka Blaisorblade
Linux registered user n. 292729
http://www.user-mode-linux.org/~blaisorblade




---
This SF.net email is sponsored by Microsoft Mobile & Embedded DevCon 2005
Attend MEDC 2005 May 9-12 in Vegas. Learn more about the latest Windows
Embedded(r) & Windows Mobile(tm) platforms, applications & content.  Register
by 3/29 & save $300 http://ads.osdn.com/?ad_id=6883&alloc_id=15149&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


[uml-devel] Re: [patch 03/12] uml: export getgid for hostfs

2005-03-23 Thread Blaisorblade
On Tuesday 22 March 2005 19:11, Christoph Hellwig wrote:
> On Tue, Mar 22, 2005 at 05:21:23PM +0100, [EMAIL PROTECTED] wrote:
> > Export this symbol which is not satisfied currently. The code using it
> > has been merged, so please export this symbol.

> and it's still bogus, and you haven't replied when I mentioned it last
> time.
In this moment I need to clean up the missing symbol. If anyone wants to 
remove the code using this, then he might post a patch explictly removing it, 
and getting it refused probably.

Or at least CC uml-devel when discussing those problems. I'm not currently 
able to find on marc.theaimsgroup.com the mail you talk about. Can you please 
provide the URL to the discussion? (even on any other archive you like, 
obviously).

That said, there are people still using that code, so it should be kept in.

Also, you blocked an important patch (the one adding ->release to 
hw_interrupt_type) saying that *perhaps* UML should avoid having any hard 
irq, a la S390. You forced so the merge of a very ugly patch manually calling 
what should have been UML's release method (i.e. free_irq_by_irq_and_dev) in 
every place calling free_irq() (and in fact one was missed at first). Might 
you reconsider your position on that issue ? (URL of the discussion below)

http://marc.theaimsgroup.com/?l=linux-kernel&w=2&r=3&s=uml+irq&q=b

The patch adding the generic handling is this one:

http://marc.theaimsgroup.com/?l=linux-kernel&m=109834481320519&w=2

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




---
This SF.net email is sponsored by Microsoft Mobile & Embedded DevCon 2005
Attend MEDC 2005 May 9-12 in Vegas. Learn more about the latest Windows
Embedded(r) & Windows Mobile(tm) platforms, applications & content.  Register
by 3/29 & save $300 http://ads.osdn.com/?ad_id=6883&alloc_id=15149&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


Re: [uml-devel] [patch 02/12] uml: cpu_relax fix

2005-03-23 Thread Andrew Morton
Blaisorblade <[EMAIL PROTECTED]> wrote:
>
> On Wednesday 23 March 2005 18:09, Bodo Stroesser wrote:
>  > [EMAIL PROTECTED] wrote:
>  > > Use rep_nop instead of barrier for cpu_relax, following $(SUBARCH)'s
>  > > doing that (i.e. i386 and x86_64).
>  >
>  > IIRC, Jeff had the idea, to use sched_yield() for this (from a discussion
>  > on #uml).
>  Hmm, makes sense, but this is to benchmark well... I remember from early 
>  discussions on 2.6 scheduler that using sched_yield might decrease 
>  performance (IIRC starve the calling application).

yup, sched_yield() is pretty uniformly bad, and can result in heaps of
starvation if the machine is busy.  Best to avoid it unless you really want
it, and have tested it thoroughly under many-tasks-busy workloads.



---
This SF.net email is sponsored by Microsoft Mobile & Embedded DevCon 2005
Attend MEDC 2005 May 9-12 in Vegas. Learn more about the latest Windows
Embedded(r) & Windows Mobile(tm) platforms, applications & content.  Register
by 3/29 & save $300 http://ads.osdn.com/?ad_id=6883&alloc_id=15149&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


Re: [uml-devel] [patch 02/12] uml: cpu_relax fix

2005-03-23 Thread Nick Piggin
Blaisorblade wrote:
On Wednesday 23 March 2005 18:09, Bodo Stroesser wrote:
[EMAIL PROTECTED] wrote:
Use rep_nop instead of barrier for cpu_relax, following $(SUBARCH)'s
doing that (i.e. i386 and x86_64).
IIRC, Jeff had the idea, to use sched_yield() for this (from a discussion
on #uml).
Hmm, makes sense, but this is to benchmark well... I remember from early 
discussions on 2.6 scheduler that using sched_yield might decrease 
performance (IIRC starve the calling application).

Typically, for places where cpu_relax is used, sched_yield would be
a poor fit. So yes it could easily reduce performance.
Also, that call should be put inside the idle loop, not for cpu_relax, which 
is very different, since it is used (for instance) in kernel/spinlock.c for 
spinlocks, and in such things. The "Pause" opcode is explicitly recommended 
(by Intel manuals, I don't recall why) for things like spinlock loops, and 
using yield there would be bad.

The other thing is that sched_yield won't relax at all if you are the
only thing running, it will be a busy wait. So again, maybe not a great
fit for the idle loop either.


---
This SF.net email is sponsored by Microsoft Mobile & Embedded DevCon 2005
Attend MEDC 2005 May 9-12 in Vegas. Learn more about the latest Windows
Embedded(r) & Windows Mobile(tm) platforms, applications & content.  Register
by 3/29 & save $300 http://ads.osdn.com/?ad_id=6883&alloc_id=15149&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


Re: [uml-devel] [patch 05/12] uml: extend cmd line limits

2005-03-23 Thread Blaisorblade
On Tuesday 22 March 2005 22:30, Anthony Brock wrote:
> Blaisor,
>
> Perhaps the error message should be changed from:
>
> "add_arg: Too much command line!\n"
>
> to something like:
>
> "add_arg: Too many command line arguments!\n"
>
> Does this explain the error more clearly? Or am I mistaken?
Yes, I was copying it and didn't notice the message didn't make sense.

Here is the patch, it's queued and will be sent shortly.

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

From: Paolo 'Blaisorblade' Giarrusso <[EMAIL PROTECTED]>, "Anthony Brock" <[EMAIL PROTECTED]>

Replace the message with a more meaningful one. Noted by Anthony Brock.

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

 linux-2.6.11-paolo/arch/um/kernel/um_arch.c |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

diff -puN arch/um/kernel/um_arch.c~uml-correct-message arch/um/kernel/um_arch.c
--- linux-2.6.11/arch/um/kernel/um_arch.c~uml-correct-message	2005-03-24 03:04:59.0 +0100
+++ linux-2.6.11-paolo/arch/um/kernel/um_arch.c	2005-03-24 03:05:36.0 +0100
@@ -47,7 +47,7 @@ char command_line[COMMAND_LINE_SIZE] = {
 void add_arg(char *arg)
 {
 	if (strlen(command_line) + strlen(arg) + 1 > COMMAND_LINE_SIZE) {
-		printf("add_arg: Too much command line!\n");
+		printf("add_arg: Too many command line arguments!\n");
 		exit(1);
 	}
 	if(strlen(command_line) > 0)
_


[uml-devel] SKAS-V8, UML/2.4.27-bs2-pre7 released, start of work on SKAS/x86-64

2005-03-23 Thread Blaisorblade
Ok, I've put on the site the announcements of SKAS-v8 (which is identical to 
-rc5, I just need to update the tarballs), of the test tree (very test) for 
UML/2.4.

And, most important, of SKAS-v9-pre1 (for 2.6.11), which is the start towards 
a SKAS version working on x86-64.

The code is there, it still works well on x86, it compiles (or at least 
should) on x86-64, and I hope it will work on x86-64. Last time I did the 
port (which was a separate patch from the x86 one, so it was almost thrown 
away; this time I've not done this error), the patch didn't work for don't 
ask me which reasons... I hope this time I can debug it soon.
-- 
Paolo Giarrusso, aka Blaisorblade
Linux registered user n. 292729
http://www.user-mode-linux.org/~blaisorblade




---
This SF.net email is sponsored by Microsoft Mobile & Embedded DevCon 2005
Attend MEDC 2005 May 9-12 in Vegas. Learn more about the latest Windows
Embedded(r) & Windows Mobile(tm) platforms, applications & content.  Register
by 3/29 & save $300 http://ads.osdn.com/?ad_id=6883&alloc_id=15149&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


[uml-devel] Re: [uml-user] SKAS-V8, UML/2.4.27-bs2-pre7 released, start of work on SKAS/x86-64

2005-03-23 Thread Blaisorblade
On Thursday 24 March 2005 03:35, Blaisorblade wrote:
> Ok, I've put on the site the announcements of SKAS-v8 (which is identical
> to -rc5, I just need to update the tarballs), of the test tree (very test)
> for UML/2.4.
It does not compile with GCC 3.4, but from what I see no 2.4.27 tree will 
compile with that GCC, even for i386: it is stricter on attributes like 
regparm and thus on FASTCALL, so he refuses this:

static FASTCALL(void reschedule_idle(struct task_struct * p));

static void reschedule_idle(struct task_struct * p)

because it says they are different declarations.
-- 
Paolo Giarrusso, aka Blaisorblade
Linux registered user n. 292729
http://www.user-mode-linux.org/~blaisorblade




---
This SF.net email is sponsored by Microsoft Mobile & Embedded DevCon 2005
Attend MEDC 2005 May 9-12 in Vegas. Learn more about the latest Windows
Embedded(r) & Windows Mobile(tm) platforms, applications & content.  Register
by 3/29 & save $300 http://ads.osdn.com/?ad_id=6883&alloc_id=15149&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