/* $Id: paccess.h,v 1.1 2000/01/20 22:50:32 ralf Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. * * Copyright (C) 1996, 1997, 1998, 1999, 2000 by Ralf Baechle * Copyright (C) 1999, 2000 Silicon Graphics, Inc. * * Protected memory access. Used for everything that might take revenge * by sending a DBE error like accessing possibly non-existant memory or * devices. */ #ifndef _ASM_PACCESS_H #define _ASM_PACCESS_H #include #define put_dbe(x,ptr) __put_dbe((x),(ptr),sizeof(*(ptr))) #define get_dbe(x,ptr) __get_dbe((x),(ptr),sizeof(*(ptr))) struct __large_pstruct { unsigned long buf[100]; }; #define __m(x) (*(struct __large_pstruct *)(x)) #define __get_dbe(x,ptr,size) ({ \ long __gu_err; \ __typeof(*(ptr)) __gu_val; \ long __gu_addr; \ __asm__("":"=r" (__gu_val)); \ __gu_addr = (long) (ptr); \ __asm__("":"=r" (__gu_err)); \ switch (size) { \ case 1: __get_dbe_asm("lb"); break; \ case 2: __get_dbe_asm("lh"); break; \ case 4: __get_dbe_asm("lw"); break; \ case 8: __get_dbe_asm("ld"); break; \ default: __get_dbe_unknown(); break; \ } x = (__typeof__(*(ptr))) __gu_val; __gu_err; }) #define __get_dbe_asm(insn) \ ({ \ __asm__ __volatile__( \ "1:\t" insn "\t%1,%2\n\t" \ "move\t%0,$0\n" \ "2:\n\t" \ ".section\t.fixup,\"ax\"\n" \ "3:\tli\t%0,%3\n\t" \ "move\t%1,$0\n\t" \ "j\t2b\n\t" \ ".previous\n\t" \ ".section\t__dbe_table,\"a\"\n\t" \ ".dword\t1b,3b\n\t" \ ".previous" \ :"=r" (__gu_err), "=r" (__gu_val) \ :"o" (__m(__gu_addr)), "i" (-EFAULT)); }) extern void __get_dbe_unknown(void); #define __put_dbe(x,ptr,size) ({ \ long __pu_err; \ __typeof__(*(ptr)) __pu_val; \ long __pu_addr; \ __pu_val = (x); \ __pu_addr = (long) (ptr); \ __asm__("":"=r" (__pu_err)); \ switch (size) { \ case 1: __put_dbe_asm("sb"); break; \ case 2: __put_dbe_asm("sh"); break; \ case 4: __put_dbe_asm("sw"); break; \ case 8: __put_dbe_asm("sd"); break; \ default: __put_dbe_unknown(); break; \ } __pu_err; }) #define __put_dbe_asm(insn) \ ({ \ __asm__ __volatile__( \ "1:\t" insn "\t%1,%2\n\t" \ "move\t%0,$0\n" \ "2:\n\t" \ ".section\t.fixup,\"ax\"\n" \ "3:\tli\t%0,%3\n\t" \ "j\t2b\n\t" \ ".previous\n\t" \ ".section\t__dbe_table,\"a\"\n\t" \ ".dword\t1b,3b\n\t" \ ".previous" \ :"=r" (__pu_err) \ :"r" (__pu_val), "o" (__m(__pu_addr)), "i" (-EFAULT)); }) extern void __put_dbe_unknown(void); #endif /* _ASM_PACCESS_H */ 743b9a01810fb32cb65d0ec5d60b'>commitdiffstats
diff options
context:
space:
mode:
authorAndy Lutomirski <luto@amacapital.net>2014-11-21 13:26:07 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2014-11-23 14:25:28 -0800
commit82975bc6a6df743b9a01810fb32cb65d0ec5d60b (patch)
treeb5a5b092dcd8420d9f72bf66be2e6544a5622040
parent90e362f4a75d0911ca75e5cd95591a6cf1f169dc (diff)
uprobes, x86: Fix _TIF_UPROBE vs _TIF_NOTIFY_RESUME
x86 call do_notify_resume on paranoid returns if TIF_UPROBE is set but not on non-paranoid returns. I suspect that this is a mistake and that the code only works because int3 is paranoid. Setting _TIF_NOTIFY_RESUME in the uprobe code was probably a workaround for the x86 bug. With that bug fixed, we can remove _TIF_NOTIFY_RESUME from the uprobes code. Reported-by: Oleg Nesterov <oleg@redhat.com> Acked-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com> Acked-by: Borislav Petkov <bp@suse.de> Signed-off-by: Andy Lutomirski <luto@amacapital.net> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>