Skip to contentSkip to conversation

PATCH [02/03]: eliminate skas_ptrace.h

uml-devel Nix 2 participants 5 messages Nov 26, 2006 – Dec 7, 2006

Subsystems (2)
lore
Share & tools
lore

Nix

author
#0 lore raw

This diff removes references to the conflicting-with-kernel-headers skas_ptrace.h, and moves skas_ptrace.h into the um header tree. There are still some trees (PPC, IA64) with a copy of a skas_ptrace.h left and without ptrace-skas.h broken off from ptrace.h: these may be broken by this change, but I can't test them so I can't tell.

 arch/um/include/sysdep-i386/skas_ptrace.h   |   22 --------------------
 arch/um/include/sysdep-x86_64/skas_ptrace.h |   22 --------------------
 arch/um/kernel/ptrace.c                     |    2 +-
 arch/um/os-Linux/process.c                  |    2 +-
 arch/um/os-Linux/skas/process.c             |    2 +-
 arch/um/os-Linux/start_up.c                 |    2 +-
 arch/um/sys-i386/ldt.c                      |    2 +-
 include/asm-i386/Kbuild                     |    1 +
 include/asm-i386/ptrace-skas.h              |   29 +++++++++++++++++++++++++++
 include/asm-um/ptrace-skas.h                |   29 +++++++++++++++++++++++++++
 include/asm-x86_64/Kbuild                   |    1 +
 include/asm-x86_64/ptrace-skas.h            |   27 +++++++++++++++++++++++++
 include/asm-x86_64/ptrace.h                 |    2 ++
 13 files changed, 94 insertions(+), 49 deletions(-)
arch/um/include/sysdep-i386/skas_ptrace.h deleted +0 -22
deleted file mode 100644
index e27b8a7..0000000
@@ -1,22 +0,0 @@
-/*
- * Copyright (C) 2000, 2001, 2002 Jeff Dike ([email protected])
- * Licensed under the GPL
- */
-
-#ifndef __SYSDEP_I386_SKAS_PTRACE_H
-#define __SYSDEP_I386_SKAS_PTRACE_H
-
-struct ptrace_faultinfo {
-        int is_write;
-        unsigned long addr;
-};
-
-struct ptrace_ldt {
-        int func;
-        void *ptr;
-        unsigned long bytecount;
-};
-
-#define PTRACE_LDT 54
-
-#endif
arch/um/include/sysdep-x86_64/skas_ptrace.h deleted +0 -22
deleted file mode 100644
index 95db4be..0000000
@@ -1,22 +0,0 @@
-/*
- * Copyright (C) 2000, 2001, 2002 Jeff Dike ([email protected])
- * Licensed under the GPL
- */
-
-#ifndef __SYSDEP_X86_64_SKAS_PTRACE_H
-#define __SYSDEP_X86_64_SKAS_PTRACE_H
-
-struct ptrace_faultinfo {
-        int is_write;
-        unsigned long addr;
-};
-
-struct ptrace_ldt {
-        int func;
-        void *ptr;
-        unsigned long bytecount;
-};
-
-#define PTRACE_LDT 54
-
-#endif
arch/um/kernel/ptrace.c +1 -1
index 9a77fb3..8c003e5 100644
@@ -14,9 +14,9 @@
 #include "linux/proc_mm.h"
 #endif
 #include "asm/ptrace.h"
+#include "asm/ptrace-skas.h"
 #include "asm/uaccess.h"
 #include "kern_util.h"
-#include "skas_ptrace.h"
 #include "sysdep/ptrace.h"
 
 static inline void set_singlestepping(struct task_struct *child, int on)
arch/um/os-Linux/process.c +1 -1
index c8bf772..1ae1795 100644
@@ -12,6 +12,7 @@
 #include <sys/mman.h>
 #include <sys/wait.h>
 #include <sys/mman.h>
+#include <asm/ptrace-skas.h>
 #include "ptrace_user.h"
 #include "os.h"
 #include "user.h"
@@ -20,7 +21,6 @@
 #include "irq_user.h"
 #include "kern_util.h"
 #include "longjmp.h"
-#include "skas_ptrace.h"
 #include "kern_constants.h"
 
 #define ARBITRARY_ADDR -1
arch/um/os-Linux/skas/process.c +1 -1
index 7baf90f..4cf9387 100644
@@ -17,6 +17,7 @@
 #include <sys/time.h>
 #include <asm/unistd.h>
 #include <asm/types.h>
+#include <asm/ptrace-skas.h>
 #include "user.h"
 #include "sysdep/ptrace.h"
 #include "user_util.h"
@@ -28,7 +29,6 @@
 #include "sysdep/stub.h"
 #include "os.h"
 #include "proc_mm.h"
-#include "skas_ptrace.h"
 #include "chan_user.h"
 #include "registers.h"
 #include "mem.h"
