Re: [uml-devel] Kernel mode fault at addr 0x92c00000, ip 0x80bcead

2006-10-13 Thread Jeff Dike
On Tue, Oct 10, 2006 at 06:17:06PM -0500, Christopher S. Aker wrote:
> This is 2.6.18-um, on top of a 2.6.16.29-skas3-v8.2 host.
> 
> Kernel file is here:
> http://www.theshore.net/~caker/uml/kernels/2.6.18-linode25
> 
> 
> Kernel panic - not syncing: Kernel mode fault at addr 0x92c0, ip 
> 0x80bcead

The stack I get from that is:

85a0f49c:  [<800350cf>] csum_partial+0xdb/0xe8
85a0f74c:  [<802aafe2>] skb_checksum+0xe7/0x28f
85a0f788:  [<802afd31>] skb_checksum_help+0x9c/0x13e
85a0f7ac:  [<803292fc>] ip_nat_fn+0x1d2/0x1e7
85a0f7e0:  [<80329528>] ip_nat_local_fn+0x75/0xf3
85a0f808:  [<802d8569>] nf_iterate+0x63/0x7b
85a0f830:  [<802d85ec>] nf_hook_slow+0x6b/0xe4
85a0f86c:  [<802e4a44>] ip_queue_xmit+0x3d7/0x4c2
85a0f944:  [<802f7668>] tcp_transmit_skb+0x2b8/0x4b1
85a0f984:  [<802f91fd>] tcp_push_one+0xde/0x159
85a0f9ac:  [<802eca55>] tcp_sendmsg+0x438/0xe54
85a0fa30:  [<8030a718>] inet_sendmsg+0x4a/0x56
__sock_sendmsg
85a0fa48:  [<802a4aad>] do_sock_write+0xbb/0xc5
85a0fa6c:  [<802a4c5f>] sock_aio_write+0x95/0x99
85a0fae0:  [<80082978>] do_sync_write+0xde/0x124
85a0fb90:  [<80082b81>] vfs_write+0x1c3/0x23d
85a0fbc8:  [<80082ccc>] sys_write+0x51/0x80
85a0fbf0:  [<80022bda>] handle_syscall+0x11a/0x138
85a0fc6c:  [<80033b68>] handle_trap+0x31/0x12d
85a0fc94:  [<80034192>] userspace+0x1c7/0x21e
85a0fcf0:  [<80022808>] fork_handler+0xef/0xff
85a0fd1c:  [<8039a828>] __restore+0x0/0x8
85a0fd5c:  [<8039aa81>] kill+0x11/0x20

> Is this a UML issue?

Hard to say.  With a kernel fault, I'd be tempted to say so, but I see no
UML code on the stack.

Have you seen just this one occurence of this?  I spent part of the
afternoon dusting off a patch which would provide the registers at the
time of the segfault.  That maybe would have helped here.

Jeff

-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
User-mode-linux-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel


Re: [uml-devel] [PATCH 01/14] uml: fix compilation options for USER_OBJS

2006-10-13 Thread Jeff Dike
On Wed, Oct 11, 2006 at 01:08:27PM +0200, Paolo Giarrusso wrote:
> Ok, at a first glance this alternative solution is ok. Make sure (run
> gdb on an userspace object file and saying list ) that it
> works and we'll be ok.

After discovering that the original patch broke UML/i386 and broke the
UML/x86_64 build, I now have the patch below.

Listing userspace functions is fine.

Jeff


Index: linux-2.6.18-mm/arch/um/Makefile
===
--- linux-2.6.18-mm.orig/arch/um/Makefile   2006-10-13 10:20:51.0 
-0400
+++ linux-2.6.18-mm/arch/um/Makefile2006-10-13 10:21:50.0 -0400
@@ -64,9 +64,14 @@ CFLAGS += $(CFLAGS-y) -D__arch_um__ -DSU
 
 AFLAGS += $(ARCH_INCLUDE)
 
