mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-16 13:34:30 +00:00
um: remove fault_catcher infrastructure
This was perhaps intended to do _nofault copies, but the real reason is lost to history. Remove this, it's not needed, and using longjmp() out of the middle of the signal handler with all the state it has modified is not going to be a good idea anyway. Link: https://patch.msgid.link/20241010224513.901c4d390b3e.Ia74742668b44603c1ca23dd36f90e964e6e7ee55@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
parent
031acdcfb5
commit
188b64f288
@ -22,8 +22,6 @@ struct mm_struct;
|
|||||||
struct thread_struct {
|
struct thread_struct {
|
||||||
struct pt_regs regs;
|
struct pt_regs regs;
|
||||||
struct pt_regs *segv_regs;
|
struct pt_regs *segv_regs;
|
||||||
void *fault_addr;
|
|
||||||
jmp_buf *fault_catcher;
|
|
||||||
struct task_struct *prev_sched;
|
struct task_struct *prev_sched;
|
||||||
struct arch_thread arch;
|
struct arch_thread arch;
|
||||||
jmp_buf switch_buf;
|
jmp_buf switch_buf;
|
||||||
@ -38,7 +36,6 @@ struct thread_struct {
|
|||||||
#define INIT_THREAD \
|
#define INIT_THREAD \
|
||||||
{ \
|
{ \
|
||||||
.regs = EMPTY_REGS, \
|
.regs = EMPTY_REGS, \
|
||||||
.fault_addr = NULL, \
|
|
||||||
.prev_sched = NULL, \
|
.prev_sched = NULL, \
|
||||||
.arch = INIT_ARCH_THREAD, \
|
.arch = INIT_ARCH_THREAD, \
|
||||||
.request = { } \
|
.request = { } \
|
||||||
|
@ -60,7 +60,6 @@ extern unsigned long from_irq_stack(int nested);
|
|||||||
extern int singlestepping(void);
|
extern int singlestepping(void);
|
||||||
|
|
||||||
extern void segv_handler(int sig, struct siginfo *unused_si, struct uml_pt_regs *regs);
|
extern void segv_handler(int sig, struct siginfo *unused_si, struct uml_pt_regs *regs);
|
||||||
extern void bus_handler(int sig, struct siginfo *si, struct uml_pt_regs *regs);
|
|
||||||
extern void winch(int sig, struct siginfo *unused_si, struct uml_pt_regs *regs);
|
extern void winch(int sig, struct siginfo *unused_si, struct uml_pt_regs *regs);
|
||||||
extern void fatal_sigsegv(void) __attribute__ ((noreturn));
|
extern void fatal_sigsegv(void) __attribute__ ((noreturn));
|
||||||
|
|
||||||
|
@ -201,7 +201,6 @@ void segv_handler(int sig, struct siginfo *unused_si, struct uml_pt_regs *regs)
|
|||||||
unsigned long segv(struct faultinfo fi, unsigned long ip, int is_user,
|
unsigned long segv(struct faultinfo fi, unsigned long ip, int is_user,
|
||||||
struct uml_pt_regs *regs)
|
struct uml_pt_regs *regs)
|
||||||
{
|
{
|
||||||
jmp_buf *catcher;
|
|
||||||
int si_code;
|
int si_code;
|
||||||
int err;
|
int err;
|
||||||
int is_write = FAULT_WRITE(fi);
|
int is_write = FAULT_WRITE(fi);
|
||||||
@ -246,15 +245,8 @@ unsigned long segv(struct faultinfo fi, unsigned long ip, int is_user,
|
|||||||
address = 0;
|
address = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
catcher = current->thread.fault_catcher;
|
|
||||||
if (!err)
|
if (!err)
|
||||||
goto out;
|
goto out;
|
||||||
else if (catcher != NULL) {
|
|
||||||
current->thread.fault_addr = (void *) address;
|
|
||||||
UML_LONGJMP(catcher, 1);
|
|
||||||
}
|
|
||||||
else if (current->thread.fault_addr != NULL)
|
|
||||||
panic("fault_addr set but no fault catcher");
|
|
||||||
else if (!is_user && arch_fixup(ip, regs))
|
else if (!is_user && arch_fixup(ip, regs))
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
@ -310,14 +302,6 @@ void relay_signal(int sig, struct siginfo *si, struct uml_pt_regs *regs)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void bus_handler(int sig, struct siginfo *si, struct uml_pt_regs *regs)
|
|
||||||
{
|
|
||||||
if (current->thread.fault_catcher != NULL)
|
|
||||||
UML_LONGJMP(current->thread.fault_catcher, 1);
|
|
||||||
else
|
|
||||||
relay_signal(sig, si, regs);
|
|
||||||
}
|
|
||||||
|
|
||||||
void winch(int sig, struct siginfo *unused_si, struct uml_pt_regs *regs)
|
void winch(int sig, struct siginfo *unused_si, struct uml_pt_regs *regs)
|
||||||
{
|
{
|
||||||
do_IRQ(WINCH_IRQ, regs);
|
do_IRQ(WINCH_IRQ, regs);
|
||||||
|
@ -26,7 +26,7 @@ void (*sig_info[NSIG])(int, struct siginfo *, struct uml_pt_regs *) = {
|
|||||||
[SIGFPE] = relay_signal,
|
[SIGFPE] = relay_signal,
|
||||||
[SIGILL] = relay_signal,
|
[SIGILL] = relay_signal,
|
||||||
[SIGWINCH] = winch,
|
[SIGWINCH] = winch,
|
||||||
[SIGBUS] = bus_handler,
|
[SIGBUS] = relay_signal,
|
||||||
[SIGSEGV] = segv_handler,
|
[SIGSEGV] = segv_handler,
|
||||||
[SIGIO] = sigio_handler,
|
[SIGIO] = sigio_handler,
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user