-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PATCH] uml: S390 preparation, abstract host page fault data
This patch removes the arch-specific fault/trap-infos from thread and skas-regs. It adds a new struct faultinfo, that is arch-specific defined in sysdep/faultinfo.h. The structure is inserted in thread.arch and thread.regs.skas and thread.regs.tt Now, segv and other trap-handlers can copy the contents from regs.X.faultinfo to thread.arch.faultinfo with one simple assignment. Also, the number of macros necessary is reduced to FAULT_ADDRESS(struct faultinfo) extracts the faulting address from faultinfo FAULT_WRITE(struct faultinfo) extracts the "is_write" flag SEGV_IS_FIXABLE(struct faultinfo) is true for the fixable segvs, i.e. (TRAP == 14) on i386 UPT_FAULTINFO(regs) result is (struct faultinfo *) to the faultinfo in regs->skas.faultinfo GET_FAULTINFO_FROM_SC(struct faultinfo, struct sigcontext *) copies the relevant parts of the sigcontext to struct faultinfo. On SIGSEGV, call user_signal() instead of handle_segv(), if the architecture provides the information needed in PTRACE_FAULTINFO, or if PTRACE_FAULTINFO is missing, because segv-stub will provide the info. The benefit of the change is, that in case of a non-fixable SIGSEGV, we can give user processes a SIGSEGV, instead of possibly looping on pagefault handling. Since handle_segv() sikked arch_fixup() implicitly by passing ip==0 to segv(), I changed segv() to call arch_fixup() only, if !is_user. Signed-off-by: Bodo Stroesser <bstroesser@fujitsu-siemens.com> Signed-off-by: Jeff Dike <jdike@addtoit.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
- Loading branch information
Bodo Stroesser
authored and
Linus Torvalds
committed
May 5, 2005
1 parent
ea66e8a
commit c578455
Showing
24 changed files
with
279 additions
and
115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
* Copyright (C) 2004 Fujitsu Siemens Computers GmbH | ||
* Author: Bodo Stroesser <bstroesser@fujitsu-siemens.com> | ||
* Licensed under the GPL | ||
*/ | ||
|
||
#ifndef __FAULTINFO_I386_H | ||
#define __FAULTINFO_I386_H | ||
|
||
/* this structure contains the full arch-specific faultinfo | ||
* from the traps. | ||
* On i386, ptrace_faultinfo unfortunately doesn't provide | ||
* all the info, since trap_no is missing. | ||
* All common elements are defined at the same position in | ||
* both structures, thus making it easy to copy the | ||
* contents without knowledge about the structure elements. | ||
*/ | ||
struct faultinfo { | ||
int error_code; /* in ptrace_faultinfo misleadingly called is_write */ | ||
unsigned long cr2; /* in ptrace_faultinfo called addr */ | ||
int trap_no; /* missing in ptrace_faultinfo */ | ||
}; | ||
|
||
#define FAULT_WRITE(fi) ((fi).error_code & 2) | ||
#define FAULT_ADDRESS(fi) ((fi).cr2) | ||
|
||
#define PTRACE_FULL_FAULTINFO 0 | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* | ||
* Copyright (C) 2000, 2001, 2002 Jeff Dike (jdike@karaya.com) | ||
* 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* | ||
* Copyright (C) 2000, 2001, 2002 Jeff Dike (jdike@karaya.com) | ||
* Licensed under the GPL | ||
*/ | ||
|
||
#ifndef __SYSDEP_IA64_SKAS_PTRACE_H | ||
#define __SYSDEP_IA64_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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* | ||
* Copyright (C) 2000, 2001, 2002 Jeff Dike (jdike@karaya.com) | ||
* Licensed under the GPL | ||
*/ | ||
|
||
#ifndef __SYSDEP_PPC_SKAS_PTRACE_H | ||
#define __SYSDEP_PPC_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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
* Copyright (C) 2004 Fujitsu Siemens Computers GmbH | ||
* Author: Bodo Stroesser <bstroesser@fujitsu-siemens.com> | ||
* Licensed under the GPL | ||
*/ | ||
|
||
#ifndef __FAULTINFO_X86_64_H | ||
#define __FAULTINFO_X86_64_H | ||
|
||
/* this structure contains the full arch-specific faultinfo | ||
* from the traps. | ||
* On i386, ptrace_faultinfo unfortunately doesn't provide | ||
* all the info, since trap_no is missing. | ||
* All common elements are defined at the same position in | ||
* both structures, thus making it easy to copy the | ||
* contents without knowledge about the structure elements. | ||
*/ | ||
struct faultinfo { | ||
int error_code; /* in ptrace_faultinfo misleadingly called is_write */ | ||
unsigned long cr2; /* in ptrace_faultinfo called addr */ | ||
int trap_no; /* missing in ptrace_faultinfo */ | ||
}; | ||
|
||
#define FAULT_WRITE(fi) ((fi).error_code & 2) | ||
#define FAULT_ADDRESS(fi) ((fi).cr2) | ||
|
||
#define PTRACE_FULL_FAULTINFO 1 | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* | ||
* Copyright (C) 2000, 2001, 2002 Jeff Dike (jdike@karaya.com) | ||
* 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.