Commit c98c0977 authored by Catalin Marinas's avatar Catalin Marinas Committed by Russell King

ARM: 6868/1: Preserve the VFP state during fork

VFP registers d16-d31 are callee saved registers and must be preserved
during function calls, including fork(). The VFP configuration should
also be preserved. The patch copies the full VFP state to the child
process.
Reported-by: default avatarPaul Wright <paul.wright@arm.com>
Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent 2e82669a
...@@ -78,6 +78,14 @@ static void vfp_thread_exit(struct thread_info *thread) ...@@ -78,6 +78,14 @@ static void vfp_thread_exit(struct thread_info *thread)
put_cpu(); put_cpu();
} }
static void vfp_thread_copy(struct thread_info *thread)
{
struct thread_info *parent = current_thread_info();
vfp_sync_hwstate(parent);
thread->vfpstate = parent->vfpstate;
}
/* /*
* When this function is called with the following 'cmd's, the following * When this function is called with the following 'cmd's, the following
* is true while this function is being run: * is true while this function is being run:
...@@ -148,6 +156,10 @@ static int vfp_notifier(struct notifier_block *self, unsigned long cmd, void *v) ...@@ -148,6 +156,10 @@ static int vfp_notifier(struct notifier_block *self, unsigned long cmd, void *v)
case THREAD_NOTIFY_EXIT: case THREAD_NOTIFY_EXIT:
vfp_thread_exit(thread); vfp_thread_exit(thread);
break; break;
case THREAD_NOTIFY_COPY:
vfp_thread_copy(thread);
break;
} }
return NOTIFY_DONE; return NOTIFY_DONE;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment