execve: Clear sigaltstack and fp_regs
Fujitsu: POSTK_DEBUG_TEMP_FIX_19 Refs: #976 Change-Id: I16895eab13eecbb47b7e6da961fae82ee5e570ee
This commit is contained in:
@@ -829,4 +829,10 @@ void proc_init(void);
|
||||
void set_timer(void);
|
||||
struct sig_pending *hassigpending(struct thread *thread);
|
||||
|
||||
void release_fp_regs(struct thread *proc);
|
||||
void save_fp_regs(struct thread *proc);
|
||||
void copy_fp_regs(struct thread *from, struct thread *to);
|
||||
void restore_fp_regs(struct thread *proc);
|
||||
void clear_fp_regs(void);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -77,10 +77,6 @@ static int vm_range_insert(struct process_vm *vm,
|
||||
static struct vm_range *vm_range_find(struct process_vm *vm,
|
||||
unsigned long addr);
|
||||
static int copy_user_ranges(struct process_vm *vm, struct process_vm *orgvm);
|
||||
extern void release_fp_regs(struct thread *proc);
|
||||
extern void save_fp_regs(struct thread *proc);
|
||||
extern void copy_fp_regs(struct thread *from, struct thread *to);
|
||||
extern void restore_fp_regs(struct thread *proc);
|
||||
extern void __runq_add_proc(struct thread *proc, int cpu_id);
|
||||
extern void terminate_host(int pid);
|
||||
extern void lapic_timer_enable(unsigned int clocks);
|
||||
@@ -2947,6 +2943,9 @@ void sched_init(void)
|
||||
INIT_LIST_HEAD(&cpu_local_var(migq));
|
||||
ihk_mc_spinlock_init(&cpu_local_var(migq_lock));
|
||||
|
||||
// to save default fpregs
|
||||
save_fp_regs(idle_thread);
|
||||
|
||||
#ifdef TIMER_CPU_ID
|
||||
if (ihk_mc_get_processor_id() == TIMER_CPU_ID) {
|
||||
init_timers();
|
||||
|
||||
@@ -2129,10 +2129,6 @@ static void munmap_all(void)
|
||||
return;
|
||||
} /* munmap_all() */
|
||||
|
||||
#ifdef POSTK_DEBUG_TEMP_FIX_19
|
||||
extern void clear_fp_regs(struct thread *thread);
|
||||
#endif /* POSTK_DEBUG_TEMP_FIX_19 */
|
||||
|
||||
SYSCALL_DECLARE(execve)
|
||||
{
|
||||
int error;
|
||||
@@ -2273,10 +2269,13 @@ SYSCALL_DECLARE(execve)
|
||||
thread->sigcommon->action[i].sa.sa_handler = SIG_DFL;
|
||||
}
|
||||
|
||||
#ifdef POSTK_DEBUG_TEMP_FIX_19
|
||||
/* The floating-point environment is reset to the default. */
|
||||
clear_fp_regs(thread);
|
||||
#endif /* POSTK_DEBUG_TEMP_FIX_19 */
|
||||
/* Reset floating-point environment to default. */
|
||||
clear_fp_regs();
|
||||
|
||||
/* Reset sigaltstack to default */
|
||||
thread->sigstack.ss_sp = NULL;
|
||||
thread->sigstack.ss_flags = SS_DISABLE;
|
||||
thread->sigstack.ss_size = 0;
|
||||
|
||||
error = ptrace_report_exec(thread);
|
||||
if(error) {
|
||||
|
||||
Reference in New Issue
Block a user