[uml-devel] tls patch compile problem (syntax error before get_thread_area)

2006-01-08 Thread William Stearns

Good afternoon, all,
	While trying to compile 2.6.15 + Jeff's 20060107 patches, I got 
this compile error:


[EMAIL PROTECTED] linux-2.6.15-um20060107]$ make ARCH=um linux
  CHK include/linux/version.h
gcc -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing 
-fno-common -ffreestanding -Os -fno-omit-frame-pointer 
-fno-optimize-sibling-calls -g  -D__arch_um__ -DSUBARCH=\"i386\" 
-Iarch/um/include 
-I/usr/src/uml-linux/linux-2.6.15-um20060107/arch/um/include/tt 
-I/usr/src/uml-linux/linux-2.6.15-um20060107/arch/um/include/skas 
-Dvmap=kernel_vmap -Din6addr_loopback=kernel_in6addr_loopback 
-Derrno=kernel_errno -Dsigprocmask=kernel_sigprocmask -fno-unit-at-a-time 
-U__i386__ -Ui386 -march=i686 -mpreferred-stack-boundary=2 
-D_LARGEFILE64_SOURCE -Wdeclaration-after-statement -Wno-pointer-sign 
-nostdinc -isystem /usr/lib/gcc/i386-redhat-linux/4.0.2/include 
-D__KERNEL__ -Iinclude  -include include/linux/autoconf.h -S -o 
arch/um/kernel-offsets.s arch/um/sys-i386/kernel-offsets.c

  CHK arch/um/include/kern_constants.h
  CHK include/linux/compile.h
  CHK usr/initramfs_list
  CC  arch/um/os-Linux/tls.o
arch/um/os-Linux/tls.c:48: error: syntax error before 'get_thread_area'
arch/um/os-Linux/tls.c:48: warning: type defaults to 'int' in declaration 
of '_syscall1'

arch/um/os-Linux/tls.c:48: warning: function declaration isn't a prototype
arch/um/os-Linux/tls.c:48: warning: data definition has no type or storage 
class

arch/um/os-Linux/tls.c:49: error: syntax error before 'set_thread_area'
arch/um/os-Linux/tls.c:49: warning: type defaults to 'int' in declaration 
of '_syscall1'

arch/um/os-Linux/tls.c:49: warning: function declaration isn't a prototype
arch/um/os-Linux/tls.c:49: warning: data definition has no type or storage 
class
arch/um/os-Linux/tls.c:51: warning: 'struct user_desc' declared inside 
parameter list
arch/um/os-Linux/tls.c:51: warning: its scope is only this definition or 
declaration, which is probably not what you want

arch/um/os-Linux/tls.c: In function 'do_set_thread_area_tt':
arch/um/os-Linux/tls.c:55: warning: implicit declaration of function 
'set_thread_area'

arch/um/os-Linux/tls.c: At top level:
arch/um/os-Linux/tls.c:62: warning: 'struct user_desc' declared inside 
parameter list

arch/um/os-Linux/tls.c: In function 'do_get_thread_area_tt':
arch/um/os-Linux/tls.c:66: warning: implicit declaration of function 
'get_thread_area'

make[1]: *** [arch/um/os-Linux/tls.o] Error 1
make: *** [arch/um/os-Linux] Error 2

	By removing the 4 tls related patches (uml-tls-support-sc-tables, 
uml-add-tls-support, uml-add-tls-support-debug, and 
uml-add-tls-support-flush-empty) from series and reapplying, the compile 
continues past this point.  uml-clean-arch_switch also needs to be 
reverted to finish compilation.
	If it makes a difference, I'm using: gcc version 4.0.2 20051125 
(Red Hat 4.0.2-8).  Finished kernel, config, and System.map are at 
http://www.stearns.org/uml/ (linux-2.6.15-um20060107-notls-2.bz2 and 
friends).

Cheers,
- Bill

---
 "My fellow Americans. I've signed legislation that will outlaw
Russia forever. We begin bombing in five minutes."
- President Reagan, before a scheduled radio broadcast, unaware
that the microphone was already on...
(Courtesy of Brian S. Dellinger <[EMAIL PROTECTED]>)
--
William Stearns ([EMAIL PROTECTED]).  Mason, Buildkernel, freedups, p0f,
rsync-backup, ssh-keyinstall, dns-check, more at:   http://www.stearns.org
--


---
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&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 1/6] UML - Fix missing KBUILD_BASENAME

2006-01-08 Thread Jeff Dike
2.6.15-mm1 caused kernel-offsets.c to stop compiling with a syntax 
error in a header.  The problem was with KBUILD_BASENAME, which didn't 
get a definition with the by-hand compilation in the main UML Makefile.
This was OK before since the expansion was syntactically the same as the
KBUILD_BASENAME token.  With -mm1, the expansion is now a quote-delimited 
string, so there needs to be a definition of it.
Since kernel-offsets.c is basically the same as other arches'
asm-offsets.c, and those seem to build OK, this patch turns
kernel-offsets.c into asm-offsets.c.
kernel-offsets.c is in arch/um/sys-$(SUBARCH), i.e. sys-i386 and
sys-x86_64, while kbuild expects it to be in arch/um/kernel.
kernel-offsets.c is moved to
arch/um/include/sysdep-$(SUBARCH)/kernel-offsets.h, which is
included by arch/um/kernel/asm-offsets.c.  With that,
include/asm-um/asm-offsets.h is generated automatically.
kernel-offsets.h continues to exist because it needs to be
accessible to userspace UML code, and include/asm-um isn't.  So, a
symlink is made from arch/um/include/kernel-offsets.h to
include/asm-um/asm-offsets.h.

Signed-off-by: Jeff Dike <[EMAIL PROTECTED]>

Index: linux-2.6.15-mm/arch/um/Makefile
===
--- linux-2.6.15-mm.orig/arch/um/Makefile   2006-01-07 21:38:10.0 
-0500
+++ linux-2.6.15-mm/arch/um/Makefile2006-01-08 22:14:47.0 -0500
@@ -189,6 +189,12 @@ define filechk_umlconfig
sed 's/ CONFIG/ UML_CONFIG/'
 endef
 
+$(ARCH_DIR)/include/uml-config.h : include/linux/autoconf.h
+   $(call filechk,umlconfig)
+
+$(ARCH_DIR)/user-offsets.s: $(ARCH_DIR)/sys-$(SUBARCH)/user-offsets.c
+   $(CC) $(USER_CFLAGS) -S -o $@ $<
+
 define filechk_gen-asm-offsets
 (set -e; \
  echo "/*"; \
@@ -202,24 +208,13 @@ define filechk_gen-asm-offsets
  echo ""; )
 endef
 
-$(ARCH_DIR)/include/uml-config.h : include/linux/autoconf.h
-   $(call filechk,umlconfig)
-
-$(ARCH_DIR)/user-offsets.s: $(ARCH_DIR)/sys-$(SUBARCH)/user-offsets.c
-   $(CC) $(USER_CFLAGS) -S -o $@ $<
-
 $(ARCH_DIR)/include/user_constants.h: $(ARCH_DIR)/user-offsets.s
$(call filechk,gen-asm-offsets)
 
 CLEAN_FILES += $(ARCH_DIR)/user-offsets.s
 
-$(ARCH_DIR)/kernel-offsets.s: $(ARCH_DIR)/sys-$(SUBARCH)/kernel-offsets.c \
-  archprepare
-   $(CC) $(CFLAGS) $(NOSTDINC_FLAGS) $(CPPFLAGS) -S -o $@ $<
-
-$(ARCH_DIR)/include/kern_constants.h: $(ARCH_DIR)/kernel-offsets.s
-   $(call filechk,gen-asm-offsets)
-
-CLEAN_FILES += $(ARCH_DIR)/kernel-offsets.s
+$(ARCH_DIR)/include/kern_constants.h:
+   @echo '  SYMLINK $@'
+   $(Q) ln -sf ../../../include/asm-um/asm-offsets.h $@
 
 export SUBARCH USER_CFLAGS OS
Index: linux-2.6.15-mm/arch/um/include/sysdep-i386/kernel-offsets.h
===
--- /dev/null   1970-01-01 00:00:00.0 +
+++ linux-2.6.15-mm/arch/um/include/sysdep-i386/kernel-offsets.h
2006-01-08 22:16:51.0 -0500
@@ -0,0 +1,23 @@
+#include 
+#include 
+#include 
+
+#define DEFINE(sym, val) \
+   asm volatile("\n->" #sym " %0 " #val : : "i" (val))
+
+#define STR(x) #x
+#define DEFINE_STR(sym, val) asm volatile("\n->" #sym " " STR(val) " " #val: : 
)
+
+#define BLANK() asm volatile("\n->" : : )
+
+#define OFFSET(sym, str, mem) \
+   DEFINE(sym, offsetof(struct str, mem));
+
+void foo(void)
+{
+   OFFSET(HOST_TASK_DEBUGREGS, task_struct, thread.arch.debugregs);
+#ifdef CONFIG_MODE_TT
+   OFFSET(HOST_TASK_EXTERN_PID, task_struct, thread.mode.tt.extern_pid);
+#endif
+#include 
+}
Index: linux-2.6.15-mm/arch/um/include/sysdep-x86_64/kernel-offsets.h
===
--- /dev/null   1970-01-01 00:00:00.0 +
+++ linux-2.6.15-mm/arch/um/include/sysdep-x86_64/kernel-offsets.h  
2006-01-08 22:15:19.0 -0500
@@ -0,0 +1,25 @@
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#define DEFINE(sym, val) \
+   asm volatile("\n->" #sym " %0 " #val : : "i" (val))
+
+#define DEFINE_STR1(x) #x
+#define DEFINE_STR(sym, val) asm volatile("\n->" #sym " " DEFINE_STR1(val) " " 
#val: : )
+
+#define BLANK() asm volatile("\n->" : : )
+
+#define OFFSET(sym, str, mem) \
+   DEFINE(sym, offsetof(struct str, mem));
+
+void foo(void)
+{
+#ifdef CONFIG_MODE_TT
+   OFFSET(HOST_TASK_EXTERN_PID, task_struct, thread.mode.tt.extern_pid);
+#endif
+#include 
+}
Index: linux-2.6.15-mm/arch/um/kernel/asm-offsets.c
===
--- linux-2.6.15-mm.orig/arch/um/kernel/asm-offsets.c   2006-01-07 
21:38:10.0 -0500
+++ linux-2.6.15-mm/arch/um/kernel/asm-offsets.c2006-01-07 
21:38:30.0 -0500
@@ -1 +1 @@
-/* Dummy file to make kbuild happy - unused! */
+#include "sysdep/kernel-offsets.h"
Index: linux-2.6.15-mm/arch/um/sys-i386/kernel-offsets.c
===

[uml-devel] [PATCH 2/6] UML - Update Kconfig help

2006-01-08 Thread Jeff Dike
The MODE_TT help was a little outdated.  This updates it in light of the
existence of skas0 mode.
It's also turned off by default since it is mostly obsoleted by skas0 mode.

Signed-off-by: Jeff Dike <[EMAIL PROTECTED]>

Index: linux-2.6.15-mm/arch/um/Kconfig
===
--- linux-2.6.15-mm.orig/arch/um/Kconfig2006-01-06 21:05:23.0 
-0500
+++ linux-2.6.15-mm/arch/um/Kconfig 2006-01-06 23:34:46.0 -0500
@@ -35,12 +35,12 @@ menu "UML-specific options"
 
 config MODE_TT
bool "Tracing thread support"
-   default y
+   default n
help
This option controls whether tracing thread support is compiled
-   into UML.  Normally, this should be set to Y.  If you intend to
-   use only skas mode (and the host has the skas patch applied to it),
-   then it is OK to say N here.
+   into UML.  This option is largely obsolete, given that skas0 provides
+   skas security and performance without needing to patch the host.
+   It is safe to say 'N' here.
 
 config STATIC_LINK
bool "Force a static link"



---
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&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 3/6] UML - Revert compile-time option checking

2006-01-08 Thread Jeff Dike
Undo the previous no-modes patch since Adrian Bunk sent in a kbuild way
of doing the same thing.

Signed-off-by: Jeff Dike <[EMAIL PROTECTED]>

