Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 78
b: refs/heads/master
c: f1290ec
h: refs/heads/master
v: v3
  • Loading branch information
Andi Kleen authored and Linus Torvalds committed Apr 16, 2005
1 parent 39c7421 commit e1b26e5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e502cdd63de666832b3b65017bb607c22d2868de
refs/heads/master: f1290ec93e5da4a748ca4758a00b580283e06596
12 changes: 5 additions & 7 deletions trunk/arch/x86_64/mm/fault.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,21 +62,19 @@ void bust_spinlocks(int yes)
static noinline int is_prefetch(struct pt_regs *regs, unsigned long addr,
unsigned long error_code)
{
unsigned char *instr = (unsigned char *)(regs->rip);
unsigned char *instr;
int scan_more = 1;
int prefetch = 0;
unsigned char *max_instr = instr + 15;
unsigned char *max_instr;

/* If it was a exec fault ignore */
if (error_code & (1<<4))
return 0;

/* Code segments in LDT could have a non zero base. Don't check
when that's possible */
if (regs->cs & (1<<2))
return 0;
instr = (unsigned char *)convert_rip_to_linear(current, regs);
max_instr = instr + 15;

if ((regs->cs & 3) != 0 && regs->rip >= TASK_SIZE)
if ((regs->cs & 3) != 0 && instr >= (unsigned char *)TASK_SIZE)
return 0;

while (scan_more && instr < max_instr) {
Expand Down
5 changes: 5 additions & 0 deletions trunk/include/asm-x86_64/ptrace.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@ struct pt_regs {
extern unsigned long profile_pc(struct pt_regs *regs);
void signal_fault(struct pt_regs *regs, void __user *frame, char *where);

struct task_struct;

extern unsigned long
convert_rip_to_linear(struct task_struct *child, struct pt_regs *regs);

enum {
EF_CF = 0x00000001,
EF_PF = 0x00000004,
Expand Down

0 comments on commit e1b26e5

Please sign in to comment.