diff options
| author | Jiri Kosina <jkosina@suse.cz> | 2011-09-15 15:08:05 +0200 | 
|---|---|---|
| committer | Jiri Kosina <jkosina@suse.cz> | 2011-09-15 15:08:18 +0200 | 
| commit | e060c38434b2caa78efe7cedaff4191040b65a15 (patch) | |
| tree | 407361230bf6733f63d8e788e4b5e6566ee04818 /arch/x86/include/asm/ptrace.h | |
| parent | 10e4ac572eeffe5317019bd7330b6058a400dfc2 (diff) | |
| parent | cc39c6a9bbdebfcf1a7dee64d83bf302bc38d941 (diff) | |
| download | olio-linux-3.10-e060c38434b2caa78efe7cedaff4191040b65a15.tar.xz olio-linux-3.10-e060c38434b2caa78efe7cedaff4191040b65a15.zip  | |
Merge branch 'master' into for-next
Fast-forward merge with Linus to be able to merge patches
based on more recent version of the tree.
Diffstat (limited to 'arch/x86/include/asm/ptrace.h')
| -rw-r--r-- | arch/x86/include/asm/ptrace.h | 19 | 
1 files changed, 19 insertions, 0 deletions
diff --git a/arch/x86/include/asm/ptrace.h b/arch/x86/include/asm/ptrace.h index 94e7618fcac..35664547125 100644 --- a/arch/x86/include/asm/ptrace.h +++ b/arch/x86/include/asm/ptrace.h @@ -131,6 +131,9 @@ struct pt_regs {  #ifdef __KERNEL__  #include <linux/init.h> +#ifdef CONFIG_PARAVIRT +#include <asm/paravirt_types.h> +#endif  struct cpuinfo_x86;  struct task_struct; @@ -187,6 +190,22 @@ static inline int v8086_mode(struct pt_regs *regs)  #endif  } +#ifdef CONFIG_X86_64 +static inline bool user_64bit_mode(struct pt_regs *regs) +{ +#ifndef CONFIG_PARAVIRT +	/* +	 * On non-paravirt systems, this is the only long mode CPL 3 +	 * selector.  We do not allow long mode selectors in the LDT. +	 */ +	return regs->cs == __USER_CS; +#else +	/* Headers are too twisted for this to go in paravirt.h. */ +	return regs->cs == __USER_CS || regs->cs == pv_info.extra_user_64bit_cs; +#endif +} +#endif +  /*   * X86_32 CPUs don't save ss and esp if the CPU is already in kernel mode   * when it traps.  The previous stack will be directly underneath the saved  |