Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 9508
b: refs/heads/master
c: be662a1
h: refs/heads/master
v: v3
  • Loading branch information
Paolo 'Blaisorblade' Giarrusso authored and Linus Torvalds committed Sep 30, 2005
1 parent ec0c8dc commit 56aeb37
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 4 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: 79dfa4a5a2eea5035de793b1633031750fe8d3ff
refs/heads/master: be662a18b7763496a052d489206af9ca2c2e1ac2
10 changes: 9 additions & 1 deletion trunk/arch/um/include/sysdep-i386/sigcontext.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#ifndef __SYS_SIGCONTEXT_I386_H
#define __SYS_SIGCONTEXT_I386_H

#include "uml-config.h"
#include <sysdep/sc.h>

#define IP_RESTART_SYSCALL(ip) ((ip) -= 2)
Expand All @@ -26,7 +27,14 @@
#define SC_START_SYSCALL(sc) do SC_EAX(sc) = -ENOSYS; while(0)

/* This is Page Fault */
#define SEGV_IS_FIXABLE(fi) ((fi)->trap_no == 14)
#define SEGV_IS_FIXABLE(fi) ((fi)->trap_no == 14)

/* SKAS3 has no trap_no on i386, but get_skas_faultinfo() sets it to 0. */
#ifdef UML_CONFIG_MODE_SKAS
#define SEGV_MAYBE_FIXABLE(fi) ((fi)->trap_no == 0 && ptrace_faultinfo)
#else
#define SEGV_MAYBE_FIXABLE(fi) 0
#endif

extern unsigned long *sc_sigmask(void *sc_ptr);
extern int sc_get_fpregs(unsigned long buf, void *sc_ptr);
Expand Down
5 changes: 4 additions & 1 deletion trunk/arch/um/include/sysdep-x86_64/sigcontext.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@
#define SC_START_SYSCALL(sc) do SC_RAX(sc) = -ENOSYS; while(0)

/* This is Page Fault */
#define SEGV_IS_FIXABLE(fi) ((fi)->trap_no == 14)
#define SEGV_IS_FIXABLE(fi) ((fi)->trap_no == 14)

/* No broken SKAS API, which doesn't pass trap_no, here. */
#define SEGV_MAYBE_FIXABLE(fi) 0

extern unsigned long *sc_sigmask(void *sc_ptr);

Expand Down
5 changes: 4 additions & 1 deletion trunk/arch/um/kernel/trap_kern.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
#include "mconsole_kern.h"
#include "mem.h"
#include "mem_kern.h"
#ifdef CONFIG_MODE_SKAS
#include "skas.h"
#endif

/* Note this is constrained to return 0, -EFAULT, -EACCESS, -ENOMEM by segv(). */
int handle_page_fault(unsigned long address, unsigned long ip,
Expand Down Expand Up @@ -134,7 +137,7 @@ unsigned long segv(struct faultinfo fi, unsigned long ip, int is_user, void *sc)
else if(current->mm == NULL)
panic("Segfault with no mm");

if (SEGV_IS_FIXABLE(&fi))
if (SEGV_IS_FIXABLE(&fi) || SEGV_MAYBE_FIXABLE(&fi))
err = handle_page_fault(address, ip, is_write, is_user, &si.si_code);
else {
err = -EFAULT;
Expand Down

0 comments on commit 56aeb37

Please sign in to comment.