FAILED: patch "[PATCH] MIPS: math-emu: Fix final emulation phase for certain" failed to apply to 4.9-stable tree
Subsystems (2)
[email protected]
maintainerThe patch below does not apply to the 4.9-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
Quoted 1 line
From
409fcace9963c1e8d2cb0f7ac62e8b34d47ef979Mon Sep 17 00:00:00 2001
From: Aleksandar Markovic <[email protected]>
Date: Thu, 2 Nov 2017 12:13:58 +0100
Subject: [PATCH] MIPS: math-emu: Fix final emulation phase for certain
instructions
Fix final phase of <CLASS|MADDF|MSUBF|MAX|MIN|MAXA|MINA>.<D|S> emulation. Provide proper generation of SIGFPE signal and updating debugfs FP exception stats in cases of any exception flags set in preceding phases of emulation.
CLASS.<D|S> instruction may generate "Unimplemented Operation" FP exception. <MADDF|MSUBF>.<D|S> instructions may generate "Inexact", "Unimplemented Operation", "Invalid Operation", "Overflow", and "Underflow" FP exceptions. <MAX|MIN|MAXA|MINA>.<D|S> instructions can generate "Unimplemented Operation" and "Invalid Operation" FP exceptions.
The proper final processing of the cases when any FP exception flag is set is achieved by replacing "break" statement with "goto copcsr" statement. With such solution, this patch brings the final phase of emulation of the above instructions consistent with the one corresponding to the previously implemented emulation of other related FPU instructions (ADD, SUB, etc.).
Patchwork: https://patchwork.linux-mips.org/patch/17581/
arch/mips/math-emu/cp1emu.c +14 -14
@@ -1795,7 +1795,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,SPFROMREG (fs,MIPSInst_FS (ir));SPFROMREG (fd,MIPSInst_FD (ir)); rv.s =ieee754sp_maddf (fd, fs, ft); -break ; + goto copcsr; }case fmsubf_op: {
@@ -1809,7 +1809,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,SPFROMREG (fs,MIPSInst_FS (ir));SPFROMREG (fd,MIPSInst_FD (ir)); rv.s =ieee754sp_msubf (fd, fs, ft); -break ; + goto copcsr; }case frint_op: {
@@ -1834,7 +1834,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,SPFROMREG (fs,MIPSInst_FS (ir)); rv.w =ieee754sp_2008class (fs); rfmt = w_fmt; -break ; + goto copcsr; }case fmin_op: {
@@ -1847,7 +1847,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,SPFROMREG (ft,MIPSInst_FT (ir));SPFROMREG (fs,MIPSInst_FS (ir)); rv.s =ieee754sp_fmin (fs, ft); -break ; + goto copcsr; }case fmina_op: {
@@ -1860,7 +1860,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,SPFROMREG (ft,MIPSInst_FT (ir));SPFROMREG (fs,MIPSInst_FS (ir)); rv.s =ieee754sp_fmina (fs, ft); -break ; + goto copcsr; }case fmax_op: {
@@ -1873,7 +1873,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,SPFROMREG (ft,MIPSInst_FT (ir));SPFROMREG (fs,MIPSInst_FS (ir)); rv.s =ieee754sp_fmax (fs, ft); -break ; + goto copcsr; }case fmaxa_op: {
@@ -1886,7 +1886,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,SPFROMREG (ft,MIPSInst_FT (ir));SPFROMREG (fs,MIPSInst_FS (ir)); rv.s =ieee754sp_fmaxa (fs, ft); -break ; + goto copcsr; }case fabs_op:
@@ -2165,7 +2165,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,DPFROMREG (fs,MIPSInst_FS (ir));DPFROMREG (fd,MIPSInst_FD (ir)); rv.d =ieee754dp_maddf (fd, fs, ft); -break ; + goto copcsr; }case fmsubf_op: {
@@ -2179,7 +2179,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,DPFROMREG (fs,MIPSInst_FS (ir));DPFROMREG (fd,MIPSInst_FD (ir)); rv.d =ieee754dp_msubf (fd, fs, ft); -break ; + goto copcsr; }case frint_op: {
@@ -2204,7 +2204,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,DPFROMREG (fs,MIPSInst_FS (ir)); rv.l =ieee754dp_2008class (fs); rfmt = l_fmt; -break ; + goto copcsr; }case fmin_op: {
@@ -2217,7 +2217,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,DPFROMREG (ft,MIPSInst_FT (ir));DPFROMREG (fs,MIPSInst_FS (ir)); rv.d =ieee754dp_fmin (fs, ft); -break ; + goto copcsr; }case fmina_op: {
@@ -2230,7 +2230,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,DPFROMREG (ft,MIPSInst_FT (ir));DPFROMREG (fs,MIPSInst_FS (ir)); rv.d =ieee754dp_fmina (fs, ft); -break ; + goto copcsr; }case fmax_op: {
@@ -2243,7 +2243,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,DPFROMREG (ft,MIPSInst_FT (ir));DPFROMREG (fs,MIPSInst_FS (ir)); rv.d =ieee754dp_fmax (fs, ft); -break ; + goto copcsr; }case fmaxa_op: {
@@ -2256,7 +2256,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,DPFROMREG (ft,MIPSInst_FT (ir));DPFROMREG (fs,MIPSInst_FS (ir)); rv.d =ieee754dp_fmaxa (fs, ft); -break ; + goto copcsr; }case fabs_op:
Hi, Greg.
So this patch is integrated in upstream and have ID 409fcac. I am attaching a slightly modified version of the patch that can be applied to 4.9-stable (2 existing lines of code were different between 4.9 and 4.14). It should be possible to apply it to 4.4-stable too.
I would appreciate if you could integrate it to 4.4-stable and 4.9-stable, as it was originally indicated.
Regards,
Aleksandar
________________________________________
From: [email protected] [[email protected]]
Sent: Monday, November 27, 2017 4:11 PM
To: Aleksandar Markovic; Douglas Leung; Goran Ferenc; [email protected]; [email protected]; Miodrag Dinic; Paul Burton; Petar Jovanovic; Raghu Gandham; [email protected]; [email protected]
Cc: [email protected]
Subject: FAILED: patch "[PATCH] MIPS: math-emu: Fix final emulation phase for certain" failed to apply to 4.9-stable tree
The patch below does not apply to the 4.9-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
Quoted 1 line
From
409fcace9963c1e8d2cb0f7ac62e8b34d47ef979Mon Sep 17 00:00:00 2001
From: Aleksandar Markovic <[email protected]>
Date: Thu, 2 Nov 2017 12:13:58 +0100
Subject: [PATCH] MIPS: math-emu: Fix final emulation phase for certain
instructions
Fix final phase of <CLASS|MADDF|MSUBF|MAX|MIN|MAXA|MINA>.<D|S> emulation. Provide proper generation of SIGFPE signal and updating debugfs FP exception stats in cases of any exception flags set in preceding phases of emulation.
CLASS.<D|S> instruction may generate "Unimplemented Operation" FP exception. <MADDF|MSUBF>.<D|S> instructions may generate "Inexact", "Unimplemented Operation", "Invalid Operation", "Overflow", and "Underflow" FP exceptions. <MAX|MIN|MAXA|MINA>.<D|S> instructions can generate "Unimplemented Operation" and "Invalid Operation" FP exceptions.
The proper final processing of the cases when any FP exception flag is set is achieved by replacing "break" statement with "goto copcsr" statement. With such solution, this patch brings the final phase of emulation of the above instructions consistent with the one corresponding to the previously implemented emulation of other related FPU instructions (ADD, SUB, etc.).
Patchwork: https://patchwork.linux-mips.org/patch/17581/
arch/mips/math-emu/cp1emu.c +14 -14
@@ -1795,7 +1795,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,SPFROMREG (fs,MIPSInst_FS (ir));SPFROMREG (fd,MIPSInst_FD (ir)); rv.s =ieee754sp_maddf (fd, fs, ft); -break ; + goto copcsr; }case fmsubf_op: {
@@ -1809,7 +1809,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,SPFROMREG (fs,MIPSInst_FS (ir));SPFROMREG (fd,MIPSInst_FD (ir)); rv.s =ieee754sp_msubf (fd, fs, ft); -break ; + goto copcsr; }case frint_op: {
@@ -1834,7 +1834,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,SPFROMREG (fs,MIPSInst_FS (ir)); rv.w =ieee754sp_2008class (fs); rfmt = w_fmt; -break ; + goto copcsr; }case fmin_op: {
@@ -1847,7 +1847,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,SPFROMREG (ft,MIPSInst_FT (ir));SPFROMREG (fs,MIPSInst_FS (ir)); rv.s =ieee754sp_fmin (fs, ft); -break ; + goto copcsr; }case fmina_op: {
@@ -1860,7 +1860,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,SPFROMREG (ft,MIPSInst_FT (ir));SPFROMREG (fs,MIPSInst_FS (ir)); rv.s =ieee754sp_fmina (fs, ft); -break ; + goto copcsr; }case fmax_op: {
@@ -1873,7 +1873,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,SPFROMREG (ft,MIPSInst_FT (ir));SPFROMREG (fs,MIPSInst_FS (ir)); rv.s =ieee754sp_fmax (fs, ft); -break ; + goto copcsr; }case fmaxa_op: {
@@ -1886,7 +1886,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,SPFROMREG (ft,MIPSInst_FT (ir));SPFROMREG (fs,MIPSInst_FS (ir)); rv.s =ieee754sp_fmaxa (fs, ft); -break ; + goto copcsr; }case fabs_op:
@@ -2165,7 +2165,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,DPFROMREG (fs,MIPSInst_FS (ir));DPFROMREG (fd,MIPSInst_FD (ir)); rv.d =ieee754dp_maddf (fd, fs, ft); -break ; + goto copcsr; }case fmsubf_op: {
@@ -2179,7 +2179,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,DPFROMREG (fs,MIPSInst_FS (ir));DPFROMREG (fd,MIPSInst_FD (ir)); rv.d =ieee754dp_msubf (fd, fs, ft); -break ; + goto copcsr; }case frint_op: {
@@ -2204,7 +2204,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,DPFROMREG (fs,MIPSInst_FS (ir)); rv.l =ieee754dp_2008class (fs); rfmt = l_fmt; -break ; + goto copcsr; }case fmin_op: {
@@ -2217,7 +2217,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,DPFROMREG (ft,MIPSInst_FT (ir));DPFROMREG (fs,MIPSInst_FS (ir)); rv.d =ieee754dp_fmin (fs, ft); -break ; + goto copcsr; }case fmina_op: {
@@ -2230,7 +2230,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,DPFROMREG (ft,MIPSInst_FT (ir));DPFROMREG (fs,MIPSInst_FS (ir)); rv.d =ieee754dp_fmina (fs, ft); -break ; + goto copcsr; }case fmax_op: {
@@ -2243,7 +2243,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,DPFROMREG (ft,MIPSInst_FT (ir));DPFROMREG (fs,MIPSInst_FS (ir)); rv.d =ieee754dp_fmax (fs, ft); -break ; + goto copcsr; }case fmaxa_op: {
@@ -2256,7 +2256,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,DPFROMREG (ft,MIPSInst_FT (ir));DPFROMREG (fs,MIPSInst_FS (ir)); rv.d =ieee754dp_fmaxa (fs, ft); -break ; + goto copcsr; }case fabs_op:
From 6802441f7f8347b24587dff8cc34140758dc4324 Mon Sep 17 00:00:00 2001
From: Aleksandar Markovic <[email protected]>
Date: Thu, 2 Nov 2017 12:13:58 +0100
Subject: [PATCH] MIPS: math-emu: Fix final emulation phase for certain
instructions
Fix final phase of <CLASS|MADDF|MSUBF|MAX|MIN|MAXA|MINA>.<D|S> emulation. Provide proper generation of SIGFPE signal and updating debugfs FP exception stats in cases of any exception flags set in preceding phases of emulation.
CLASS.<D|S> instruction may generate "Unimplemented Operation" FP exception. <MADDF|MSUBF>.<D|S> instructions may generate "Inexact", "Unimplemented Operation", "Invalid Operation", "Overflow", and "Underflow" FP exceptions. <MAX|MIN|MAXA|MINA>.<D|S> instructions can generate "Unimplemented Operation" and "Invalid Operation" FP exceptions.
The proper final processing of the cases when any FP exception flag is set is achieved by replacing "break" statement with "goto copcsr" statement. With such solution, this patch brings the final phase of emulation of the above instructions consistent with the one corresponding to the previously implemented emulation of other related FPU instructions (ADD, SUB, etc.).
Patchwork: https://patchwork.linux-mips.org/patch/17581/
--- arch/mips/math-emu/cp1emu.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-)
arch/mips/math-emu/cp1emu.c +14 -14
@@ -1781,7 +1781,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,SPFROMREG (fs,MIPSInst_FS (ir));SPFROMREG (fd,MIPSInst_FD (ir)); rv.s =ieee754sp_maddf (fd, fs, ft); -break ; + goto copcsr; }case fmsubf_op: {
@@ -1794,7 +1794,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,SPFROMREG (fs,MIPSInst_FS (ir));SPFROMREG (fd,MIPSInst_FD (ir)); rv.s =ieee754sp_msubf (fd, fs, ft); -break ; + goto copcsr; }case frint_op: {
@@ -1818,7 +1818,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,SPFROMREG (fs,MIPSInst_FS (ir)); rv.w =ieee754sp_2008class (fs); rfmt = w_fmt; -break ; + goto copcsr; }case fmin_op: {
@@ -1830,7 +1830,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,SPFROMREG (ft,MIPSInst_FT (ir));SPFROMREG (fs,MIPSInst_FS (ir)); rv.s =ieee754sp_fmin (fs, ft); -break ; + goto copcsr; }case fmina_op: {
@@ -1842,7 +1842,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,SPFROMREG (ft,MIPSInst_FT (ir));SPFROMREG (fs,MIPSInst_FS (ir)); rv.s =ieee754sp_fmina (fs, ft); -break ; + goto copcsr; }case fmax_op: {
@@ -1854,7 +1854,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,SPFROMREG (ft,MIPSInst_FT (ir));SPFROMREG (fs,MIPSInst_FS (ir)); rv.s =ieee754sp_fmax (fs, ft); -break ; + goto copcsr; }case fmaxa_op: {
@@ -1866,7 +1866,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,SPFROMREG (ft,MIPSInst_FT (ir));SPFROMREG (fs,MIPSInst_FS (ir)); rv.s =ieee754sp_fmaxa (fs, ft); -break ; + goto copcsr; }case fabs_op:
@@ -2110,7 +2110,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,DPFROMREG (fs,MIPSInst_FS (ir));DPFROMREG (fd,MIPSInst_FD (ir)); rv.d =ieee754dp_maddf (fd, fs, ft); -break ; + goto copcsr; }case fmsubf_op: {
@@ -2123,7 +2123,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,DPFROMREG (fs,MIPSInst_FS (ir));DPFROMREG (fd,MIPSInst_FD (ir)); rv.d =ieee754dp_msubf (fd, fs, ft); -break ; + goto copcsr; }case frint_op: {
@@ -2147,7 +2147,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,DPFROMREG (fs,MIPSInst_FS (ir)); rv.w =ieee754dp_2008class (fs); rfmt = w_fmt; -break ; + goto copcsr; }case fmin_op: {
@@ -2159,7 +2159,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,DPFROMREG (ft,MIPSInst_FT (ir));DPFROMREG (fs,MIPSInst_FS (ir)); rv.d =ieee754dp_fmin (fs, ft); -break ; + goto copcsr; }case fmina_op: {
@@ -2171,7 +2171,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,DPFROMREG (ft,MIPSInst_FT (ir));DPFROMREG (fs,MIPSInst_FS (ir)); rv.d =ieee754dp_fmina (fs, ft); -break ; + goto copcsr; }case fmax_op: {
@@ -2183,7 +2183,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,DPFROMREG (ft,MIPSInst_FT (ir));DPFROMREG (fs,MIPSInst_FS (ir)); rv.d =ieee754dp_fmax (fs, ft); -break ; + goto copcsr; }case fmaxa_op: {
@@ -2195,7 +2195,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,DPFROMREG (ft,MIPSInst_FT (ir));DPFROMREG (fs,MIPSInst_FS (ir)); rv.d =ieee754dp_fmaxa (fs, ft); -break ; + goto copcsr; }case fabs_op:
Signature · 1 line
2.7.4
[email protected]
maintainerQuoted 8 lines · Aleksandar Markovic
Hi, Greg.
So this patch is integrated in upstream and have ID 409fcac. I am attaching a slightly modified version of the patch that can be applied to 4.9-stable (2 existing lines of code were different between 4.9 and 4.14). It should be possible to apply it to 4.4-stable too.
I would appreciate if you could integrate it to 4.4-stable and 4.9-stable, as it was originally indicated.
Now queued up to both trees, many thanks for the backport!
greg k-h