All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] MIPS: Minor FPU emulation fixes
@ 2017-10-06 17:28 Aleksandar Markovic
  2017-10-06 17:29 ` [PATCH 1/2] MIPS: math-emu: Update debugfs FP exception stats for certain instructions Aleksandar Markovic
  2017-10-06 17:29 ` [PATCH 2/2] MIPS: math-emu: Use preferred flavor of unsigned integer declarations Aleksandar Markovic
  0 siblings, 2 replies; 15+ messages in thread
From: Aleksandar Markovic @ 2017-10-06 17:28 UTC (permalink / raw)
  To: linux-mips
  Cc: Aleksandar Markovic, Douglas Leung, Goran Ferenc, James Hogan,
	James Hogan, linux-kernel, Maciej W. Rozycki, Manuel Lauss,
	Miodrag Dinic, Paul Burton, Petar Jovanovic, Raghu Gandham,
	Ralf Baechle

From: Aleksandar Markovic <aleksandar.markovic@imgtec.com>

This series contains two minor FPU emulation patches that
were not included into a recent larger series of FPU fixes,
mainly not to additionally burden already complex set of
patches.

Only the first patch changes functionality, and in such way
that it affects certain Mips debugfs features only.

The second one is just a cosmetic change - it just cleans
the code, and removes some checkpatch warnings.

Aleksandar Markovic (2):
  MIPS: math-emu: Update debugfs FP exception stats for certain
    instructions
  MIPS: math-emu: Use preferred flavor of unsigned integer declarations

 arch/mips/math-emu/cp1emu.c     | 46 +++++++++++++++++++++--------------------
 arch/mips/math-emu/dp_maddf.c   |  8 +++----
 arch/mips/math-emu/dp_mul.c     |  8 +++----
 arch/mips/math-emu/dp_sqrt.c    |  4 ++--
 arch/mips/math-emu/ieee754.h    | 15 +++++++-------
 arch/mips/math-emu/ieee754int.h |  6 +++---
 arch/mips/math-emu/ieee754sp.c  |  4 ++--
 arch/mips/math-emu/ieee754sp.h  |  2 +-
 arch/mips/math-emu/sp_div.c     |  4 ++--
 arch/mips/math-emu/sp_fint.c    |  2 +-
 arch/mips/math-emu/sp_maddf.c   |  6 +++---
 arch/mips/math-emu/sp_mul.c     | 10 ++++-----
 12 files changed, 59 insertions(+), 56 deletions(-)

-- 
2.7.4

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH 1/2] MIPS: math-emu: Update debugfs FP exception stats for certain instructions
  2017-10-06 17:28 [PATCH 0/2] MIPS: Minor FPU emulation fixes Aleksandar Markovic
@ 2017-10-06 17:29 ` Aleksandar Markovic
  2017-10-09 21:09     ` James Hogan
  2017-10-06 17:29 ` [PATCH 2/2] MIPS: math-emu: Use preferred flavor of unsigned integer declarations Aleksandar Markovic
  1 sibling, 1 reply; 15+ messages in thread
From: Aleksandar Markovic @ 2017-10-06 17:29 UTC (permalink / raw)
  To: linux-mips
  Cc: Aleksandar Markovic, Douglas Leung, Goran Ferenc, James Hogan,
	linux-kernel, Maciej W. Rozycki, Manuel Lauss, Masahiro Yamada,
	Miodrag Dinic, Paul Burton, Petar Jovanovic, Raghu Gandham,
	Ralf Baechle

From: Aleksandar Markovic <aleksandar.markovic@imgtec.com>

Fix omission of updating of debugfs FP exception stats for
instructions <CLASS|MADDF|MSUBF|MAX|MIN|MAXA|MINA>.<D|S>.

CLASS.<D|S> can generate Unimplemented Operation FP exception.
<MADDF|MSUBF|MAX|MIN|MAXA|MINA>>.<D|S> can generate Inexact,
Unimplemented Operation, Invalid Operation, Overflow, and
Underflow FP exceptions. In such cases, and prior to this
patch, debugfs FP exception stats were not updated, and
therefore contained overall wrong values.

This brings the emulation of mentioned instructions consistent
with the previously implemented emulation of other related
FPU instructions.

There is still some room for refactoring and improving the
code segment under label "copcsr", but this is beyond the
scope of this patch.

Fixes: 38db37ba069f ("MIPS: math-emu: Add support for the MIPS R6 CLASS FPU instruction")
Fixes: e24c3bec3e8e ("MIPS: math-emu: Add support for the MIPS R6 MADDF FPU instruction")
Fixes: 83d43305a1df ("MIPS: math-emu: Add support for the MIPS R6 MSUBF FPU instruction")
Fixes: a79f5f9ba508 ("MIPS: math-emu: Add support for the MIPS R6 MAX{, A} FPU instruction")
Fixes: 4e9561b20e2f ("MIPS: math-emu: Add support for the MIPS R6 MIN{, A} FPU instruction")

Signed-off-by: Aleksandar Markovic <aleksandar.markovic@imgtec.com>
---
 arch/mips/math-emu/cp1emu.c | 28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/arch/mips/math-emu/cp1emu.c b/arch/mips/math-emu/cp1emu.c
index 192542d..d2fcb30 100644
--- a/arch/mips/math-emu/cp1emu.c
+++ b/arch/mips/math-emu/cp1emu.c
@@ -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:
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 2/2] MIPS: math-emu: Use preferred flavor of unsigned integer declarations
  2017-10-06 17:28 [PATCH 0/2] MIPS: Minor FPU emulation fixes Aleksandar Markovic
  2017-10-06 17:29 ` [PATCH 1/2] MIPS: math-emu: Update debugfs FP exception stats for certain instructions Aleksandar Markovic
@ 2017-10-06 17:29 ` Aleksandar Markovic
  2017-10-09 16:59     ` James Hogan
  1 sibling, 1 reply; 15+ messages in thread
From: Aleksandar Markovic @ 2017-10-06 17:29 UTC (permalink / raw)
  To: linux-mips
  Cc: Aleksandar Markovic, Douglas Leung, Goran Ferenc, James Hogan,
	James Hogan, linux-kernel, Maciej W. Rozycki, Masahiro Yamada,
	Miodrag Dinic, Paul Burton, Petar Jovanovic, Raghu Gandham,
	Ralf Baechle

From: Aleksandar Markovic <aleksandar.markovic@imgtec.com>

Fix occurences of unsigned integer declarations that are not
preferred by standards of checkpatch scripts. This removes
significant number of checkpatch warnings in math-emu
directory (several files will become completely warning-free),
and thus makes easier to spot (now and in the future) other
perhaps more significant checkpatch errors and warnings.

Signed-off-by: Aleksandar Markovic <aleksandar.markovic@imgtec.com>
---
 arch/mips/math-emu/cp1emu.c     | 18 ++++++++++--------
 arch/mips/math-emu/dp_maddf.c   |  8 ++++----
 arch/mips/math-emu/dp_mul.c     |  8 ++++----
 arch/mips/math-emu/dp_sqrt.c    |  4 ++--
 arch/mips/math-emu/ieee754.h    | 15 ++++++++-------
 arch/mips/math-emu/ieee754int.h |  6 +++---
 arch/mips/math-emu/ieee754sp.c  |  4 ++--
 arch/mips/math-emu/ieee754sp.h  |  2 +-
 arch/mips/math-emu/sp_div.c     |  4 ++--
 arch/mips/math-emu/sp_fint.c    |  2 +-
 arch/mips/math-emu/sp_maddf.c   |  6 +++---
 arch/mips/math-emu/sp_mul.c     | 10 +++++-----
 12 files changed, 45 insertions(+), 42 deletions(-)

diff --git a/arch/mips/math-emu/cp1emu.c b/arch/mips/math-emu/cp1emu.c
index d2fcb30..9f145e1 100644
--- a/arch/mips/math-emu/cp1emu.c
+++ b/arch/mips/math-emu/cp1emu.c
@@ -810,7 +810,7 @@ do {									\
 #define SITOREG(si, x)							\
 do {									\
 	if (cop1_64bit(xcp) && !hybrid_fprs()) {			\
-		unsigned i;						\
+		unsigned int i;						\
 		set_fpr32(&ctx->fpr[x], 0, si);				\
 		for (i = 1; i < ARRAY_SIZE(ctx->fpr[x].val32); i++)	\
 			set_fpr32(&ctx->fpr[x], i, 0);			\
@@ -823,7 +823,7 @@ do {									\
 
 #define SITOHREG(si, x)							\
 do {									\
-	unsigned i;							\
+	unsigned int i;							\
 	set_fpr32(&ctx->fpr[x], 1, si);					\
 	for (i = 2; i < ARRAY_SIZE(ctx->fpr[x].val32); i++)		\
 		set_fpr32(&ctx->fpr[x], i, 0);				\
@@ -834,7 +834,7 @@ do {									\
 
 #define DITOREG(di, x)							\
 do {									\
-	unsigned fpr, i;						\
+	unsigned int fpr, i;						\
 	fpr = (x) & ~(cop1_64bit(xcp) ^ 1);				\
 	set_fpr64(&ctx->fpr[fpr], 0, di);				\
 	for (i = 1; i < ARRAY_SIZE(ctx->fpr[x].val64); i++)		\
@@ -1465,7 +1465,7 @@ DEF3OP(nmsub, dp, ieee754dp_mul, ieee754dp_sub, ieee754dp_neg);
 static int fpux_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
 	mips_instruction ir, void __user **fault_addr)
 {
-	unsigned rcsr = 0;	/* resulting csr */
+	unsigned int rcsr = 0;	/* resulting csr */
 
 	MIPS_FPU_EMU_INC_STATS(cp1xops);
 
@@ -1661,10 +1661,10 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
 	mips_instruction ir)
 {
 	int rfmt;		/* resulting format */
-	unsigned rcsr = 0;	/* resulting csr */
+	unsigned int rcsr = 0;	/* resulting csr */
 	unsigned int oldrm;
 	unsigned int cbit;
-	unsigned cond;
+	unsigned int cond;
 	union {
 		union ieee754dp d;
 		union ieee754sp s;
@@ -2029,9 +2029,10 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
 
 		default:
 			if (!NO_R6EMU && MIPSInst_FUNC(ir) >= fcmp_op) {
-				unsigned cmpop = MIPSInst_FUNC(ir) - fcmp_op;
+				unsigned int cmpop;
 				union ieee754sp fs, ft;
 
+				cmpop = MIPSInst_FUNC(ir) - fcmp_op;
 				SPFROMREG(fs, MIPSInst_FS(ir));
 				SPFROMREG(ft, MIPSInst_FT(ir));
 				rv.w = ieee754sp_cmp(fs, ft,
@@ -2379,9 +2380,10 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
 
 		default:
 			if (!NO_R6EMU && MIPSInst_FUNC(ir) >= fcmp_op) {
-				unsigned cmpop = MIPSInst_FUNC(ir) - fcmp_op;
+				unsigned int cmpop;
 				union ieee754dp fs, ft;
 
+				cmpop = MIPSInst_FUNC(ir) - fcmp_op;
 				DPFROMREG(fs, MIPSInst_FS(ir));
 				DPFROMREG(ft, MIPSInst_FT(ir));
 				rv.w = ieee754dp_cmp(fs, ft,
diff --git a/arch/mips/math-emu/dp_maddf.c b/arch/mips/math-emu/dp_maddf.c
index e0d9be5..7ad79ed 100644
--- a/arch/mips/math-emu/dp_maddf.c
+++ b/arch/mips/math-emu/dp_maddf.c
@@ -45,10 +45,10 @@ static union ieee754dp _dp_maddf(union ieee754dp z, union ieee754dp x,
 {
 	int re;
 	int rs;
-	unsigned lxm;
-	unsigned hxm;
-	unsigned lym;
-	unsigned hym;
+	unsigned int lxm;
+	unsigned int hxm;
+	unsigned int lym;
+	unsigned int hym;
 	u64 lrm;
 	u64 hrm;
 	u64 lzm;
diff --git a/arch/mips/math-emu/dp_mul.c b/arch/mips/math-emu/dp_mul.c
index 87d0b44..60c8bfe 100644
--- a/arch/mips/math-emu/dp_mul.c
+++ b/arch/mips/math-emu/dp_mul.c
@@ -26,10 +26,10 @@ union ieee754dp ieee754dp_mul(union ieee754dp x, union ieee754dp y)
 	int re;
 	int rs;
 	u64 rm;
-	unsigned lxm;
-	unsigned hxm;
-	unsigned lym;
-	unsigned hym;
+	unsigned int lxm;
+	unsigned int hxm;
+	unsigned int lym;
+	unsigned int hym;
 	u64 lrm;
 	u64 hrm;
 	u64 t;
diff --git a/arch/mips/math-emu/dp_sqrt.c b/arch/mips/math-emu/dp_sqrt.c
index cd5bc08..cea907b 100644
--- a/arch/mips/math-emu/dp_sqrt.c
+++ b/arch/mips/math-emu/dp_sqrt.c
@@ -21,7 +21,7 @@
 
 #include "ieee754dp.h"
 
-static const unsigned table[] = {
+static const unsigned int table[] = {
 	0, 1204, 3062, 5746, 9193, 13348, 18162, 23592,
 	29598, 36145, 43202, 50740, 58733, 67158, 75992,
 	85215, 83599, 71378, 60428, 50647, 41945, 34246,
@@ -33,7 +33,7 @@ union ieee754dp ieee754dp_sqrt(union ieee754dp x)
 {
 	struct _ieee754_csr oldcsr;
 	union ieee754dp y, z, t;
-	unsigned scalx, yh;
+	unsigned int scalx, yh;
 	COMPXDP;
 
 	EXPLODEXDP;
diff --git a/arch/mips/math-emu/ieee754.h b/arch/mips/math-emu/ieee754.h
index 92dc8fa..e0eb7a9 100644
--- a/arch/mips/math-emu/ieee754.h
+++ b/arch/mips/math-emu/ieee754.h
@@ -165,11 +165,12 @@ struct _ieee754_csr {
 };
 #define ieee754_csr (*(struct _ieee754_csr *)(&current->thread.fpu.fcr31))
 
-static inline unsigned ieee754_getrm(void)
+static inline unsigned int ieee754_getrm(void)
 {
 	return (ieee754_csr.rm);
 }
-static inline unsigned ieee754_setrm(unsigned rm)
+
+static inline unsigned int ieee754_setrm(unsigned int rm)
 {
 	return (ieee754_csr.rm = rm);
 }
@@ -177,14 +178,14 @@ static inline unsigned ieee754_setrm(unsigned rm)
 /*
  * get current exceptions
  */
-static inline unsigned ieee754_getcx(void)
+static inline unsigned int ieee754_getcx(void)
 {
 	return (ieee754_csr.cx);
 }
 
 /* test for current exception condition
  */
-static inline int ieee754_cxtest(unsigned n)
+static inline int ieee754_cxtest(unsigned int n)
 {
 	return (ieee754_csr.cx & n);
 }
@@ -192,21 +193,21 @@ static inline int ieee754_cxtest(unsigned n)
 /*
  * get sticky exceptions
  */
-static inline unsigned ieee754_getsx(void)
+static inline unsigned int ieee754_getsx(void)
 {
 	return (ieee754_csr.sx);
 }
 
 /* clear sticky conditions
 */
-static inline unsigned ieee754_clrsx(void)
+static inline unsigned int ieee754_clrsx(void)
 {
 	return (ieee754_csr.sx = 0);
 }
 
 /* test for sticky exception condition
  */
-static inline int ieee754_sxtest(unsigned n)
+static inline int ieee754_sxtest(unsigned int n)
 {
 	return (ieee754_csr.sx & n);
 }
diff --git a/arch/mips/math-emu/ieee754int.h b/arch/mips/math-emu/ieee754int.h
index dd2071f..06ac0e2 100644
--- a/arch/mips/math-emu/ieee754int.h
+++ b/arch/mips/math-emu/ieee754int.h
@@ -54,13 +54,13 @@ static inline int ieee754_class_nan(int xc)
 }
 
 #define COMPXSP \
-	unsigned xm; int xe; int xs __maybe_unused; int xc
+	unsigned int xm; int xe; int xs __maybe_unused; int xc
 
 #define COMPYSP \
-	unsigned ym; int ye; int ys; int yc
+	unsigned int ym; int ye; int ys; int yc
 
 #define COMPZSP \
-	unsigned zm; int ze; int zs; int zc
+	unsigned int zm; int ze; int zs; int zc
 
 #define EXPLODESP(v, vc, vs, ve, vm)					\
 {									\
diff --git a/arch/mips/math-emu/ieee754sp.c b/arch/mips/math-emu/ieee754sp.c
index 260e6896..8423e4c 100644
--- a/arch/mips/math-emu/ieee754sp.c
+++ b/arch/mips/math-emu/ieee754sp.c
@@ -65,7 +65,7 @@ union ieee754sp __cold ieee754sp_nanxcpt(union ieee754sp r)
 	return r;
 }
 
-static unsigned ieee754sp_get_rounding(int sn, unsigned xm)
+static unsigned int ieee754sp_get_rounding(int sn, unsigned int xm)
 {
 	/* inexact must round of 3 bits
 	 */
@@ -96,7 +96,7 @@ static unsigned ieee754sp_get_rounding(int sn, unsigned xm)
  * xe is an unbiased exponent
  * xm is 3bit extended precision value.
  */
-union ieee754sp ieee754sp_format(int sn, int xe, unsigned xm)
+union ieee754sp ieee754sp_format(int sn, int xe, unsigned int xm)
 {
 	assert(xm);		/* we don't gen exact zeros (probably should) */
 
diff --git a/arch/mips/math-emu/ieee754sp.h b/arch/mips/math-emu/ieee754sp.h
index 0f63e42..8c5a638 100644
--- a/arch/mips/math-emu/ieee754sp.h
+++ b/arch/mips/math-emu/ieee754sp.h
@@ -69,7 +69,7 @@ static inline int ieee754sp_finite(union ieee754sp x)
 #define SPDNORMY	SPDNORMx(ym, ye)
 #define SPDNORMZ	SPDNORMx(zm, ze)
 
-static inline union ieee754sp buildsp(int s, int bx, unsigned m)
+static inline union ieee754sp buildsp(int s, int bx, unsigned int m)
 {
 	union ieee754sp r;
 
diff --git a/arch/mips/math-emu/sp_div.c b/arch/mips/math-emu/sp_div.c
index 27f6db3..23587b3 100644
--- a/arch/mips/math-emu/sp_div.c
+++ b/arch/mips/math-emu/sp_div.c
@@ -23,9 +23,9 @@
 
 union ieee754sp ieee754sp_div(union ieee754sp x, union ieee754sp y)
 {
-	unsigned rm;
+	unsigned int rm;
 	int re;
-	unsigned bm;
+	unsigned int bm;
 
 	COMPXSP;
 	COMPYSP;
diff --git a/arch/mips/math-emu/sp_fint.c b/arch/mips/math-emu/sp_fint.c
index d5d8495..1a35d12 100644
--- a/arch/mips/math-emu/sp_fint.c
+++ b/arch/mips/math-emu/sp_fint.c
@@ -23,7 +23,7 @@
 
 union ieee754sp ieee754sp_fint(int x)
 {
-	unsigned xm;
+	unsigned int xm;
 	int xe;
 	int xs;
 
diff --git a/arch/mips/math-emu/sp_maddf.c b/arch/mips/math-emu/sp_maddf.c
index 7195fe7..f823338 100644
--- a/arch/mips/math-emu/sp_maddf.c
+++ b/arch/mips/math-emu/sp_maddf.c
@@ -20,9 +20,9 @@ static union ieee754sp _sp_maddf(union ieee754sp z, union ieee754sp x,
 {
 	int re;
 	int rs;
-	unsigned rm;
-	uint64_t rm64;
-	uint64_t zm64;
+	unsigned int rm;
+	u64 rm64;
+	u64 zm64;
 	int s;
 
 	COMPXSP;
diff --git a/arch/mips/math-emu/sp_mul.c b/arch/mips/math-emu/sp_mul.c
index d910c43..4015101 100644
--- a/arch/mips/math-emu/sp_mul.c
+++ b/arch/mips/math-emu/sp_mul.c
@@ -25,15 +25,15 @@ union ieee754sp ieee754sp_mul(union ieee754sp x, union ieee754sp y)
 {
 	int re;
 	int rs;
-	unsigned rm;
+	unsigned int rm;
 	unsigned short lxm;
 	unsigned short hxm;
 	unsigned short lym;
 	unsigned short hym;
-	unsigned lrm;
-	unsigned hrm;
-	unsigned t;
-	unsigned at;
+	unsigned int lrm;
+	unsigned int hrm;
+	unsigned int t;
+	unsigned int at;
 
 	COMPXSP;
 	COMPYSP;
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [PATCH 2/2] MIPS: math-emu: Use preferred flavor of unsigned integer declarations
@ 2017-10-09 16:59     ` James Hogan
  0 siblings, 0 replies; 15+ messages in thread
From: James Hogan @ 2017-10-09 16:59 UTC (permalink / raw)
  To: Aleksandar Markovic
  Cc: linux-mips, Aleksandar Markovic, Douglas Leung, Goran Ferenc,
	linux-kernel, Maciej W. Rozycki, Masahiro Yamada, Miodrag Dinic,
	Paul Burton, Petar Jovanovic, Raghu Gandham, Ralf Baechle

On Fri, Oct 06, 2017 at 07:29:01PM +0200, Aleksandar Markovic wrote:
> From: Aleksandar Markovic <aleksandar.markovic@imgtec.com>
> 
> Fix occurences of unsigned integer declarations that are not
> preferred by standards of checkpatch scripts. This removes
> significant number of checkpatch warnings in math-emu
> directory (several files will become completely warning-free),
> and thus makes easier to spot (now and in the future) other
> perhaps more significant checkpatch errors and warnings.
> 
> Signed-off-by: Aleksandar Markovic <aleksandar.markovic@imgtec.com>

Reviewed-by: James Hogan <jhogan@kernel.org>

Cheers
James

> ---
>  arch/mips/math-emu/cp1emu.c     | 18 ++++++++++--------
>  arch/mips/math-emu/dp_maddf.c   |  8 ++++----
>  arch/mips/math-emu/dp_mul.c     |  8 ++++----
>  arch/mips/math-emu/dp_sqrt.c    |  4 ++--
>  arch/mips/math-emu/ieee754.h    | 15 ++++++++-------
>  arch/mips/math-emu/ieee754int.h |  6 +++---
>  arch/mips/math-emu/ieee754sp.c  |  4 ++--
>  arch/mips/math-emu/ieee754sp.h  |  2 +-
>  arch/mips/math-emu/sp_div.c     |  4 ++--
>  arch/mips/math-emu/sp_fint.c    |  2 +-
>  arch/mips/math-emu/sp_maddf.c   |  6 +++---
>  arch/mips/math-emu/sp_mul.c     | 10 +++++-----
>  12 files changed, 45 insertions(+), 42 deletions(-)
> 
> diff --git a/arch/mips/math-emu/cp1emu.c b/arch/mips/math-emu/cp1emu.c
> index d2fcb30..9f145e1 100644
> --- a/arch/mips/math-emu/cp1emu.c
> +++ b/arch/mips/math-emu/cp1emu.c
> @@ -810,7 +810,7 @@ do {									\
>  #define SITOREG(si, x)							\
>  do {									\
>  	if (cop1_64bit(xcp) && !hybrid_fprs()) {			\
> -		unsigned i;						\
> +		unsigned int i;						\
>  		set_fpr32(&ctx->fpr[x], 0, si);				\
>  		for (i = 1; i < ARRAY_SIZE(ctx->fpr[x].val32); i++)	\
>  			set_fpr32(&ctx->fpr[x], i, 0);			\
> @@ -823,7 +823,7 @@ do {									\
>  
>  #define SITOHREG(si, x)							\
>  do {									\
> -	unsigned i;							\
> +	unsigned int i;							\
>  	set_fpr32(&ctx->fpr[x], 1, si);					\
>  	for (i = 2; i < ARRAY_SIZE(ctx->fpr[x].val32); i++)		\
>  		set_fpr32(&ctx->fpr[x], i, 0);				\
> @@ -834,7 +834,7 @@ do {									\
>  
>  #define DITOREG(di, x)							\
>  do {									\
> -	unsigned fpr, i;						\
> +	unsigned int fpr, i;						\
>  	fpr = (x) & ~(cop1_64bit(xcp) ^ 1);				\
>  	set_fpr64(&ctx->fpr[fpr], 0, di);				\
>  	for (i = 1; i < ARRAY_SIZE(ctx->fpr[x].val64); i++)		\
> @@ -1465,7 +1465,7 @@ DEF3OP(nmsub, dp, ieee754dp_mul, ieee754dp_sub, ieee754dp_neg);
>  static int fpux_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
>  	mips_instruction ir, void __user **fault_addr)
>  {
> -	unsigned rcsr = 0;	/* resulting csr */
> +	unsigned int rcsr = 0;	/* resulting csr */
>  
>  	MIPS_FPU_EMU_INC_STATS(cp1xops);
>  
> @@ -1661,10 +1661,10 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
>  	mips_instruction ir)
>  {
>  	int rfmt;		/* resulting format */
> -	unsigned rcsr = 0;	/* resulting csr */
> +	unsigned int rcsr = 0;	/* resulting csr */
>  	unsigned int oldrm;
>  	unsigned int cbit;
> -	unsigned cond;
> +	unsigned int cond;
>  	union {
>  		union ieee754dp d;
>  		union ieee754sp s;
> @@ -2029,9 +2029,10 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
>  
>  		default:
>  			if (!NO_R6EMU && MIPSInst_FUNC(ir) >= fcmp_op) {
> -				unsigned cmpop = MIPSInst_FUNC(ir) - fcmp_op;
> +				unsigned int cmpop;
>  				union ieee754sp fs, ft;
>  
> +				cmpop = MIPSInst_FUNC(ir) - fcmp_op;
>  				SPFROMREG(fs, MIPSInst_FS(ir));
>  				SPFROMREG(ft, MIPSInst_FT(ir));
>  				rv.w = ieee754sp_cmp(fs, ft,
> @@ -2379,9 +2380,10 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
>  
>  		default:
>  			if (!NO_R6EMU && MIPSInst_FUNC(ir) >= fcmp_op) {
> -				unsigned cmpop = MIPSInst_FUNC(ir) - fcmp_op;
> +				unsigned int cmpop;
>  				union ieee754dp fs, ft;
>  
> +				cmpop = MIPSInst_FUNC(ir) - fcmp_op;
>  				DPFROMREG(fs, MIPSInst_FS(ir));
>  				DPFROMREG(ft, MIPSInst_FT(ir));
>  				rv.w = ieee754dp_cmp(fs, ft,
> diff --git a/arch/mips/math-emu/dp_maddf.c b/arch/mips/math-emu/dp_maddf.c
> index e0d9be5..7ad79ed 100644
> --- a/arch/mips/math-emu/dp_maddf.c
> +++ b/arch/mips/math-emu/dp_maddf.c
> @@ -45,10 +45,10 @@ static union ieee754dp _dp_maddf(union ieee754dp z, union ieee754dp x,
>  {
>  	int re;
>  	int rs;
> -	unsigned lxm;
> -	unsigned hxm;
> -	unsigned lym;
> -	unsigned hym;
> +	unsigned int lxm;
> +	unsigned int hxm;
> +	unsigned int lym;
> +	unsigned int hym;
>  	u64 lrm;
>  	u64 hrm;
>  	u64 lzm;
> diff --git a/arch/mips/math-emu/dp_mul.c b/arch/mips/math-emu/dp_mul.c
> index 87d0b44..60c8bfe 100644
> --- a/arch/mips/math-emu/dp_mul.c
> +++ b/arch/mips/math-emu/dp_mul.c
> @@ -26,10 +26,10 @@ union ieee754dp ieee754dp_mul(union ieee754dp x, union ieee754dp y)
>  	int re;
>  	int rs;
>  	u64 rm;
> -	unsigned lxm;
> -	unsigned hxm;
> -	unsigned lym;
> -	unsigned hym;
> +	unsigned int lxm;
> +	unsigned int hxm;
> +	unsigned int lym;
> +	unsigned int hym;
>  	u64 lrm;
>  	u64 hrm;
>  	u64 t;
> diff --git a/arch/mips/math-emu/dp_sqrt.c b/arch/mips/math-emu/dp_sqrt.c
> index cd5bc08..cea907b 100644
> --- a/arch/mips/math-emu/dp_sqrt.c
> +++ b/arch/mips/math-emu/dp_sqrt.c
> @@ -21,7 +21,7 @@
>  
>  #include "ieee754dp.h"
>  
> -static const unsigned table[] = {
> +static const unsigned int table[] = {
>  	0, 1204, 3062, 5746, 9193, 13348, 18162, 23592,
>  	29598, 36145, 43202, 50740, 58733, 67158, 75992,
>  	85215, 83599, 71378, 60428, 50647, 41945, 34246,
> @@ -33,7 +33,7 @@ union ieee754dp ieee754dp_sqrt(union ieee754dp x)
>  {
>  	struct _ieee754_csr oldcsr;
>  	union ieee754dp y, z, t;
> -	unsigned scalx, yh;
> +	unsigned int scalx, yh;
>  	COMPXDP;
>  
>  	EXPLODEXDP;
> diff --git a/arch/mips/math-emu/ieee754.h b/arch/mips/math-emu/ieee754.h
> index 92dc8fa..e0eb7a9 100644
> --- a/arch/mips/math-emu/ieee754.h
> +++ b/arch/mips/math-emu/ieee754.h
> @@ -165,11 +165,12 @@ struct _ieee754_csr {
>  };
>  #define ieee754_csr (*(struct _ieee754_csr *)(&current->thread.fpu.fcr31))
>  
> -static inline unsigned ieee754_getrm(void)
> +static inline unsigned int ieee754_getrm(void)
>  {
>  	return (ieee754_csr.rm);
>  }
> -static inline unsigned ieee754_setrm(unsigned rm)
> +
> +static inline unsigned int ieee754_setrm(unsigned int rm)
>  {
>  	return (ieee754_csr.rm = rm);
>  }
> @@ -177,14 +178,14 @@ static inline unsigned ieee754_setrm(unsigned rm)
>  /*
>   * get current exceptions
>   */
> -static inline unsigned ieee754_getcx(void)
> +static inline unsigned int ieee754_getcx(void)
>  {
>  	return (ieee754_csr.cx);
>  }
>  
>  /* test for current exception condition
>   */
> -static inline int ieee754_cxtest(unsigned n)
> +static inline int ieee754_cxtest(unsigned int n)
>  {
>  	return (ieee754_csr.cx & n);
>  }
> @@ -192,21 +193,21 @@ static inline int ieee754_cxtest(unsigned n)
>  /*
>   * get sticky exceptions
>   */
> -static inline unsigned ieee754_getsx(void)
> +static inline unsigned int ieee754_getsx(void)
>  {
>  	return (ieee754_csr.sx);
>  }
>  
>  /* clear sticky conditions
>  */
> -static inline unsigned ieee754_clrsx(void)
> +static inline unsigned int ieee754_clrsx(void)
>  {
>  	return (ieee754_csr.sx = 0);
>  }
>  
>  /* test for sticky exception condition
>   */
> -static inline int ieee754_sxtest(unsigned n)
> +static inline int ieee754_sxtest(unsigned int n)
>  {
>  	return (ieee754_csr.sx & n);
>  }
> diff --git a/arch/mips/math-emu/ieee754int.h b/arch/mips/math-emu/ieee754int.h
> index dd2071f..06ac0e2 100644
> --- a/arch/mips/math-emu/ieee754int.h
> +++ b/arch/mips/math-emu/ieee754int.h
> @@ -54,13 +54,13 @@ static inline int ieee754_class_nan(int xc)
>  }
>  
>  #define COMPXSP \
> -	unsigned xm; int xe; int xs __maybe_unused; int xc
> +	unsigned int xm; int xe; int xs __maybe_unused; int xc
>  
>  #define COMPYSP \
> -	unsigned ym; int ye; int ys; int yc
> +	unsigned int ym; int ye; int ys; int yc
>  
>  #define COMPZSP \
> -	unsigned zm; int ze; int zs; int zc
> +	unsigned int zm; int ze; int zs; int zc
>  
>  #define EXPLODESP(v, vc, vs, ve, vm)					\
>  {									\
> diff --git a/arch/mips/math-emu/ieee754sp.c b/arch/mips/math-emu/ieee754sp.c
> index 260e6896..8423e4c 100644
> --- a/arch/mips/math-emu/ieee754sp.c
> +++ b/arch/mips/math-emu/ieee754sp.c
> @@ -65,7 +65,7 @@ union ieee754sp __cold ieee754sp_nanxcpt(union ieee754sp r)
>  	return r;
>  }
>  
> -static unsigned ieee754sp_get_rounding(int sn, unsigned xm)
> +static unsigned int ieee754sp_get_rounding(int sn, unsigned int xm)
>  {
>  	/* inexact must round of 3 bits
>  	 */
> @@ -96,7 +96,7 @@ static unsigned ieee754sp_get_rounding(int sn, unsigned xm)
>   * xe is an unbiased exponent
>   * xm is 3bit extended precision value.
>   */
> -union ieee754sp ieee754sp_format(int sn, int xe, unsigned xm)
> +union ieee754sp ieee754sp_format(int sn, int xe, unsigned int xm)
>  {
>  	assert(xm);		/* we don't gen exact zeros (probably should) */
>  
> diff --git a/arch/mips/math-emu/ieee754sp.h b/arch/mips/math-emu/ieee754sp.h
> index 0f63e42..8c5a638 100644
> --- a/arch/mips/math-emu/ieee754sp.h
> +++ b/arch/mips/math-emu/ieee754sp.h
> @@ -69,7 +69,7 @@ static inline int ieee754sp_finite(union ieee754sp x)
>  #define SPDNORMY	SPDNORMx(ym, ye)
>  #define SPDNORMZ	SPDNORMx(zm, ze)
>  
> -static inline union ieee754sp buildsp(int s, int bx, unsigned m)
> +static inline union ieee754sp buildsp(int s, int bx, unsigned int m)
>  {
>  	union ieee754sp r;
>  
> diff --git a/arch/mips/math-emu/sp_div.c b/arch/mips/math-emu/sp_div.c
> index 27f6db3..23587b3 100644
> --- a/arch/mips/math-emu/sp_div.c
> +++ b/arch/mips/math-emu/sp_div.c
> @@ -23,9 +23,9 @@
>  
>  union ieee754sp ieee754sp_div(union ieee754sp x, union ieee754sp y)
>  {
> -	unsigned rm;
> +	unsigned int rm;
>  	int re;
> -	unsigned bm;
> +	unsigned int bm;
>  
>  	COMPXSP;
>  	COMPYSP;
> diff --git a/arch/mips/math-emu/sp_fint.c b/arch/mips/math-emu/sp_fint.c
> index d5d8495..1a35d12 100644
> --- a/arch/mips/math-emu/sp_fint.c
> +++ b/arch/mips/math-emu/sp_fint.c
> @@ -23,7 +23,7 @@
>  
>  union ieee754sp ieee754sp_fint(int x)
>  {
> -	unsigned xm;
> +	unsigned int xm;
>  	int xe;
>  	int xs;
>  
> diff --git a/arch/mips/math-emu/sp_maddf.c b/arch/mips/math-emu/sp_maddf.c
> index 7195fe7..f823338 100644
> --- a/arch/mips/math-emu/sp_maddf.c
> +++ b/arch/mips/math-emu/sp_maddf.c
> @@ -20,9 +20,9 @@ static union ieee754sp _sp_maddf(union ieee754sp z, union ieee754sp x,
>  {
>  	int re;
>  	int rs;
> -	unsigned rm;
> -	uint64_t rm64;
> -	uint64_t zm64;
> +	unsigned int rm;
> +	u64 rm64;
> +	u64 zm64;
>  	int s;
>  
>  	COMPXSP;
> diff --git a/arch/mips/math-emu/sp_mul.c b/arch/mips/math-emu/sp_mul.c
> index d910c43..4015101 100644
> --- a/arch/mips/math-emu/sp_mul.c
> +++ b/arch/mips/math-emu/sp_mul.c
> @@ -25,15 +25,15 @@ union ieee754sp ieee754sp_mul(union ieee754sp x, union ieee754sp y)
>  {
>  	int re;
>  	int rs;
> -	unsigned rm;
> +	unsigned int rm;
>  	unsigned short lxm;
>  	unsigned short hxm;
>  	unsigned short lym;
>  	unsigned short hym;
> -	unsigned lrm;
> -	unsigned hrm;
> -	unsigned t;
> -	unsigned at;
> +	unsigned int lrm;
> +	unsigned int hrm;
> +	unsigned int t;
> +	unsigned int at;
>  
>  	COMPXSP;
>  	COMPYSP;
> -- 
> 2.7.4
> 

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 2/2] MIPS: math-emu: Use preferred flavor of unsigned integer declarations
@ 2017-10-09 16:59     ` James Hogan
  0 siblings, 0 replies; 15+ messages in thread
From: James Hogan @ 2017-10-09 16:59 UTC (permalink / raw)
  To: Aleksandar Markovic
  Cc: linux-mips, Aleksandar Markovic, Douglas Leung, Goran Ferenc,
	linux-kernel, Maciej W. Rozycki, Masahiro Yamada, Miodrag Dinic,
	Paul Burton, Petar Jovanovic, Raghu Gandham, Ralf Baechle

On Fri, Oct 06, 2017 at 07:29:01PM +0200, Aleksandar Markovic wrote:
> From: Aleksandar Markovic <aleksandar.markovic@imgtec.com>
> 
> Fix occurences of unsigned integer declarations that are not
> preferred by standards of checkpatch scripts. This removes
> significant number of checkpatch warnings in math-emu
> directory (several files will become completely warning-free),
> and thus makes easier to spot (now and in the future) other
> perhaps more significant checkpatch errors and warnings.
> 
> Signed-off-by: Aleksandar Markovic <aleksandar.markovic@imgtec.com>

Reviewed-by: James Hogan <jhogan@kernel.org>

Cheers
James

> ---
>  arch/mips/math-emu/cp1emu.c     | 18 ++++++++++--------
>  arch/mips/math-emu/dp_maddf.c   |  8 ++++----
>  arch/mips/math-emu/dp_mul.c     |  8 ++++----
>  arch/mips/math-emu/dp_sqrt.c    |  4 ++--
>  arch/mips/math-emu/ieee754.h    | 15 ++++++++-------
>  arch/mips/math-emu/ieee754int.h |  6 +++---
>  arch/mips/math-emu/ieee754sp.c  |  4 ++--
>  arch/mips/math-emu/ieee754sp.h  |  2 +-
>  arch/mips/math-emu/sp_div.c     |  4 ++--
>  arch/mips/math-emu/sp_fint.c    |  2 +-
>  arch/mips/math-emu/sp_maddf.c   |  6 +++---
>  arch/mips/math-emu/sp_mul.c     | 10 +++++-----
>  12 files changed, 45 insertions(+), 42 deletions(-)
> 
> diff --git a/arch/mips/math-emu/cp1emu.c b/arch/mips/math-emu/cp1emu.c
> index d2fcb30..9f145e1 100644
> --- a/arch/mips/math-emu/cp1emu.c
> +++ b/arch/mips/math-emu/cp1emu.c
> @@ -810,7 +810,7 @@ do {									\
>  #define SITOREG(si, x)							\
>  do {									\
>  	if (cop1_64bit(xcp) && !hybrid_fprs()) {			\
> -		unsigned i;						\
> +		unsigned int i;						\
>  		set_fpr32(&ctx->fpr[x], 0, si);				\
>  		for (i = 1; i < ARRAY_SIZE(ctx->fpr[x].val32); i++)	\
>  			set_fpr32(&ctx->fpr[x], i, 0);			\
> @@ -823,7 +823,7 @@ do {									\
>  
>  #define SITOHREG(si, x)							\
>  do {									\
> -	unsigned i;							\
> +	unsigned int i;							\
>  	set_fpr32(&ctx->fpr[x], 1, si);					\
>  	for (i = 2; i < ARRAY_SIZE(ctx->fpr[x].val32); i++)		\
>  		set_fpr32(&ctx->fpr[x], i, 0);				\
> @@ -834,7 +834,7 @@ do {									\
>  
>  #define DITOREG(di, x)							\
>  do {									\
> -	unsigned fpr, i;						\
> +	unsigned int fpr, i;						\
>  	fpr = (x) & ~(cop1_64bit(xcp) ^ 1);				\
>  	set_fpr64(&ctx->fpr[fpr], 0, di);				\
>  	for (i = 1; i < ARRAY_SIZE(ctx->fpr[x].val64); i++)		\
> @@ -1465,7 +1465,7 @@ DEF3OP(nmsub, dp, ieee754dp_mul, ieee754dp_sub, ieee754dp_neg);
>  static int fpux_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
>  	mips_instruction ir, void __user **fault_addr)
>  {
> -	unsigned rcsr = 0;	/* resulting csr */
> +	unsigned int rcsr = 0;	/* resulting csr */
>  
>  	MIPS_FPU_EMU_INC_STATS(cp1xops);
>  
> @@ -1661,10 +1661,10 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
>  	mips_instruction ir)
>  {
>  	int rfmt;		/* resulting format */
> -	unsigned rcsr = 0;	/* resulting csr */
> +	unsigned int rcsr = 0;	/* resulting csr */
>  	unsigned int oldrm;
>  	unsigned int cbit;
> -	unsigned cond;
> +	unsigned int cond;
>  	union {
>  		union ieee754dp d;
>  		union ieee754sp s;
> @@ -2029,9 +2029,10 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
>  
>  		default:
>  			if (!NO_R6EMU && MIPSInst_FUNC(ir) >= fcmp_op) {
> -				unsigned cmpop = MIPSInst_FUNC(ir) - fcmp_op;
> +				unsigned int cmpop;
>  				union ieee754sp fs, ft;
>  
> +				cmpop = MIPSInst_FUNC(ir) - fcmp_op;
>  				SPFROMREG(fs, MIPSInst_FS(ir));
>  				SPFROMREG(ft, MIPSInst_FT(ir));
>  				rv.w = ieee754sp_cmp(fs, ft,
> @@ -2379,9 +2380,10 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
>  
>  		default:
>  			if (!NO_R6EMU && MIPSInst_FUNC(ir) >= fcmp_op) {
> -				unsigned cmpop = MIPSInst_FUNC(ir) - fcmp_op;
> +				unsigned int cmpop;
>  				union ieee754dp fs, ft;
>  
> +				cmpop = MIPSInst_FUNC(ir) - fcmp_op;
>  				DPFROMREG(fs, MIPSInst_FS(ir));
>  				DPFROMREG(ft, MIPSInst_FT(ir));
>  				rv.w = ieee754dp_cmp(fs, ft,
> diff --git a/arch/mips/math-emu/dp_maddf.c b/arch/mips/math-emu/dp_maddf.c
> index e0d9be5..7ad79ed 100644
> --- a/arch/mips/math-emu/dp_maddf.c
> +++ b/arch/mips/math-emu/dp_maddf.c
> @@ -45,10 +45,10 @@ static union ieee754dp _dp_maddf(union ieee754dp z, union ieee754dp x,
>  {
>  	int re;
>  	int rs;
> -	unsigned lxm;
> -	unsigned hxm;
> -	unsigned lym;
> -	unsigned hym;
> +	unsigned int lxm;
> +	unsigned int hxm;
> +	unsigned int lym;
> +	unsigned int hym;
>  	u64 lrm;
>  	u64 hrm;
>  	u64 lzm;
> diff --git a/arch/mips/math-emu/dp_mul.c b/arch/mips/math-emu/dp_mul.c
> index 87d0b44..60c8bfe 100644
> --- a/arch/mips/math-emu/dp_mul.c
> +++ b/arch/mips/math-emu/dp_mul.c
> @@ -26,10 +26,10 @@ union ieee754dp ieee754dp_mul(union ieee754dp x, union ieee754dp y)
>  	int re;
>  	int rs;
>  	u64 rm;
> -	unsigned lxm;
> -	unsigned hxm;
> -	unsigned lym;
> -	unsigned hym;
> +	unsigned int lxm;
> +	unsigned int hxm;
> +	unsigned int lym;
> +	unsigned int hym;
>  	u64 lrm;
>  	u64 hrm;
>  	u64 t;
> diff --git a/arch/mips/math-emu/dp_sqrt.c b/arch/mips/math-emu/dp_sqrt.c
> index cd5bc08..cea907b 100644
> --- a/arch/mips/math-emu/dp_sqrt.c
> +++ b/arch/mips/math-emu/dp_sqrt.c
> @@ -21,7 +21,7 @@
>  
>  #include "ieee754dp.h"
>  
> -static const unsigned table[] = {
> +static const unsigned int table[] = {
>  	0, 1204, 3062, 5746, 9193, 13348, 18162, 23592,
>  	29598, 36145, 43202, 50740, 58733, 67158, 75992,
>  	85215, 83599, 71378, 60428, 50647, 41945, 34246,
> @@ -33,7 +33,7 @@ union ieee754dp ieee754dp_sqrt(union ieee754dp x)
>  {
>  	struct _ieee754_csr oldcsr;
>  	union ieee754dp y, z, t;
> -	unsigned scalx, yh;
> +	unsigned int scalx, yh;
>  	COMPXDP;
>  
>  	EXPLODEXDP;
> diff --git a/arch/mips/math-emu/ieee754.h b/arch/mips/math-emu/ieee754.h
> index 92dc8fa..e0eb7a9 100644
> --- a/arch/mips/math-emu/ieee754.h
> +++ b/arch/mips/math-emu/ieee754.h
> @@ -165,11 +165,12 @@ struct _ieee754_csr {
>  };
>  #define ieee754_csr (*(struct _ieee754_csr *)(&current->thread.fpu.fcr31))
>  
> -static inline unsigned ieee754_getrm(void)
> +static inline unsigned int ieee754_getrm(void)
>  {
>  	return (ieee754_csr.rm);
>  }
> -static inline unsigned ieee754_setrm(unsigned rm)
> +
> +static inline unsigned int ieee754_setrm(unsigned int rm)
>  {
>  	return (ieee754_csr.rm = rm);
>  }
> @@ -177,14 +178,14 @@ static inline unsigned ieee754_setrm(unsigned rm)
>  /*
>   * get current exceptions
>   */
> -static inline unsigned ieee754_getcx(void)
> +static inline unsigned int ieee754_getcx(void)
>  {
>  	return (ieee754_csr.cx);
>  }
>  
>  /* test for current exception condition
>   */
> -static inline int ieee754_cxtest(unsigned n)
> +static inline int ieee754_cxtest(unsigned int n)
>  {
>  	return (ieee754_csr.cx & n);
>  }
> @@ -192,21 +193,21 @@ static inline int ieee754_cxtest(unsigned n)
>  /*
>   * get sticky exceptions
>   */
> -static inline unsigned ieee754_getsx(void)
> +static inline unsigned int ieee754_getsx(void)
>  {
>  	return (ieee754_csr.sx);
>  }
>  
>  /* clear sticky conditions
>  */
> -static inline unsigned ieee754_clrsx(void)
> +static inline unsigned int ieee754_clrsx(void)
>  {
>  	return (ieee754_csr.sx = 0);
>  }
>  
>  /* test for sticky exception condition
>   */
> -static inline int ieee754_sxtest(unsigned n)
> +static inline int ieee754_sxtest(unsigned int n)
>  {
>  	return (ieee754_csr.sx & n);
>  }
> diff --git a/arch/mips/math-emu/ieee754int.h b/arch/mips/math-emu/ieee754int.h
> index dd2071f..06ac0e2 100644
> --- a/arch/mips/math-emu/ieee754int.h
> +++ b/arch/mips/math-emu/ieee754int.h
> @@ -54,13 +54,13 @@ static inline int ieee754_class_nan(int xc)
>  }
>  
>  #define COMPXSP \
> -	unsigned xm; int xe; int xs __maybe_unused; int xc
> +	unsigned int xm; int xe; int xs __maybe_unused; int xc
>  
>  #define COMPYSP \
> -	unsigned ym; int ye; int ys; int yc
> +	unsigned int ym; int ye; int ys; int yc
>  
>  #define COMPZSP \
> -	unsigned zm; int ze; int zs; int zc
> +	unsigned int zm; int ze; int zs; int zc
>  
>  #define EXPLODESP(v, vc, vs, ve, vm)					\
>  {									\
> diff --git a/arch/mips/math-emu/ieee754sp.c b/arch/mips/math-emu/ieee754sp.c
> index 260e6896..8423e4c 100644
> --- a/arch/mips/math-emu/ieee754sp.c
> +++ b/arch/mips/math-emu/ieee754sp.c
> @@ -65,7 +65,7 @@ union ieee754sp __cold ieee754sp_nanxcpt(union ieee754sp r)
>  	return r;
>  }
>  
> -static unsigned ieee754sp_get_rounding(int sn, unsigned xm)
> +static unsigned int ieee754sp_get_rounding(int sn, unsigned int xm)
>  {
>  	/* inexact must round of 3 bits
>  	 */
> @@ -96,7 +96,7 @@ static unsigned ieee754sp_get_rounding(int sn, unsigned xm)
>   * xe is an unbiased exponent
>   * xm is 3bit extended precision value.
>   */
> -union ieee754sp ieee754sp_format(int sn, int xe, unsigned xm)
> +union ieee754sp ieee754sp_format(int sn, int xe, unsigned int xm)
>  {
>  	assert(xm);		/* we don't gen exact zeros (probably should) */
>  
> diff --git a/arch/mips/math-emu/ieee754sp.h b/arch/mips/math-emu/ieee754sp.h
> index 0f63e42..8c5a638 100644
> --- a/arch/mips/math-emu/ieee754sp.h
> +++ b/arch/mips/math-emu/ieee754sp.h
> @@ -69,7 +69,7 @@ static inline int ieee754sp_finite(union ieee754sp x)
>  #define SPDNORMY	SPDNORMx(ym, ye)
>  #define SPDNORMZ	SPDNORMx(zm, ze)
>  
> -static inline union ieee754sp buildsp(int s, int bx, unsigned m)
> +static inline union ieee754sp buildsp(int s, int bx, unsigned int m)
>  {
>  	union ieee754sp r;
>  
> diff --git a/arch/mips/math-emu/sp_div.c b/arch/mips/math-emu/sp_div.c
> index 27f6db3..23587b3 100644
> --- a/arch/mips/math-emu/sp_div.c
> +++ b/arch/mips/math-emu/sp_div.c
> @@ -23,9 +23,9 @@
>  
>  union ieee754sp ieee754sp_div(union ieee754sp x, union ieee754sp y)
>  {
> -	unsigned rm;
> +	unsigned int rm;
>  	int re;
> -	unsigned bm;
> +	unsigned int bm;
>  
>  	COMPXSP;
>  	COMPYSP;
> diff --git a/arch/mips/math-emu/sp_fint.c b/arch/mips/math-emu/sp_fint.c
> index d5d8495..1a35d12 100644
> --- a/arch/mips/math-emu/sp_fint.c
> +++ b/arch/mips/math-emu/sp_fint.c
> @@ -23,7 +23,7 @@
>  
>  union ieee754sp ieee754sp_fint(int x)
>  {
> -	unsigned xm;
> +	unsigned int xm;
>  	int xe;
>  	int xs;
>  
> diff --git a/arch/mips/math-emu/sp_maddf.c b/arch/mips/math-emu/sp_maddf.c
> index 7195fe7..f823338 100644
> --- a/arch/mips/math-emu/sp_maddf.c
> +++ b/arch/mips/math-emu/sp_maddf.c
> @@ -20,9 +20,9 @@ static union ieee754sp _sp_maddf(union ieee754sp z, union ieee754sp x,
>  {
>  	int re;
>  	int rs;
> -	unsigned rm;
> -	uint64_t rm64;
> -	uint64_t zm64;
> +	unsigned int rm;
> +	u64 rm64;
> +	u64 zm64;
>  	int s;
>  
>  	COMPXSP;
> diff --git a/arch/mips/math-emu/sp_mul.c b/arch/mips/math-emu/sp_mul.c
> index d910c43..4015101 100644
> --- a/arch/mips/math-emu/sp_mul.c
> +++ b/arch/mips/math-emu/sp_mul.c
> @@ -25,15 +25,15 @@ union ieee754sp ieee754sp_mul(union ieee754sp x, union ieee754sp y)
>  {
>  	int re;
>  	int rs;
> -	unsigned rm;
> +	unsigned int rm;
>  	unsigned short lxm;
>  	unsigned short hxm;
>  	unsigned short lym;
>  	unsigned short hym;
> -	unsigned lrm;
> -	unsigned hrm;
> -	unsigned t;
> -	unsigned at;
> +	unsigned int lrm;
> +	unsigned int hrm;
> +	unsigned int t;
> +	unsigned int at;
>  
>  	COMPXSP;
>  	COMPYSP;
> -- 
> 2.7.4
> 

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 1/2] MIPS: math-emu: Update debugfs FP exception stats for certain instructions
@ 2017-10-09 21:09     ` James Hogan
  0 siblings, 0 replies; 15+ messages in thread
From: James Hogan @ 2017-10-09 21:09 UTC (permalink / raw)
  To: Aleksandar Markovic
  Cc: linux-mips, Aleksandar Markovic, Douglas Leung, Goran Ferenc,
	linux-kernel, Maciej W. Rozycki, Manuel Lauss, Masahiro Yamada,
	Miodrag Dinic, Paul Burton, Petar Jovanovic, Raghu Gandham,
	Ralf Baechle

[-- Attachment #1: Type: text/plain, Size: 6547 bytes --]

On Fri, Oct 06, 2017 at 07:29:00PM +0200, Aleksandar Markovic wrote:
> From: Aleksandar Markovic <aleksandar.markovic@imgtec.com>
> 
> Fix omission of updating of debugfs FP exception stats for
> instructions <CLASS|MADDF|MSUBF|MAX|MIN|MAXA|MINA>.<D|S>.
> 
> CLASS.<D|S> can generate Unimplemented Operation FP exception.
> <MADDF|MSUBF|MAX|MIN|MAXA|MINA>>.<D|S> can generate Inexact,

nit: s/>>/>/

> Unimplemented Operation, Invalid Operation, Overflow, and
> Underflow FP exceptions. In such cases, and prior to this

Well, according to the manual I'm looking at MAX|MIN|MAXA|MINA can't
generate inexact, overflow, or underflow FP exceptions, and in practice
the only FPE generated by emulating these instructions is invalid
operation for MADDF/MSUBF. So presumably that's the only case we really
care about.

I.e. the MADDF/MSUBF invalid operation should be counted, but crucially
the setting of rcsr bits allows it to generate a SIGFPE which from a
glance it doesn't appear to do until this patch. The other changes are
redundant and harmless.

Does that sound correct? (appologies if I'm missing something, I'm just
reading the code, and reading FPU emulation code late at night is
probably asking for trouble).

Given the potential fixing of SIGFPE in that case should this be tagged
for stable?

Thanks
James


> patch, debugfs FP exception stats were not updated, and
> therefore contained overall wrong values.
> 
> This brings the emulation of mentioned instructions consistent
> with the previously implemented emulation of other related
> FPU instructions.
> 
> There is still some room for refactoring and improving the
> code segment under label "copcsr", but this is beyond the
> scope of this patch.
> 
> Fixes: 38db37ba069f ("MIPS: math-emu: Add support for the MIPS R6 CLASS FPU instruction")
> Fixes: e24c3bec3e8e ("MIPS: math-emu: Add support for the MIPS R6 MADDF FPU instruction")
> Fixes: 83d43305a1df ("MIPS: math-emu: Add support for the MIPS R6 MSUBF FPU instruction")
> Fixes: a79f5f9ba508 ("MIPS: math-emu: Add support for the MIPS R6 MAX{, A} FPU instruction")
> Fixes: 4e9561b20e2f ("MIPS: math-emu: Add support for the MIPS R6 MIN{, A} FPU instruction")
> 
> Signed-off-by: Aleksandar Markovic <aleksandar.markovic@imgtec.com>
> ---
>  arch/mips/math-emu/cp1emu.c | 28 ++++++++++++++--------------
>  1 file changed, 14 insertions(+), 14 deletions(-)
> 
> diff --git a/arch/mips/math-emu/cp1emu.c b/arch/mips/math-emu/cp1emu.c
> index 192542d..d2fcb30 100644
> --- a/arch/mips/math-emu/cp1emu.c
> +++ b/arch/mips/math-emu/cp1emu.c
> @@ -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:
> -- 
> 2.7.4
> 

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 1/2] MIPS: math-emu: Update debugfs FP exception stats for certain instructions
@ 2017-10-09 21:09     ` James Hogan
  0 siblings, 0 replies; 15+ messages in thread
From: James Hogan @ 2017-10-09 21:09 UTC (permalink / raw)
  To: Aleksandar Markovic
  Cc: linux-mips, Aleksandar Markovic, Douglas Leung, Goran Ferenc,
	linux-kernel, Maciej W. Rozycki, Manuel Lauss, Masahiro Yamada,
	Miodrag Dinic, Paul Burton, Petar Jovanovic, Raghu Gandham,
	Ralf Baechle

[-- Attachment #1: Type: text/plain, Size: 6547 bytes --]

On Fri, Oct 06, 2017 at 07:29:00PM +0200, Aleksandar Markovic wrote:
> From: Aleksandar Markovic <aleksandar.markovic@imgtec.com>
> 
> Fix omission of updating of debugfs FP exception stats for
> instructions <CLASS|MADDF|MSUBF|MAX|MIN|MAXA|MINA>.<D|S>.
> 
> CLASS.<D|S> can generate Unimplemented Operation FP exception.
> <MADDF|MSUBF|MAX|MIN|MAXA|MINA>>.<D|S> can generate Inexact,

nit: s/>>/>/

> Unimplemented Operation, Invalid Operation, Overflow, and
> Underflow FP exceptions. In such cases, and prior to this

Well, according to the manual I'm looking at MAX|MIN|MAXA|MINA can't
generate inexact, overflow, or underflow FP exceptions, and in practice
the only FPE generated by emulating these instructions is invalid
operation for MADDF/MSUBF. So presumably that's the only case we really
care about.

I.e. the MADDF/MSUBF invalid operation should be counted, but crucially
the setting of rcsr bits allows it to generate a SIGFPE which from a
glance it doesn't appear to do until this patch. The other changes are
redundant and harmless.

Does that sound correct? (appologies if I'm missing something, I'm just
reading the code, and reading FPU emulation code late at night is
probably asking for trouble).

Given the potential fixing of SIGFPE in that case should this be tagged
for stable?

Thanks
James


> patch, debugfs FP exception stats were not updated, and
> therefore contained overall wrong values.
> 
> This brings the emulation of mentioned instructions consistent
> with the previously implemented emulation of other related
> FPU instructions.
> 
> There is still some room for refactoring and improving the
> code segment under label "copcsr", but this is beyond the
> scope of this patch.
> 
> Fixes: 38db37ba069f ("MIPS: math-emu: Add support for the MIPS R6 CLASS FPU instruction")
> Fixes: e24c3bec3e8e ("MIPS: math-emu: Add support for the MIPS R6 MADDF FPU instruction")
> Fixes: 83d43305a1df ("MIPS: math-emu: Add support for the MIPS R6 MSUBF FPU instruction")
> Fixes: a79f5f9ba508 ("MIPS: math-emu: Add support for the MIPS R6 MAX{, A} FPU instruction")
> Fixes: 4e9561b20e2f ("MIPS: math-emu: Add support for the MIPS R6 MIN{, A} FPU instruction")
> 
> Signed-off-by: Aleksandar Markovic <aleksandar.markovic@imgtec.com>
> ---
>  arch/mips/math-emu/cp1emu.c | 28 ++++++++++++++--------------
>  1 file changed, 14 insertions(+), 14 deletions(-)
> 
> diff --git a/arch/mips/math-emu/cp1emu.c b/arch/mips/math-emu/cp1emu.c
> index 192542d..d2fcb30 100644
> --- a/arch/mips/math-emu/cp1emu.c
> +++ b/arch/mips/math-emu/cp1emu.c
> @@ -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:
> -- 
> 2.7.4
> 

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* RE: [PATCH 1/2] MIPS: math-emu: Update debugfs FP exception stats for certain instructions
  2017-10-09 21:09     ` James Hogan
@ 2017-10-11 16:18       ` Aleksandar Markovic
  -1 siblings, 0 replies; 15+ messages in thread
From: Aleksandar Markovic @ 2017-10-11 16:18 UTC (permalink / raw)
  To: James Hogan, Aleksandar Markovic
  Cc: linux-mips, Douglas Leung, Goran Ferenc, linux-kernel,
	Maciej Rozycki, Manuel Lauss, Masahiro Yamada, Miodrag Dinic,
	Paul Burton, Petar Jovanovic, Raghu Gandham, Ralf Baechle

Thanks, James, for the review.

I've got a couple of points bellow that will, I hope, clarify several issues.

> ________________________________________
> From: James Hogan [james.hogan@mips.com]
> Sent: Monday, October 09, 2017 2:09 PM
> To: Aleksandar Markovic
> Cc: linux-mips@linux-mips.org; Aleksandar Markovic; Douglas Leung;
> Goran Ferenc; linux-kernel@vger.kernel.org; Maciej Rozycki;
> Manuel Lauss; Masahiro Yamada; Miodrag Dinic; Paul Burton;
> Petar Jovanovic; Raghu Gandham; Ralf Baechle
> Subject: Re: [PATCH 1/2] MIPS: math-emu: Update debugfs FP
> exception stats for certain instructions
> 
> On Fri, Oct 06, 2017 at 07:29:00PM +0200, Aleksandar Markovic wrote:
> > From: Aleksandar Markovic <aleksandar.markovic@imgtec.com>
> >
> > Fix omission of updating of debugfs FP exception stats for
> > instructions <CLASS|MADDF|MSUBF|MAX|MIN|MAXA|MINA>.<D|S>.
> >
> > CLASS.<D|S> can generate Unimplemented Operation FP exception.
> > <MADDF|MSUBF|MAX|MIN|MAXA|MINA>>.<D|S> can generate Inexact,
> 
> nit: s/>>/>/

Will be fixed in v2.

> 
> > Unimplemented Operation, Invalid Operation, Overflow, and
> > Underflow FP exceptions. In such cases, and prior to this
> 
> Well, according to the manual I'm looking at MAX|MIN|MAXA|MINA can't
> generate inexact, overflow, or underflow FP exceptions
>

The "MIPS64® Instruction Set Reference Manual" v6.00 mentions that all
five FP exception are possible for MAX|MIN|MAXA|MINA, but in v6.05, the
list was reduced to only two, as you hinted. I am going to sync the commit
message with v6.05 of the document.

> ... and in practice
> the only FPE generated by emulating these instructions is invalid
> operation for MADDF/MSUBF. So presumably that's the only case we really
> care about.
> 
> I.e. the MADDF/MSUBF invalid operation should be counted, but crucially
> the setting of rcsr bits allows it to generate a SIGFPE which from a
> glance it doesn't appear to do until this patch. The other changes are
> redundant and harmless.
> 
> Does that sound correct? (appologies if I'm missing something, I'm just
> reading the code, and reading FPU emulation code late at night is
> probably asking for trouble).
>

You are close, but not quite, I'll explain that in a moment.

First, just to note that SIGFPE will be generated if the condition

((ctx->fcr31 >> 5) & ctx->fcr31 & FPU_CSR_ALL_E)

is met (the code is almost at the end of fpu_emu(), cp1emu.c, line 1557).
ctx is one of the arguments of fpu_emu(), but, in the current state of the
code, by analyzing several levels of invocations, it can be concluded
that ctx will always be equal to &current->thread.fpu. So, the register
current->thread.fpu->fcr31 is actually important here.

Now, let's consider, for simplicity, the case of MADDF operation resulting
in an overflow caused by addition of two large FP numbers. The "special"
treatment of such case will be done within invocation of ieee754dp_format(),
which will in turn (in this particular example) execute
ieee754_setcx(IEEE754_OVERFLOW), which will further execute

	ieee754_csr.cx |= flags;
	ieee754_csr.sx |= flags;

and, since ieee754_csr is macro for &current->thread.fpu.fcr31, this will result
in setting tworelevant and correct bits in current->thread.fpu->fcr31.

This means that condition from few paragraphs above will be met, and SIGFPE
will be generated.

Whole above scenario happens regardless of inclusion of this patch.

Actually, setting exception bits within "copcsr label code" seems redundant.
It though does no harm. I have some theory why is this code here, and why
we even may want to keep it as is, but this would be too much for this mail.

> 
> Given the potential fixing of SIGFPE in that case should this be tagged
> for stable?
> 

As I explained above, SIGFPE behavior is already correct, without this patch.
This patch fixes only debugfs stats. So, it is not that critical.

Looking forward to your response.

Aleksandar

^ permalink raw reply	[flat|nested] 15+ messages in thread

* RE: [PATCH 1/2] MIPS: math-emu: Update debugfs FP exception stats for certain instructions
@ 2017-10-11 16:18       ` Aleksandar Markovic
  0 siblings, 0 replies; 15+ messages in thread
From: Aleksandar Markovic @ 2017-10-11 16:18 UTC (permalink / raw)
  To: James Hogan, Aleksandar Markovic
  Cc: linux-mips, Douglas Leung, Goran Ferenc, linux-kernel,
	Maciej Rozycki, Manuel Lauss, Masahiro Yamada, Miodrag Dinic,
	Paul Burton, Petar Jovanovic, Raghu Gandham, Ralf Baechle

Thanks, James, for the review.

I've got a couple of points bellow that will, I hope, clarify several issues.

> ________________________________________
> From: James Hogan [james.hogan@mips.com]
> Sent: Monday, October 09, 2017 2:09 PM
> To: Aleksandar Markovic
> Cc: linux-mips@linux-mips.org; Aleksandar Markovic; Douglas Leung;
> Goran Ferenc; linux-kernel@vger.kernel.org; Maciej Rozycki;
> Manuel Lauss; Masahiro Yamada; Miodrag Dinic; Paul Burton;
> Petar Jovanovic; Raghu Gandham; Ralf Baechle
> Subject: Re: [PATCH 1/2] MIPS: math-emu: Update debugfs FP
> exception stats for certain instructions
> 
> On Fri, Oct 06, 2017 at 07:29:00PM +0200, Aleksandar Markovic wrote:
> > From: Aleksandar Markovic <aleksandar.markovic@imgtec.com>
> >
> > Fix omission of updating of debugfs FP exception stats for
> > instructions <CLASS|MADDF|MSUBF|MAX|MIN|MAXA|MINA>.<D|S>.
> >
> > CLASS.<D|S> can generate Unimplemented Operation FP exception.
> > <MADDF|MSUBF|MAX|MIN|MAXA|MINA>>.<D|S> can generate Inexact,
> 
> nit: s/>>/>/

Will be fixed in v2.

> 
> > Unimplemented Operation, Invalid Operation, Overflow, and
> > Underflow FP exceptions. In such cases, and prior to this
> 
> Well, according to the manual I'm looking at MAX|MIN|MAXA|MINA can't
> generate inexact, overflow, or underflow FP exceptions
>

The "MIPS64® Instruction Set Reference Manual" v6.00 mentions that all
five FP exception are possible for MAX|MIN|MAXA|MINA, but in v6.05, the
list was reduced to only two, as you hinted. I am going to sync the commit
message with v6.05 of the document.

> ... and in practice
> the only FPE generated by emulating these instructions is invalid
> operation for MADDF/MSUBF. So presumably that's the only case we really
> care about.
> 
> I.e. the MADDF/MSUBF invalid operation should be counted, but crucially
> the setting of rcsr bits allows it to generate a SIGFPE which from a
> glance it doesn't appear to do until this patch. The other changes are
> redundant and harmless.
> 
> Does that sound correct? (appologies if I'm missing something, I'm just
> reading the code, and reading FPU emulation code late at night is
> probably asking for trouble).
>

You are close, but not quite, I'll explain that in a moment.

First, just to note that SIGFPE will be generated if the condition

((ctx->fcr31 >> 5) & ctx->fcr31 & FPU_CSR_ALL_E)

is met (the code is almost at the end of fpu_emu(), cp1emu.c, line 1557).
ctx is one of the arguments of fpu_emu(), but, in the current state of the
code, by analyzing several levels of invocations, it can be concluded
that ctx will always be equal to &current->thread.fpu. So, the register
current->thread.fpu->fcr31 is actually important here.

Now, let's consider, for simplicity, the case of MADDF operation resulting
in an overflow caused by addition of two large FP numbers. The "special"
treatment of such case will be done within invocation of ieee754dp_format(),
which will in turn (in this particular example) execute
ieee754_setcx(IEEE754_OVERFLOW), which will further execute

	ieee754_csr.cx |= flags;
	ieee754_csr.sx |= flags;

and, since ieee754_csr is macro for &current->thread.fpu.fcr31, this will result
in setting tworelevant and correct bits in current->thread.fpu->fcr31.

This means that condition from few paragraphs above will be met, and SIGFPE
will be generated.

Whole above scenario happens regardless of inclusion of this patch.

Actually, setting exception bits within "copcsr label code" seems redundant.
It though does no harm. I have some theory why is this code here, and why
we even may want to keep it as is, but this would be too much for this mail.

> 
> Given the potential fixing of SIGFPE in that case should this be tagged
> for stable?
> 

As I explained above, SIGFPE behavior is already correct, without this patch.
This patch fixes only debugfs stats. So, it is not that critical.

Looking forward to your response.

Aleksandar
From james.hartley@sondrel.com Wed Oct 11 20:12:08 2017
Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 11 Oct 2017 20:12:15 +0200 (CEST)
Received: from mail-db5eur01on0041.outbound.protection.outlook.com ([104.47.2.41]:43296
        "EHLO EUR01-DB5-obe.outbound.protection.outlook.com"
        rhost-flags-OK-OK-OK-FAIL) by eddie.linux-mips.org with ESMTP
        id S23990557AbdJKSMIYhtkD (ORCPT <rfc822;linux-mips@linux-mips.org>);
        Wed, 11 Oct 2017 20:12:08 +0200
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=sondrel.onmicrosoft.com; s=selector1-sondrel-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version;
 bh=6WWb5WsBJdzlRqPgragvDMTChJDlxgFqw6mDeUxZE0g=;
 b=xTxirVeVEYeoYlYD7bCkzYPXP1U+q+rNGSRI+HrZF3Z1WBbTB5rV30pZDv2HWg6YB/wMeoz4iFBC7+c5Qm/8Cr1CG57w2kxLF7IEHhj7NjOp2+LEe2FyfhjpDgPhrp28HI7EQ0SwxYiYEcyugj7w0myUUamZJLSrnnQRz2y4cGk=
Received: from HE1P191CA0013.EURP191.PROD.OUTLOOK.COM (2603:10a6:3:cf::23) by
 VI1P191MB0142.EURP191.PROD.OUTLOOK.COM (2603:10a6:800:a6::8) with Microsoft
 SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Wed, 11 Oct
 2017 18:11:56 +0000
Received: from DB5EUR03FT050.eop-EUR03.prod.protection.outlook.com
 (2a01:111:f400:7e0a::207) by HE1P191CA0013.outlook.office365.com
 (2603:10a6:3:cf::23) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.56.9 via Frontend
 Transport; Wed, 11 Oct 2017 18:11:56 +0000
Authentication-Results: spf=fail (sender IP is 195.88.9.101)
 smtp.mailfrom=sondrel.com; davemloft.net; dkim=none (message not signed)
 header.d=none;davemloft.net; dmarc=none action=none header.from=sondrel.com;
Received-SPF: Fail (protection.outlook.com: domain of sondrel.com does not
 designate 195.88.9.101 as permitted sender) receiver=protection.outlook.com;
 client-ip=195.88.9.101; helo=leopard.hh.imgtec.org;
Received: from leopard.hh.imgtec.org (195.88.9.101) by
 DB5EUR03FT050.mail.protection.outlook.com (10.152.21.128) with Microsoft SMTP
 Server id 15.20.77.10 via Frontend Transport; Wed, 11 Oct 2017 18:11:55 +0000
From:   James Hartley <james.hartley@sondrel.com>
To:     <davem@davemloft.net>
CC:     <linux-mips@linux-mips.org>, <james.hartley@sondrel.com>,
        James Hartley <james.hartley@imgtec.com>
Subject: [PATCH] MAINTAINERS: Update Pistachio platform maintainers
Date:   Wed, 11 Oct 2017 19:11:32 +0100
Message-ID: <1507745492-13349-1-git-send-email-james.hartley@sondrel.com>
X-Mailer: git-send-email 2.7.4
X-EOPAttributedMessage: 0
X-Forefront-Antispam-Report: CIP:195.88.9.101;IPV:CAL;SCL:-1;CTRY:GB;EFV:NLI;SFV:NSPM;SFS:(10009020)(6009001)(39830400002)(376002)(346002)(2980300002)(1110001)(1109001)(339900001)(189002)(199003)(6916009)(4326008)(81156014)(189998001)(6506006)(5003940100001)(2351001)(6486002)(106466001)(33646002)(2906002)(50986999)(81166006)(6666003)(53936002)(47776003)(105606002)(316002)(36756003)(86362001)(6512007)(54906003)(356003)(26826003)(85426001)(478600001)(68736007)(36736006)(50466002)(25786009)(97736004)(48376002)(305945005)(5660300001)(8676002)(16586007)(8936002)(50226002);DIR:OUT;SFP:1101;SCL:1;SRVR:VI1P191MB0142;H:leopard.hh.imgtec.org;FPR:;SPF:Fail;PTR:InfoDomainNonexistent;MX:1;A:1;LANG:en;
X-Microsoft-Exchange-Diagnostics: 1;DB5EUR03FT050;1:AxGCdYrWXzJDj6IZ9LNVkmPBjZq3YFUenDkgcA7d5Bo/tLOONkz8+wDHuM0GKctuXCJrOHsecrPZjwLVTEBWs8m+pqcvwsYwpTIQW2nvxxO22j5TI2u39AlpW4oap0B+
MIME-Version: 1.0
Content-Type: text/plain
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id: 47be4195-054d-45d9-6073-08d510d38e22
X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(2017030254152)(2017052603199)(201703131423075)(201703031133081)(201702281549075);SRVR:VI1P191MB0142;
X-Microsoft-Exchange-Diagnostics: 1;VI1P191MB0142;3:9atM948kJP6rw2ygwoOf59rFkZ+coITLnjKodMwzSWyT43kJzQaPnpbjAdlrTSJunPvzxSoiww5qtzb1UDvpLGvWfytX9TbbObpC9MnWrvv0dFOEjDqJybUbTXLgHlDoSmmhFwwTL/Pe8migMQTS1teCJB0tuFXLLQzcAk0yaN/VeyYorXpBxMAwSNY62TN+KUZa/mmV0zr01UMHRh4FUHZYmXVzqy/MVgibnpC1y8IbCirCZobPY1L3RBYtQLD2HWRGJNX+J6zk1I3Lt4ujoSdUAAc6VjffJCM24PpMaLWEnat8pNHTuDzHIP3Gj1TDbPeIAyiVlL7wIRM1ZmJWJhS3QKmvj/MHSemy3V6BST4=;25:CUlsXrtw3GXxoUXTun5EK79zoYoZkGlFwalZQplI5X8qG6k5Yk/mNBxHtNp6XVKEDFXFmd7/MJCcKZmFFBQBTFcQOiXEBmlfTJv/oKVMK/eB8jIlHQJUNYREuYRlhEGVbDSVCd1JMUv/7XvLWHjmrVONmnjNDh2EmbCt0FPUgxZmE/tJ56sfhqs+pH264wURD52gAGyxFlfvHIem5S49lNleZsfHH4U8WZvMltF/MHdiBumOERzLKAA5lLJeI9Tw9puZnlVdTKf8f+bTEsHUgobVLXBt5mMJ6N3pynJA9fVuwmnX9Huujd4ZrTn2QxCZAWxh794LgdftNraDAfRQBA==
X-MS-TrafficTypeDiagnostic: VI1P191MB0142:
X-Microsoft-Exchange-Diagnostics: 1;VI1P191MB0142;31:xu1+OZyGWesTbeUDKJypOE2VS+iLD3FeoaGjB/ac6dyvN/96Vo8Vz46GdowY25+p2XRo+V0twWN+cYy76GpXxZo5P3ADV8cHPLtjdq442Lb9auZbnJ4DvvKUfUr1YYOSYkYXTzyfLDgn14bmMSEK7wT3O9FuIwceopqGOKBHwY4kIRwjK1289Q5OkOEYsog6hc0i/j3+W6YiT57gSs5QpPES3AZrkneCcFdBlKAl3vs=;20:NDwnrh3b1CTe3EHqEGWnY6lCtUqTyUJ6LtIJt+BBJqtZLqFrQhlkKMLc7bHcGoUt3ovyQgslyAi38fhlg4aulTpoSpb5X39LRbiD5DNQ4TjrEuti66RaPuIpB2wmR+X8Hv5hIlwPou3If6sLP66Q+PvYy9DDeTi7Ut7syJKENNaVDODe/bd1n+vHoJZbkDF8hNeDg1KEjHGr+SwyTqWdqpvgBCfrxigUZl/mR4uo1VPX9Gte5yJsXaorqIZuH3Q7;4:doZ20mauoDM5k2i2POAcMaVhmQOjclm9tHSoTL2BO7lDGE2LKF97qngE2VnxcKnCVZvTTuqZqoDJ/A/qmFOy39eCIRMWlgkVeRKkA8dk4WaxntIp2MrQ2rgJBQBvmHRG0IJEJuytynmYE8ZmBOm1lAgNf2/xkK2XRPj6WicM5FpxG6YcwwP3toOGsKML9fSwCQPYXsE/KSX+KfiVMTvQR4M8Bx8w84CkMIMj3Rprsrb9eAdSiIXpml77MZgGutUN
X-Exchange-Antispam-Report-Test: UriScan:;
X-Microsoft-Antispam-PRVS: <VI1P191MB014223D90F6803D892CAEC14F94A0@VI1P191MB0142.EURP191.PROD.OUTLOOK.COM>
X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(3002001)(100000703101)(100105400095)(93006095)(93001095)(10201501046)(6041248)(20161123555025)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123564025)(20161123562025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:VI1P191MB0142;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:VI1P191MB0142;
X-Forefront-PRVS: 0457F11EAF
X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;VI1P191MB0142;23:8b3SyZBB1WyPdi40YkQll5P7AP0xQZmEH+W5QkTmb?=
 =?us-ascii?Q?TS2FmCfRLTlFmPgH1P7+Cdras7svXmEJ4sYTiuAmv4T28O+q0wwIq8Oqa0P8?=
 =?us-ascii?Q?MjD3zM+LizHUMsbA5iTslgv/rCTWjyzlqr9s8XSmtNx47z2OtrMBesqgemkt?=
 =?us-ascii?Q?B7Kv50Mk+OtSoi2G7JKVaX9Fcunkef+BrRPWWrEwYnCM8Z8ndKuMA12KBxAs?=
 =?us-ascii?Q?brvYWCiYMojhOMumJYV0LYy13ZNnfzSHaIx+SxRylwnzPnyakvFmrxrYrSX1?=
 =?us-ascii?Q?NTTUwafEBPhsRiJeUXMdBY+m0vF6etGo7QpV9aZom8oTMn8qwqi4uNvyq+qY?=
 =?us-ascii?Q?kI9e8ihNyPItUBripRlK2cKadwyClrb6KpgfvQibUoE7OoudTDB2ZqY6ZVov?=
 =?us-ascii?Q?o2wR1brQ3WOlHJPvQ87oBrx0ky9T0zxfXrIbQDjqrCbnJapl5fV3APsuzPpx?=
 =?us-ascii?Q?rWwWzcr3MbNJUpUlcRJd5HV19M+ofWCSmFm3MdiIEBarwCTUd96ZIAR4d0Tz?=
 =?us-ascii?Q?Hv/sp8znj8IaC8gFGc+T/Kpw4VyL0EN/yNVXKym2E5NifjPToFzUyi0K3MVA?=
 =?us-ascii?Q?mHfRs8vpinPhnzJSxyu6SuUjg4657dCkVso9+ndXqmCc8KSiFyKmcykfCpoV?=
 =?us-ascii?Q?oQzUtXQ4rzvOIGNbLHrMG1suh5AO7jVaixRZLStpUZ06F42yd2cVysdIy1Ll?=
 =?us-ascii?Q?8cRtIZX8o0MfQwpF/dYLYwJJ7MFR4XYG8DPboO6KgCjudWvs3QiBeMdrkcp8?=
 =?us-ascii?Q?6Yz8l+N+dbEXO2MYbeSYRkSFU21r3/h6rx1UuWgGdVCj9kEDsQsJc26Xb6kF?=
 =?us-ascii?Q?GF5Yvo5IkBqKDF3kWhUT6FJNMfkffK8vNLHNq/jHs5DpWO0sK8He2jXNbVd4?=
 =?us-ascii?Q?Lvjcu9pvl7k6t+XP0fjbZcy8axCpL4RLM/5hKFdW7CyFsm+U/auXsOkC6ji0?=
 =?us-ascii?Q?aikt5ytR8l4rVsd2cQUOlqMsn2Sd8ol5dHvQ1g0z5CaS0Uo2qz+vZenlMpHO?=
 =?us-ascii?Q?vzkBbww6R9/usBeOpqaPK8lvQOEAtN14nmJ8A6EK+9ZGuiKzfra+7mlgrzDW?=
 =?us-ascii?Q?e94pS6IBQSTFLfetmPI9jcHXZ672ugXY0HmrrNQXjXdcVovmHhhwjx0vHhDu?=
 =?us-ascii?Q?nvT5Gr2HnWAnQp8YAHMcT30NmX/pBAH?=
X-Microsoft-Exchange-Diagnostics: 1;VI1P191MB0142;6:x2zHvZQURMu6PSfnUMbyOTp9AxI0U4XLi225UY0TECxUwAxH+0VoRAyUfTHKoPXGdlF71yPUvvkWunn3GP5a8OrhNKt/ErUEwk4j6YGzqCOUDrYpK/P1mqrcDCZ/2CD0CaHHMkIDYJumXc0nroZe7ITi/Rs9tsOXUqqjG/2moV9oySLgYPxLjhdGiONu1IvOkZ2+YnRDvBb3YzmjZcqvh/ufiQyCgqOabjzJivWDa7YZYXXpWRU0TxBknajFBGL5jgyfqG8zQozzECFgcE1ddOk/IHynbWt99U2/A45WdSOlPoQHFFOTMrtW5UYhWvUnECt/PG9kb+QBB1vuq70RJg==;5:sitG1d6Qt8TSNOhJg1IWaGxZZrdlHBeAqCUaixNA3w9DfVfJp3L63rvnFMcV39Veo7to+AEcTtr6OHG7X1JM3n5qaDNi2qoVcqvTeKc40Gxy7QPnzpS5/oLfhdi3EAiVgDl0467iOFW1qyfShYP0LQ==;24:zdIE4WB+SH0M/JVTR8aM4jSm3moKnW0xS6S3WWU77YS0VrrAaqc/OqCcvFen6cDGCzWqlGBqAhgo9991Ig0UdJvOhUPnb/soSPpq9nVGs2c=;7://NR3AmqpCetPYzdf/8m9x6WLlfNCOrHRv7AXz9USGT/VM8UJZVr0rsGDIWk5Kpn8VpOOv03c1/G5MfWlnLZpY38s+PQ2rGZsNp9ALsaEVIe+0Z92XrqLqIASl1dhLSITODGXQOcCAfMBJzA7mTXIV7tfwhZ3090VGrIhavKLEOjrBgfPLuBRAqjfdhRAGP1dwK800QNJfcZsg7lZJZ6cQDBm+THhJaxmaYdTUSFrJo=
SpamDiagnosticOutput: 1:99
SpamDiagnosticMetadata: NSPM
X-OriginatorOrg: sondrel.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Oct 2017 18:11:55.0145
 (UTC)
X-MS-Exchange-CrossTenant-Id: 4faa3872-698e-4896-80ec-148b916cb1ba
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=4faa3872-698e-4896-80ec-148b916cb1ba;Ip=[195.88.9.101];Helo=[leopard.hh.imgtec.org]
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1P191MB0142
Return-Path: <james.hartley@sondrel.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 60367
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: james.hartley@sondrel.com
Precedence: bulk
List-help: <mailto:ecartis@linux-mips.org?Subject=help>
List-unsubscribe: <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips>
List-software: Ecartis version 1.0.0
List-Id: linux-mips <linux-mips.eddie.linux-mips.org>
X-List-ID: linux-mips <linux-mips.eddie.linux-mips.org>
List-subscribe: <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips>
List-owner: <mailto:ralf@linux-mips.org>
List-post: <mailto:linux-mips@linux-mips.org>
List-archive: <http://www.linux-mips.org/archives/linux-mips/>
X-list: linux-mips

From: James Hartley <james.hartley@imgtec.com>

Neither of the current maintainers works for Imagination any more.

Removed both imgtec email addresses and added back mine for
occasional reviews, also changed from Maintained to Odd Fixes to
reflect the time that I will be able to spend on it.

Signed-off-by: James Hartley <james.hartley@sondrel.com>
---
 MAINTAINERS | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index ccc5181..5ccf3b5 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -10731,10 +10731,9 @@ S:	Maintained
 F:	drivers/pinctrl/spear/
 
 PISTACHIO SOC SUPPORT
-M:	James Hartley <james.hartley@imgtec.com>
-M:	Ionela Voinescu <ionela.voinescu@imgtec.com>
+M:	James Hartley <james.hartley@sondrel.com>
 L:	linux-mips@linux-mips.org
-S:	Maintained
+S:	Odd Fixes
 F:	arch/mips/pistachio/
 F:	arch/mips/include/asm/mach-pistachio/
 F:	arch/mips/boot/dts/img/pistachio*
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [PATCH 1/2] MIPS: math-emu: Update debugfs FP exception stats for certain instructions
  2017-10-11 16:18       ` Aleksandar Markovic
  (?)
@ 2017-10-12 10:17       ` James Hogan
  2017-10-12 14:32           ` Aleksandar Markovic
       [not found]         ` <683c-59df7500-1-10d973a0@9889400>
  -1 siblings, 2 replies; 15+ messages in thread
From: James Hogan @ 2017-10-12 10:17 UTC (permalink / raw)
  To: Aleksandar Markovic
  Cc: Aleksandar Markovic, linux-mips, Douglas Leung, Goran Ferenc,
	linux-kernel, Maciej Rozycki, Manuel Lauss, Masahiro Yamada,
	Miodrag Dinic, Paul Burton, Petar Jovanovic, Raghu Gandham,
	Ralf Baechle

[-- Attachment #1: Type: text/plain, Size: 4713 bytes --]

On Wed, Oct 11, 2017 at 04:18:49PM +0000, Aleksandar Markovic wrote:
> Thanks, James, for the review.
> 
> I've got a couple of points bellow that will, I hope, clarify several issues.
> 
> > ________________________________________
> > From: James Hogan [james.hogan@mips.com]
> > Sent: Monday, October 09, 2017 2:09 PM
> > To: Aleksandar Markovic
> > Cc: linux-mips@linux-mips.org; Aleksandar Markovic; Douglas Leung;
> > Goran Ferenc; linux-kernel@vger.kernel.org; Maciej Rozycki;
> > Manuel Lauss; Masahiro Yamada; Miodrag Dinic; Paul Burton;
> > Petar Jovanovic; Raghu Gandham; Ralf Baechle
> > Subject: Re: [PATCH 1/2] MIPS: math-emu: Update debugfs FP
> > exception stats for certain instructions
> > 
> > On Fri, Oct 06, 2017 at 07:29:00PM +0200, Aleksandar Markovic wrote:
> > > From: Aleksandar Markovic <aleksandar.markovic@imgtec.com>
> > >
> > > Fix omission of updating of debugfs FP exception stats for
> > > instructions <CLASS|MADDF|MSUBF|MAX|MIN|MAXA|MINA>.<D|S>.
> > >
> > > CLASS.<D|S> can generate Unimplemented Operation FP exception.
> > > <MADDF|MSUBF|MAX|MIN|MAXA|MINA>>.<D|S> can generate Inexact,
> > 
> > nit: s/>>/>/
> 
> Will be fixed in v2.
> 
> > 
> > > Unimplemented Operation, Invalid Operation, Overflow, and
> > > Underflow FP exceptions. In such cases, and prior to this
> > 
> > Well, according to the manual I'm looking at MAX|MIN|MAXA|MINA can't
> > generate inexact, overflow, or underflow FP exceptions
> >
> 
> The "MIPS64® Instruction Set Reference Manual" v6.00 mentions that all
> five FP exception are possible for MAX|MIN|MAXA|MINA, but in v6.05, the
> list was reduced to only two, as you hinted. I am going to sync the commit
> message with v6.05 of the document.
> 
> > ... and in practice
> > the only FPE generated by emulating these instructions is invalid
> > operation for MADDF/MSUBF. So presumably that's the only case we really
> > care about.
> > 
> > I.e. the MADDF/MSUBF invalid operation should be counted, but crucially
> > the setting of rcsr bits allows it to generate a SIGFPE which from a
> > glance it doesn't appear to do until this patch. The other changes are
> > redundant and harmless.
> > 
> > Does that sound correct? (appologies if I'm missing something, I'm just
> > reading the code, and reading FPU emulation code late at night is
> > probably asking for trouble).
> >
> 
> You are close, but not quite, I'll explain that in a moment.
> 
> First, just to note that SIGFPE will be generated if the condition
> 
> ((ctx->fcr31 >> 5) & ctx->fcr31 & FPU_CSR_ALL_E)
> 
> is met (the code is almost at the end of fpu_emu(), cp1emu.c, line 1557).
> ctx is one of the arguments of fpu_emu(), but, in the current state of the
> code, by analyzing several levels of invocations, it can be concluded
> that ctx will always be equal to &current->thread.fpu. So, the register
> current->thread.fpu->fcr31 is actually important here.
> 
> Now, let's consider, for simplicity, the case of MADDF operation resulting
> in an overflow caused by addition of two large FP numbers. The "special"
> treatment of such case will be done within invocation of ieee754dp_format(),

Ah yes, obviously an MADDF can generate those other exception bits :-)

> which will in turn (in this particular example) execute
> ieee754_setcx(IEEE754_OVERFLOW), which will further execute
> 
> 	ieee754_csr.cx |= flags;
> 	ieee754_csr.sx |= flags;
> 
> and, since ieee754_csr is macro for &current->thread.fpu.fcr31, this will result
> in setting tworelevant and correct bits in current->thread.fpu->fcr31.
> 
> This means that condition from few paragraphs above will be met, and SIGFPE
> will be generated.

But just before that condition it does:
ctx->fcr31 = (ctx->fcr31 & ~FPU_CSR_ALL_X) | rcsr;

I.e. it clears the X bits used in the condition, and overrides them
based on rcsr, which is initialised to 0 and is only set after the
copcsr label and in a couple of other cases I don't think we'd be
hitting for MADDF.

Cheers
James

> 
> Whole above scenario happens regardless of inclusion of this patch.
> 
> Actually, setting exception bits within "copcsr label code" seems redundant.
> It though does no harm. I have some theory why is this code here, and why
> we even may want to keep it as is, but this would be too much for this mail.
> 
> > 
> > Given the potential fixing of SIGFPE in that case should this be tagged
> > for stable?
> > 
> 
> As I explained above, SIGFPE behavior is already correct, without this patch.
> This patch fixes only debugfs stats. So, it is not that critical.
> 
> Looking forward to your response.
> 
> Aleksandar

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* RE: [PATCH 1/2] MIPS: math-emu: Update debugfs FP exception stats for certain instructions
  2017-10-12 10:17       ` James Hogan
@ 2017-10-12 14:32           ` Aleksandar Markovic
       [not found]         ` <683c-59df7500-1-10d973a0@9889400>
  1 sibling, 0 replies; 15+ messages in thread
From: Aleksandar Markovic @ 2017-10-12 14:32 UTC (permalink / raw)
  To: James Hogan
  Cc: Aleksandar Markovic, linux-mips, Douglas Leung, Goran Ferenc,
	linux-kernel, Maciej Rozycki, Manuel Lauss, Masahiro Yamada,
	Miodrag Dinic, Paul Burton, Petar Jovanovic, Raghu Gandham,
	Ralf Baechle


(resending since the previous mail was rejected by the mailing list because of html format)

> Subject: Re: [PATCH 1/2] MIPS: math-emu: Update debugfs FP exception stats for certain instructions
> Date: Thursday, October 12, 2017 12:17 CEST
> From: James Hogan <james.hogan@mips.com>>
> > ...
> > if ((ctx->fcr31 >> 5) & ctx->fcr31 & FPU_CSR_ALL_E)
> > ...
>
> But just before that condition it does:
>
> ctx->fcr31 = (ctx->fcr31 & ~FPU_CSR_ALL_X) | rcsr;
> I.e. it clears the X bits used in the condition, and overrides them,
> based on rcsr, which is initialised to 0 and is only set after the
> copcsr label and in a couple of other cases I don't think we'd be
> hitting for MADDF.
>

The code is odd and deceiving here. Let's see the whole "copcsr label"
code segment:
 
copcsr:
if (ieee754_cxtest(IEEE754_INEXACT)) {
    MIPS_FPU_EMU_INC_STATS(ieee754_inexact);
    rcsr |= FPU_CSR_INE_X | FPU_CSR_INE_S;
}
if (ieee754_cxtest(IEEE754_UNDERFLOW)) {
    MIPS_FPU_EMU_INC_STATS(ieee754_underflow);
    rcsr |= FPU_CSR_UDF_X | FPU_CSR_UDF_S;
}
if (ieee754_cxtest(IEEE754_OVERFLOW)) {
    MIPS_FPU_EMU_INC_STATS(ieee754_overflow);
    rcsr |= FPU_CSR_OVF_X | FPU_CSR_OVF_S;
}
if (ieee754_cxtest(IEEE754_INVALID_OPERATION)) {
    MIPS_FPU_EMU_INC_STATS(ieee754_invalidop);
    rcsr |= FPU_CSR_INV_X | FPU_CSR_INV_S;
}
 
ctx->fcr31 = (ctx->fcr31 & ~FPU_CSR_ALL_X) | rcsr;
if ((ctx->fcr31 >> 5) & ctx->fcr31 & FPU_CSR_ALL_E) {
    /*printk ("SIGFPE: FPU csr = %08x\n",
    ctx->fcr31); */
    return SIGFPE;
}


Value of rcsr will be dictated by series of invocations to ieee754_cxtest(),
which, in fact, means that exception bits will be copied from fcr31 to rcsr.

Then, fcr31 exception bits are cleared and set to the values they had just
before clearing.

Obviously, this will not do anything in our scenarios.

However, the patch is about correct setting of debugfs stats, and this code
segment correctly does this.

May I suggest that we accept my patch as is, and if anybody for any reason
wants to deal further with related code, this should be done in a separate
fix/patch?

Regards,
Aleksandar

^ permalink raw reply	[flat|nested] 15+ messages in thread

* RE: [PATCH 1/2] MIPS: math-emu: Update debugfs FP exception stats for certain instructions
@ 2017-10-12 14:32           ` Aleksandar Markovic
  0 siblings, 0 replies; 15+ messages in thread
From: Aleksandar Markovic @ 2017-10-12 14:32 UTC (permalink / raw)
  To: James Hogan
  Cc: Aleksandar Markovic, linux-mips, Douglas Leung, Goran Ferenc,
	linux-kernel, Maciej Rozycki, Manuel Lauss, Masahiro Yamada,
	Miodrag Dinic, Paul Burton, Petar Jovanovic, Raghu Gandham,
	Ralf Baechle

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="us-ascii", Size: 13204 bytes --]


(resending since the previous mail was rejected by the mailing list because of html format)

> Subject: Re: [PATCH 1/2] MIPS: math-emu: Update debugfs FP exception stats for certain instructions
> Date: Thursday, October 12, 2017 12:17 CEST
> From: James Hogan <james.hogan@mips.com>>
> > ...
> > if ((ctx->fcr31 >> 5) & ctx->fcr31 & FPU_CSR_ALL_E)
> > ...
>
> But just before that condition it does:
>
> ctx->fcr31 = (ctx->fcr31 & ~FPU_CSR_ALL_X) | rcsr;
> I.e. it clears the X bits used in the condition, and overrides them,
> based on rcsr, which is initialised to 0 and is only set after the
> copcsr label and in a couple of other cases I don't think we'd be
> hitting for MADDF.
>

The code is odd and deceiving here. Let's see the whole "copcsr label"
code segment:
 
copcsr:
if (ieee754_cxtest(IEEE754_INEXACT)) {
    MIPS_FPU_EMU_INC_STATS(ieee754_inexact);
    rcsr |= FPU_CSR_INE_X | FPU_CSR_INE_S;
}
if (ieee754_cxtest(IEEE754_UNDERFLOW)) {
    MIPS_FPU_EMU_INC_STATS(ieee754_underflow);
    rcsr |= FPU_CSR_UDF_X | FPU_CSR_UDF_S;
}
if (ieee754_cxtest(IEEE754_OVERFLOW)) {
    MIPS_FPU_EMU_INC_STATS(ieee754_overflow);
    rcsr |= FPU_CSR_OVF_X | FPU_CSR_OVF_S;
}
if (ieee754_cxtest(IEEE754_INVALID_OPERATION)) {
    MIPS_FPU_EMU_INC_STATS(ieee754_invalidop);
    rcsr |= FPU_CSR_INV_X | FPU_CSR_INV_S;
}
 
ctx->fcr31 = (ctx->fcr31 & ~FPU_CSR_ALL_X) | rcsr;
if ((ctx->fcr31 >> 5) & ctx->fcr31 & FPU_CSR_ALL_E) {
    /*printk ("SIGFPE: FPU csr = %08x\n",
    ctx->fcr31); */
    return SIGFPE;
}


Value of rcsr will be dictated by series of invocations to ieee754_cxtest(),
which, in fact, means that exception bits will be copied from fcr31 to rcsr.

Then, fcr31 exception bits are cleared and set to the values they had just
before clearing.

Obviously, this will not do anything in our scenarios.

However, the patch is about correct setting of debugfs stats, and this code
segment correctly does this.

May I suggest that we accept my patch as is, and if anybody for any reason
wants to deal further with related code, this should be done in a separate
fix/patch?

Regards,
Aleksandar
From julien.thierry@arm.com Thu Oct 12 16:41:55 2017
Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 12 Oct 2017 16:42:02 +0200 (CEST)
Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:52410 "EHLO
        foss.arm.com" rhost-flags-OK-OK-OK-OK) by eddie.linux-mips.org
        with ESMTP id S23993035AbdJLOlzXHWhk (ORCPT
        <rfc822;linux-mips@linux-mips.org>); Thu, 12 Oct 2017 16:41:55 +0200
Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249])
        by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id A59D31529;
        Thu, 12 Oct 2017 07:41:47 -0700 (PDT)
Received: from [10.1.207.56] (e112298-lin.cambridge.arm.com [10.1.207.56])
        by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id ACAB53F236;
        Thu, 12 Oct 2017 07:41:44 -0700 (PDT)
Subject: Re: [PATCH 1/9] SOC: brcmstb: add memory API
To:     Jim Quinlan <jim2101024@gmail.com>, linux-kernel@vger.kernel.org
Cc:     bcm-kernel-feedback-list@broadcom.com,
        linux-arm-kernel@lists.infradead.org, linux-mips@linux-mips.org,
        devicetree@vger.kernel.org, linux-pci@vger.kernel.org,
        Florian Fainelli <f.fainelli@gmail.com>,
        Ralf Baechle <ralf@linux-mips.org>,
        Catalin Marinas <catalin.marinas@arm.com>,
        Will Deacon <will.deacon@arm.com>,
        Bjorn Helgaas <bhelgaas@google.com>,
        Rob Herring <robh+dt@kernel.org>,
        Mark Rutland <mark.rutland@arm.com>,
        Gregory Fong <gregory.0xf0@gmail.com>,
        Kevin Cernekee <cernekee@gmail.com>,
        Brian Norris <computersforpeace@gmail.com>
References: <1507761269-7017-1-git-send-email-jim2101024@gmail.com>
 <1507761269-7017-2-git-send-email-jim2101024@gmail.com>
From:   Julien Thierry <julien.thierry@arm.com>
Message-ID: <b6be2073-7a90-f83f-4e25-79ef04827bd7@arm.com>
Date:   Thu, 12 Oct 2017 15:41:42 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101
 Thunderbird/52.2.1
MIME-Version: 1.0
In-Reply-To: <1507761269-7017-2-git-send-email-jim2101024@gmail.com>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 8bit
Return-Path: <julien.thierry@arm.com>
X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0)
X-Orcpt: rfc822;linux-mips@linux-mips.org
Original-Recipient: rfc822;linux-mips@linux-mips.org
X-archive-position: 60382
X-ecartis-version: Ecartis v1.0.0
Sender: linux-mips-bounce@linux-mips.org
Errors-to: linux-mips-bounce@linux-mips.org
X-original-sender: julien.thierry@arm.com
Precedence: bulk
List-help: <mailto:ecartis@linux-mips.org?Subject=help>
List-unsubscribe: <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips>
List-software: Ecartis version 1.0.0
List-Id: linux-mips <linux-mips.eddie.linux-mips.org>
X-List-ID: linux-mips <linux-mips.eddie.linux-mips.org>
List-subscribe: <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips>
List-owner: <mailto:ralf@linux-mips.org>
List-post: <mailto:linux-mips@linux-mips.org>
List-archive: <http://www.linux-mips.org/archives/linux-mips/>
X-list: linux-mips

Hi Jim,

On 11/10/17 23:34, Jim Quinlan wrote:
> From: Florian Fainelli <f.fainelli@gmail.com>
> 
> This commit adds a memory API suitable for ascertaining the sizes of
> each of the N memory controllers in a Broadcom STB chip.  Its first
> user will be the Broadcom STB PCIe root complex driver, which needs
> to know these sizes to properly set up DMA mappings for inbound
> regions.
> 
> We cannot use memblock here or anything like what Linux provides
> because it collapses adjacent regions within a larger block, and here
> we actually need per-memory controller addresses and sizes, which is
> why we resort to manual DT parsing.
> 
> Signed-off-by: Jim Quinlan <jim2101024@gmail.com>
> ---
>   drivers/soc/bcm/brcmstb/Makefile |   2 +-
>   drivers/soc/bcm/brcmstb/memory.c | 183 +++++++++++++++++++++++++++++++++++++++
>   include/soc/brcmstb/memory_api.h |  25 ++++++
>   3 files changed, 209 insertions(+), 1 deletion(-)
>   create mode 100644 drivers/soc/bcm/brcmstb/memory.c
>   create mode 100644 include/soc/brcmstb/memory_api.h
> 
> diff --git a/drivers/soc/bcm/brcmstb/Makefile b/drivers/soc/bcm/brcmstb/Makefile
> index 9120b27..4cea7b6 100644
> --- a/drivers/soc/bcm/brcmstb/Makefile
> +++ b/drivers/soc/bcm/brcmstb/Makefile
> @@ -1 +1 @@
> -obj-y				+= common.o biuctrl.o
> +obj-y				+= common.o biuctrl.o memory.o
> diff --git a/drivers/soc/bcm/brcmstb/memory.c b/drivers/soc/bcm/brcmstb/memory.c
> new file mode 100644
> index 0000000..cb6bf73
> --- /dev/null
> +++ b/drivers/soc/bcm/brcmstb/memory.c
> @@ -0,0 +1,183 @@
> +/*
> + * Copyright © 2015-2017 Broadcom
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> + * GNU General Public License for more details.
> + *
> + * A copy of the GPL is available at
> + * http://www.broadcom.com/licenses/GPLv2.php or from the Free Software
> + * Foundation at https://www.gnu.org/licenses/ .
> + */
> +
> +#include <linux/device.h>
> +#include <linux/io.h>
> +#include <linux/libfdt.h>
> +#include <linux/of_address.h>
> +#include <linux/of_fdt.h>
> +#include <linux/sizes.h>
> +#include <soc/brcmstb/memory_api.h>
> +
> +/* -------------------- Constants -------------------- */
> +
> +/* Macros to help extract property data */
> +#define U8TOU32(b, offs) \
> +	((((u32)b[0 + offs] << 0)  & 0x000000ff) | \
> +	 (((u32)b[1 + offs] << 8)  & 0x0000ff00) | \
> +	 (((u32)b[2 + offs] << 16) & 0x00ff0000) | \
> +	 (((u32)b[3 + offs] << 24) & 0xff000000))
> +
> +#define DT_PROP_DATA_TO_U32(b, offs) (fdt32_to_cpu(U8TOU32(b, offs)))
> +

I fail to understand why this is not:

#define DT_PROP_DATA_TO_U32(b, offs) (fdt32_to_cpu(*(u32*)(b + offs)))


If I understand correctly, fdt data is in big endian, the macro U8TOU32 
reads it as little endian. My guess is that this won't work on big 
endian kernels but should work on little endian since fdt32_to_cpu will 
revert the bytes again.

Am I missing something?

Cheers,

> +/* Constants used when retrieving memc info */
> +#define NUM_BUS_RANGES 10
> +#define BUS_RANGE_ULIMIT_SHIFT 4
> +#define BUS_RANGE_LLIMIT_SHIFT 4
> +#define BUS_RANGE_PA_SHIFT 12
> +
> +enum {
> +	BUSNUM_MCP0 = 0x4,
> +	BUSNUM_MCP1 = 0x5,
> +	BUSNUM_MCP2 = 0x6,
> +};
> +
> +/* -------------------- Functions -------------------- */
> +
> +/*
> + * If the DT nodes are handy, determine which MEMC holds the specified
> + * physical address.
> + */
> +#ifdef CONFIG_ARCH_BRCMSTB
> +int __brcmstb_memory_phys_addr_to_memc(phys_addr_t pa, void __iomem *base)
> +{
> +	int memc = -1;
> +	int i;
> +
> +	for (i = 0; i < NUM_BUS_RANGES; i++, base += 8) {
> +		const u64 ulimit_raw = readl(base);
> +		const u64 llimit_raw = readl(base + 4);
> +		const u64 ulimit =
> +			((ulimit_raw >> BUS_RANGE_ULIMIT_SHIFT)
> +			 << BUS_RANGE_PA_SHIFT) | 0xfff;
> +		const u64 llimit = (llimit_raw >> BUS_RANGE_LLIMIT_SHIFT)
> +				   << BUS_RANGE_PA_SHIFT;
> +		const u32 busnum = (u32)(ulimit_raw & 0xf);
> +
> +		if (pa >= llimit && pa <= ulimit) {
> +			if (busnum >= BUSNUM_MCP0 && busnum <= BUSNUM_MCP2) {
> +				memc = busnum - BUSNUM_MCP0;
> +				break;
> +			}
> +		}
> +	}
> +
> +	return memc;
> +}
> +
> +int brcmstb_memory_phys_addr_to_memc(phys_addr_t pa)
> +{
> +	int memc = -1;
> +	struct device_node *np;
> +	void __iomem *cpubiuctrl;
> +
> +	np = of_find_compatible_node(NULL, NULL, "brcm,brcmstb-cpu-biu-ctrl");
> +	if (!np)
> +		return memc;
> +
> +	cpubiuctrl = of_iomap(np, 0);
> +	if (!cpubiuctrl)
> +		goto cleanup;
> +
> +	memc = __brcmstb_memory_phys_addr_to_memc(pa, cpubiuctrl);
> +	iounmap(cpubiuctrl);
> +
> +cleanup:
> +	of_node_put(np);
> +
> +	return memc;
> +}
> +
> +#elif defined(CONFIG_MIPS)
> +int brcmstb_memory_phys_addr_to_memc(phys_addr_t pa)
> +{
> +	/* The logic here is fairly simple and hardcoded: if pa <= 0x5000_0000,
> +	 * then this is MEMC0, else MEMC1.
> +	 *
> +	 * For systems with 2GB on MEMC0, MEMC1 starts at 9000_0000, with 1GB
> +	 * on MEMC0, MEMC1 starts at 6000_0000.
> +	 */
> +	if (pa >= 0x50000000ULL)
> +		return 1;
> +	else
> +		return 0;
> +}
> +#endif
> +EXPORT_SYMBOL(brcmstb_memory_phys_addr_to_memc);
> +
> +u64 brcmstb_memory_memc_size(int memc)
> +{
> +	const void *fdt = initial_boot_params;
> +	const int mem_offset = fdt_path_offset(fdt, "/memory");
> +	int addr_cells = 1, size_cells = 1;
> +	const struct fdt_property *prop;
> +	int proplen, cellslen;
> +	u64 memc_size = 0;
> +	int i;
> +
> +	/* Get root size and address cells if specified */
> +	prop = fdt_get_property(fdt, 0, "#size-cells", &proplen);
> +	if (prop)
> +		size_cells = DT_PROP_DATA_TO_U32(prop->data, 0);
> +
> +	prop = fdt_get_property(fdt, 0, "#address-cells", &proplen);
> +	if (prop)
> +		addr_cells = DT_PROP_DATA_TO_U32(prop->data, 0);
> +
> +	if (mem_offset < 0)
> +		return -1;
> +
> +	prop = fdt_get_property(fdt, mem_offset, "reg", &proplen);
> +	cellslen = (int)sizeof(u32) * (addr_cells + size_cells);
> +	if ((proplen % cellslen) != 0)
> +		return -1;
> +
> +	for (i = 0; i < proplen / cellslen; ++i) {
> +		u64 addr = 0;
> +		u64 size = 0;
> +		int memc_idx;
> +		int j;
> +
> +		for (j = 0; j < addr_cells; ++j) {
> +			int offset = (cellslen * i) + (sizeof(u32) * j);
> +
> +			addr |= (u64)DT_PROP_DATA_TO_U32(prop->data, offset) <<
> +				((addr_cells - j - 1) * 32);
> +		}
> +		for (j = 0; j < size_cells; ++j) {
> +			int offset = (cellslen * i) +
> +				(sizeof(u32) * (j + addr_cells));
> +
> +			size |= (u64)DT_PROP_DATA_TO_U32(prop->data, offset) <<
> +				((size_cells - j - 1) * 32);
> +		}
> +
> +		if ((phys_addr_t)addr != addr) {
> +			pr_err("phys_addr_t is smaller than provided address 0x%llx!\n",
> +			       addr);
> +			return -1;
> +		}
> +
> +		memc_idx = brcmstb_memory_phys_addr_to_memc((phys_addr_t)addr);
> +		if (memc_idx == memc)
> +			memc_size += size;
> +	}
> +
> +	return memc_size;
> +}
> +EXPORT_SYMBOL(brcmstb_memory_memc_size);
> +
> diff --git a/include/soc/brcmstb/memory_api.h b/include/soc/brcmstb/memory_api.h
> new file mode 100644
> index 0000000..d922906
> --- /dev/null
> +++ b/include/soc/brcmstb/memory_api.h
> @@ -0,0 +1,25 @@
> +#ifndef __MEMORY_API_H
> +#define __MEMORY_API_H
> +
> +/*
> + * Bus Interface Unit control register setup, must happen early during boot,
> + * before SMP is brought up, called by machine entry point.
> + */
> +void brcmstb_biuctrl_init(void);
> +
> +#ifdef CONFIG_SOC_BRCMSTB
> +int brcmstb_memory_phys_addr_to_memc(phys_addr_t pa);
> +u64 brcmstb_memory_memc_size(int memc);
> +#else
> +static inline int brcmstb_memory_phys_addr_to_memc(phys_addr_t pa)
> +{
> +	return -EINVAL;
> +}
> +
> +static inline u64 brcmstb_memory_memc_size(int memc)
> +{
> +	return -1;
> +}
> +#endif
> +
> +#endif /* __MEMORY_API_H */
> 

-- 
Julien Thierry

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 1/2] MIPS: math-emu: Update debugfs FP exception stats for certain instructions
       [not found]         ` <683c-59df7500-1-10d973a0@9889400>
@ 2017-10-12 14:44           ` James Hogan
  2017-10-12 15:54             ` Aleksandar Markovic
  0 siblings, 1 reply; 15+ messages in thread
From: James Hogan @ 2017-10-12 14:44 UTC (permalink / raw)
  To: Aleksandar Markovic
  Cc: Miodrag Dinic, Paul Burton, Petar Jovanovic, Raghu Gandham,
	Ralf Baechle, Aleksandar Markovic, linux-mips, Douglas Leung,
	Goran Ferenc, linux-kernel, Maciej Rozycki, Manuel Lauss,
	Masahiro Yamada

[-- Attachment #1: Type: text/plain, Size: 2739 bytes --]

On Thu, Oct 12, 2017 at 03:57:50PM +0200, Aleksandar Markovic wrote:
> 
> > Subject: Re: [PATCH 1/2] MIPS: math-emu: Update debugfs FP exception stats for certain instructions
> > Date: Thursday, October 12, 2017 12:17 CEST
> > From: James Hogan <james.hogan@mips.com>>@badag02.ba.imgtec.org>
> > > ...
> > > if ((ctx->fcr31 >> 5) & ctx->fcr31 & FPU_CSR_ALL_E)
> > > ...
> >
> > But just before that condition it does:
> >
> > ctx->fcr31 = (ctx->fcr31 & ~FPU_CSR_ALL_X) | rcsr;
> > I.e. it clears the X bits used in the condition, and overrides them,
> > based on rcsr, which is initialised to 0 and is only set after the
> > copcsr label and in a couple of other cases I don't think we'd be
> > hitting for MADDF.
> >
> 
> The code is odd and deceiving here. Let's see the whole "copcsr label"
> code segment: copcsr:if (ieee754_cxtest(IEEE754_INEXACT)) {  MIPS_FPU_EMU_INC_STATS(ieee754_inexact);  rcsr |= FPU_CSR_INE_X | FPU_CSR_INE_S;}if (ieee754_cxtest(IEEE754_UNDERFLOW)) {  MIPS_FPU_EMU_INC_STATS(ieee754_underflow);  rcsr |= FPU_CSR_UDF_X | FPU_CSR_UDF_S;}if (ieee754_cxtest(IEEE754_OVERFLOW)) {  MIPS_FPU_EMU_INC_STATS(ieee754_overflow);  rcsr |= FPU_CSR_OVF_X | FPU_CSR_OVF_S;}  if (ieee754_cxtest(IEEE754_INVALID_OPERATION)) {  MIPS_FPU_EMU_INC_STATS(ieee754_invalidop);  rcsr |= FPU_CSR_INV_X | FPU_CSR_INV_S;} ctx->fcr31 = (ctx->fcr31 & ~FPU_CSR_ALL_X) | rcsr;if ((ctx->fcr31 >> 5) & ctx->fcr31 & FPU_CSR_ALL_E) {  /*printk ("SIGFPE: FPU csr = %08x\n",  ctx->fcr31); */  return SIGFPE;}

Note: thats the one in fpux_emu(), not fpu_emu() which this patch
modifies. In fpu_emu() the copying of bits from rcsr to fcr32 and the
SIGFPE checking takes place outside of the switch, after other stuff can
modify rcsr.

> 
> 
> Value of rcsr will be dictated by series of invocations to ieee754_cxtest(),
> which, in fact, means that exception bits will be copied from fcr31 to rcsr.
> 
> Then, fcr31 exception bits are cleared and set to the values they had just
> before clearing.
> 
> Obviously, this will not do anything in our scenarios.
> 
> However, the patch is about correct setting of debugfs stats, and this code
> segment correctly does this.

Right, but its not going to even get to copcsr until this patch, so the
SIGFPE handling is I think fixed by this patch, i.e. it isn't just about
the stats.

> 
> May I suggest that we accept my patch as is, and if anybody for any reason
> wants to deal further with related code, this should be done in a separate
> fix/patch?

This patch fixes something, I think it should
a) be clear in the commit message what is fixed
b) be tagged for stable (though that can always be done
retrospectively).

Cheers
James

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* RE: [PATCH 1/2] MIPS: math-emu: Update debugfs FP exception stats for certain instructions
  2017-10-12 14:44           ` James Hogan
@ 2017-10-12 15:54             ` Aleksandar Markovic
  2017-10-12 16:33               ` James Hogan
  0 siblings, 1 reply; 15+ messages in thread
From: Aleksandar Markovic @ 2017-10-12 15:54 UTC (permalink / raw)
  To: James Hogan, Aleksandar Markovic
  Cc: Miodrag Dinic, Paul Burton, Petar Jovanovic, Raghu Gandham,
	Ralf Baechle, linux-mips, Douglas Leung, Goran Ferenc,
	linux-kernel, Maciej Rozycki, Manuel Lauss, Masahiro Yamada

> Right, but its not going to even get to copcsr until this patch, so the
> SIGFPE handling is I think fixed by this patch, i.e. it isn't just about
> the stats.

On more detailed code inspection, you are right.

> This patch fixes something, I think it should
> a) be clear in the commit message what is fixed
> b) be tagged for stable (though that can always be done
> retrospectively)

If you agree, I am going to submit v2 of the series, that would fully
address these concerns.

Additionally, it seems to me that a new round of testing that tests
involved code paths under various scenarios would be appropriate
and I am going to do that.

> Note: thats the one in fpux_emu(), not fpu_emu() which this patch
> modifies.

Yes, my bad, wanting to respond as quickly as possible, I inserted
the segment from fpux_emu(), not fpu_emu() as I should have.

By the way, and not related to this patch, I see only 4 (out of 5)
exceptions are handled in fpux_emu() case (division-by-zero is not
handled), I presume this is fine (probably division-by-zero not
needed), isn't it?

I truly appreciate your analysis and help.

Aleksandar

________________________________________
From: James Hogan [james.hogan@mips.com]
Sent: Thursday, October 12, 2017 7:44 AM
To: Aleksandar Markovic
Cc: Miodrag Dinic; Paul Burton; Petar Jovanovic; Raghu Gandham; Ralf Baechle; Aleksandar Markovic; linux-mips@linux-mips.org; Douglas Leung; Goran Ferenc; linux-kernel@vger.kernel.org; Maciej Rozycki; Manuel Lauss; Masahiro Yamada
Subject: Re: [PATCH 1/2] MIPS: math-emu: Update debugfs FP exception stats for certain instructions

On Thu, Oct 12, 2017 at 03:57:50PM +0200, Aleksandar Markovic wrote:
>
> > Subject: Re: [PATCH 1/2] MIPS: math-emu: Update debugfs FP exception stats for certain instructions
> > Date: Thursday, October 12, 2017 12:17 CEST
> > From: James Hogan <james.hogan@mips.com>>@badag02.ba.imgtec.org>
> > > ...
> > > if ((ctx->fcr31 >> 5) & ctx->fcr31 & FPU_CSR_ALL_E)
> > > ...
> >
> > But just before that condition it does:
> >
> > ctx->fcr31 = (ctx->fcr31 & ~FPU_CSR_ALL_X) | rcsr;
> > I.e. it clears the X bits used in the condition, and overrides them,
> > based on rcsr, which is initialised to 0 and is only set after the
> > copcsr label and in a couple of other cases I don't think we'd be
> > hitting for MADDF.
> >
>
> The code is odd and deceiving here. Let's see the whole "copcsr label"
> code segment: copcsr:if (ieee754_cxtest(IEEE754_INEXACT)) {  MIPS_FPU_EMU_INC_STATS(ieee754_inexact);  rcsr |= FPU_CSR_INE_X | FPU_CSR_INE_S;}if (ieee754_cxtest(IEEE754_UNDERFLOW)) {  MIPS_FPU_EMU_INC_STATS(ieee754_underflow);  rcsr |= FPU_CSR_UDF_X | FPU_CSR_UDF_S;}if (ieee754_cxtest(IEEE754_OVERFLOW)) {  MIPS_FPU_EMU_INC_STATS(ieee754_overflow);  rcsr |= FPU_CSR_OVF_X | FPU_CSR_OVF_S;}  if (ieee754_cxtest(IEEE754_INVALID_OPERATION)) {  MIPS_FPU_EMU_INC_STATS(ieee754_invalidop);  rcsr |= FPU_CSR_INV_X | FPU_CSR_INV_S;} ctx->fcr31 = (ctx->fcr31 & ~FPU_CSR_ALL_X) | rcsr;if ((ctx->fcr31 >> 5) & ctx->fcr31 & FPU_CSR_ALL_E) {  /*printk ("SIGFPE: FPU csr = %08x\n",  ctx->fcr31); */  return SIGFPE;}

Note: thats the one in fpux_emu(), not fpu_emu() which this patch
modifies. In fpu_emu() the copying of bits from rcsr to fcr32 and the
SIGFPE checking takes place outside of the switch, after other stuff can
modify rcsr.

>
>
> Value of rcsr will be dictated by series of invocations to ieee754_cxtest(),
> which, in fact, means that exception bits will be copied from fcr31 to rcsr.
>
> Then, fcr31 exception bits are cleared and set to the values they had just
> before clearing.
>
> Obviously, this will not do anything in our scenarios.
>
> However, the patch is about correct setting of debugfs stats, and this code
> segment correctly does this.



>
> May I suggest that we accept my patch as is, and if anybody for any reason
> wants to deal further with related code, this should be done in a separate
> fix/patch?

This patch fixes something, I think it should
a) be clear in the commit message what is fixed
b) be tagged for stable (though that can always be done
retrospectively).

Cheers
James

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 1/2] MIPS: math-emu: Update debugfs FP exception stats for certain instructions
  2017-10-12 15:54             ` Aleksandar Markovic
@ 2017-10-12 16:33               ` James Hogan
  0 siblings, 0 replies; 15+ messages in thread
From: James Hogan @ 2017-10-12 16:33 UTC (permalink / raw)
  To: Aleksandar Markovic
  Cc: Aleksandar Markovic, Miodrag Dinic, Paul Burton, Petar Jovanovic,
	Raghu Gandham, Ralf Baechle, linux-mips, Douglas Leung,
	Goran Ferenc, linux-kernel, Maciej Rozycki, Manuel Lauss,
	Masahiro Yamada

On Thu, Oct 12, 2017 at 03:54:48PM +0000, Aleksandar Markovic wrote:
> > This patch fixes something, I think it should
> > a) be clear in the commit message what is fixed
> > b) be tagged for stable (though that can always be done
> > retrospectively)
> 
> If you agree, I am going to submit v2 of the series, that would fully
> address these concerns.
> 
> Additionally, it seems to me that a new round of testing that tests
> involved code paths under various scenarios would be appropriate
> and I am going to do that.

awesome, thanks!

> > Note: thats the one in fpux_emu(), not fpu_emu() which this patch
> > modifies.
> 
> Yes, my bad, wanting to respond as quickly as possible, I inserted
> the segment from fpux_emu(), not fpu_emu() as I should have.
> 
> By the way, and not related to this patch, I see only 4 (out of 5)
> exceptions are handled in fpux_emu() case (division-by-zero is not
> handled), I presume this is fine (probably division-by-zero not
> needed), isn't it?

Yeh I just spotted that too.

I agree that it only seems to be division instructions (fdiv_op,
frsqrt_op, and frecip_op) that need it, which are all handled in
fpu_emu(), so it should be fine as is.

> 
> I truly appreciate your analysis and help.

No problem

Cheers
James

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2017-10-12 16:35 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-06 17:28 [PATCH 0/2] MIPS: Minor FPU emulation fixes Aleksandar Markovic
2017-10-06 17:29 ` [PATCH 1/2] MIPS: math-emu: Update debugfs FP exception stats for certain instructions Aleksandar Markovic
2017-10-09 21:09   ` James Hogan
2017-10-09 21:09     ` James Hogan
2017-10-11 16:18     ` Aleksandar Markovic
2017-10-11 16:18       ` Aleksandar Markovic
2017-10-12 10:17       ` James Hogan
2017-10-12 14:32         ` Aleksandar Markovic
2017-10-12 14:32           ` Aleksandar Markovic
     [not found]         ` <683c-59df7500-1-10d973a0@9889400>
2017-10-12 14:44           ` James Hogan
2017-10-12 15:54             ` Aleksandar Markovic
2017-10-12 16:33               ` James Hogan
2017-10-06 17:29 ` [PATCH 2/2] MIPS: math-emu: Use preferred flavor of unsigned integer declarations Aleksandar Markovic
2017-10-09 16:59   ` James Hogan
2017-10-09 16:59     ` James Hogan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.