-USER_CFLAGS := $(patsubst -I%,,$(CFLAGS))
-USER_CFLAGS := $(patsubst -D__KERNEL__,,$(USER_CFLAGS)) $(ARCH_INCLUDE) \
-   $(MODE_INCLUDE) -D_FILE_OFFSET_BITS=64
+USER_CFLAGS = $(patsubst $(KERNEL_DEFINES),,$(patsubst -D__KERNEL__,,\
+   $(patsubst -I%,,$(CFLAGS $(ARCH_INCLUDE) $(MODE_INCLUDE) \
+   -D_FILE_OFFSET_BITS=64
+
+include $(srctree)/$(ARCH_DIR)/Makefile-$(SUBARCH)
+
+#This will adjust *FLAGS accordingly to the platform.
+include $(srctree)/$(ARCH_DIR)/Makefile-os-$(OS)
 
 # -Derrno=kernel_errno - This turns all kernel references to errno into
 # kernel_errno to separate them from the libc errno.  This allows -fno-common
@@ -74,15 +79,11 @@ USER_CFLAGS := $(patsubst -D__KERNEL__,,
 # errnos.
 # These apply to kernelspace only.
 
-CFLAGS += -Derrno=kernel_errno -Dsigprocmask=kernel_sigprocmask \
-   -Dmktime=kernel_mktime
+KERNEL_DEFINES = -Derrno=kernel_errno -Dsigprocmask=kernel_sigprocmask \
+   -Dmktime=kernel_mktime $(ARCH_KERNEL_DEFINES)
+CFLAGS += $(KERNEL_DEFINES)
 CFLAGS += $(call cc-option,-fno-unit-at-a-time,)
 
-include $(srctree)/$(ARCH_DIR)/Makefile-$(SUBARCH)
-
-#This will adjust *FLAGS accordingly to the platform.
-include $(srctree)/$(ARCH_DIR)/Makefile-os-$(OS)
-
 # These are needed for clean and mrproper, since in that case .config is not
 # included; the values here are meaningless
 
Index: linux-2.6.18-mm/arch/um/Makefile-x86_64
===
--- linux-2.6.18-mm.orig/arch/um/Makefile-x86_642006-10-13 
10:20:51.0 -0400
+++ linux-2.6.18-mm/arch/um/Makefile-x86_64 2006-10-13 10:21:50.0 
-0400
@@ -8,8 +8,8 @@ _extra_flags_ = -fno-builtin -m64
 
 #We #undef __x86_64__ for kernelspace, not for userspace where
 #it's needed for headers to work!
-CFLAGS += -U__$(SUBARCH)__ $(_extra_flags_)
-USER_CFLAGS += $(_extra_flags_)
+ARCH_KERNEL_DEFINES = -U__$(SUBARCH)__
+CFLAGS += $(_extra_flags_)
 
 CHECKFLAGS  += -m64
 AFLAGS += -m64
Index: linux-2.6.18-mm/arch/um/Makefile-i386
===
--- linux-2.6.18-mm.orig/arch/um/Makefile-i386  2006-10-10 09:10:21.0 
-0400
+++ linux-2.6.18-mm/arch/um/Makefile-i386   2006-10-13 10:28:43.0 
-0400
@@ -16,7 +16,6 @@ OBJCOPYFLAGS  := -O binary -R .note -R
 ifeq ("$(origin SUBARCH)", "command line")
 ifneq ("$(shell uname -m | sed -e s/i.86/i386/)", "$(SUBARCH)")
 CFLAGS += $(call cc-option,-m32)
-USER_CFLAGS+= $(call cc-option,-m32)
 AFLAGS += $(call cc-option,-m32)
 LINK-y += $(call cc-option,-m32)
 UML_OBJCOPYFLAGS   += -F $(ELF_FORMAT)
@@ -25,7 +24,7 @@ export LDFLAGS HOSTCFLAGS HOSTLDFLAGS UM
 endif
 endif
 
-CFLAGS += -U__$(SUBARCH)__ -U$(SUBARCH)
+ARCH_KERNEL_DEFINES += -U__$(SUBARCH)__ -U$(SUBARCH)
 
 # First of all, tune CFLAGS for the specific CPU. This actually sets cflags-y.
 include $(srctree)/arch/i386/Makefile.cpu
@@ -38,4 +37,3 @@ cflags-y += $(call cc-option,-mpreferred
 cflags-y += -ffreestanding
 
 CFLAGS += $(cflags-y)
-USER_CFLAGS += $(cflags-y)

-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
User-mode-linux-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel


Re: [uml-devel] [PATCH 06/14] uml: make UML_SETJMP always safe

2006-10-13 Thread Blaisorblade
On Monday 09 October 2006 20:00, Jeff Dike wrote:
> On Thu, Oct 05, 2006 at 11:38:52PM +0200, Paolo 'Blaisorblade' Giarrusso 
wrote:
> > From: Paolo 'Blaisorblade' Giarrusso <[EMAIL PROTECTED]>
> >
> > If enable is moved by GCC in a register its value may not be preserved
> > after coming back there with longjmp(). So, mark it as volatile to
> > prevent this; this is suggested (it seems) in info gcc, when it talks
> > about -Wuninitialized. I re-read this and it seems to say something
> > different, but I still believe this may be needed.
> >
> > Signed-off-by: Paolo 'Blaisorblade' Giarrusso <[EMAIL PROTECTED]>
> > ---
> >
> >  arch/um/include/longjmp.h |3 ++-
> >  1 files changed, 2 insertions(+), 1 deletions(-)
> >
> > diff --git a/arch/um/include/longjmp.h b/arch/um/include/longjmp.h
> > index e93c6d3..e860bc5 100644
> > --- a/arch/um/include/longjmp.h
> > +++ b/arch/um/include/longjmp.h
> > @@ -12,7 +12,8 @@ #define UML_LONGJMP(buf, val) do { \
> >  } while(0)
> >
> >  #define UML_SETJMP(buf) ({ \
> > -   int n, enable; \
> > +   int n; \
> > +   volatile int enable;\
> > enable = get_signals(); \
> > n = setjmp(*buf); \
> > if(n != 0) \
>
> I agree with this, but not entirely with your reasoning.  The
> -Wuninitialized documentation just talks about when gcc emits a
> warning.
>
> What we want is a guarantee that enable is not cached in a register,
> but is stored in memory.  What documentation I can find seems to imply
> that is the case ("accesses to volatile objects must have settled
> before the next sequence point").
>
> However, given the prevailing opinion that essentially all volatile
> declarations are hiding bugs, I wouldn't mind a bit of review of this
> from someone holding this opinion.

I agree with that, so I think Al (whom I cc'ed) will be able to evaluate this.
 - however I think that the problem with volatile is that it does not have any 
semantic wrt cache - volatile does not even work with host-to-device 
operation (the thing it was thought for) if you have reasonable caches - 
unless the var is in a MMIO region with disabled caches.

So relying on volatile for variables shared between threads is not useful.

Note that raw_spinlock_t counter is volatile, however - separate caches 
flushes or atomic operations are needed, but it may avoid the need for a full 
barrier() operation or a volatile "memory" clobber - GCC knows only the 
volatile object has changed, while with barrier() it must assume everything 
must be reloaded. However, at least one barrier operation is needed for a 
spinlock to prevent GCC from moving code outside of critical sections.
-- 
Inform me of my mistakes, so I can keep imitating Homer Simpson's "Doh!".
Paolo Giarrusso, aka Blaisorblade
http://www.user-mode-linux.org/~blaisorblade
Chiacchiera con i tuoi amici in tempo reale! 
 http://it.yahoo.com/mail_it/foot/*http://it.messenger.yahoo.com 


-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
User-mode-linux-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel


Re: [uml-devel] SKAS mode not working, x86_64 SMP host, x86_64 guest, problems with noprocmm

2006-10-13 Thread Blaisorblade
On Sunday 08 October 2006 22:01, Nikola Ciprich wrote:
> That's it!
> -mm3 kernel is causing this problem, and Your patch indeed fixes it! I
> completely forgot that I was also trying mm patches and I certainly
> mixed them with Your patches :-/
> at least I'm glad that I now know where the problem was...

Fine!
Next time, however, you'll save your time if you cut'n'paste the gcc output 
and do "head Makefile" (brighter variations are possible, but that should 
work if you don't use git) to get the exact version string. I don't want to 
criticize, just to give you a tip :-) !

Bye
-- 
Inform me of my mistakes, so I can keep imitating Homer Simpson's "Doh!".
Paolo Giarrusso, aka Blaisorblade
http://www.user-mode-linux.org/~blaisorblade
Chiacchiera con i tuoi amici in tempo reale! 
 http://it.yahoo.com/mail_it/foot/*http://it.messenger.yahoo.com 


-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
User-mode-linux-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel


Re: [uml-devel] Kernel mode fault at addr 0x92c00000, ip 0x80bcead

2006-10-13 Thread Blaisorblade
On Friday 13 October 2006 22:07, Jeff Dike wrote:
> On Tue, Oct 10, 2006 at 06:17:06PM -0500, Christopher S. Aker wrote:
> > This is 2.6.18-um, on top of a 2.6.16.29-skas3-v8.2 host.
> >
> > Kernel file is here:
> > http://www.theshore.net/~caker/uml/kernels/2.6.18-linode25
> >
> >
> > Kernel panic - not syncing: Kernel mode fault at addr 0x92c0, ip
> > 0x80bcead
Jeff, are these addresses normal? They tell that the binary is a statically 
linked one - but what is the memory layout? Chris, can you post 
cat /proc//maps on a running instance of that kernel, together with host 
and guest config (the guest's one is contained there, I know, but I don't 
have the time to extract).

I'm suspiscious about memory layout problems (say host with unusual splits, 
like 1G/3G, or some problem with memory mappings anyhow).

> The stack I get from that is:
I.e. all the rest are bogus functions?

There are automated solutions for this - compiling with frame pointers allows 
correct backtracing with a runtime penalty but is implemented; however, we 
could reuse (not copy, please, we cannot maintain it) the x86 DWARF unwinder 
(instead of using frame pointer and to slow down fast paths, additional 
out-of-line debug info are used when the stack trace is output) - but we 
should implement this latter one. Jeff, can you take a look at it?

> 85a0f49c:  [<800350cf>] csum_partial+0xdb/0xe8
> 85a0f74c:  [<802aafe2>] skb_checksum+0xe7/0x28f
> 85a0f788:  [<802afd31>] skb_checksum_help+0x9c/0x13e
> 85a0f7ac:  [<803292fc>] ip_nat_fn+0x1d2/0x1e7
> 85a0f7e0:  [<80329528>] ip_nat_local_fn+0x75/0xf3
> 85a0f808:  [<802d8569>] nf_iterate+0x63/0x7b
> 85a0f830:  [<802d85ec>] nf_hook_slow+0x6b/0xe4
> 85a0f86c:  [<802e4a44>] ip_queue_xmit+0x3d7/0x4c2
> 85a0f944:  [<802f7668>] tcp_transmit_skb+0x2b8/0x4b1
> 85a0f984:  [<802f91fd>] tcp_push_one+0xde/0x159
> 85a0f9ac:  [<802eca55>] tcp_sendmsg+0x438/0xe54
> 85a0fa30:  [<8030a718>] inet_sendmsg+0x4a/0x56
>   __sock_sendmsg
> 85a0fa48:  [<802a4aad>] do_sock_write+0xbb/0xc5
> 85a0fa6c:  [<802a4c5f>] sock_aio_write+0x95/0x99
> 85a0fae0:  [<80082978>] do_sync_write+0xde/0x124
> 85a0fb90:  [<80082b81>] vfs_write+0x1c3/0x23d
> 85a0fbc8:  [<80082ccc>] sys_write+0x51/0x80
> 85a0fbf0:  [<80022bda>] handle_syscall+0x11a/0x138
> 85a0fc6c:  [<80033b68>] handle_trap+0x31/0x12d
> 85a0fc94:  [<80034192>] userspace+0x1c7/0x21e
> 85a0fcf0:  [<80022808>] fork_handler+0xef/0xff
> 85a0fd1c:  [<8039a828>] __restore+0x0/0x8
> 85a0fd5c:  [<8039aa81>] kill+0x11/0x20

-- 
Inform me of my mistakes, so I can keep imitating Homer Simpson's "Doh!".
Paolo Giarrusso, aka Blaisorblade
http://www.user-mode-linux.org/~blaisorblade
Chiacchiera con i tuoi amici in tempo reale! 
 http://it.yahoo.com/mail_it/foot/*http://it.messenger.yahoo.com 


-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
User-mode-linux-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel


Re: [uml-devel] Kernel mode fault at addr 0x92c00000, ip 0x80bcead

2006-10-13 Thread Christopher S. Aker
Blaisorblade wrote:
> On Friday 13 October 2006 22:07, Jeff Dike wrote:
>> On Tue, Oct 10, 2006 at 06:17:06PM -0500, Christopher S. Aker wrote:
>>> This is 2.6.18-um, on top of a 2.6.16.29-skas3-v8.2 host.
>>>
>>> Kernel file is here:
>>> http://www.theshore.net/~caker/uml/kernels/2.6.18-linode25
>>>
>>>
>>> Kernel panic - not syncing: Kernel mode fault at addr 0x92c0, ip
>>> 0x80bcead
> Jeff, are these addresses normal? They tell that the binary is a statically 
> linked one - but what is the memory layout? Chris, can you post 
> cat /proc//maps on a running instance of that kernel, together with host 
> and guest config (the guest's one is contained there, I know, but I don't 
> have the time to extract).
> 
> I'm suspiscious about memory layout problems (say host with unusual splits, 
> like 1G/3G, or some problem with memory mappings anyhow).

All the stuff you requested is in here: 
http://www.theshore.net/~caker/uml/kmf/

http://www.theshore.net/~caker/uml/kmf/maps.txt (has the maps from all 
the UML's pids, in case you notice duplicates)

http://www.theshore.net/~caker/uml/kmf/config-2.6.18-um.txt
http://www.theshore.net/~caker/uml/kmf/config-2.6.16.29-1-bigmem-skas-v8.2.txt

Thanks!
-Chris


-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
User-mode-linux-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel


Re: [uml-devel] [uml-user] proc filesystem ipaddress

2006-10-13 Thread Blaisorblade
On Friday 13 October 2006 05:33, Nic James Ferrier wrote:
> I know this is not UML specific... but maybe the kernel hackers here
> can answer this anyway, since I'm doing it to make life with UMLs
> easier.
>
> I've patched the ipv4 stack so that it does proc registration of the
> IP address for an iface.
Take a look at /proc/net/if_inet6, generated by 

> Currently I'm just getting the details for eth0.
>
> I'm using kernel ioctl calls (correctly surrounded by get_fs/set_fs
> calls) to get the interface data.

> All the interface data is returned at 16 bits.
I.e. that's the seq_printf string, right?

> I've put printk's in the kernel side of the code and there I can see
> the values are 32 bit.

The values you pass to seq printf, right? Actually IMHO not - I guess printk() 
used different data.

> So it seems that in the conversion from kernel space to user space
> half the information is being lost.
>
> Anyone know anything about that?
See below, there's the analsys.
> Here's my patch to create /proc/net/ipaddress in case anyone's
> interested in half the data:
I know you're beginning to write kernel code and this is not even a finished 
patch, however I'm commenting _various_ improvable aspects of the work. Do 
not worry for that.

> --- old/linux-2.6.17.1/net/ipv4/proc.c
> +++ new/linux-2.6.17.1/net/ipv4/proc.c
> @@ -44,6 +44,77 @@
>  #include 
>  #include 
>
> +
> + New IP Address proc interface
> +#include 
> +#include 
> +
> +static int ipaddress_dev_ioctl(struct ifreq *ir, unsigned int cmd)
> +{
> + int res;
> +mm_segment_t oldfs;
> +
> + oldfs = get_fs();

> + set_fs(get_ds());

Nah, this line should be set_fs(KERNEL_DS) - grep for examples, I've always 
used KERNEL_DS there and it's the only one that makes sense.

Also, for mainline acceptance I guess they'd prefer to bypass ioctl and access 
directly the needed fields.
Btw, on linux-kernel@ or on linux-netdev@ (cc'ing here) you might also ask why 
this info is missing.

> + res = devinet_ioctl(cmd, (struct ifreq __user *) ir);
> + set_fs(oldfs);
> + return res;
> +}
> +
> +static int ipaddress_seq_show(struct seq_file *seq, void *v)
> +{
> +struct ifreq ir;
> +struct sockaddr_in * if_addr;
> +struct sockaddr_in * local_addr;
> +uint32_t local;
> +uint32_t mask;
> +uint32_t broadcast;
> +uint32_t destination;
> +
> +memset(&ir, 0, sizeof(ir));
> +strcpy(ir.ifr_ifrn.ifrn_name, "eth0");

Ok, that will be fixed afterwards - that file (the ipv6 one, see above) 
iterates between addrs correctly. Note also that one interface can be 
associated to multiple address, even without using aliases, if you use 
the "ip" command (which uses probably even a different kernel level API - I 
remember that ifconfig and friends use an in-kernel emulation of the old 
API - but since the data model is different it is just an emulation).

> +
> +ipaddress_dev_ioctl(&ir, SIOCGIFADDR);
> +local_addr = if_addr = (struct sockaddr_in *) ir.ifr_addr.sa_data;

But local_addr is redundant, right?
Beyond that, I've found your bug. You can cast a (struct sockaddr*) to a 
(struct sockaddr_in*), but your doing a worse cast; since ifr_addr is a 
struct sockaddr, the _below_ version is correct:

if_addr = (struct sockaddr_in *) ir.ifr_addr;

The way you do it, if_addr is 2 + the correct value - i.e. 16 bit are cut 
away.

Unless in kernel they use different conventions (then show it me and I'll 
agree).

> +local = if_addr->sin_addr.s_addr;
> +
> +ipaddress_dev_ioctl(&ir, SIOCGIFNETMASK);
> +if_addr = (struct sockaddr_in *) ir.ifr_addr.sa_data;
> +mask = if_addr->sin_addr.s_addr;
> +
> +ipaddress_dev_ioctl(&ir, SIOCGIFBRDADDR);
> +if_addr = (struct sockaddr_in *) ir.ifr_addr.sa_data;

Here you should use ifr_broadaddr, and so on... look directly at struct ifreq 
definition. That is an union so what you do happens to work, but this detail 
is not part of the API, so don't cheat ;-).

> +broadcast = if_addr->sin_addr.s_addr;
> +
> +ipaddress_dev_ioctl(&ir, SIOCGIFDSTADDR);
> +if_addr = (struct sockaddr_in *) ir.ifr_addr.sa_data;
> +destination = if_addr->sin_addr.s_addr;
> +
> +seq_printf(seq, "ethx: %u %u %u %u\n",
> +   local,
> +   mask,
> +   broadcast,
> +   destination);
> +//inet_ntoa(local_addr->sin_addr));
> +return 0;
> +}
> +
> +static int ipaddress_seq_open(struct inode *inode, struct file *file)
> +{
> + return single_open(file, ipaddress_seq_show, NULL);
> +}
> +
> +static struct file_operations ipaddress_seq_fops = {
> + .owner   = THIS_MODULE,
> + .open= ipaddress_seq_open,
> + .read= seq_read,
> + .llseek  = seq_lseek,
> + .release = single_release,
> +};
> +
> + End new IP Address proc interface
> +
> +
>  static int fold_prot_inuse(struct proto 

Re: [uml-devel] [uml-user] proc filesystem ipaddress

2006-10-13 Thread Blaisorblade
On Saturday 14 October 2006 03:46, Blaisorblade wrote:
> On Friday 13 October 2006 05:33, Nic James Ferrier wrote:
> > I know this is not UML specific... but maybe the kernel hackers here
> > can answer this anyway, since I'm doing it to make life with UMLs
> > easier.
> >
> > I've patched the ipv4 stack so that it does proc registration of the
> > IP address for an iface.
>
> Take a look at /proc/net/if_inet6, generated by
net/ipv6/addrconf.c
(I forgot this).
-- 
Inform me of my mistakes, so I can keep imitating Homer Simpson's "Doh!".
Paolo Giarrusso, aka Blaisorblade
http://www.user-mode-linux.org/~blaisorblade
Chiacchiera con i tuoi amici in tempo reale! 
 http://it.yahoo.com/mail_it/foot/*http://it.messenger.yahoo.com 


-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
User-mode-linux-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel


Re: [uml-devel] Kernel mode fault at addr 0x92c00000, ip 0x80bcead

2006-10-13 Thread Blaisorblade
On Saturday 14 October 2006 03:19, Christopher S. Aker wrote:
> Blaisorblade wrote:
> > On Friday 13 October 2006 22:07, Jeff Dike wrote:
> >> On Tue, Oct 10, 2006 at 06:17:06PM -0500, Christopher S. Aker wrote:
> >>> This is 2.6.18-um, on top of a 2.6.16.29-skas3-v8.2 host.
> >>>
> >>> Kernel file is here:
> >>> http://www.theshore.net/~caker/uml/kernels/2.6.18-linode25
> >>>
> >>>
> >>> Kernel panic - not syncing: Kernel mode fault at addr 0x92c0, ip
> >>> 0x80bcead

> > Jeff, are these addresses normal? They tell that the binary is a
> > statically linked one - but what is the memory layout? Chris, can you
> > post
> > cat /proc//maps on a running instance of that kernel, together with
> > host and guest config (the guest's one is contained there, I know, but I
> > don't have the time to extract).

> > I'm suspiscious about memory layout problems (say host with unusual
> > splits, like 1G/3G, or some problem with memory mappings anyhow).

> All the stuff you requested is in here:
> http://www.theshore.net/~caker/uml/kmf/

> http://www.theshore.net/~caker/uml/kmf/maps.txt (has the maps from all
> the UML's pids, in case you notice duplicates)

> http://www.theshore.net/~caker/uml/kmf/config-2.6.18-um.txt
> http://www.theshore.net/~caker/uml/kmf/config-2.6.16.29-1-bigmem-skas-v8.2.
>txt
Which is the cmd line? With how much memory where these instances started?

Ok, Jeff, I recall something but I'm not sure. I even thought kernel threads 
mapped the whole RAM at boot in their physical range part (which is their 
entire address space), but it does not seem so.

The host is just a 64G with 3G/1G split, however the UML is a TT+SKAS with 
HALF_GIGS=2 (which _is_ unusual, and could be replaced with disabling TT 
entirely, which gives a free 2,75G of memory space for UML). In fact, the UML 
binary starts at 0x8000  (i.e. 2G), and there are various holes in the 
virtual RAM mapped in kernel side - a big part of about 30M (the 
0x80607000-0x92c0 range), then there is a 4M hole (the pre-vmalloc hole 
should be 8M, but we have a 4M hole for uml_reserved after current brk()), 
then various holes and allocated ranges (with varying offsets) here and 
there, like if the area were allocated for vmalloc(). The problem is that we 
have an allocated anonymous memory range (which the checksum is accessing) 
before the 4M hole!

8000-80514000 rwxp  fd:00 540678 /vbin/kernel/2.6.18-linode25
80514000-80607000 rwxp 80514000 00:00 0  [heap]
80607000-92c0 rwxs 00607000 00:16
738427 /linodes/encode1/tmp/vm_file-AVT0fb (deleted)

9300-9300b000 rwxs 006b6000 00:16
738427 /linodes/encode1/tmp/vm_file-AVT0fb (deleted)
9300c000-93017000 rwxs 006c2000 00:16
738427 /linodes/encode1/tmp/vm_file-AVT0fb (deleted)

I can't follow this code at the moment, so I go for now.
Bye!
-- 
Inform me of my mistakes, so I can keep imitating Homer Simpson's "Doh!".
Paolo Giarrusso, aka Blaisorblade
http://www.user-mode-linux.org/~blaisorblade
Chiacchiera con i tuoi amici in tempo reale! 
 http://it.yahoo.com/mail_it/foot/*http://it.messenger.yahoo.com 


-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
User-mode-linux-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel


Re: [uml-devel] Kernel mode fault at addr 0x92c00000, ip 0x80bcead

2006-10-13 Thread Christopher S. Aker
Blaisorblade wrote:
> Which is the cmd line? With how much memory where these instances started?

Kernel command line: mem=300M fake_ide fakehd con=null con0=fd:0,fd:1 
devfs=nomount root=/dev/ubda ubda= 7 ubdb= 
eth0=tuntap,encode1_0,fe:fd:46:55:81:95 token_max=40 token_refill=512

> Ok, Jeff, I recall something but I'm not sure. I even thought kernel threads 
> mapped the whole RAM at boot in their physical range part (which is their 
> entire address space), but it does not seem so.
> 
> The host is just a 64G with 3G/1G split, however the UML is a TT+SKAS with 
> HALF_GIGS=2 (which _is_ unusual, and could be replaced with disabling TT 

Jeff had this discussion with me a few weeks ago when I was trying to 
get UML to use more than ~550M.

At that time, I tried disabling TT mode but had to revert because non-TT 
mode enabled umls wouldn't boot on some very old skas hosts of mine.  I 
suspected that you might point in the same direction he did.  That 
problem is less important since I should really just upgrade those boxes...

> entirely, which gives a free 2,75G of memory space for UML). In fact, the UML 
> binary starts at 0x8000  (i.e. 2G), and there are various holes in the 
> virtual RAM mapped in kernel side - a big part of about 30M (the 
> 0x80607000-0x92c0 range), then there is a 4M hole (the pre-vmalloc hole 
> should be 8M, but we have a 4M hole for uml_reserved after current brk()), 
> then various holes and allocated ranges (with varying offsets) here and 
> there, like if the area were allocated for vmalloc(). The problem is that we 
> have an allocated anonymous memory range (which the checksum is accessing) 
> before the 4M hole!
> 
> 8000-80514000 rwxp  fd:00 540678 /vbin/kernel/2.6.18-linode25
> 80514000-80607000 rwxp 80514000 00:00 0  [heap]
> 80607000-92c0 rwxs 00607000 00:16
>   738427 /linodes/encode1/tmp/vm_file-AVT0fb (deleted)
> 
> 9300-9300b000 rwxs 006b6000 00:16
>   738427 /linodes/encode1/tmp/vm_file-AVT0fb (deleted)
> 9300c000-93017000 rwxs 006c2000 00:16
>   738427 /linodes/encode1/tmp/vm_file-AVT0fb (deleted)
> 
> I can't follow this code at the moment, so I go for now.
> Bye!

-Chris

-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
User-mode-linux-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel