[patch 12/83] sparc64: Sync FPU state in VIS emulation handler.

Greg KH
2008-12-11T19:21:58Z

[-- Attachment #1: 0006-sparc64-Sync-FPU-state-in-VIS-emulation-handler.patch --]
[-- Type: text/plain, Size: 841 bytes --]

2.6.27-stable review patch. If anyone has any objections, please let us know.

------------------

From: Hong H. Pham <hong.pham@windriver.com>

[ Upstream commit 410d2c8187ed969238ba98008c1d57307a56cfd8 ]

Copy the FPU state to the task's thread_info->fpregs for the VIS emulation
functions to access.

Signed-off-by: Hong H. Pham <hong.pham@windriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
arch/sparc64/kernel/visemul.c | 2 ++
1 file changed, 2 insertions(+)

--- a/arch/sparc64/kernel/visemul.c
+++ b/arch/sparc64/kernel/visemul.c
@@ -807,6 +807,8 @@ int vis_emul(struct pt_regs *regs, unsig
if (get_user(insn, (u32 __user *) pc))
return -EFAULT;

+ save_and_clear_fpu();
+
opf = (insn & VIS_OPF_MASK) >> VIS_OPF_SHIFT;
switch (opf) {