Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Paul Wright <paul.wright@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>

authored by

Catalin Marinas and committed by
Russell King
c98c0977 2e82669a

+12
+12
arch/arm/vfp/vfpmodule.c
··· 78 78 put_cpu(); 79 79 } 80 80 81 + static void vfp_thread_copy(struct thread_info *thread) 82 + { 83 + struct thread_info *parent = current_thread_info(); 84 + 85 + vfp_sync_hwstate(parent); 86 + thread->vfpstate = parent->vfpstate; 87 + } 88 + 81 89 /* 82 90 * When this function is called with the following 'cmd's, the following 83 91 * is true while this function is being run: ··· 155 147 156 148 case THREAD_NOTIFY_EXIT: 157 149 vfp_thread_exit(thread); 150 + break; 151 + 152 + case THREAD_NOTIFY_COPY: 153 + vfp_thread_copy(thread); 158 154 break; 159 155 } 160 156