arch/um/os-Linux/start_up.c +1 -1
index 5031485..46c2410 100644
@@ -40,7 +40,7 @@
 
 #ifdef UML_CONFIG_MODE_SKAS
 #include "skas.h"
-#include "skas_ptrace.h"
+#include <asm/ptrace-skas.h>
 #include "registers.h"
 #endif
 
arch/um/sys-i386/ldt.c +1 -1
index fe0877b..b50c8b5 100644
@@ -87,7 +87,7 @@ out:
 #ifdef CONFIG_MODE_SKAS
 
 #include "skas.h"
-#include "skas_ptrace.h"
+#include "asm/ptrace-skas.h"
 #include "asm/mmu_context.h"
 #include "proc_mm.h"
 
include/asm-i386/Kbuild +1 -0
index b75a348..03f1fa1 100644
@@ -8,3 +8,4 @@ header-y += ucontext.h
 unifdef-y += mtrr.h
 unifdef-y += setup.h
 unifdef-y += vm86.h
+unifdef-y += ptrace-skas.h
include/asm-i386/ptrace-skas.h new file +29 -0
new file mode 100644
index 0000000..6842650
@@ -0,0 +1,29 @@
+#ifndef _I386_PTRACE_SKAS_H
+#define _I386_PTRACE_SKAS_H
+
+/*For SKAS3 support.*/
+
+#define PTRACE_FAULTINFO	  52
+/* 53 was used for PTRACE_SIGPENDING, don't reuse it. */
+#define PTRACE_LDT		  54
+#define PTRACE_SWITCH_MM 	  55
+#define PTRACE_EX_FAULTINFO	  56
+
+struct ptrace_faultinfo {
+	int is_write;
+	unsigned long addr;
+};
+
+struct ptrace_ex_faultinfo {
+	int is_write;
+	unsigned long addr;
+	int trap_no;
+};
+
+struct ptrace_ldt {
+	int func;
+  	void *ptr;
+	unsigned long bytecount;
+};
+
+#endif
include/asm-um/ptrace-skas.h new file +29 -0
new file mode 100644
index 0000000..2c54ac2
@@ -0,0 +1,29 @@
+#ifndef _UM_PTRACE_SKAS_H
+#define _UM_PTRACE_SKAS_H
+
+/*For SKAS3 support.*/
+
+#define PTRACE_FAULTINFO	  52
+/* 53 was used for PTRACE_SIGPENDING, don't reuse it. */
+#define PTRACE_LDT		  54
+#define PTRACE_SWITCH_MM 	  55
+#define PTRACE_EX_FAULTINFO	  56
+
+struct ptrace_faultinfo {
+	int is_write;
+	unsigned long addr;
+};
+
+struct ptrace_ex_faultinfo {
+	int is_write;
+	unsigned long addr;
+	int trap_no;
+};
+
+struct ptrace_ldt {
+	int func;
+  	void *ptr;
+	unsigned long bytecount;
+};
+
+#endif
include/asm-x86_64/Kbuild +1 -0
index 40f2f13..d49d004 100644
@@ -19,3 +19,4 @@ header-y += vsyscall32.h
 unifdef-y += mce.h
 unifdef-y += mtrr.h
 unifdef-y += vsyscall.h