Index: linux-2.6.15-mm/arch/um/kernel/um_arch.c
===
--- linux-2.6.15-mm.orig/arch/um/kernel/um_arch.c   2006-01-06 
22:25:10.0 -0500
+++ linux-2.6.15-mm/arch/um/kernel/um_arch.c2006-01-06 23:36:39.0 
-0500
@@ -243,10 +243,6 @@ static int __init mode_tt_setup(char *li
return(0);
 }
 
-#else
-
-#error Either CONFIG_MODE_TT or CONFIG_MODE_SKAS must be enabled
-
 #endif
 #endif
 #endif



---
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&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 4/6] UML - Eliminate doubled boot output

2006-01-08 Thread Jeff Dike
CON_PRINTBUFFER was a bad idea for the mconsole console.  It causes
the boot output to be printed twice.

Signed-off-by: Jeff Dike <[EMAIL PROTECTED]>

Index: linux-2.6.15/arch/um/drivers/mconsole_kern.c
===
--- linux-2.6.15.orig/arch/um/drivers/mconsole_kern.c   2006-01-06 
20:49:21.0 -0500
+++ linux-2.6.15/arch/um/drivers/mconsole_kern.c2006-01-06 
20:49:48.0 -0500
@@ -500,7 +500,7 @@ static void console_write(struct console
 
 static struct console mc_console = { .name = "mc",
 .write = console_write,
-.flags = CON_PRINTBUFFER | CON_ENABLED,
+.flags = CON_ENABLED,
 .index = -1 };
 
 static int mc_add_console(void)



---
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&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 5/6] UML - Fix debug output on x86_64

2006-01-08 Thread Jeff Dike
The debug-stub patch was broken on x86_64 because it thinks the
frame size there is 168 words.  In reality, it is 168 bytes, and
using HOST_FRAME_SIZE, which is expressed in consistent units across
architectures, fixes this.

Signed-off-by: Jeff Dike <[EMAIL PROTECTED]>

Index: linux-2.6.15/arch/um/kernel/skas/process.c
===
--- linux-2.6.15.orig/arch/um/kernel/skas/process.c 2006-01-05 
16:19:59.0 -0500
+++ linux-2.6.15/arch/um/kernel/skas/process.c  2006-01-05 17:44:53.0 
-0500
@@ -68,7 +68,7 @@ void wait_stub_done(int pid, int sig, ch
 
 if((n < 0) || !WIFSTOPPED(status) ||
(WSTOPSIG(status) != SIGUSR1 && WSTOPSIG(status) != SIGTRAP)){
-   unsigned long regs[FRAME_SIZE];
+   unsigned long regs[HOST_FRAME_SIZE];
if(ptrace(PTRACE_GETREGS, pid, 0, regs) < 0)
printk("Failed to get registers from stub, "
   "errno = %d\n", errno);
@@ -76,7 +76,7 @@ void wait_stub_done(int pid, int sig, ch
int i;
 
printk("Stub registers -\n");
-   for(i = 0; i < FRAME_SIZE; i++)
+   for(i = 0; i < HOST_FRAME_SIZE; i++)
printk("\t%d - %lx\n", i, regs[i]);
}
 panic("%s : failed to wait for SIGUSR1/SIGTRAP, "



---
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&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 6/6] UML - Kill an unused variable

2006-01-08 Thread Jeff Dike
The HDIO_GETGEO patch left an unused variable in the UML block
driver.  This gets rid of it.

Signed-off-by: Jeff Dike <[EMAIL PROTECTED]>

Index: linux-2.6.15-mm/arch/um/drivers/ubd_kern.c
===
--- linux-2.6.15-mm.orig/arch/um/drivers/ubd_kern.c 2006-01-06 
21:05:23.0 -0500
+++ linux-2.6.15-mm/arch/um/drivers/ubd_kern.c  2006-01-08 09:33:13.0 
-0500
@@ -1073,7 +1073,6 @@ static int ubd_getgeo(struct block_devic
 static int ubd_ioctl(struct inode * inode, struct file * file,
 unsigned int cmd, unsigned long arg)
 {
-   struct hd_geometry __user *loc = (struct hd_geometry __user *) arg;
struct ubd *dev = inode->i_bdev->bd_disk->private_data;
struct hd_driveid ubd_id = {
.cyls   = 0,



---
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&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