[uml-user] Patchset for 64bit host and 32bit guest

2007-10-19 Thread fru...@freaknet.org
Hi to the list,

I'm going throu the 32bit on 64bit on debian 4, as first I had a problem
with the host kernel to run 32bits uml kernels, I solve it installing a
vanilla 2.6.18.8 patch it for debian and then I could start a prebuilted
kernel from nagafix(the 2.6.23) but I got the arch_switch_tls_skas
problem, I patched the kernel with the x86-64-support.diff from the bb1
branch

http://www.user-mode-linux.org/~blaisorblade/patches/guest/uml-2.6.18-bb1/broken-out/tls/

One hunk failed

patching file arch/um/os-Linux/sys-i386/tls.c
Hunk #1 FAILED at 1.
Hunk #2 FAILED at 28.
2 out of 2 hunks FAILED -- saving rejects to file
arch/um/os-Linux/sys-i386/tls.c.rej

This is it, sorry I'm not able to fix it:

$ cat arch/um/os-Linux/sys-i386/tls.c.rej

***
*** 1,16 
  #include 
  #include 
  #include "sysdep/tls.h"
  #include "user_util.h"

  static _syscall1(int, get_thread_area, user_desc_t *, u_info);

  /* Checks whether host supports TLS, and sets *tls_min according to
the value
   * valid on the host.
   * i386 host have it == 6; x86_64 host have it == 12, for i386
emulation. */
- void check_host_supports_tls(int *supports_tls, int *tls_min) {
/* Values for x86 and x86_64.*/
-   int val[] = {GDT_ENTRY_TLS_MIN_I386, GDT_ENTRY_TLS_MIN_X86_64};
int i;

for (i = 0; i < ARRAY_SIZE(val); i++) {
--- 1,26 
+ #include 
+ #include 
  #include 
  #include 
  #include "sysdep/tls.h"
  #include "user_util.h"
+ #include "os.h"
+ #include "uml-config.h"
+
+ /* TLS support - we basically rely on the host's one.*/

  static _syscall1(int, get_thread_area, user_desc_t *, u_info);

+ //XXX: should get this from an include!
+ extern int host_gdt_entry_tls_min;
+
  /* Checks whether host supports TLS, and sets *tls_min according to
the value
   * valid on the host.
   * i386 host have it == 6; x86_64 host have it == 12, for i386
emulation. */
+ int check_host_supports_tls()
+ {
/* Values for x86 and x86_64.*/
+   int val[] = { GDT_ENTRY_TLS_MIN_I386, GDT_ENTRY_TLS_MIN_X86_64 }; 
int i;

for (i = 0; i < ARRAY_SIZE(val); i++) {
*** void check_host_supports_tls(int *suppor
*** 18,34 
info.entry_number = val[i];

if (get_thread_area(&info) == 0) {
-   *tls_min = val[i];
-   *supports_tls = 1;
-   return;
} else {
if (errno == EINVAL)
continue;
else if (errno == ENOSYS)
-   *supports_tls = 0;
-   return;
}
}

-   *supports_tls = 0;
  }
--- 28,110 
info.entry_number = val[i];

if (get_thread_area(&info) == 0) {
+   host_gdt_entry_tls_min = val[i];
+   return 1;
} else {
if (errno == EINVAL)
continue;
else if (errno == ENOSYS)
+   return 0;
}
}

+   return 0;
+ }
+
+ /* In TT mode, this should be called only by the tracing thread, and
makes sense
+  * only for PTRACE_SET_THREAD_AREA. In SKAS mode, it's used normally.
+  *
+  */
+
+ #ifndef PTRACE_GET_THREAD_AREA
+ #define PTRACE_GET_THREAD_AREA 25
+ #endif
+
+ #ifndef PTRACE_SET_THREAD_AREA
+ #define PTRACE_SET_THREAD_AREA 26
+ #endif
+
+ int os_set_thread_area(user_desc_t *info, int pid)
+ {
+   int ret;
+
+   ret = ptrace(PTRACE_SET_THREAD_AREA, pid, info->entry_number,
+(unsigned long) info);
+   if (ret < 0)
+   ret = -errno;
+   return ret;
+ }
+
+ #ifdef UML_CONFIG_MODE_SKAS
+
+ int os_get_thread_area(user_desc_t *info, int pid)
+ {
+   int ret;
+
+   ret = ptrace(PTRACE_GET_THREAD_AREA, pid, info->entry_number,
+(unsigned long) info);
+   if (ret < 0)
+   ret = -errno;
+   return ret;
+ }
+
+ #endif
+
+ #ifdef UML_CONFIG_MODE_TT
+ #include "linux/unistd.h"
+
+ static _syscall1(int, set_thread_area, user_desc_t *, u_info);
+
+ int do_set_thread_area_tt(user_desc_t *info)
+ {
+   int ret;
+
+   ret = set_thread_area(info);
+   if (ret < 0) {
+   ret = -errno;
+   }
+   return ret;
+ }
+
+ int do_get_thread_area_tt(user_desc_t *info)
+ {
+   int ret;
+
+   ret = get_thread_area(info);
+   if (ret < 0) {
+   ret = -errno;
+   }
+   return ret;
  }
+
+ #endif /* UML_CONFIG_MODE_TT */

And another one:

***
*** 1,76 
- #include 
- #include 
- #include 
- #include "sysdep/tls.h"
- #include "uml-config.h"
-
- /* TLS support - we basically rely on the host's one.*/
-
- /* In TT mode, this should be called only by the tracing thread, and
makes sense
-  * only for PTRACE_SET_THREAD_AREA. In SKAS mode, it's used normally.
-  *
-  */
-
- #if

[uml-user] request_module: runaway loop modprobe binfmt-464c

2007-10-23 Thread fru...@freaknet.org
Hi to the list,

I'm getting confused in the patching procedure,

I've compiled as a host on a amd64 the kernel 2.6.18.8 patched with the
skas-freemap-2.6.18-v9-pre9.patch from
http://www.user-mode-linux.org/~blaisorblade/patches/skas3-2.6/skas-fremap-2.6.18-v9-pre9/skas-fremap-2.6.18-v9-pre9.patch.bz2

As a guest kernel I used the 2.6.18 original debian source compiled on a
32bit intel (statically) machine with the
uml-freemap-usage-2.6.18.rc4.patch from
http://www.user-mode-linux.org/~blaisorblade/patches/devel-guest/uml-fremap-usage-2.6.18-rc4.patch

When I execute the guest kernel I get the error:
request_module:runaway loop modprobe binfmt-464c

I tryed to use 3 of the precompiled from nagafix and I get a
arch_switch_tls error ( 2.6.23 2.6.22 2.6.18).

Should I use a different patchset for the guest?

This is my uml command line
./linux-32.uml mem=256M umid=fruity udb0=linux_fs.32bit.ext3
udb1=swapfile noprocmm

I whould like to debug it more, can anyone tell wich debugging setting
should be applied to the host kernel and to the guest kernel?

Thanks for the time you guys are spenting on this project :)
Fruity


-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
___
User-mode-linux-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-user


Re: [uml-user] uml_mconsole and eth...

2007-11-12 Thread fru...@freaknet.org
[EMAIL PROTECTED] wrote:
> Sorry, probably my previous post was not explanatory enough.
> I think that my problem cannot be tackle tacking down eth0. Indeed, in my 
> scenario, the network interface of the "mobile node" virtual machine need to 
> be kept up for the whole time, because I want to keep alive a tcp connection 
> to the virtual machine during the eth0 handoff between a uml_switch to
> another uml_switch. Therefore, what I need is something like an instantaneous 
> handoff (the handoff has to be faster as possible).
>   
Sorry,
I think I answered to the sender other than repling on the list.

Using the tun/tap metod and creating a bridge for each tap, or one for
all, to add|remove the tap's from the bridge, should do like with a real
switch.

fruity



-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
___
User-mode-linux-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-user