+unifdef-y += ptrace-skas.h
include/asm-x86_64/ptrace-skas.h new file +27 -0
new file mode 100644
index 0000000..7f8ac4b
@@ -0,0 +1,27 @@
+#ifndef _X86_64_PTRACE_SKAS_H
+#define _X86_64_PTRACE_SKAS_H
+
+#define PTRACE_FAULTINFO 52
+/* 53 was used for PTRACE_SIGPENDING, don't reuse it. */
+#define PTRACE_LDT 54
+#define PTRACE_SWITCH_MM 55
+#define PTRACE_EX_FAULTINFO	  56
+
+struct ptrace_faultinfo {
+	int is_write;
+	unsigned long addr;
+};
+
+struct ptrace_ex_faultinfo {
+	int is_write;
+	unsigned long addr;
+	int trap_no;
+};
+
+struct ptrace_ldt {
+	int func;
+  	void *ptr;
+	unsigned long bytecount;
+};
+
+#endif
include/asm-x86_64/ptrace.h +2 -0
index ca6f15f..171bfbd 100644
@@ -66,6 +66,8 @@ struct pt_regs {
 
 #endif
 
+#include <asm/ptrace-skas.h>
+
 /* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */
 #define PTRACE_GETREGS            12
 #define PTRACE_SETREGS            13
Signature · 12 lines
`The main high-level difference between Emacs and (say) UNIX, Windows,
 or BeOS... is that Emacs boots quicker.' --- PdS

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
User-mode-linux-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
#1 lore raw
Quoted 3 lines · Nix

This diff removes references to the conflicting-with-kernel-headers skas_ptrace.h, and moves skas_ptrace.h into the um header tree.

Unaccurate - you move skas_ptrace.h into include/asm-i386, right?

Quoted 4 lines

There are still some trees (PPC, IA64) with a copy of a skas_ptrace.h left and without ptrace-skas.h broken off from ptrace.h: these may be broken by this change, but I can't test them so I can't tell.

This change is plain wrong this way, if my reasoning is correct.

arch/um/os-Linux/start_up.o is in USER_OBJS, so it is compiled against host headers.
You cannot _depend_ on them including the SKAS patch, as I said. And that header is in arch/um/include to be includable by both kernelspace and userspace files...

Signature · 16 lines
Inform me of my mistakes, so I can add them to my list!
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 


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
User-mode-linux-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
author
#2 lore raw

On 29 Nov 2006, [email protected] uttered the following:

Quoted 5 lines · Nix
Quoted 3 lines

This diff removes references to the conflicting-with-kernel-headers skas_ptrace.h, and moves skas_ptrace.h into the um header tree.

Unaccurate - you move skas_ptrace.h into include/asm-i386, right?

Gah. Yes. Sorry, brainfart.

Quoted 11 lines
Quoted 4 lines

There are still some trees (PPC, IA64) with a copy of a skas_ptrace.h left and without ptrace-skas.h broken off from ptrace.h: these may be broken by this change, but I can't test them so I can't tell.

This change is plain wrong this way, if my reasoning is correct.

arch/um/os-Linux/start_up.o is in USER_OBJS, so it is compiled against host headers.
You cannot _depend_ on them including the SKAS patch, as I said. And that header is in arch/um/include to be includable by both kernelspace and userspace files...

Oh, hell, true. The problem is that we'll have to cater for people who *have* included the skas headers, including the old ones...

... fixed patch coming in a bit (shopping and 2.6.19 upgrade first).

Signature · 12 lines
`The main high-level difference between Emacs and (say) UNIX, Windows,
 or BeOS... is that Emacs boots quicker.' --- PdS

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
User-mode-linux-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
author
#3 lore raw

On 1 Dec 2006, [email protected] uttered the following:

Quoted 9 lines

On 29 Nov 2006, [email protected] uttered the following:

Quoted 5 lines

arch/um/os-Linux/start_up.o is in USER_OBJS, so it is compiled against host headers.
You cannot _depend_ on them including the SKAS patch, as I said. And that header is in arch/um/include to be includable by both kernelspace and userspace files...

Oh, hell, true. The problem is that we'll have to cater for people who *have* included the skas headers, including the old ones...

No we won't: kernel building includes things from the Linux source tree's includes directory, not /usr/include/asm, so what people have in /usr/include/asm/ptrace.h should be irrelevant.

(I have now reproduced this failure both with and without the skas patch in the headers installed via `make headers_install'.)

Or is it that userspace stuff includes /usr/include/asm/*, kernelspace stuff includes include/asm-{whatever} from the kernel tree, but nothing includes both, so we need *some* things in some third location where both can see them?

(If that's so, I don't see how my patch built at all. Hm.)

Signature · 12 lines
`The main high-level difference between Emacs and (say) UNIX, Windows,
 or BeOS... is that Emacs boots quicker.' --- PdS

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
User-mode-linux-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
#4 lore raw
Quoted 8 lines · Nix

On 1 Dec 2006, [email protected] uttered the following:

Quoted 7 lines

On 29 Nov 2006, [email protected] uttered the following:

Quoted 5 lines

arch/um/os-Linux/start_up.o is in USER_OBJS, so it is compiled against host headers.
You cannot _depend_ on them including the SKAS patch, as I said. And that header is in arch/um/include to be includable by both kernelspace and userspace files...

Quoted 6 lines
Quoted 2 lines

Oh, hell, true. The problem is that we'll have to cater for people who *have* included the skas headers, including the old ones...

No we won't: kernel building includes things from the Linux source tree's includes directory, not /usr/include/asm, so what people have in /usr/include/asm/ptrace.h should be irrelevant.

For userspace files there's anyway a problem, since they _do_ use /usr/include/asm/ptrace.h .

Quoted 7 lines

(I have now reproduced this failure both with and without the skas patch in the headers installed via `make headers_install'.)

Or is it that userspace stuff includes /usr/include/asm/*, kernelspace stuff includes include/asm-{whatever} from the kernel tree, but nothing includes both, so we need *some* things in some third location where both can see them?

Exactly, the third location is arch/um/include for UML (it must be used for things needed only by userspace files, but is also used for some things which would be in include/asm-um).

Quoted 1 line

(If that's so, I don't see how my patch built at all. Hm.)

Bad dependency tracking ? I doubt that however...

Signature · 16 lines
Inform me of my mistakes, so I can add them to my list!
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 


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
User-mode-linux-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel